/* 历史记录区域 */
.history-section {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: 95%;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-tabs {
    display: flex;
    gap: 10px;
}

.history-tab {
    padding: 8px 15px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.history-tab:hover {
    background-color: #f5f5f5;
}

.history-tab.active {
    background-color: #6c5ce7;
    color: #fff;
    border-color: #6c5ce7;
}

.history-content {
    position: relative;
    min-height: 200px;
}

.loading-history,
.empty-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 200px;
    color: #888;
}

.loading-history i,
.empty-history i {
    font-size: 3em;
    margin-bottom: 10px;
    color: #ccc;
}

.empty-history p {
    font-size: 1.1em;
}

.text-history,
.doc-history {
    width: 100%;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 历史记录项样式 - 现代化设计 */
.history-item {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border: 1px solid rgba(87, 81, 213, 0.12);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.history-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-highlight) 0%, rgba(87, 81, 213, 0.5) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(87, 81, 213, 0.15), 0 4px 8px rgba(0, 0, 0, 0.08);
    border-color: rgba(87, 81, 213, 0.25);
}

.history-item:hover::before {
    opacity: 1;
}

/* 历史记录项头部 */
.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.history-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
    row-gap: 6px;
}

.history-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.1;
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    text-transform: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
    white-space: nowrap;
}

.history-chip i {
    font-size: 11px;
}

