.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;
}

/* 检测类型选择 */
.detect-type-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.detect-type-tab {
    padding: 10px 24px;
    background: var(--bg-surface);
    border: 2px solid var(--border-light);
    border-radius: 99px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.detect-type-tab:hover {
    border-color: #d1d5db;
    color: var(--text-main);
}

.detect-type-tab.active {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-color: var(--ai-color);
    color: white;
}

/* 检测区域卡片 */
.detect-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 32px;
    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: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f9fafb;
}

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

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

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

.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: 240px;
    padding: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}
.text-input:focus { border-color: var(--ai-color); }

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

/* 检测说明 */
.detect-notice {
    background: linear-gradient(135deg, #f5f3ff, #fef3c7);
    border: 1px solid #e9d5ff;
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 24px;
    font-size: 13px;
    color: #5b21b6;
    line-height: 1.6;
}
.detect-notice strong {
    color: #7c3aed;
}

/* 提交按钮 */
.btn-detect {
    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-detect:hover {
    background: linear-gradient(135deg, #6d28d9, #4338ca);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-detect:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-detect.loading .btn-text { display: none; }
.btn-detect.loading .loading-spinner { display: inline-block; }
.btn-detect:not(.loading) .loading-spinner { display: none; }

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

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

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

.result-actions-header {
    display: flex;
    gap: 12px;
}

.btn-download-report {
    padding: 10px 20px;
    background: #f3f4f6;
    color: var(--text-secondary);
    font-size: 13px; font-weight: 500;
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-download-report:hover {
    background: #e5e7eb;
    color: var(--text-main);
}

/* 检测结果概览 */
.result-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.result-stat-card {
    padding: 24px;
    background: #f9fafb;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.result-stat-card.ai {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-color: var(--ai-color);
}

.result-stat-card.human {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: var(--success);
}

.result-stat-card.uncertain {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: var(--warning);
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}
.stat-value.ai { color: var(--ai-color); }
.stat-value.human { color: var(--success); }
.stat-value.uncertain { color: var(--warning); }

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

/* 检测结果详情 */
.result-detail {
    margin-bottom: 28px;
}

.detail-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
}

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

/* AI 生成内容高亮 */
.ai-highlight {
    background: rgba(124, 58, 237, 0.15);
    border-bottom: 2px solid var(--ai-color);
    padding: 2px 0;
}

.human-highlight {
    background: rgba(22, 163, 74, 0.1);
    border-bottom: 2px solid var(--success);
    padding: 2px 0;
}

/* 图例说明 */
.legend {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: var(--radius-lg);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}
.legend-color.ai { background: var(--ai-color); opacity: 0.3; }
.legend-color.human { background: var(--success); opacity: 0.3; }

/* 操作按钮 */
.result-actions {
    display: flex;
    gap: 12px;
}

.btn-regenerate, .btn-reduce {
    flex: 1;
    padding: 14px;
    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-regenerate:hover, .btn-reduce:hover {
    background: #e5e7eb;
    color: var(--text-main);
}

.btn-reduce {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: white;
}
.btn-reduce:hover {
    background: linear-gradient(135deg, #6d28d9, #4338ca);
}

/* 论文风格选择（优化版） */
.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;
}

/* 固定词功能 */
.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;
}