/* ================= 降重页面样式 ================= */
.page-header {
    text-align: center;
    padding: 24px 0 32px;
}
.page-title {
    font-size: 24px; font-weight: 700;
    color: var(--text-main); margin-bottom: 8px;
}
.page-subtitle {
    color: var(--text-secondary); font-size: 14px;
}

/* 数据统计栏 */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 16px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.stat-value {
    font-weight: 600;
    color: var(--primary);
}
.stat-tag {
    padding: 2px 8px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

/* 服务类型选择 */
.service-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.service-tab {
    position: relative;
    padding: 20px 16px;
    background: var(--bg-surface);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.service-tab:hover {
    border-color: #d1d5db;
}

.service-tab.selected {
    border-color: var(--primary);
    background: #eef2ff;
    box-shadow: 0 0 15px var(--primary);
}

.service-tab input { display: none; }

.service-name {
    font-size: 16px; font-weight: 600;
    color: var(--text-main); margin-bottom: 8px;
}

.service-guarantee {
    font-size: 14px; color: var(--text-secondary);
    margin-bottom: 8px; line-height: 1.4;
}

.service-time {
    font-size: 12px; color: var(--text-secondary);
}

.service-badge {
    position: absolute;
    top: -8px; right: -8px;
    padding: 2px 8px;
    background: var(--success);
    color: white;
    font-size: 10px; font-weight: 600;
    border-radius: 99px;
}

/* 上传区域 */
.upload-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
}

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

.section-title {
    font-size: 15px; font-weight: 600;
    color: var(--text-main);
}

.input-toggle {
    display: flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
}

.toggle-btn {
    padding: 6px 16px;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--bg-surface);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

/* 文件上传框 */
.upload-box {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f9fafb;
}

.upload-box:hover, .upload-box.dragover {
    border-color: var(--primary);
    background: #eef2ff;
}

.upload-icon {
    width: 48px; height: 48px;
    margin: 0 auto 16px;
    color: var(--primary);
}

.upload-text {
    font-size: 14px; color: var(--text-main);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 12px; color: var(--text-secondary);
}

.upload-formats {
    margin-top: 12px;
    font-size: 11px; color: #9ca3af;
}

/* 文本输入框 */
.text-input-area {
    display: none;
}
.text-input-area.active { display: block; }

.text-input {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}
.text-input:focus {
    border-color: var(--primary);
}

.text-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* 固定词功能 */
.fixed-words {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.fixed-words-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.fixed-words-header svg {
    width: 16px; height: 16px;
    color: var(--warning);
}

.fixed-words-input {
    display: flex;
    gap: 8px;
}

.fixed-words-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}

.fixed-words-input input:focus {
    border-color: var(--primary);
}

.btn-add {
    padding: 10px 20px;
    background: #f3f4f6;
    color: var(--text-secondary);
    font-size: 13px; font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}
.btn-add:hover {
    background: #e5e7eb;
    color: var(--text-main);
}

.fixed-words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.fixed-word-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #eef2ff;
    color: var(--primary);
    font-size: 12px;
    border-radius: 99px;
}

.fixed-word-tag button {
    color: inherit;
    font-size: 14px;
    line-height: 1;
}

/* 说明提示 */
.info-tip {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 24px;
    font-size: 13px;
    color: #166534;
    line-height: 1.6;
}

.info-tip strong {
    font-weight: 600;
}

/* 提交按钮 */
.btn-submit {
    width: 200px;
    margin: 0 auto;
    padding: 10px;
    background: var(--primary);
    color: white;
    font-size: 15px; font-weight: 600;
    border-radius: var(--radius-xl);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-submit:hover { background: var(--primary-hover); }
.btn-submit:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* 处理结果区域 */
.result-section {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 24px;
}
.result-section.show { display: block; }

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.result-title {
    font-size: 16px; font-weight: 600;
    color: var(--text-main);
}

.result-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.result-stat {
    text-align: center;
}

.result-stat-value {
    font-size: 24px; font-weight: 700;
    color: var(--success);
}

.result-stat-label {
    font-size: 12px; color: var(--text-secondary);
}

.result-content {
    background: #f9fafb;
    border-radius: var(--radius-lg);
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-main);
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-copy, .btn-download {
    flex: 1;
    padding: 12px;
    background: #f3f4f6;
    color: var(--text-secondary);
    font-size: 14px; font-weight: 500;
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-copy:hover, .btn-download:hover {
    background: #e5e7eb;
    color: var(--text-main);
}

/* ================= 顶部选项卡样式（参考 cnkifree 风格） ================= */

/* 文献库范围切换 */
.library-tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    background: #f5f7fa;
    border-radius: 8px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.library-tab {
    flex: 1;
    padding: 8px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.library-tab:hover {
    color: var(--text-main);
    background: #e8ecef;
}

.library-tab.active {
    color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.library-tab.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* 检测版本卡片网格 */
.version-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.version-card {
    padding: 16px 14px;
    background: var(--bg-surface);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.version-card:hover {
    border-color: #a5b4fc;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.version-card.active {
    border-color: var(--primary);
    background: #eef2ff;
}

.version-card.active::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.version-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.version-card.active .version-icon {
    color: var(--primary);
}

.version-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.version-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 顶部提示栏 */
.top-notice {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-lg);
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
}
.top-notice svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .version-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .library-tabs {
        max-width: 100%;
    }
    .library-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* 璁烘枃椋庢牸閫夋嫨锛堜紭鍖栫増锛� */
.type-options {
    display: flex;
    gap: 40px;
}

.type-option {
    position: relative;
    cursor: pointer;
}

.type-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.type-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    padding-left: 42px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-align: center;
    justify-content: center;
    position: relative;
}

.type-label::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    background: white;
    transition: all 0.2s;
}

.type-label::after {
    content: '';
    position: absolute;
    left: 21px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transition: all 0.2s;
}

.type-option input:checked + .type-label {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-color: #7c3aed;
    color: #7c3aed;
}

.type-option input:checked + .type-label::before {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-color: #7c3aed;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.3);
}

.type-option input:checked + .type-label::after {
    opacity: 1;
}

.type-label:hover {
    border-color: #a5b4fc;
    background: #f5f3ff;
}