/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 导航栏 ========== */
#navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.nav-brand .logo { font-size: 24px; }

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

/* 一键降AI 按钮特殊样式 */
.nav-link-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    font-weight: 600;
}
.nav-link-ai:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4296 100%);
    color: white !important;
    transform: scale(1.03);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--gray-600);
}

/* ========== 主内容区 ========== */
#mainContent {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 60px);
}

.page { display: none; }
.page.active { display: block; }

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 24px;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.page-header p {
    color: var(--gray-500);
    font-size: 14px;
}

/* ========== 认证页面 ========== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 28px;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--gray-200);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.auth-tab.active {
    color: var(--primary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    font-family: inherit;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 12px;
    min-height: 20px;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover { background: #15803d; }

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover { background: #b91c1c; }

/* 一键降AI 按钮（下载报告列表中） */
.btn-ai-reduce {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
}
.btn-ai-reduce:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4296 100%);
    transform: scale(1.05);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
}

/* ========== 统计卡片 ========== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-500);
}

/* ========== 表格 ========== */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--gray-50);
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-row td {
    text-align: center;
    color: var(--gray-400);
    padding: 48px 16px !important;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.paid { background: #dcfce7; color: #166534; }
.status-badge.unpaid { background: #fef3c7; color: #92400e; }
.status-badge.completed { background: #dbeafe; color: #1e40af; }
.status-badge.checking { background: #f3e8ff; color: #6b21a8; }
.status-badge.uploaded { background: #fce7f3; color: #9d174d; }

/* ========== 查重版本选择 ========== */
.version-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.version-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    text-align: center;
}

.version-card:hover {
    border-color: var(--primary-light);
    background: rgba(37, 99, 235, 0.03);
}

.version-card:has(input:checked) {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.06);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.version-card input {
    display: none;
}

.version-icon {
    font-size: 34px;
}

.version-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--gray-700);
}

.version-card:has(input:checked) .version-name {
    color: var(--primary);
    font-weight: 600;
}

/* 响应式 - 小屏改2列 */
@media (max-width: 600px) {
    .version-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 版本提示 */
.version-hint {
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    color: #92400e;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* 国际版检测须知 */
.version-notice {
    padding: 20px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-lg);
    color: #075985;
    font-size: 13px;
    line-height: 1.8;
    margin-top: 24px;
}

.version-notice h4 {
    font-size: 15px;
    margin-bottom: 12px;
    color: #0369a1;
}

.version-notice .notice-item {
    margin-bottom: 6px;
    padding-left: 4px;
}

.version-notice .notice-label {
    font-weight: 600;
    color: #0284c7;
}
.upload-area {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}

.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.02);
}

.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-text { font-size: 16px; color: var(--gray-700); margin-bottom: 8px; }
.upload-hint { font-size: 13px; color: var(--gray-400); }

.upload-preview {
    margin-top: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.preview-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preview-icon { font-size: 32px; }
.preview-details { flex: 1; }
.preview-name { font-size: 14px; font-weight: 500; color: var(--gray-800); }
.preview-size { font-size: 13px; color: var(--gray-500); }

/* 移除按钮 - 蓝色背景白色文字 */
.upload-preview .btn-outline {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.upload-preview .btn-outline:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* 费用明细 */
.pricing-card {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: var(--radius-lg);
}

.pricing-card h3 {
    font-size: 16px;
    color: var(--gray-800);
    margin-bottom: 12px;
}

.pricing-details { }

.pricing-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--gray-600);
}

.pricing-divider {
    border-top: 1px dashed var(--gray-300);
    margin: 8px 0;
}

.pricing-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.pricing-amount {
    color: var(--danger);
    font-size: 24px;
}

.pricing-note {
    display: block;
    color: var(--gray-400);
    font-size: 12px;
    margin-top: 8px;
}

/* 进度条 */
.upload-progress { margin-top: 16px; }
.progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s;
    width: 0%;
}
.progress-text {
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 8px;
}

/* ========== 弹窗 ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.modal-header h3 {
    font-size: 18px;
    color: var(--gray-900);
}

.modal-close {
    border: none;
    background: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover { color: var(--gray-600); }

/* 二维码弹窗 */
.qrcode-modal {
    max-width: 380px;
    text-align: center;
}

.qrcode-modal .modal-body {
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.qrcode-image {
    width: 240px;
    height: 240px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    object-fit: contain;
}

.qrcode-hint {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.6;
}

.qrcode-hint.wechat { color: #166534; }
.qrcode-hint.alipay { color: #1e40af; }

.qrcode-fallback {
    display: none;
    font-size: 13px;
    color: var(--danger);
}

.qrcode-modal .btn-copy {
    margin-top: 8px;
    padding: 8px 20px;
    font-size: 13px;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gray-700);
    transition: all 0.2s;
}

.qrcode-modal .btn-copy:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* 客服浮动按钮 */
.cs-float-btn {
    position: fixed;
    right: 20px;
    bottom: 100px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    z-index: 999;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.cs-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.cs-float-icon {
    font-size: 24px;
    line-height: 1;
}

.cs-float-text {
    font-size: 10px;
    margin-top: 2px;
}

/* 客服弹窗 */
.cs-popup {
    position: fixed;
    right: 20px;
    bottom: 170px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1000;
    overflow: hidden;
    animation: csSlideIn 0.25s ease-out;
}

@keyframes csSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cs-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    font-size: 15px;
    font-weight: 500;
}

.cs-popup-body {
    padding: 16px;
}

@media (max-width: 480px) {
    .cs-popup {
        width: calc(100vw - 40px);
        right: 10px;
        bottom: 160px;
    }
    .cs-float-btn {
        right: 10px;
        bottom: 80px;
        width: 50px;
        height: 50px;
    }
}

.modal-body {
    padding: 24px;
}

/* 支付弹窗 - 支付方式选择 */
.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.payment-method {
    padding: 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    font-family: inherit;
}

.payment-method:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.02);
}

.payment-method.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.payment-method-icon { font-size: 36px; margin-bottom: 8px; }
.payment-method-name { font-size: 14px; font-weight: 500; color: var(--gray-700); }

/* Toast */
.toast {
    position: fixed;
    top: 80px;
    right: 24px;
    padding: 12px 24px;
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.show { transform: translateX(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }

/* 居中弹窗 */
.center-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    padding: 20px 32px;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 15px;
    font-weight: 500;
    z-index: 400;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 90%;
    pointer-events: none;
}

.center-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.center-toast.error {
    background: var(--danger);
}

.center-toast.success {
    background: var(--success);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-700);
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover { background: var(--gray-50); }
.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 响应式 */
/* 移动端底部导航 */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    z-index: 998;
    padding: 8px 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.mobile-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--gray-500);
    font-size: 11px;
    padding: 4px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.mobile-nav-btn .icon {
    font-size: 22px;
    line-height: 1;
}

.mobile-nav-btn.active {
    color: var(--primary);
    background: #eff6ff;
}

@media (max-width: 768px) {
    #navbar { padding: 0 16px; }
    .nav-links { display: none; }
    .mobile-nav { display: flex; }
    #mainContent { padding: 16px; padding-bottom: 80px; }
    .cs-float-btn { bottom: 90px; }
    .cs-popup { bottom: 160px; }
    .stats-row { grid-template-columns: 1fr; }
    .auth-card { padding: 24px; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 10px; }
}

/* Turnitin 自动查重进度动画 */
@keyframes progressAnim {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.status-badge.checking {
    background: #eff6ff;
    color: #1e40af;
}

.status-badge.failed {
    background: #fef2f2;
    color: #991b1b;
}

.checking {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