.history-source-chip {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.history-source-chip--text {
    background: rgba(110, 231, 183, 0.22);
    color: #047857;
}

.history-source-chip--doc {
    background: rgba(196, 181, 253, 0.25);
    color: #6d28d9;
}

.history-platform-tag {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.history-platform-tag--unknown {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.history-platform-tag--cnki,
.history-platform-tag--zhiwang {
    background: rgba(99, 102, 241, 0.16);
    color: #4338ca;
}

.history-platform-tag--vip,
.history-platform-tag--weipu {
    background: rgba(251, 191, 36, 0.18);
    color: #b45309;
}

.history-language-chip {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.history-mode-chip {
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
}

.history-platform-tag--wanfang,
.history-platform-tag--wanfang-data,
.history-platform-tag--daya {
    background: rgba(244, 114, 182, 0.18);
    color: #be185d;
}

.history-platform-tag--zhuque-ai,
.history-platform-tag--zhuque,
.history-platform-tag--zhuque-ai-general {
    background: rgba(16, 185, 129, 0.18);
    color: #047857;
}

.history-platform-tag--gezida,
.history-platform-tag--paperyy,
.history-platform-tag--paperpass,
.history-platform-tag--bigan {
    background: rgba(14, 165, 233, 0.16);
    color: #0369a1;
}

.history-platform-tag--turnitin {
    background: rgba(79, 70, 229, 0.16);
    color: #4338ca;
}

.history-platform-tag--general,
.history-platform-tag--unknown {
    background: rgba(107, 114, 128, 0.16);
    color: #374151;
}

.platform-variant-options,
.zhuque-variant-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0 4px;
}

.platform-variant-options .variant-option,
.zhuque-variant-options .variant-option {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.platform-variant-options .variant-option input[type="radio"],
.zhuque-variant-options .variant-option input[type="radio"] {
    margin-top: 6px;
}

.platform-variant-options .variant-option__title,
.zhuque-variant-options .variant-option__title {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
}

.platform-variant-options .variant-option__desc,
.zhuque-variant-options .variant-option__desc {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.platform-variant-options .variant-option.selected,
.zhuque-variant-options .variant-option.selected {
    border-color: #4338ca;
    box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.12);
}

.history-item-type-badge {
    min-height: 28px;
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.history-item-type-badge--combo {
    background: rgba(147, 51, 234, 0.18);
    color: #7e22ce;
}

.history-item-type-badge--ai {
    background: rgba(59, 130, 246, 0.16);
    color: #1d4ed8;
}

.history-item-type-badge--rewrite {
    background: rgba(249, 115, 22, 0.18);
    color: #c2410c;
}

.history-item-time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

.history-item-time i {
    color: var(--color-highlight);
    font-size: 12px;
}

.history-metrics-badge {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #f8fbff 0%, #e9f2ff 100%);
    border: 1px solid rgba(3, 105, 161, 0.12);
    border-radius: 10px;
    font-size: clamp(11px, 1.2vw, 12px);
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.history-metrics-badge--minimal {
    color: #475569;
}

.history-metric-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}

.history-metric-chip-label {
    color: #64748b;
    font-size: 0.9em;
}

.history-metric-chip-value {
    font-size: 1em;
    font-weight: 600;
    color: #0f172a;
}

.history-metric-separator {
    color: rgba(15, 23, 42, 0.2);
    font-size: 0.9em;
}

.history-metric-points--charged .history-metric-chip-value,
.history-metric-points--reserved .history-metric-chip-value {
    color: #0b568f;
}

.history-metric-points--warning .history-metric-chip-value {
    color: #b45309;
}

.history-metric-points--danger .history-metric-chip-value {
    color: #b42318;
}

.history-metric-points--pending .history-metric-chip-value,
.history-metric-points--unknown .history-metric-chip-value {
    color: #475569;
}

.history-metric-points--zero .history-metric-chip-value {
    color: #0f172a;
}

@media (max-width: 420px) {
    .history-metrics-badge {
        justify-content: flex-start;
    }

    .history-metric-separator {
        display: none;
    }
}

/* 历史记录预览区域（折叠状态） */
.history-item-preview-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

/* 历史记录完整内容区域（展开状态） */
.history-item-expanded-content {
    margin-bottom: 16px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item.expanded .history-item-expanded-content {
    opacity: 1;
    max-height: 600px;
    overflow: visible;
}

/* 对比面板容器 */
.history-comparison-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

/* 单个面板 */
.history-panel {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 面板头部 */
.history-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid;
}

.history-input-panel .history-panel-header {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-bottom-color: rgba(217, 119, 6, 0.2);
}

.history-output-panel .history-panel-header {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-bottom-color: rgba(16, 185, 129, 0.2);
}

.history-panel-header i {
    font-size: 15px;
}

.history-input-panel .history-panel-header i {
    color: #d97706;
}

.history-output-panel .history-panel-header i {
    color: #10b981;
}

.history-panel-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

/* 面板内容 */
.history-panel-body {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.history-input-panel .history-panel-body {
    background: #fffef9;
}

.history-output-panel .history-panel-body {
    background: #f0fdf9;
}

.history-full-text {
    color: #374151;
    line-height: 1.8;
    font-size: 13px;
    word-break: break-word;
    white-space: pre-wrap;
}

/* 旧版内容区域样式（保留兼容） */
.history-item-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.history-text-section {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.history-text-section:hover {
    background: #ffffff;
    border-color: rgba(87, 81, 213, 0.15);
}

.history-text-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-text-label i {
    color: var(--color-highlight);
    font-size: 13px;
}

.history-text-preview {
    color: #4b5563;
    font-size: 13px;
    line-height: 1.6;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-text-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.08) 50%, transparent 100%);
}

/* 历史记录项底部 */
.history-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.history-expiry-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #78350f;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.history-expiry-badge i {
    color: #d97706;
}

.history-item-actions {
    display: flex;
    gap: 8px;
}

/* 历史记录操作按钮 */
.btn-history-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-history-action i {
    font-size: 14px;
}

/* 展开/收起按钮 */
.btn-history-action.btn-toggle {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-history-action.btn-toggle:hover {
    background: linear-gradient(135deg, var(--color-highlight) 0%, #6d66e8 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(87, 81, 213, 0.3);
}

/* 复制原文按钮 */
.btn-history-action.btn-copy-input {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

/* 文档历史卡片专用布局 */
.history-item.history-item-doc {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.history-doc-header {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-start;
}

.history-doc-info {
    flex: 1 1 360px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-doc-file {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-doc-file-icon {
    font-size: 32px;
    color: var(--color-highlight);
}

.history-doc-file-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-file-name {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.history-file-meta {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.history-doc-expiry-chip {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(250, 204, 21, 0.18);
    color: #92400e;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(217, 119, 6, 0.25);
}

.history-doc-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    row-gap: 6px;
}

.history-doc-metrics {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(238, 242, 255, 0.9) 100%);
    font-size: 12px;
    min-height: 56px;
}

.history-doc-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.history-doc-metric-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.history-doc-metric-label i {
    font-size: 11px;
}

.history-doc-metric-value {
    font-size: clamp(13px, 1.5vw, 15px);
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
}

.history-item-footer--doc {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding-top: 12px;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.history-doc-footer-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6b7280;
}

.history-doc-actions {
    display: flex;
    gap: 10px;
}

.btn-history-action.btn-doc-primary {
    min-width: 180px;
    justify-content: center;
    background: linear-gradient(120deg, #7c3aed, #6366f1);
    color: #fff;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.25);
}

.btn-history-action.btn-doc-primary:disabled {
    opacity: 0.5;
    box-shadow: none;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .history-doc-header {
        flex-direction: column;
    }

    .history-doc-metrics {
        flex: 1 1 auto;
        width: 100%;
        justify-content: space-between;
    }

    .history-doc-expiry-chip {
        margin-left: 0;
    }
}

.btn-history-action.btn-copy-input:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

/* 复制结果按钮 */
.btn-history-action.btn-copy-output {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-history-action.btn-copy-output:hover {
    background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* 下载Word按钮 */
.btn-history-action.btn-download {
    background: linear-gradient(135deg, var(--color-highlight) 0%, #6d66e8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(87, 81, 213, 0.25);
}

.btn-history-action.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(87, 81, 213, 0.35);
}

.btn-history-action.btn-copy:active,
.btn-history-action.btn-download:active {
    transform: translateY(0);
}

/* 旧版兼容按钮样式 */
.btn-history-action.btn-detail {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-history-action.btn-detail:hover {
    background: linear-gradient(135deg, var(--color-highlight) 0%, #6d66e8 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(87, 81, 213, 0.3);
}

.btn-history-action.btn-copy {
    background: linear-gradient(135deg, var(--color-highlight) 0%, #6d66e8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(87, 81, 213, 0.25);
}

.btn-history-action.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(87, 81, 213, 0.35);
}

/* 旧版兼容样式 */
.history-item-date {
    color: #666;
}

.history-item-type {
    display: flex;
    gap: 8px;
}

.history-item-summary,
.history-item-file {
    color: #333;
    margin-bottom: 12px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.history-item-stats {
    display: flex;
    gap: 15px;
    color: #666;
    font-size: 13px;
}

.char-count,
.expires-in {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-view-detail,
.btn-download {
    background-color: #6c5ce7;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-view-detail:hover,
.btn-download:hover {
    background-color: #5341d6;
}

/* 历史记录详情模态框样式 - 现代化设计 */
.history-detail-modal {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* 历史记录详情弹窗 - 现代化升级 */
#history-detail-modal .modal-content {
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

#history-detail-modal .modal-header {
    background: linear-gradient(135deg, var(--color-highlight) 0%, #6d66e8 100%);
    padding: 24px 28px !important;
    border-bottom: none !important;
}

#history-detail-modal .modal-header h2 {
    color: white !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

#history-detail-modal .modal-header .close-modal {
    color: white !important;
    opacity: 0.9;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
}

#history-detail-modal .modal-header .close-modal:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* 基本信息区域 */
#history-detail-modal .modal-body>div:first-child {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
    padding: 24px 28px !important;
    border-bottom: 2px solid rgba(87, 81, 213, 0.1) !important;
}

#history-detail-modal .modal-body>div:first-child>div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

#history-detail-modal .modal-body>div:first-child>div>div {
    background: white;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(87, 81, 213, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

#history-detail-modal .modal-body>div:first-child>div>div:hover {
    border-color: rgba(87, 81, 213, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(87, 81, 213, 0.1);
}

#history-detail-modal .modal-body>div:first-child>div>div span:first-child {
    display: block;
    color: #6b7280 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

#history-detail-modal .modal-body>div:first-child>div>div span:last-child {
    display: block;
    color: var(--color-text-primary) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    margin-left: 0 !important;
}

/* 文本对比区域美化 */
#history-detail-modal .modal-body>div:nth-child(2) {
    gap: 0 !important;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

#history-detail-modal .modal-body>div:nth-child(2)>div {
    position: relative;
}

/* 原文区域样式 */
#history-detail-modal .modal-body>div:nth-child(2)>div:first-child>div:first-child {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    padding: 18px 24px !important;
    border-bottom: 2px solid rgba(217, 119, 6, 0.2) !important;
}

#history-detail-modal .modal-body>div:nth-child(2)>div:first-child>div:first-child h3 {
    color: #92400e !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

#history-detail-modal .modal-body>div:nth-child(2)>div:first-child>div:first-child i {
    color: #d97706;
    font-size: 16px;
}

#history-detail-modal .modal-body>div:nth-child(2)>div:first-child>div:last-child {
    padding: 24px !important;
    background: #fffef9;
}

#history-detail-modal #detail-input-text {
    color: #374151 !important;
    line-height: 1.8 !important;
    font-size: 14px !important;
}

/* 处理结果区域样式 */
#history-detail-modal .modal-body>div:nth-child(2)>div:nth-child(2)>div:first-child {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
    padding: 18px 24px !important;
    border-bottom: 2px solid rgba(16, 185, 129, 0.2) !important;
}

#history-detail-modal .modal-body>div:nth-child(2)>div:nth-child(2)>div:first-child h3 {
    color: #065f46 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

#history-detail-modal .modal-body>div:nth-child(2)>div:nth-child(2)>div:first-child i {
    color: #10b981;
    font-size: 16px;
}

#history-detail-modal .modal-body>div:nth-child(2)>div:nth-child(2)>div:last-child {
    padding: 24px !important;
    background: #f0fdf9;
}

#history-detail-modal #detail-output-text {
    color: #374151 !important;
    line-height: 1.8 !important;
    font-size: 14px !important;
}

/* 操作按钮区域美化 */
#history-detail-modal .modal-body>div:last-child {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%) !important;
    padding: 24px 28px !important;
    border-top: 2px solid rgba(87, 81, 213, 0.1) !important;
}

#history-detail-modal .modal-body>div:last-child>div {
    gap: 12px;
}

#history-detail-modal #detail-copy-input,
#history-detail-modal #detail-copy-output {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 10px 20px !important;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

#history-detail-modal #detail-copy-input:hover,
#history-detail-modal #detail-copy-output:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#history-detail-modal #detail-download-word {
    background: linear-gradient(135deg, var(--color-highlight) 0%, #6d66e8 100%);
    color: white;
    border: none;
    padding: 10px 24px !important;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(87, 81, 213, 0.3);
    transition: all 0.2s ease;
}

#history-detail-modal #detail-download-word:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(87, 81, 213, 0.4);
}

/* 旧版兼容 */
.history-detail-info {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    margin-bottom: 8px;
}

.info-label {
    font-weight: bold;
    width: 100px;
    color: #555;
}

/* 历史记录响应式设计 */
@media (max-width: 768px) {

    /* 历史记录列表项移动端优化 */
    .history-item {
        padding: 16px;
        margin-bottom: 12px;
    }

    .history-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .history-item-meta {
        flex-wrap: wrap;
    }

    .history-item-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .history-item-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .btn-history-action {
        width: 100%;
        justify-content: center;
        padding: 10px 12px;
    }

    .btn-history-action.btn-toggle {
        grid-column: 1 / -1;
    }

    /* 展开面板移动端优化 */
    .history-comparison-panels {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .history-item.expanded .history-item-expanded-content {
        max-height: 800px;
    }

    .history-panel-body {
        max-height: 300px;
    }

    /* 历史记录详情弹窗移动端优化 */
    #history-detail-modal .modal-content {
        width: 100%;
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }

    #history-detail-modal .modal-body>div:first-child>div {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #history-detail-modal .modal-body>div:nth-child(2) {
        flex-direction: column !important;
    }

    #history-detail-modal .modal-body>div:nth-child(2)>div:first-child {
        border-right: none !important;
        border-bottom: 1px solid #e5e7eb;
    }

    #history-detail-modal .modal-body>div:last-child>div {
        flex-direction: column;
    }

    #history-detail-modal #detail-copy-input,
    #history-detail-modal #detail-copy-output,
    #history-detail-modal #detail-download-word {
        width: 100%;
    }
}

.history-content-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.content-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.content-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.text-content {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.5;
}

.btn-copy {
    background-color: #0984e3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.btn-copy:hover {
    background-color: #0769b5;
}

.btn-copy.copied {
    background-color: #00b894;
}

.error-message {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
}

/* 错误建议样式 */
.error-suggestions {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    text-align: left;
}

.error-suggestions h5 {
    color: #495057;
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
}

.error-suggestions h5 i {
    color: #ffc107;
    margin-right: 8px;
}

.error-suggestions ul {
    margin: 0;
    padding-left: 20px;
    color: #6c757d;
}

.error-suggestions li {
    margin-bottom: 8px;
    line-height: 1.4;
    font-size: 13px;
}

.error-suggestions li:last-child {
    margin-bottom: 0;
}

.error-suggestions strong {
    color: #007bff;
    font-weight: 600;
}

/* 添加处理结果提示样式（默认黄色警示） */
.privacy-note {
    font-size: 0.85rem;
    color: #8a6d3b;
    background-color: #fff3cd;
    padding: 6px 12px;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    flex-shrink: 0;
    max-width: 60%;
}

.privacy-note i {
    color: #d48806;
}

/* 小字提示样式 */
.hint-text {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.6;
    margin-top: 12px;
    padding: 10px 14px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #6c757d;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.hint-text i {
    color: #6c757d;
    margin-top: 2px;
    flex-shrink: 0;
}

.hint-text ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
    flex: 1;
}

.hint-text ul li {
    margin-bottom: 6px;
    position: relative;
    padding-left: 16px;
}

.hint-text ul li:last-child {
    margin-bottom: 0;
}

.hint-text ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #6c757d;
    font-weight: bold;
}

