        * { margin: 0; padding: 0; box-sizing: border-box; }
        :root {
            --primary: #2563eb;
            --primary-dark: #1d4ed8;
            --sidebar-bg: #1e293b;
            --header-bg: #1e293b;
            --card-bg: #ffffff;
            --border: #e2e8f0;
            --success: #16a34a;
            --error: #dc2626;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
        }
        body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; background: #f1f5f9; color: var(--text-primary); }

        /* Login */
        .login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f1f5f9; }
        .login-card { background: white; border-radius: 12px; padding: 2.5rem; width: 380px; box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
        .login-logo { text-align: center; margin-bottom: 2rem; }
        .login-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-top: 0.5rem; }
        .login-logo p { color: var(--text-secondary); font-size: 0.875rem; margin-top: 0.25rem; }

        /* Header */
        .header { background: var(--header-bg); color: white; padding: 0 2rem; height: 60px; display: flex; align-items: center; justify-content: space-between; }
        .logo { font-size: 1.25rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
        .user-info { display: flex; align-items: center; gap: 1rem; }
        .user-name { color: #94a3b8; font-size: 0.875rem; }
        .btn-logout { background: none; border: 1px solid #475569; color: #94a3b8; padding: 0.375rem 0.75rem; border-radius: 4px; cursor: pointer; font-size: 0.875rem; }
        .btn-logout:hover { border-color: #94a3b8; color: white; }

        /* Layout */
        .container { display: flex; height: calc(100vh - 60px); }
        .sidebar { width: 240px; background: var(--sidebar-bg); color: white; padding: 1.5rem 0; position: relative; }
        .nav-item { padding: 0.75rem 1.5rem; cursor: pointer; transition: background 0.2s; display: flex; align-items: center; gap: 0.75rem; font-size: 1.1rem; }
        .nav-item:hover { background: rgba(255,255,255,0.1); }
        .nav-item.active { background: var(--primary); }
        .sidebar-bottom { position: absolute; bottom: 1.5rem; width: 100%; }

        /* Main */
        .main { flex: 1; padding: 1.5rem; overflow-y: auto; }
        .card { background: var(--card-bg); border-radius: 8px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 1rem; }
        .card-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; }

        /* Upload */
        .upload-zone { border: 2px dashed var(--border); border-radius: 8px; padding: 0.9rem; text-align: center; cursor: pointer; transition: all 0.3s; }
        .upload-zone:hover { border-color: var(--primary); background: #f8fafc; }
        .upload-zone.dragover { border-color: var(--primary); background: #eff6ff; }
        .upload-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
        .upload-text { color: var(--text-secondary); margin-bottom: 0.25rem; }
        .upload-hint { font-size: 0.875rem; color: var(--text-secondary); }
        .file-info { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; background: #f8fafc; border-radius: 6px; margin-top: 0.75rem; }

        /* Form */
        .form-group { margin-bottom: 1.25rem; }
        .form-label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 1rem; }
        .form-input, .form-select { width: 100%; padding: 0.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 1rem; }
        .form-input:focus, .form-select:focus { outline: none; border-color: var(--primary); }

        /* Button */
        .btn { padding: 0.75rem 1.5rem; border: none; border-radius: 6px; font-size: 1rem; cursor: pointer; transition: all 0.2s; }
        .btn-primary { background: var(--primary); color: white; }
        .btn-primary:hover { background: var(--primary-dark); }
        .btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }
        .btn-block { width: 100%; }

        /* 验证码行：输入框与获取按钮并排 */
        .code-row { display: flex; gap: 0.5rem; }
        .code-row .form-input { flex: 1 1 auto; min-width: 0; }
        .btn-code { flex: 0 0 auto; width: 7rem; padding: 0 0.5rem; border: 1px solid var(--primary); border-radius: 6px; background: white; color: var(--primary); font-size: 0.9rem; cursor: pointer; }
        .btn-code:disabled { border-color: var(--border); color: #94a3b8; cursor: not-allowed; }
        .login-tip { margin-top: 1rem; font-size: 0.82rem; color: #64748b; text-align: center; line-height: 1.5; }

        /* Progress */
        .progress-bar-bg { width: 100%; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
        .progress-bar { height: 100%; background: var(--primary); transition: width 0.3s; width: 0%; }
        .progress-text { margin-top: 0.5rem; color: var(--text-secondary); font-size: 0.875rem; }

        /* Result */
        .result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
        .result-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
        .result-table th { background: #f8fafc; padding: 0.75rem; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); }
        .result-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); }
        .result-table tr:hover { background: #f8fafc; }
        mark { background: #fef3c7; padding: 0 2px; border-radius: 2px; }
        .bracket-hl { color: #dc2626; font-weight: 600; }

        /* History */
        .history-item { padding: 1rem; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 1rem; cursor: pointer; transition: all 0.2s; }
        .history-item:hover { border-color: var(--primary); }
        .history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
        .history-filename { font-weight: 600; }
        .history-meta { font-size: 0.875rem; color: var(--text-secondary); }
        .status-badge { padding: 0.25rem 0.75rem; border-radius: 12px; font-size: 0.75rem; }
        .status-done { background: #dcfce7; color: var(--success); }
        .status-running { background: #dbeafe; color: var(--primary); }
        .status-error { background: #fee2e2; color: var(--error); }

        /* 书稿预审 */
        .precheck-grade { padding: 0.3rem 0.9rem; border-radius: 6px; font-size: 0.95rem; font-weight: 700; }
        .grade-A { background: #dcfce7; color: #16a34a; }
        .grade-B { background: #ffedd5; color: #ea580c; }
        .grade-C { background: #fee2e2; color: #dc2626; }
        .verdict-ok { color: #16a34a; font-weight: 600; }
        .verdict-warn { color: #ea580c; font-weight: 600; }
        .verdict-bad { color: #dc2626; font-weight: 600; }

        /* Alert */
        .alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.875rem; }
        .alert-error { background: #fee2e2; color: var(--error); }
        .alert-success { background: #dcfce7; color: var(--success); }
        .toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; padding: 0.75rem 1.5rem; border-radius: 8px; font-size: 0.9rem; z-index: 9999; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
        .toast.show { opacity: 1; }
        .hidden { display: none !important; }

        /* History review badges */
        .hist-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
        .hist-accepted { background: #dcfce7; color: #16a34a; }
        .hist-rejected { background: #fee2e2; color: #dc2626; }
        .hist-pending_fix { background: #fef3c7; color: #b45309; }
        .hist-optional { background: #e0f2fe; color: #0369a1; }
        .hist-level { font-size: 0.65rem; color: var(--text-secondary); margin-left: 0.25rem; }
        .hist-detail { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.25rem; line-height: 1.4; }
        .hist-banner { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px; padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.875rem; color: #1e40af; display: flex; align-items: center; gap: 0.5rem; }

        /* Compare */
        .cmp-btn { background: #7c3aed; color: white; }
        .cmp-btn:hover { background: #6d28d9; }
        .dl-btn { background: #e2e8f0; color: #334155; padding: 0.2rem 0.55rem; font-size: 0.75rem; }
        .dl-btn:hover { background: #cbd5e1; }
        .cmp-banner { background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 6px; padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.875rem; color: #5b21b6; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
        .cmp-banner strong { color: #7c3aed; }
        .cmp-close { background: none; border: none; cursor: pointer; color: #7c3aed; font-size: 0.875rem; margin-left: auto; padding: 0.25rem 0.5rem; border-radius: 4px; }
        .cmp-close:hover { background: #ede9fe; }
        .cmp-filter { display: inline-flex; align-items: center; gap: 0.35rem; background: #ede9fe; padding: 0.25rem 0.6rem; border-radius: 4px; cursor: pointer; font-size: 0.8rem; color: #5b21b6; }
        .cmp-filter input { accent-color: #7c3aed; }
        .cmp-row { background: #faf5ff !important; }
        .cmp-row td:first-child { position: relative; }
        .cmp-tag { display: inline-block; background: #ede9fe; color: #7c3aed; font-size: 0.7rem; font-weight: 600; padding: 0.1rem 0.4rem; border-radius: 3px; margin-left: 0.25rem; }
        .cmp-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
        .cmp-modal { background: white; border-radius: 12px; padding: 2rem; width: 520px; max-height: 70vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
        .cmp-modal h3 { font-size: 1.15rem; margin-bottom: 1rem; }
        .cmp-task-item { padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 0.75rem; cursor: pointer; transition: all 0.2s; }
        .cmp-task-item:hover { border-color: #7c3aed; background: #f5f3ff; }
        .cmp-task-name { font-weight: 600; font-size: 0.95rem; }
        .cmp-task-meta { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; }
        .cmp-empty { text-align: center; color: #94a3b8; padding: 2rem; }
        .cmp-modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }
        .btn-ghost { background: none; border: 1px solid var(--border); color: var(--text-secondary); padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
        .btn-ghost:hover { border-color: var(--text-primary); color: var(--text-primary); }