.history-tip {
    margin: 12px 0 0;
    font-size: 0.9rem;
    color: #1b4332;
    line-height: 1.5;
}

.history-tip.warning {
    color: #8a6d3b;
    background: rgba(255, 243, 205, 0.7);
    border-left: 3px solid #ffc107;
    padding: 6px 10px;
    border-radius: 4px;
}

.history-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0 0;
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
    background-color: #fff4d1;
    color: #704c00;
    animation: fadeInUp 0.3s ease-out;
}

.history-alert-banner.warning {
    border-left-color: #ffc107;
    background-color: #fff4d1;
    color: #704c00;
}

.history-alert-banner.error {
    border-left-color: #f25f5c;
    background-color: #fde2e1;
    color: #842029;
}

.history-alert-banner .history-alert-icon {
    font-size: 1.2rem;
    line-height: 1;
    margin-top: 2px;
}

.history-alert-banner .history-alert-text {
    flex: 1;
    line-height: 1.5;
    font-size: 0.9rem;
}

.history-alert-banner .history-alert-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.history-alert-banner .history-alert-close {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
}

.history-alert-banner .history-alert-link {
    text-decoration: underline;
    font-weight: 600;
    color: inherit;
}

.history-alert-banner .history-alert-link:hover {
    text-decoration: none;
}

@keyframes historyPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.6);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(255, 193, 7, 0.2);
        transform: scale(1.02);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
        transform: scale(1);
    }
}

.history-pulse {
    animation: historyPulse var(--motion-pulse) var(--motion-ease) 2;
    position: relative;
}

.history-pulse:focus-visible {
    outline: 2px solid rgba(255, 193, 7, 0.8);
    outline-offset: 2px;
}

@keyframes historyRowGlow {
    0% {
        box-shadow: 0 6px 16px rgba(255, 193, 7, 0.15);
        border-color: rgba(255, 193, 7, 0.4);
    }

    50% {
        box-shadow: 0 10px 28px rgba(255, 193, 7, 0.28);
        border-color: rgba(255, 193, 7, 0.65);
    }

    100% {
        box-shadow: 0 6px 16px rgba(255, 193, 7, 0.15);
        border-color: rgba(255, 193, 7, 0.4);
    }
}

.history-item.focus-highlight {
    animation: historyRowGlow 1.6s ease-in-out 6;
    border-color: rgba(255, 193, 7, 0.6);
}

.history-item.focus-highlight::before {
    opacity: 1;
    background: linear-gradient(180deg, rgba(255, 193, 7, 0.85) 0%, rgba(255, 193, 7, 0.25) 100%);
}

.result-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 1rem;
    color: #333;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* 增强段落显示效果，确保Word复制时识别段落 */
.result-content p {
    margin: 0 0 1.2em 0;
    line-height: 1.6;
    text-align: justify;
    text-indent: 0;
    display: block;
    padding: 0;
    border: 0;
}

.result-content p:last-child {
    margin-bottom: 0;
}

.result-content br {
    line-height: 1.6;
    display: inline;
}

/* 确保段落间距在复制时也能被识别 */
.result-content p+p {
    margin-top: 1.2em;
}
