/* ===== Design Tokens（全站统一 · 竞赛学术风） ===== */
:root {
    --academic-navy: #0f2744;
    --academic-navy-mid: #1a365d;
    --academic-gold: #b8954a;
    --academic-cream: #f7f5f0;
    --academic-cream-dark: #ebe8e0;
    --academic-ink: #1e293b;
    --academic-muted: #64748b;

    --color-primary: #1a365d;
    --color-primary-dark: #0f2744;
    --color-primary-light: #e8eef6;
    --color-surface: #ffffff;
    --color-bg: #f3f5f8;
    --color-bg-elevated: #ffffff;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-success: #15803d;
    --color-danger: #dc2626;
    --color-warning: #b45309;
    --color-info: #0369a1;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-card: 0 2px 8px rgba(15, 39, 68, 0.05), 0 1px 2px rgba(15, 39, 68, 0.04);
    --shadow-card-hover: 0 12px 28px rgba(15, 39, 68, 0.1);
    --shadow-elevated: 0 8px 28px rgba(15, 39, 68, 0.08);
    --font-sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
    --nav-height: 56px;
    --container-max: 1120px;
}

/* ===== Reset & Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.65;
    min-height: 100vh;
}
body.modal-open { overflow: hidden; }
a { transition: color .2s; }

/* ===== Navbar ===== */
.navbar {
    display: flex; align-items: center; gap: 24px;
    padding: 12px 28px;
    min-height: var(--nav-height);
    background:
        linear-gradient(90deg, rgba(184,149,74,.08), transparent 28%),
        linear-gradient(135deg, #0a1a2e 0%, var(--academic-navy) 48%, #152a45 100%);
    color: #e2e8f0;
    box-shadow: 0 4px 20px rgba(10, 26, 46, .35);
    border-bottom: 1px solid rgba(255,255,255,.06);
    position: sticky; top: 0; z-index: 100;
}
.navbar .brand {
    display: inline-flex; align-items: center; gap: 10px;
    color: #fff; font-weight: 700; text-decoration: none; font-size: 17px;
    letter-spacing: .2px;
}
.navbar .brand-text {
    background: linear-gradient(90deg, #f0e6d0 0%, #e8c97a 40%, #93c5fd 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, rgba(184,149,74,.28), rgba(147,197,253,.18));
    color: #e8c97a; flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255,255,255,.1);
}
.brand-mark .ui-icon { width: 1.15rem; height: 1.15rem; }
.nav-links { list-style: none; display: flex; gap: 4px; flex: 1; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.nav-links a {
    color: #94a3b8; text-decoration: none; padding: 7px 11px;
    border-radius: 6px; font-size: .85rem; transition: all .2s; white-space: nowrap;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-user { display: flex; gap: 12px; align-items: center; }
.nav-user a, .nav-user button {
    color: #cbd5e1; text-decoration: none; background: transparent;
    border: none; cursor: pointer; font-size: .9rem; transition: color .2s;
}
.nav-user a:hover, .nav-user button:hover { color: #fff; }
.nav-user span { color: #94a3b8; font-size: .85rem; }
.nav-username { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout-btn {
    color: #cbd5e1; background: transparent; border: none; cursor: pointer;
    font-size: .9rem; transition: color .2s;
    padding: 6px 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,.12);
}
.nav-logout-btn:hover { color: #fff; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.2); }

/* 导航分组（学生端） */
.nav-group {
    display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; flex-shrink: 0;
    padding-right: 10px; margin-right: 6px;
    border-right: 1px solid rgba(255,255,255,.1);
}
.nav-group:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.nav-group-tail { padding-left: 2px; }
.nav-group-label {
    font-size: .68rem; font-weight: 600; color: #64748b;
    text-transform: uppercase; letter-spacing: .08em;
    margin-right: 4px; user-select: none;
}
.nav-links a.nav-emphasis { color: #e8c97a; font-weight: 600; }
.nav-links a.nav-emphasis:hover { color: #fff; background: rgba(184,149,74,.18); }

/* 教师预览横幅 */
.preview-banner {
    display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
    padding: 12px 16px; margin-bottom: 16px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fcd34d; border-radius: var(--radius-sm);
    color: #92400e; font-size: .9rem;
}
.preview-banner strong { color: #b45309; }

/* ===== Container & Layout ===== */
.container { max-width: var(--container-max); margin: 28px auto 40px; padding: 0 20px; }

/* ===== Page Header ===== */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
    padding: 22px 24px;
    background: linear-gradient(135deg, #fff 0%, var(--academic-cream) 100%);
    border: 1px solid var(--academic-cream-dark);
    border-left: 4px solid var(--academic-navy-mid);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
}
.page-header-title {
    font-size: 1.5rem; font-weight: 700; color: var(--academic-ink);
    letter-spacing: -0.02em; line-height: 1.3;
}
.page-header-subtitle {
    margin-top: 6px; color: var(--academic-muted); font-size: .92rem; max-width: 56ch; line-height: 1.55;
}
.page-header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.page-header-row { display: flex; align-items: center; gap: 14px; }
.page-header-icon-wrap {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(135deg, #e8eef6 0%, #f0ebe0 100%);
    color: var(--academic-navy-mid);
    box-shadow: 0 0 0 1px rgba(26, 54, 93, .08);
}
.page-header-icon-wrap .ui-icon { width: 1.5rem; height: 1.5rem; }

/* ===== UI Icons ===== */
.ui-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; display: block; }
.ui-icon-lg { width: 1.5rem; height: 1.5rem; }
.ui-icon-xl { width: 3rem; height: 3rem; }
.ui-icon-wrap {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.35rem; height: 2.35rem; border-radius: 10px; flex-shrink: 0;
    background: var(--color-primary-light); color: var(--color-primary);
}
.ui-icon-wrap-sm { width: 1.85rem; height: 1.85rem; border-radius: 8px; }
.ui-icon-wrap .ui-icon { width: 1.15rem; height: 1.15rem; }
.ui-icon-wrap-muted { background: #f1f5f9; color: #64748b; }
.ui-icon-wrap-success { background: #dcfce7; color: #15803d; }
.ui-icon-wrap-warning { background: #fef3c7; color: #b45309; }
.ui-icon-wrap-violet { background: #e8eef6; color: #1a365d; }

.section-block-title .ui-icon-wrap-sm { vertical-align: -4px; margin-right: 2px; }

.empty-state-icon { color: #cbd5e1; margin-bottom: 12px; display: flex; justify-content: center; }
.empty-hint-block {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; color: #9ca3af; text-align: center; padding: 32px 16px; font-size: .9rem;
}
.empty-hint-block .ui-icon-xl { color: #cbd5e1; opacity: .9; }

/* ===== Section ===== */
.section-block { margin-bottom: 20px; }
.section-block-title {
    font-size: 1.02rem; font-weight: 600; color: var(--academic-ink);
    margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.section-block-title::before {
    content: ''; width: 3px; height: 1.05em; background: var(--academic-gold);
    border-radius: 2px; flex-shrink: 0;
}

/* ===== Card ===== */
.card {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-md); padding: 22px 24px; margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    transition: box-shadow .2s, border-color .2s;
}
.card.card-interactive { transition: box-shadow .2s, border-color .2s, transform .2s; }
.card.card-interactive:hover {
    box-shadow: var(--shadow-card-hover); border-color: #cbd5e1;
    transform: translateY(-1px);
}
.card h1 { font-size: 1.5rem; margin-bottom: .5rem; color: var(--color-text); }
.card h2 { font-size: 1.15rem; margin-bottom: .75rem; color: var(--color-text); font-weight: 600; }
.card h3 { font-size: 1.05rem; margin-bottom: .5rem; color: #334155; font-weight: 600; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 18px; font-size: .9rem; font-weight: 600;
    background: var(--academic-navy-mid); color: #fff;
    border: 0; border-radius: 7px; text-decoration: none; cursor: pointer;
    transition: all .2s; box-shadow: 0 2px 8px rgba(15, 39, 68, .22);
}
.btn:hover { background: var(--academic-navy); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15, 39, 68, .3); }
.btn:active { transform: translateY(0); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 2px 6px rgba(220,38,38,.25); }
.btn-danger:hover { background: linear-gradient(135deg, #dc2626, #b91c1c); box-shadow: 0 4px 12px rgba(220,38,38,.35); }
.btn-secondary { background: #64748b; box-shadow: 0 2px 6px rgba(71,85,105,.2); }
.btn-secondary:hover { background: #475569; box-shadow: 0 4px 12px rgba(71,85,105,.3); }
.btn-success { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 2px 6px rgba(22,163,74,.25); }
.btn-success:hover { background: linear-gradient(135deg, #16a34a, #15803d); box-shadow: 0 4px 12px rgba(22,163,74,.35); }
.btn-sm { font-size: .8rem; padding: 5px 12px; border-radius: 6px; }
.btn-primary { background: var(--academic-navy-mid); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: #374151; font-size: .9rem; }
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group textarea, .form-group select,
.form-control {
    width: 100%; padding: 10px 14px; border: 1px solid #d4dce8; border-radius: 8px;
    font-size: 14px; background: #fff; transition: border-color .2s, box-shadow .2s;
}
.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group textarea:focus, .form-group select:focus,
.form-control:focus {
    outline: none; border-color: var(--academic-navy-mid);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, .1);
}
.form-check {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
    width: auto; max-width: max-content;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 1.05rem; height: 1.05rem; margin: 0; flex-shrink: 0;
    accent-color: var(--academic-navy-mid, #1a365d);
    cursor: pointer;
}
.form-check label { margin: 0; cursor: pointer; font-weight: 500; }

.pkg-check-grid {
    display: flex; flex-wrap: wrap; gap: 10px 16px;
    margin-top: 4px;
}
.pkg-check-item {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    background: #fafbfc;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    font-size: .88rem;
    color: var(--academic-ink, #1e293b);
    white-space: nowrap;
}
.pkg-check-item:hover { border-color: #c9d4e4; background: #fff; }
.pkg-check-item input[type="checkbox"] {
    width: 1.05rem; height: 1.05rem; margin: 0; flex-shrink: 0;
    accent-color: var(--academic-navy-mid, #1a365d);
}
.form-actions { margin-top: 20px; }
.form-card {
    background: #fff; border: 1px solid var(--color-border); border-radius: 12px;
    padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow-card);
}

/* ===== Alerts & Flash ===== */
.flash-messages { margin-bottom: 16px; }
.flash-alert {
    display: flex; align-items: flex-start; gap: 10px;
    animation: flash-in .25s ease-out;
}
@keyframes flash-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.flash-icon {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700;
}
.alert-success .flash-icon { background: #bbf7d0; color: #166534; }
.alert-error .flash-icon { background: #fecaca; color: #991b1b; }
.alert-info .flash-icon { background: #bae6fd; color: #075985; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 10px; font-size: .9rem; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: #f0f9ff; color: #075985; border: 1px solid #bae6fd; }

/* ===== Empty State ===== */
.empty-state {
    text-align: center; padding: 48px 28px; color: var(--color-text-muted);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
    border: 1px dashed #d4dce8; border-radius: 12px;
}
.empty-state-icon { color: #cbd5e1; margin-bottom: 12px; }
.empty-state-title { font-size: 1.05rem; font-weight: 600; color: var(--color-text); margin-bottom: 8px; }
.empty-state-desc { font-size: .9rem; margin-bottom: 16px; max-width: 36ch; margin-left: auto; margin-right: auto; }

/* ===== Badge ===== */
.badge {
    display: inline-flex; align-items: center; padding: 2px 9px;
    border-radius: 4px; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
}
.badge-primary { background: var(--color-primary-light); color: var(--color-primary-dark); }
.badge-muted { background: #f1f5f9; color: var(--color-text-muted); }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; opacity: 0; transition: opacity .2s ease;
}
.modal-overlay.is-open { opacity: 1; }
.modal-dialog {
    background: var(--color-surface); border-radius: var(--radius-md);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
    width: 100%; max-width: 720px; max-height: 90vh;
    display: flex; flex-direction: column; overflow: hidden;
    transform: translateY(8px); transition: transform .2s ease;
}
.modal-overlay.is-open .modal-dialog { transform: translateY(0); }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--color-border);
}
.modal-title { font-size: 1.1rem; font-weight: 600; color: var(--color-text); }
.modal-close {
    background: none; border: none; font-size: 1.5rem; line-height: 1;
    color: var(--color-text-muted); cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm);
}
.modal-close:hover { background: #f1f5f9; color: var(--color-text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

/* ===== Auth Card ===== */
.auth-card {
    max-width: 420px; margin: 48px auto;
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 1.25rem; }
.auth-card .form-actions-row {
    display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap;
}
.auth-card .auth-link { color: var(--color-primary); font-size: .9rem; text-decoration: none; }
.auth-card .auth-link:hover { text-decoration: underline; }

.demo-accounts-card { max-width: 520px; margin: 1rem auto 0; border: 1px dashed #93c5fd; background: #f8fbff; }
.demo-accounts-title { font-size: 1.05rem; margin: 0 0 .5rem; color: #1e40af; }
.demo-accounts-desc { font-size: .9rem; color: #64748b; margin: 0 0 1rem; }
.demo-accounts-grid { display: flex; flex-direction: column; gap: .75rem; }
.demo-account-item { padding: .75rem 1rem; background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; }
.demo-account-role { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: #dbeafe; color: #1d4ed8; margin-right: .5rem; }
.demo-account-role.teacher { background: #ede9fe; color: #6d28d9; }
.demo-account-sep { color: #94a3b8; margin: 0 .25rem; }
.demo-account-hint { font-size: .85rem; color: #64748b; margin: .35rem 0 0; }
.demo-accounts-foot { font-size: .8rem; color: #94a3b8; margin: .75rem 0 0; }

/* ===== Footer ===== */
.site-footer {
    text-align: center; padding: 28px 24px; color: var(--academic-muted); margin-top: 56px;
    border-top: 1px solid var(--academic-cream-dark);
    background: linear-gradient(180deg, transparent 0%, var(--academic-cream) 100%);
    font-size: .85rem; letter-spacing: .02em;
}

/* ===== Data Table ===== */
.data-table, .table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td, .table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f1f5f9; }
.data-table th, .table th { background: linear-gradient(180deg, #f8fafc, #f1f5f9); font-weight: 600; font-size: .8rem; color: #64748b; text-transform: uppercase; letter-spacing: .5px; }
.data-table tbody tr, .table tbody tr { transition: background .15s; }
.data-table tbody tr:hover, .table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:nth-child(even), .table tbody tr:nth-child(even) { background: #fafbfc; }
.data-table tbody tr:nth-child(even):hover, .table tbody tr:nth-child(even):hover { background: #f1f5f9; }
.empty-hint { color: #9ca3af; text-align: center; padding: 32px 16px; font-size: .9rem; }

/* ===== Tags ===== */
.tag {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 4px; font-size: .78rem;
    margin: 2px; font-weight: 600; letter-spacing: .02em;
    background: var(--color-primary-light); color: var(--academic-navy-mid);
    border: 1px solid rgba(26, 54, 93, .1);
}
.tag-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.tag-pass { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* ===== Status ===== */
.status-untried { color: #9ca3af; }
.status-passed { color: #16a34a; font-weight: 500; }
.status-unresolved { color: #dc2626; font-weight: 500; }

/* ===== D 子项目 ===== */

/* 题目详情双栏布局 */
.problem-detail { display: flex; gap: 24px; align-items: flex-start; }
.problem-left { flex: 0 0 45%; }
.problem-right { flex: 1; min-width: 0; }
.problem-text { white-space: pre-wrap; background: #f8fafc; padding: 14px; border-radius: 8px; border: 1px solid #e5e7eb; font-size: .9rem; line-height: 1.6; }
.problem-sample { font-family: 'Consolas', 'Monaco', monospace; }

/* Monaco 编辑器宿主 */
.monaco-editor-host { height: 500px; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }

/* 编辑器工具栏 */
.editor-toolbar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }

/* 交互式终端面板 */
.terminal-panel { margin-top: 10px; border: 1px solid #334155; border-radius: 8px; overflow: hidden; }
.terminal-header {
    background: linear-gradient(180deg, #1e293b, #0f172a); color: #94a3b8;
    padding: 8px 14px; display: flex; align-items: center; gap: 8px; font-size: .8rem;
}
.terminal-header span:first-child { flex: 1; font-weight: 600; }
.terminal-output {
    background: #0f172a; color: #e2e8f0; padding: 12px 14px;
    font-family: 'Consolas', 'Monaco', monospace; font-size: .85rem;
    min-height: 80px; max-height: 250px; overflow-y: auto;
    white-space: pre-wrap; word-break: break-all;
}
.terminal-output .stderr { color: #f87171; }
.terminal-output .info { color: #60a5fa; font-style: italic; }
.terminal-output .stdin-echo { color: #34d399; }
.terminal-input-line {
    background: #0f172a; border-top: 1px solid #334155;
    display: flex; align-items: center; padding: 6px 14px;
}
.terminal-prompt { color: #22c55e; font-family: monospace; margin-right: 6px; }
.terminal-input {
    flex: 1; background: transparent; border: none; outline: none;
    color: #e2e8f0; font-family: monospace; font-size: .85rem;
}
.submit-hint { color: #6b7280; font-size: 0.9rem; }

/* 判题结果 */
.result-box { margin-top: 16px; padding: 20px; background: #fff; border-radius: 10px; border: 1px solid #e5e7eb; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.verdict { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.verdict-pass { color: #16a34a; }
.verdict-fail { color: #dc2626; }
.analysis { white-space: pre-wrap; background: #f8fafc; padding: 14px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: .9rem; line-height: 1.6; }

/* 学习数据面板 */
.stats-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card {
    text-align: center; padding: 22px 14px;
    background: linear-gradient(165deg, #fff 0%, #fafbfc 100%);
    border-radius: 12px; border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.stats-dash-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.stats-chart-card h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.stats-chart-title { margin: 0 0 .25rem; font-size: 1.05rem; font-weight: 600; color: #0f172a; }
.stats-chart-sub { margin: 0 0 .85rem; font-size: .82rem; color: #64748b; }
.stats-chart-wrap { position: relative; height: 260px; }
.stats-chart-wrap--tall { height: 300px; }
.stats-chart-wrap--compact { height: 200px; max-height: 220px; }
.stats-chart-card--accent {
    border-top: 3px solid #3b82f6;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 42%);
}
.stats-chart-card--wide { grid-column: 1 / -1; }
.stats-cloud-card { margin-bottom: 1.5rem; }
.stats-wordcloud-canvas {
    width: 100% !important;
    max-width: 100%;
    height: 320px;
    display: block;
    border-radius: 10px;
    background: linear-gradient(145deg, #f8fafc 0%, #eef2ff 55%, #ecfeff 100%);
}
.stats-screen-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 1.5rem;
    padding: 1.1rem 1.15rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 48%, #0e7490 100%);
    color: #e2e8f0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .28);
}
.stats-screen-strip .screen-kpi { text-align: center; padding: .35rem; }
.stats-screen-strip .screen-kpi .label {
    font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; opacity: .78; margin-bottom: .35rem;
}
.stats-screen-strip .screen-kpi .value {
    font-size: 1.65rem; font-weight: 700; color: #fff; line-height: 1.2;
}
.stats-class-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 1.5rem;
}
.stats-class-charts .stats-chart-card { padding: 1.25rem; }
@media (max-width: 900px) {
    .stats-dash-grid, .stats-class-charts, .stats-screen-strip {
        grid-template-columns: 1fr;
    }
}
.stat-label { color: #6b7280; font-size: 0.78rem; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--academic-navy-mid); letter-spacing: -.02em; }

/* 错题本卡片 */
.mistake-card { margin-bottom: 8px; }
.mistake-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.mistake-analysis { color: #6b7280; font-size: 0.9rem; margin: 4px 0; }
.tab-bar { display: flex; gap: 16px; margin-top: 8px; }
.tab-bar a { color: #6b7280; text-decoration: none; padding-bottom: 4px; transition: color .2s; }
.tab-bar a.active { color: var(--academic-navy-mid); border-bottom: 2px solid var(--academic-gold); font-weight: 600; }

/* 代码块 */
.code-block {
    background: linear-gradient(135deg, #1e293b, #0f172a); color: #e2e8f0;
    padding: 18px; border-radius: 8px; overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace; font-size: .9rem; line-height: 1.5;
}

/* ===== B 子项目：Admin 布局 ===== */

.admin-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; min-height: 52px;
    background:
        linear-gradient(90deg, rgba(184,149,74,.1), transparent 30%),
        linear-gradient(135deg, #0a1a2e 0%, var(--academic-navy) 100%);
    color: #e2e8f0;
    box-shadow: 0 4px 16px rgba(10, 26, 46, .3);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.admin-topbar .brand {
    display: inline-flex; align-items: center; gap: 10px;
    color: #fff; font-weight: 700; text-decoration: none; font-size: 17px;
}
.admin-topbar .brand-text {
    background: linear-gradient(90deg, #f0e6d0 0%, #e8c97a 45%, #93c5fd 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.admin-topbar .nav-user { display: flex; gap: 12px; align-items: center; }
.admin-topbar .nav-user button {
    color: #e2e8f0; background: transparent; border: 1px solid rgba(255,255,255,.14);
    border-radius: 6px; padding: 5px 12px; cursor: pointer; transition: all .2s;
}
.admin-topbar .nav-user button:hover { color: #fff; background: rgba(255,255,255,.06); }

.admin-body { display: flex; min-height: calc(100vh - 52px); }

.admin-sidebar {
    width: 220px; flex-shrink: 0;
    background: linear-gradient(180deg, #132338 0%, #0a1a2e 100%);
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 16px 0;
    border-right: 1px solid rgba(255,255,255,.05);
}
.admin-sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.admin-sidebar a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; color: #94a3b8;
    text-decoration: none; font-size: 13.5px; border-radius: 8px; transition: all .2s;
}
.admin-sidebar a .ui-icon { width: 1.05rem; height: 1.05rem; opacity: .88; flex-shrink: 0; }
.admin-sidebar a.active .ui-icon { opacity: 1; }
.admin-sidebar a:hover { color: #fff; background: rgba(255,255,255,.06); }
.admin-sidebar a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--academic-navy-mid), #243b55);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(15, 39, 68, .35);
    border: 1px solid rgba(184, 149, 74, .25);
}
.admin-back {
    padding: 12px 24px; color: #64748b; text-decoration: none; font-size: 13px;
    margin-top: auto; border-top: 1px solid rgba(255,255,255,.06); display: block; transition: all .2s;
}
.admin-back:hover { color: #f8fafc; background: rgba(255,255,255,.04); }

.admin-content {
    flex: 1; padding: 28px 36px; overflow-y: auto;
    background:
        radial-gradient(ellipse 70% 30% at 50% 0%, rgba(26, 54, 93, .035), transparent 55%),
        var(--color-bg);
}

/* Admin 卡片 + 表格 */
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.admin-header h1 { font-size: 1.4rem; color: var(--academic-ink); }

.summary-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.summary-card {
    display: flex; align-items: flex-start; gap: 12px; text-align: left;
    background: linear-gradient(165deg, #fff 0%, #fafbfc 100%);
    border: 1px solid var(--color-border); border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-card); transition: box-shadow .2s, transform .2s, border-color .2s;
}
.summary-card-body { flex: 1; min-width: 0; }
.summary-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); border-color: #cbd5e1; }
.summary-card .label { color: #6b7280; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .06em; }
.summary-card .value { font-size: 1.8rem; font-weight: 700; color: var(--academic-navy-mid); margin-top: 4px; }

/* Admin 表单 */
.admin-form { max-width: 720px; }
.admin-form .form-group textarea { min-height: 120px; }

/* Admin tabs */
.admin-tabs { display: flex; gap: 0; border-bottom: 2px solid #e5e7eb; margin-bottom: 20px; }
.admin-tabs a {
    padding: 10px 20px; color: #6b7280; text-decoration: none; border-bottom: 2px solid transparent;
    margin-bottom: -2px; font-size: 14px; transition: all .2s;
}
.admin-tabs a:hover { color: #1e293b; }
.admin-tabs a.active { color: var(--academic-navy-mid); border-bottom-color: var(--academic-gold); font-weight: 600; }

/* 行内表单/操作 */
.inline-actions { display: flex; gap: 8px; align-items: center; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
    .nav-links { gap: 4px; flex-wrap: wrap; width: 100%; order: 3; }
    .nav-group { border-right: none; margin-right: 0; padding-right: 0; margin-bottom: 4px; }
    .nav-group-label { display: none; }
    .nav-links a { padding: 4px 8px; font-size: .8rem; }
    .page-header-title { font-size: 1.35rem; }
    .hero-banner { padding: 24px 20px; }
    .quick-links { grid-template-columns: repeat(2, 1fr); }
    .quick-links-compact { grid-template-columns: repeat(2, 1fr); }
    .problem-detail { flex-direction: column; }
    .problem-left, .problem-right { flex: none; width: 100%; }
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
    .summary-cards { grid-template-columns: repeat(2, 1fr); }
    .admin-sidebar { display: none; }
    .admin-content { padding: 16px; }
}

/* ===== Playground ===== */
.playground { display: flex; gap: 1.25rem; min-height: 70vh; }
.playground-left {
    flex: 1; min-width: 0; overflow-y: auto; max-height: 80vh; padding: 18px 18px 18px;
    background: #fff; border: 1px solid var(--color-border); border-radius: 12px;
    box-shadow: var(--shadow-card);
}
.playground-right {
    flex: 1.05; min-width: 0; display: flex; flex-direction: column;
    padding: 14px; background: #fff; border: 1px solid var(--color-border);
    border-radius: 12px; box-shadow: var(--shadow-card);
}
.playground-right .monaco-editor-host {
    flex: 1; min-height: 350px; border: 1px solid #d4dce8; border-radius: 10px;
    overflow: hidden; box-shadow: inset 0 1px 2px rgba(15, 39, 68, .04);
}
.multitest-table { width: 100%; border-collapse: collapse; font-size: .875rem; margin-top: .5rem; }
.multitest-table th, .multitest-table td {
    border: 1px solid #e5e7eb; padding: .4rem .55rem; vertical-align: top; text-align: left;
}
.multitest-table th { background: #f8fafc; font-weight: 600; }
.multitest-table pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: .8rem; max-height: 8rem; overflow: auto; }
.multitest-pass { color: #15803d; font-weight: 600; }
.multitest-fail { color: #b91c1c; font-weight: 600; }
.multitest-case-card {
    border: 1px solid #e5e7eb; border-radius: 8px; padding: .65rem; margin-bottom: .5rem; background: #fafafa;
}
.multitest-case-card label { display: block; font-size: .8rem; color: #64748b; margin-bottom: .2rem; }
.multitest-case-card textarea { width: 100%; font-family: ui-monospace, monospace; font-size: .8rem; }
.free-mode-editor label { font-weight: 600; display: block; margin-bottom: .25rem; color: #374151; }
.free-mode-editor textarea { width: 100%; font-family: inherit; }
@media (max-width: 768px) {
    .playground { flex-direction: column; }
    .playground-left { max-height: none; padding-right: 0; }
}

/* ===== Resource Center ===== */
.tag-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.tag-active { background: var(--academic-navy-mid) !important; color: #fff !important; border-color: var(--academic-navy-mid) !important; }
.tag-sm { font-size: .75rem; padding: 2px 8px; }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel .data-table { margin: 0; }
.table-panel .data-table th:first-child,
.table-panel .data-table td:first-child { padding-left: 20px; }
.table-panel .data-table th:last-child,
.table-panel .data-table td:last-child { padding-right: 20px; }
.table-panel .empty-hint { margin: 0; border: none; border-radius: 0; }
.resource-card { padding: 1.25rem; transition: transform .2s, box-shadow .2s, border-color .2s; }
.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: #cbd5e1;
}
.resource-card-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.resource-type-icon { font-size: 1.2rem; }
.resource-title { font-weight: 600; font-size: 1.05rem; }
.resource-summary { color: #4b5563; font-size: .9rem; margin: .5rem 0; }
.resource-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .5rem; }
.embedded-content { margin-top: .75rem; padding: 1rem; background: #f9fafb; border-radius: 8px; border: 1px solid #e5e7eb; }

.text-muted { color: #9ca3af; font-size: .85rem; }

/* ===== Admin 建题表单 ===== */
.form-section { margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid #e5e7eb; }
.form-section:last-of-type { border-bottom: none; }
.form-section-title { font-size: 1.05rem; margin: 0 0 .35rem; color: #1e293b; }
.form-section-desc { font-size: .9rem; color: #64748b; margin: 0 0 .75rem; }
.ai-draft-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.ai-draft-row .form-control { flex: 1; min-width: 200px; }
.ai-draft-hint { font-size: .85rem; margin-top: .5rem; }
.ai-draft-hint.info { color: #2563eb; }
.ai-draft-hint.success { color: #16a34a; }
.ai-draft-hint.error { color: #dc2626; }
.sample-row { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: .75rem 1rem; margin-bottom: .75rem; }
.sample-row-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; font-weight: 600; font-size: .9rem; }
.tag-checkbox-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-checkbox-item { display: flex; align-items: center; gap: .25rem; cursor: pointer; }
.code-textarea { font-family: 'Consolas', 'Monaco', monospace; font-size: .9rem; }
.form-row-inline { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row-inline .form-group { flex: 1; min-width: 160px; margin-bottom: 12px; }
.form-hint { font-size: .85rem; color: #6b7280; margin: 0 0 .5rem; line-height: 1.45; }
.form-check--public {
    margin: 8px 0 4px;
    padding: 10px 14px;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    background: #fafbfc;
    max-width: 280px;
}

/* ===== Playground 提交历史 ===== */
.submission-history { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; }
.submission-history-list { list-style: none; padding: 0; margin: 0; }
.submission-history-list li {
    display: flex; align-items: center; gap: .75rem; padding: .4rem 0;
    border-bottom: 1px solid #f1f5f9; font-size: .9rem;
}
.submission-history-list li:last-child { border-bottom: none; }
.submission-time { color: #64748b; min-width: 72px; }
.verdict-chip { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.verdict-chip.pass { background: #dcfce7; color: #166534; }
.verdict-chip.fail { background: #fee2e2; color: #991b1b; }

.verdict-chip.fail { background: #fee2e2; color: #991b1b; }

/* ===== 作业向导 & 待办 ===== */
.wizard-steps { display: flex; gap: 0; margin-bottom: 1.5rem; border-bottom: 2px solid #e5e7eb; }
.wizard-step {
    flex: 1; text-align: center; padding: .75rem .5rem; color: #94a3b8; font-size: .85rem;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.wizard-step span {
    display: inline-block; width: 1.5rem; height: 1.5rem; line-height: 1.5rem;
    border-radius: 50%; background: #e2e8f0; color: #64748b; margin-right: .35rem; font-size: .8rem;
}
.wizard-step.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.wizard-step.active span { background: #2563eb; color: #fff; }
.wizard-nav { display: flex; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.wizard-preview { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; line-height: 1.6; }
.checkbox-grid { display: flex; flex-direction: column; gap: .4rem; max-height: 240px; overflow-y: auto; }

.todo-card-list { display: flex; flex-direction: column; gap: .75rem; }
.todo-card {
    padding: 1rem 1.25rem; text-decoration: none; color: inherit;
    display: flex; gap: 12px; align-items: flex-start;
    animation: portalFadeIn .4s ease both;
    animation-delay: calc(var(--todo-i, 0) * .06s);
}
.todo-card-icon { flex-shrink: 0; margin-top: 2px; }
.todo-card-main { flex: 1; min-width: 0; }
.todo-card-header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.todo-title { font-weight: 600; color: var(--color-text); }
.todo-card-desc {
    margin: 4px 0 6px; font-size: .82rem; color: #64748b; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.todo-card-meta { display: flex; gap: 1rem; font-size: .85rem; color: #64748b; }
.todo-progress {
    height: 6px; background: #e2e8f0; border-radius: 999px; margin-top: 8px; overflow: hidden;
}
.todo-progress-fill {
    display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1a365d, #2563eb);
    min-width: 0; transition: width .6s ease;
}
.todo-overdue { border-left: 4px solid #f59e0b; }
.task-meta-bar { display: flex; gap: 2rem; padding: 1rem 1.25rem; flex-wrap: wrap; }
.task-meta-label { display: block; font-size: .75rem; color: #94a3b8; }
.task-item-list { list-style: none; padding: 0; margin: 0; }
.task-item-row {
    display: flex; align-items: center; gap: .75rem; padding: .75rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.task-item-row.is-done { opacity: .85; }
.task-item-row.is-done .task-item-icon { color: #16a34a; }
.task-item-icon { font-size: 1.1rem; color: #94a3b8; width: 1.5rem; text-align: center; }
.task-item-body { flex: 1; min-width: 0; }
.task-item-title { font-weight: 600; }
.task-item-type { font-size: .75rem; color: #94a3b8; }
.task-item-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ===== 我的班级 ===== */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 1rem; }
.class-card {
    text-decoration: none; color: inherit; display: block;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
a.class-card.card:hover,
.class-card.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: #cbd5e1;
}
.class-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: .35rem; }
.class-card-icon { flex-shrink: 0; margin-top: 2px; }
.class-card-heading { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.class-card-title { font-size: 1.15rem; margin: 0; color: var(--color-text); }
.class-card-meta { font-size: .85rem; color: #64748b; margin: 0 0 .5rem; }
.class-card-announcement { font-size: .85rem; color: #475569; margin: 0; line-height: 1.5; }
.class-card-announcement.muted { color: #94a3b8; }
.class-card-announcement-label { font-weight: 600; color: #64748b; margin-right: .25rem; }
.class-card-announcement-preview { color: #94a3b8; }
.class-quick-links { margin-bottom: 1rem; }
.announcement-row-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.announcement-pinned { background: #f0fdf4; margin: 0 -1rem; padding: .75rem 1rem; border-radius: 6px; }

/* ===== 试卷答题 ===== */
.exam-question-header { margin-bottom: .5rem; }
.exam-question-title { font-size: 1.05rem; margin: 0 0 .75rem; }
.exam-options { display: flex; flex-direction: column; gap: .4rem; }
.quiz-options-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.option-row { display: flex; gap: .5rem; align-items: center; }
.option-letter { font-weight: 600; min-width: 1.5rem; }
.score-bar { height: 6px; background: #e2e8f0; border-radius: 4px; margin-top: 4px; max-width: 120px; }
.score-bar-fill { height: 100%; background: var(--academic-navy-mid); border-radius: 4px; }

/* ===== Mistake Recommendations ===== */
.mistake-stats-bar {
    display: flex; gap: 2.5rem; justify-content: center; padding: 1.35rem; margin-bottom: 8px; flex-wrap: wrap;
}
.mistake-stat {
    text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px;
    min-width: 120px; padding: 8px 16px; border-radius: 12px;
}
.mistake-stat.is-unresolved { background: #fff7ed; }
.mistake-stat.is-mastered { background: #f0fdf4; }
.mistake-stat-value { display: block; font-size: 2.15rem; font-weight: 800; color: var(--academic-navy-mid, #1a365d); line-height: 1.1; }
.mistake-stat.is-unresolved .mistake-stat-value { color: #c2410c; }
.mistake-stat.is-mastered .mistake-stat-value { color: #15803d; }
.mistake-stat-label { font-size: .85rem; color: #6b7280; font-weight: 600; }
.mistake-page-head { position: relative; margin-bottom: .5rem; }
.mistake-loop-kicker {
    margin: -.25rem 0 12px; font-size: .75rem; letter-spacing: .14em; font-weight: 600;
    color: var(--academic-gold, #b8954a);
}
.mistake-head-actions { display: flex; justify-content: flex-end; margin: -.5rem 0 1rem; }
.mistake-title { font-weight: 600; color: var(--color-text); text-decoration: none; }
.mistake-title:hover { color: var(--color-primary, #2563eb); }
.mistake-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: .5rem; align-items: center; }
.btn-text-danger {
    border: none; background: transparent; color: #94a3b8; font-size: .82rem;
    cursor: pointer; padding: 4px 6px;
}
.btn-text-danger:hover { color: #dc2626; }
.btn-accent {
    background: var(--academic-navy-mid); color: #fff; border: none;
}
.btn-accent:hover { background: var(--academic-navy); color: #fff; }
.mistake-modal-loading { text-align: center; padding: 2rem; color: #6b7280; }
.empty-state-inline { text-align: center; padding: 2rem; color: #6b7280; }
.mistake-review-layout { display: flex; gap: 1rem; min-height: 320px; }
.mistake-review-list {
    width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: .35rem;
    max-height: 400px; overflow-y: auto; border-right: 1px solid #e5e7eb; padding-right: .75rem;
}
.resource-list-item {
    display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
    padding: .6rem .75rem; border: 1px solid #e5e7eb; border-radius: 8px;
    background: #f8fafc; cursor: pointer; text-align: left; width: 100%;
    transition: border-color .15s, background .15s;
}
.resource-list-item:hover { border-color: #93c5fd; background: #eff6ff; }
.resource-list-item.active { border-color: #2563eb; background: #eff6ff; }
.resource-list-icon { font-size: 1rem; }
.resource-list-title { font-weight: 600; font-size: .9rem; color: #1e293b; }
.resource-list-type { font-size: .75rem; color: #6b7280; }
.mistake-review-preview { flex: 1; min-width: 0; }
.preview-placeholder { color: #9ca3af; padding: 2rem; text-align: center; }
.preview-title { margin: 0 0 .75rem; font-size: 1rem; }
.preview-summary { color: #4b5563; font-size: .9rem; margin-bottom: .75rem; }
.video-wrapper { background: #000; border-radius: 8px; overflow: hidden; }
.video-wrapper video { width: 100%; max-height: 360px; display: block; }
.pdf-frame { width: 100%; height: 360px; border: 1px solid #e5e7eb; border-radius: 8px; }
.preview-error { color: #dc2626; padding: 1rem; text-align: center; }
.enhance-subtitle { color: #6b7280; margin: 0 0 .75rem; font-size: .9rem; }
.enhance-problem-body {
    background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px;
    padding: 1rem; max-height: 360px; overflow-y: auto; line-height: 1.6; font-size: .95rem;
}
.enhance-actions { margin-top: 1rem; text-align: right; }
.modal-dialog { max-width: 820px; width: 95vw; max-height: 90vh; display: flex; flex-direction: column; }
@media (max-width: 768px) {
    .mistake-review-layout { flex-direction: column; }
    .mistake-review-list { width: 100%; max-height: 160px; border-right: none; border-bottom: 1px solid #e5e7eb; padding-right: 0; padding-bottom: .75rem; }
}

.mistake-recommend { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid #e5e7eb; }
.mistake-recommend h4 { font-size: .85rem; color: #6b7280; margin: 0 0 .5rem; }

/* 错题本增强（批次8） */
.mistake-advice-card { border-left: 4px solid var(--color-primary, #2563eb); }
.mistake-advice-title { margin: 0 0 .75rem; font-size: 1.1rem; }
.mistake-advice-summary { margin: 0 0 1rem; color: var(--color-text); font-weight: 500; }
.mistake-advice-details { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mistake-advice-label { display: block; font-size: .8rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: .25rem; }
.mistake-advice-item p { margin: 0; font-size: .9rem; color: #374151; line-height: 1.5; }

.mistake-chart-filter { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.mistake-chart-wrap { display: flex; align-items: center; gap: 1rem; }
.mistake-chart-wrap canvas { max-width: 140px; max-height: 140px; }
.mistake-chart-legend { display: flex; flex-direction: column; gap: .5rem; font-size: .9rem; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.legend-syntax { background: #dc2626; }
.legend-logic { background: #d97706; }

.mistake-filter-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; flex: 1; min-width: 280px; }
.mistake-filter-form .form-group { margin: 0; min-width: 140px; }

.mistake-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.mistake-column-title { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; font-size: 1rem; }
.mistake-column-count { background: #e5e7eb; color: #374151; font-size: .75rem; padding: 2px 8px; border-radius: 10px; }

@media (max-width: 768px) {
    .mistake-advice-details { grid-template-columns: 1fr; }
    .mistake-columns { grid-template-columns: 1fr; }
}
.recommend-item { margin-bottom: .4rem; font-size: .9rem; }
.recommend-item a { font-weight: 500; }
.recommend-summary { color: #9ca3af; font-size: .8rem; margin-left: .5rem; }

/* ===== Forum ===== */
.forum-post-card { padding: 1.25rem; transition: transform .2s; }
.forum-post-card:hover { transform: translateY(-1px); }
.forum-post-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.forum-post-title { font-weight: 600; font-size: 1.1rem; }
.forum-post-meta { color: #6b7280; font-size: .85rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.forum-post-preview { color: #4b5563; font-size: .9rem; margin-top: .5rem; }
.forum-detail { padding: 1.5rem; }
.forum-comment { padding: .75rem 0; border-bottom: 1px solid #f1f5f9; }
.forum-comment:last-of-type { border-bottom: none; }
.forum-comment-meta { font-size: .85rem; color: #6b7280; margin-bottom: .25rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.forum-comment-content { margin: .25rem 0; }
.forum-comment-actions { font-size: .8rem; }
.forum-comment-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; }
.btn-link { background: none; border: none; color: #3b82f6; cursor: pointer; font-size: inherit; padding: 0; transition: color .2s; }
.btn-link:hover { text-decoration: underline; color: #2563eb; }
.btn-liked { background: #fef2f2 !important; border-color: #fca5a5 !important; }
.new-posts-banner { background: linear-gradient(135deg, #dbeafe, #ede9fe); color: #1e40af; padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; border: 1px solid #bfdbfe; }
.pagination { display: flex; align-items: center; gap: 1rem; justify-content: center; margin-top: 1.5rem; }
.markdown-body { line-height: 1.8; }
.markdown-body pre { background: #1e293b; color: #e2e8f0; padding: 1rem; border-radius: 8px; overflow-x: auto; }
.markdown-body code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote { border-left: 3px solid #3b82f6; padding-left: 1rem; color: #4b5563; margin: 1rem 0; }

/* ===== Quiz 理论题 ===== */
.quiz-option { padding: 10px 14px; border-radius: 8px; transition: background .15s; }
.quiz-option:hover { background: #f8fafc; }
.quiz-option label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.quiz-option input { margin: 0; accent-color: #3b82f6; }

/* ===== Homepage ===== */
.hero-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 55%, #1e293b 100%);
    color: #e2e8f0; border: none; padding: 32px 28px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; flex-wrap: wrap; position: relative; overflow: hidden;
}
.hero-banner::after {
    content: ''; position: absolute; top: -40%; right: -10%;
    width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle, rgba(96,165,250,.12) 0%, transparent 70%);
    pointer-events: none;
}
.hero-visual {
    flex-shrink: 0; width: 132px; height: 132px;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1;
}
.hero-code-art { width: 100%; height: 100%; }
.hero-banner-content { flex: 1; min-width: 240px; }
.hero-banner .hero-eyebrow {
    display: inline-block; font-size: .75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
    color: #93c5fd; margin-bottom: 10px;
}
.hero-banner h1 {
    font-size: 1.75rem; font-weight: 700; color: #fff;
    letter-spacing: -0.02em; line-height: 1.25;
}
.hero-desc { color: #94a3b8; font-size: .98rem; margin-top: 10px; max-width: 48ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.hero-actions .btn-outline-light {
    background: transparent; color: #e2e8f0; border: 1px solid rgba(255,255,255,.25);
    box-shadow: none;
}
.hero-actions .btn-outline-light:hover {
    background: rgba(255,255,255,.08); color: #fff; transform: none;
}
.quick-links {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px; margin-bottom: 20px;
}
.quick-links-compact {
    grid-template-columns: repeat(4, 1fr);
}
.quick-link {
    display: flex; flex-direction: row; align-items: center; gap: 12px;
    padding: 14px 16px; background: var(--color-surface);
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
    text-decoration: none; color: var(--color-text); transition: border-color .2s, box-shadow .2s;
}
.quick-link-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.quick-link:hover { border-color: #93c5fd; box-shadow: var(--shadow-card); color: var(--color-primary); }
.quick-link-label { font-size: .8rem; color: var(--color-text-muted); }
.quick-link-title { font-weight: 600; font-size: .95rem; }
.stat-card-accent { border-top: 3px solid var(--color-primary); }
.stat-card-warn { border-top: 3px solid var(--color-warning); }
.stat-card-ok { border-top: 3px solid var(--color-success); }
.feature-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px; margin-top: 8px;
}
.feature-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; background: #f8fafc; border-radius: var(--radius-sm);
    border: 1px solid var(--color-border); font-size: .9rem; color: #475569;
}
.feature-item-body strong { display: block; color: var(--color-text); margin-bottom: 4px; font-size: .95rem; }
.feature-item-body { flex: 1; min-width: 0; }
.feature-item strong { display: block; color: var(--color-text); margin-bottom: 4px; font-size: .95rem; }
.feature-list { list-style: none; padding: 0; }
.feature-list li { padding: 8px 0; padding-left: 24px; position: relative; color: #374151; }
.feature-list li::before { content: ''; position: absolute; left: 4px; top: 14px; width: 8px; height: 8px; background: var(--color-primary); border-radius: 50%; }
.recommend-row { margin-bottom: .75rem; padding-bottom: .75rem; border-bottom: 1px solid #f1f5f9; }
.recommend-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.recommend-row-header { display: flex; align-items: center; gap: .5rem; }
.recommend-row-title { font-weight: 600; color: #1e293b; text-decoration: none; }
a.recommend-row-title:hover { color: #2563eb; }
.recommend-row-summary { color: #6b7280; font-size: .9rem; margin: .25rem 0 0; }
.announcement-row {
    display: flex; gap: 12px; align-items: flex-start;
    margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9;
}
.announcement-row:last-child { border-bottom: none; }
.announcement-icon-wrap { flex-shrink: 0; margin-top: 2px; }
.announcement-body { flex: 1; min-width: 0; }
.announcement-title { font-size: 1rem; margin-bottom: 4px; color: #1e293b; }
.announcement-content { color: #4b5563; font-size: .9rem; }
.announcement-time { color: #9ca3af; }

.auth-split {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 20px; align-items: stretch; max-width: 920px; margin: 0 auto;
}
.auth-illustration {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 32px 24px; border-radius: var(--radius-md);
    background: linear-gradient(160deg, #eff6ff 0%, #f5f3ff 55%, #ecfeff 100%);
    border: 1px solid #dbeafe; text-align: center;
}
.auth-illustration-visual { width: 140px; height: 140px; margin-bottom: 16px; }
.auth-illustration-visual .hero-code-art { width: 100%; height: 100%; }
.auth-illustration h2 { font-size: 1.15rem; color: #1e293b; margin-bottom: 8px; }
.auth-illustration p { font-size: .9rem; color: #64748b; max-width: 28ch; line-height: 1.55; }
.auth-split .auth-card, .auth-split .demo-accounts-card { max-width: none; margin-left: 0; margin-right: 0; }

.action-chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.action-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px; border-radius: 8px; font-size: .875rem; font-weight: 500;
    text-decoration: none; color: #1e293b; background: #f8fafc;
    border: 1px solid #e2e8f0; transition: all .15s;
}
.action-chip:hover { border-color: #c9d4e4; background: #f8fafc; color: var(--academic-navy-mid); }
.action-chip .ui-icon { width: 1rem; height: 1rem; color: #64748b; }
.action-chip:hover .ui-icon { color: var(--academic-navy-mid); }

@media (max-width: 768px) {
    .hero-visual { display: none; }
    .auth-split { grid-template-columns: 1fr; }
    .auth-illustration { display: none; }
}

/* ===== Coze AI 助手浮窗覆盖 ===== */
.coze-chat-header img[src*="coze"],
.coze-chat-header .coze-logo,
.coze-chat-header svg[class*="logo"] { display: none !important; }
.coze-chat-btn { box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35) !important; }

/* 问通义浮钮与对话 */
.fab-tongyi {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 900;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(184, 149, 74, .35);
    background: linear-gradient(135deg, var(--academic-navy-mid), var(--academic-navy));
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(15, 39, 68, 0.35);
}
.fab-tongyi:hover { background: var(--academic-navy); filter: brightness(1.05); }
.fab-tongyi .ui-icon { width: 1.05rem; height: 1.05rem; }

.tongyi-chat { display: flex; flex-direction: column; min-height: 360px; max-height: 60vh; }
.tongyi-chat-messages {
    flex: 1; overflow-y: auto; padding: .5rem 0 1rem;
    display: flex; flex-direction: column; gap: .75rem;
}
.tongyi-chat-hint { color: #9ca3af; font-size: .9rem; text-align: center; padding: 1rem; }
.tongyi-chat-msg { display: flex; }
.tongyi-chat-msg-user { justify-content: flex-end; }
.tongyi-chat-msg-assistant { justify-content: flex-start; }
.tongyi-chat-bubble {
    max-width: 85%; padding: .6rem .85rem; border-radius: 12px;
    font-size: .9rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.tongyi-chat-msg-user .tongyi-chat-bubble { background: var(--color-primary, #2563eb); color: #fff; }
.tongyi-chat-msg-assistant .tongyi-chat-bubble { background: #f1f5f9; color: #1e293b; }
.tongyi-chat-loading { color: #6b7280; font-style: italic; }
.tongyi-chat-input-row { display: flex; gap: .5rem; align-items: flex-end; border-top: 1px solid #e5e7eb; padding-top: .75rem; }
.tongyi-chat-input-row textarea { flex: 1; resize: vertical; min-height: 48px; }

/* 班级数据热力表 */
.heatmap-table td { text-align: center; min-width: 48px; }
.heatmap-table th { font-size: .8rem; white-space: nowrap; }

/* 打印：班级数据快照 */
@media print {
    .navbar, .admin-sidebar, .admin-topbar, .admin-tabs, .no-print,
    .fab-tongyi, .site-footer, .flash-messages { display: none !important; }
    .admin-body { display: block !important; }
    .admin-content { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }
    .class-data-printable { padding: 0; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #e5e7eb; break-inside: avoid; }
}

/* ===== Academic portal: landing + auth ===== */
/* tokens already in :root */

.container.container--landing,
.container.container--auth,
main.container:has(.page-landing),
main.container:has(.auth-portal) {
    max-width: none;
    width: 100%;
    padding: 0;
    margin: 0 auto 24px;
}

.page-landing { width: 100%; }

.landing-hero {
    background: linear-gradient(135deg, var(--academic-navy) 0%, var(--academic-navy-mid) 52%, #243b53 100%);
    color: #e2e8f0;
    padding: 56px 24px 64px;
    position: relative;
    overflow: hidden;
}
.landing-hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}
.landing-hero-inner {
    max-width: 1080px; margin: 0 auto;
    display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center;
    position: relative; z-index: 1;
}
.landing-kicker {
    font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--academic-gold); margin-bottom: 14px;
}
.landing-kicker--dark { color: var(--academic-gold); }
.landing-hero h1 {
    font-size: clamp(1.85rem, 4vw, 2.65rem); font-weight: 700; color: #fff;
    letter-spacing: -.02em; line-height: 1.15; margin-bottom: 16px;
}
.landing-lead {
    font-size: 1.02rem; line-height: 1.75; color: #cbd5e1; max-width: 52ch; margin-bottom: 28px;
}
.landing-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.landing-hero-panel {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    padding: 24px 28px;
    backdrop-filter: blur(8px);
}
.landing-hero-panel-head {
    font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    color: #94a3b8; margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.landing-hero-panel-list { list-style: none; padding: 0; margin: 0; }
.landing-hero-panel-list li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; font-size: .92rem; color: #e2e8f0;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.landing-hero-panel-list li:last-child { border-bottom: none; }
.landing-hero-panel-list span {
    font-size: .75rem; font-weight: 700; color: var(--academic-gold);
    min-width: 1.5rem;
}

.landing-metrics {
    background: linear-gradient(180deg, #fbfaf7 0%, #fff 100%);
    border-bottom: 1px solid var(--academic-cream-dark);
    padding: 8px 24px 0;
}
.landing-metrics-inner {
    max-width: 1080px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
.landing-metric {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 32px 18px 36px; text-align: center;
    border-right: 1px solid var(--academic-cream-dark);
    transition: background .2s ease;
}
.landing-metric:hover { background: rgba(255,255,255,.7); }
.landing-metric:last-child { border-right: none; }
.landing-metric-icon {
    width: 2.5rem; height: 2.5rem; border-radius: 10px;
    margin-bottom: 2px;
}
.landing-metric strong {
    display: block; font-size: 1rem; color: var(--academic-ink); margin-bottom: 0;
    letter-spacing: -.01em;
}
.landing-metric > span:last-child {
    font-size: .82rem; color: var(--academic-muted); line-height: 1.5; max-width: 22ch;
}

.landing-section { padding: 56px 24px; background: #fff; }
.landing-section--cream { background: var(--academic-cream); }
.landing-section-head {
    max-width: 1080px; margin: 0 auto 36px; text-align: center;
}
.landing-section-head h2 {
    font-size: 1.65rem; font-weight: 700; color: var(--academic-ink);
    letter-spacing: -.02em; margin-bottom: 10px;
}
.landing-section-desc { color: var(--academic-muted); font-size: .95rem; max-width: 48ch; margin: 0 auto; }

.landing-cap-grid {
    max-width: 1080px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.landing-cap-card {
    position: relative;
    background: linear-gradient(165deg, #fff 0%, #faf9f7 100%);
    border: 1px solid var(--academic-cream-dark);
    border-radius: 12px; padding: 26px 20px 24px;
    box-shadow: 0 1px 0 rgba(15, 39, 68, .03);
    transition: box-shadow .25s, border-color .25s, transform .25s;
}
.landing-cap-card:hover {
    border-color: #c9d4e4;
    box-shadow: 0 12px 28px rgba(15, 39, 68, .08);
    transform: translateY(-3px);
}
.landing-cap-num {
    position: absolute; top: 16px; right: 18px;
    font-size: .72rem; font-weight: 700; letter-spacing: .08em;
    color: var(--academic-gold); opacity: .85;
}
.landing-cap-card h3 { font-size: 1rem; font-weight: 600; margin: 14px 0 8px; color: var(--academic-ink); }
.landing-cap-card p { font-size: .88rem; color: var(--academic-muted); line-height: 1.6; margin: 0; }

.landing-why-grid {
    max-width: 960px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.landing-why-card {
    position: relative;
    padding: 28px 24px 26px; background: #fff;
    border: 1px solid var(--academic-cream-dark); border-radius: 12px;
    border-top: 3px solid var(--academic-navy-mid);
    box-shadow: 0 4px 16px rgba(15, 39, 68, .04);
    transition: transform .2s, box-shadow .2s;
}
.landing-why-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 39, 68, .07);
}
.landing-why-mark {
    display: block; font-size: .7rem; font-weight: 700; letter-spacing: .14em;
    color: var(--academic-gold); margin-bottom: 10px;
}
.landing-why-card h3 { font-size: 1.08rem; margin-bottom: 10px; color: var(--academic-ink); }
.landing-why-card p { font-size: .9rem; color: var(--academic-muted); line-height: 1.65; margin: 0; }

.landing-flow-grid {
    max-width: 880px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.landing-flow-col {
    padding: 28px 26px 24px;
    background: #fff;
    border: 1px solid var(--academic-cream-dark);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(15, 39, 68, .045);
    position: relative;
    overflow: hidden;
}
.landing-flow-col::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: linear-gradient(180deg, var(--academic-navy-mid), var(--academic-gold));
}
.landing-flow-col--student::before {
    background: linear-gradient(180deg, #1d6b5c, var(--academic-gold));
}
.landing-flow-badge {
    display: inline-block; margin-bottom: 8px;
    font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--academic-navy-mid); background: var(--academic-cream);
    padding: 4px 10px; border-radius: 4px;
}
.landing-flow-col--student .landing-flow-badge {
    color: #166534; background: #ecfdf5;
}
.landing-flow-col h3 {
    font-size: 1.05rem; font-weight: 600; color: var(--academic-navy);
    margin: 0 0 16px; padding: 0; border: none; display: block;
}
.landing-flow-steps {
    list-style: none; padding: 0; margin: 0; counter-reset: flow;
}
.landing-flow-steps li {
    counter-increment: flow;
    position: relative; padding: 12px 0 12px 36px;
    font-size: .9rem; color: var(--academic-muted); font-weight: 500;
    border-bottom: 1px dashed var(--academic-cream-dark);
}
.landing-flow-steps li:last-child { border-bottom: none; }
.landing-flow-steps li::before {
    content: counter(flow);
    position: absolute; left: 0; top: 11px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--academic-cream); color: var(--academic-navy);
    border: 1px solid var(--academic-cream-dark);
    font-size: .72rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.landing-cta {
    background: var(--academic-navy);
    padding: 48px 24px; text-align: center; color: #e2e8f0;
}
.landing-cta-inner { max-width: 560px; margin: 0 auto; }
.landing-cta h2 { font-size: 1.45rem; color: #fff; margin-bottom: 10px; font-weight: 600; }
.landing-cta p { font-size: .92rem; color: #94a3b8; margin-bottom: 24px; }

.btn-academic {
    background: var(--academic-navy-mid) !important;
    box-shadow: 0 2px 8px rgba(15, 39, 68, .25) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
}
.btn-academic:hover { background: var(--academic-navy) !important; transform: translateY(-1px); }
.btn-academic-lg { padding: 12px 28px !important; font-size: .95rem !important; }
.btn-academic-block { width: 100%; justify-content: center; }
.btn-outline-academic {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 22px; font-size: .9rem; font-weight: 600;
    color: var(--academic-navy-mid); background: transparent;
    border: 1.5px solid var(--academic-navy-mid); border-radius: 6px;
    text-decoration: none; transition: all .2s;
}
.btn-outline-academic:hover { background: rgba(26, 54, 93, .06); color: var(--academic-navy); }
.btn-outline-academic--light { color: #e2e8f0; border-color: rgba(255,255,255,.35); }
.btn-outline-academic--light:hover { background: rgba(255,255,255,.08); color: #fff; }

.ui-icon-wrap-lg { width: 2.75rem; height: 2.75rem; border-radius: 10px; }
.ui-icon-wrap-lg .ui-icon { width: 1.35rem; height: 1.35rem; }
.text-muted-sm { color: var(--color-text-muted); font-size: .9rem; margin: -8px 0 12px; }

.portal-home .container { padding: 0 20px; }
.portal-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 24px; flex-wrap: wrap;
    padding: 32px 34px; margin-bottom: 20px;
    background:
        linear-gradient(125deg, #0f2744 0%, #1a365d 42%, #243b55 72%, #1e3a5f 100%);
    border: none;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 39, 68, .22);
    color: #e2e8f0;
}
.portal-hero-glow {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 50% 80% at 90% 20%, rgba(184, 149, 74, .18), transparent 55%),
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: auto, 36px 36px, 36px 36px;
    opacity: .9;
}
.portal-hero-text,
.portal-hero-actions { position: relative; z-index: 1; }
.portal-hero-kicker {
    font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--academic-gold); margin-bottom: 10px;
}
.portal-hero h1 {
    font-size: 1.6rem; font-weight: 700; color: #fff; margin-bottom: 10px;
    letter-spacing: -.02em;
}
.portal-hero-desc {
    font-size: .92rem; color: #94a3b8; max-width: 52ch; line-height: 1.65; margin-bottom: 14px;
}
.portal-hero-chips {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.portal-hero-chips span {
    font-size: .72rem; font-weight: 600; letter-spacing: .04em;
    padding: 4px 10px; border-radius: 4px;
    background: rgba(255,255,255,.08); color: #cbd5e1;
    border: 1px solid rgba(255,255,255,.1);
}
.portal-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-self: center; }
.portal-hero .btn-academic {
    background: var(--academic-gold) !important;
    color: #1a2744 !important;
    box-shadow: 0 2px 10px rgba(184, 149, 74, .35) !important;
}
.portal-hero .btn-academic:hover {
    background: #c9a55a !important;
}
.portal-hero .btn-outline-academic {
    color: #e2e8f0; border-color: rgba(255,255,255,.35);
}
.portal-hero .btn-outline-academic:hover {
    background: rgba(255,255,255,.1); color: #fff;
}
.section-block-title--plain::before { display: none; }
.quick-link--academic { position: relative; padding-top: 18px; }
.quick-link-num {
    position: absolute; top: 10px; left: 16px;
    font-size: .65rem; font-weight: 700; letter-spacing: .08em; color: var(--academic-gold);
}

/* 修复：门户内勿再叠加左右 padding，否则与快捷入口/卡片错位 */
.container.container--landing .portal-home,
.container.container--landing .section-block,
main.container:has(.portal-home) .portal-home,
main.container:has(.portal-home) .section-block {
    padding-left: 0;
    padding-right: 0;
}

.auth-portal {
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    min-height: calc(100vh - var(--nav-height) - 120px);
}
.auth-portal-brand {
    background:
        radial-gradient(ellipse 70% 50% at 10% 90%, rgba(184, 149, 74, .14), transparent 50%),
        radial-gradient(ellipse 55% 45% at 95% 5%, rgba(59, 130, 246, .12), transparent 45%),
        linear-gradient(165deg, #0a1a2e 0%, var(--academic-navy) 45%, var(--academic-navy-mid) 100%);
    color: #e2e8f0; padding: 48px 44px;
    display: flex; align-items: center;
    position: relative; overflow: hidden;
}
.auth-portal-brand::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(180deg, #000 40%, transparent 95%);
}
.auth-portal-brand::after {
    content: ''; position: absolute; right: -80px; top: 20%;
    width: 280px; height: 280px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 0 0 40px rgba(255,255,255,.02);
    pointer-events: none;
}
.auth-portal-brand-inner { position: relative; z-index: 1; max-width: 440px; width: 100%; }
.auth-portal-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth-portal-brand .brand-mark {
    width: 48px; height: 48px; border-radius: 12px;
    background: rgba(255,255,255,.1); color: #e8c97a;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}
.auth-portal-logo-title { font-size: 1.35rem; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.auth-portal-logo-sub { font-size: .82rem; color: #94a3b8; margin-top: 3px; }
.auth-portal-mission { font-size: .95rem; line-height: 1.75; color: #cbd5e1; margin-bottom: 22px; }

.auth-preview-window {
    margin: 0 0 22px;
    border-radius: 12px; overflow: hidden;
    background: rgba(8, 16, 28, .55);
    border: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 16px 40px rgba(0,0,0,.28);
}
.auth-preview-chrome {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 12px; background: rgba(255,255,255,.04);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.auth-preview-chrome span {
    width: 8px; height: 8px; border-radius: 50%;
    background: #475569;
}
.auth-preview-chrome span:nth-child(1) { background: #f87171; }
.auth-preview-chrome span:nth-child(2) { background: #fbbf24; }
.auth-preview-chrome span:nth-child(3) { background: #34d399; }
.auth-preview-chrome em {
    margin-left: 8px; font-style: normal; font-size: .7rem;
    color: #64748b; letter-spacing: .04em;
}
.auth-preview-code {
    margin: 0; padding: 14px 16px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .78rem; line-height: 1.65; color: #cbd5e1;
    white-space: pre;
}
.auth-preview-code .tok-kw { color: #93c5fd; }
.auth-preview-code .tok-fn { color: #c4b5fd; }
.auth-preview-code .tok-num { color: #fcd34d; }
.auth-preview-code .tok-cmt { color: #64748b; }
.auth-preview-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
    padding: 4px 0;
}
.auth-preview-stats div {
    padding: 14px 12px; text-align: center;
    border-right: 1px solid rgba(255,255,255,.06);
}
.auth-preview-stats div:last-child { border-right: none; }
.auth-preview-stats b {
    display: block; font-size: .88rem; color: #fff; margin-bottom: 4px; font-weight: 600;
}
.auth-preview-stats i {
    font-style: normal; font-size: .72rem; color: #94a3b8;
}

.auth-portal-features { list-style: none; padding: 0; margin: 0 0 24px; }
.auth-portal-features li {
    position: relative; padding: 8px 0 8px 20px;
    font-size: .88rem; color: #94a3b8;
}
.auth-portal-features li::before {
    content: ''; position: absolute; left: 0; top: 14px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--academic-gold);
}
.auth-portal-features--rich {
    display: grid; gap: 8px; margin-bottom: 22px;
}
.auth-portal-features--rich li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; margin: 0;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    color: #e2e8f0; font-size: .86rem; font-weight: 500;
}
.auth-portal-features--rich li::before { display: none; }
.auth-portal-features--rich .af-num {
    flex-shrink: 0; font-size: .68rem; font-weight: 700; letter-spacing: .08em;
    color: var(--academic-gold); min-width: 1.6rem;
}
.auth-portal-footnote {
    font-size: .8rem; color: #94a3b8; letter-spacing: .04em;
    border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px;
}

.auth-portal-main {
    background: var(--academic-cream);
    padding: 40px 32px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 20px;
}
.auth-portal-card {
    width: 100%; max-width: 420px;
    background: #fff; border: 1px solid var(--academic-cream-dark);
    border-radius: 14px; padding: 34px 30px;
    box-shadow: 0 8px 32px rgba(15, 39, 68, .08);
}
.auth-portal-card-head h1 { font-size: 1.45rem; font-weight: 700; margin: 6px 0 8px; color: var(--academic-ink); }
.auth-portal-card-desc { font-size: .88rem; color: var(--academic-muted); margin: 0; }
.auth-portal-form { margin-top: 20px; }
.form-control--academic {
    border-radius: 6px !important;
    border-color: #d4dce8 !important;
}
.form-control--academic:focus {
    border-color: var(--academic-navy-mid) !important;
    box-shadow: 0 0 0 3px rgba(26, 54, 93, .1) !important;
}
.auth-portal-form-actions { margin-top: 8px; }
.auth-portal-switch {
    text-align: center; font-size: .88rem; color: var(--academic-muted); margin-top: 16px;
}
.auth-portal-switch a { color: var(--academic-navy-mid); font-weight: 600; text-decoration: none; }
.auth-portal-switch a:hover { text-decoration: underline; }

.auth-portal-demo {
    width: 100%; max-width: 420px;
    padding: 16px 20px; background: #fff;
    border: 1px dashed #c9d4e4; border-radius: 10px;
}
.auth-portal-demo h2 { font-size: .92rem; font-weight: 600; color: var(--academic-ink); margin: 0 0 4px; }
.auth-portal-demo p { font-size: .8rem; color: var(--academic-muted); margin: 0 0 12px; }
.auth-portal-demo-grid { display: flex; flex-direction: column; gap: 8px; }
.auth-portal-demo-item {
    font-size: .85rem; padding: 10px 12px; background: var(--academic-cream);
    border-radius: 6px;
}
.auth-portal-demo-item .demo-account-role {
    display: inline-block; font-size: .72rem; font-weight: 600;
    padding: 2px 8px; border-radius: 4px; background: #dbeafe; color: #1d4ed8; margin-right: .35rem;
}
.auth-portal-demo-item .demo-account-role.teacher { background: #ede9fe; color: #6d28d9; }
.auth-portal-demo-item code { font-size: .84rem; }

.site-footer--minimal {
    margin-top: 0;
    padding: 16px 24px;
    background: var(--academic-cream);
    border-top: 1px solid var(--academic-cream-dark);
    font-size: .82rem;
    color: var(--academic-muted);
}
body:has(.auth-portal) .site-footer,
body:has(.page-landing) .site-footer {
    margin-top: 0;
    padding: 16px 24px;
    background: var(--academic-cream);
    border-top: 1px solid var(--academic-cream-dark);
    font-size: .82rem;
    color: var(--academic-muted);
}
body:has(.auth-portal) .fab-tongyi { display: none !important; }

/* ===== S2 Code Duel ===== */
.duel-page { max-width: 880px; margin: 0 auto; padding: 8px 4px 32px; }
.duel-hero {
    margin-bottom: 20px; padding: 22px 24px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f2744 0%, #1a365d 55%, #243b55 100%);
    color: #e2e8f0;
}
.duel-hero .landing-kicker--dark { color: var(--academic-gold, #b8954a); }
.duel-hero h1 { font-size: 1.85rem; margin: 8px 0; color: #fff; letter-spacing: -.02em; }
.duel-hero-desc { color: #cbd5e1; line-height: 1.65; max-width: 52ch; margin: 0; }
.duel-hero-actions .btn-outline-academic {
    border-color: rgba(255,255,255,.35); color: #fff;
}
.duel-hero-actions .btn-outline-academic:hover {
    background: rgba(255,255,255,.1); border-color: #fff;
}
.duel-rules { margin-bottom: 16px; }
.duel-rules-list { margin: 0; padding-left: 1.25rem; color: #475569; line-height: 1.7; }
.duel-start-form { display: grid; gap: 12px; max-width: 420px; }
.duel-demo-hint { margin-top: 16px; }

.duel-arena { max-width: 1100px; margin: 0 auto; padding-bottom: 40px; position: relative; }
.duel-arena.is-scoring .duel-code-area { opacity: .72; pointer-events: none; }

/* 电影定格胜负 */
.duel-cinematic {
    position: fixed; inset: 0; z-index: 1200;
    display: flex; align-items: center; justify-content: center;
    background: rgba(15, 39, 68, .92);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .4s ease, visibility .4s;
}
.duel-cinematic.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
.duel-cinematic.is-exiting { opacity: 0; }
.duel-cinematic-inner { text-align: center; color: #fff; padding: 24px; }
.duel-cinematic-kicker {
    font-size: .75rem; letter-spacing: .28em; font-weight: 600;
    color: var(--academic-gold, #b8954a); margin: 0 0 16px;
}
.duel-cinematic-headline {
    margin: 0; font-size: clamp(3rem, 12vw, 5.5rem); font-weight: 800;
    letter-spacing: .08em; line-height: 1;
    animation: duelCineIn .55s cubic-bezier(.2,.8,.2,1);
}
.duel-cinematic-sub {
    margin: 18px 0 0; font-size: 1.15rem; color: #cbd5e1;
    letter-spacing: .06em; font-variant-numeric: tabular-nums;
}
.duel-cinematic.is-win { background: linear-gradient(160deg, #0f2744 0%, #14532d 100%); }
.duel-cinematic.is-lose { background: linear-gradient(160deg, #0f2744 0%, #7c2d12 100%); }
.duel-cinematic.is-draw { background: linear-gradient(160deg, #0f2744 0%, #1e293b 100%); }
.duel-cinematic.is-win .duel-cinematic-headline { color: #86efac; }
.duel-cinematic.is-lose .duel-cinematic-headline { color: #fdba74; }
.duel-cinematic.is-draw .duel-cinematic-headline { color: #e2e8f0; }
@keyframes duelCineIn {
    from { opacity: 0; transform: scale(.86) translateY(12px); letter-spacing: .2em; }
    to { opacity: 1; transform: scale(1) translateY(0); letter-spacing: .08em; }
}

.duel-arena-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.duel-arena-top h1 { font-size: 1.35rem; margin: 4px 0 0; }
.duel-timer {
    background: var(--academic-navy, #0f2744); color: #e2e8f0;
    padding: 12px 18px; border-radius: 10px; text-align: center; min-width: 110px;
    box-shadow: 0 8px 24px rgba(15, 39, 68, .18);
    transition: background .25s, transform .25s;
}
.duel-timer-label { display: block; font-size: .72rem; letter-spacing: .08em; opacity: .75; }
.duel-timer strong { font-size: 1.55rem; font-variant-numeric: tabular-nums; }
.duel-timer.is-urgent { background: #9a3412; animation: duelTimerPulse 1s ease infinite; }
.duel-timer.is-critical { background: #7f1d1d; animation: duelTimerPulse .55s ease infinite; }
@keyframes duelTimerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.duel-arena-grid {
    display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px;
}
.duel-problem-panel h2, .duel-problem-panel h3 { font-size: .95rem; margin: 12px 0 6px; }
.duel-problem-panel h2 { margin-top: 0; }
.duel-opponent-bar {
    display: flex; align-items: center; gap: 8px;
    font-size: .88rem; color: var(--academic-muted, #64748b); margin-bottom: 8px;
    padding: 8px 10px; border-radius: 8px; background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.duel-opponent-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--academic-gold, #b8954a);
    box-shadow: 0 0 0 3px rgba(184,149,74,.25);
}
.duel-opponent-bar.is-scoring {
    border-color: #fde68a; background: #fffbeb; color: #92400e;
}
.duel-opponent-bar.is-scoring .duel-opponent-dot {
    animation: duelDotBlink .7s ease infinite;
}
@keyframes duelDotBlink {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(184,149,74,.25); }
    50% { opacity: .35; box-shadow: 0 0 0 6px rgba(184,149,74,.12); }
}
.duel-live-opt {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: .82rem; color: #64748b; margin-bottom: 8px; cursor: pointer;
}
.duel-code-area {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9rem; min-height: 320px; border-radius: 8px !important;
    border: 1.5px solid #cbd5e1 !important;
    transition: opacity .3s, border-color .2s;
}
.duel-code-area:focus { border-color: var(--academic-navy-mid, #1a365d) !important; }
.duel-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }

.duel-result-view.is-revealed { animation: duelResultIn .5s ease; }
@keyframes duelResultIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
.duel-result-banner {
    padding: 28px 24px; border-radius: 12px; margin-bottom: 16px;
    background: var(--academic-cream, #f7f5f0);
    border: 1px solid var(--academic-cream-dark, #ebe8e0);
}
.duel-result-banner.is-win {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #86efac;
}
.duel-result-banner.is-lose {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border-color: #fdba74;
}
.duel-result-banner.is-draw { background: #f8fafc; }
.duel-result-banner h1 { margin: 6px 0; font-size: 2rem; letter-spacing: -.02em; }
.duel-scoreline { color: #475569; margin: 0; font-size: 1rem; }

.duel-score-meters { margin-bottom: 16px; padding: 18px 20px; }
.duel-meter + .duel-meter { margin-top: 14px; }
.duel-meter-head {
    display: flex; justify-content: space-between; font-size: .88rem;
    color: #475569; margin-bottom: 6px; font-weight: 600;
}
.duel-meter-track {
    height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden;
}
.duel-meter-fill {
    height: 100%; width: 0; border-radius: 999px;
    transition: width .9s cubic-bezier(.2,.8,.2,1);
}
.duel-meter-fill.is-you { background: linear-gradient(90deg, #1a365d, #2563eb); }
.duel-meter-fill.is-agent { background: linear-gradient(90deg, #b8954a, #d4a574); }

.duel-review { margin-bottom: 16px; line-height: 1.6; }
.duel-result-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.duel-cases-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.duel-cases-table th, .duel-cases-table td {
    border-bottom: 1px solid #e2e8f0; padding: 8px; text-align: left; vertical-align: top;
}
.duel-cases-table pre { margin: 0; white-space: pre-wrap; font-size: .8rem; }
.duel-cases-table td.ok { color: #15803d; font-weight: 600; }
.duel-cases-table td.bad { color: #c2410c; font-weight: 600; }
.duel-cases-table tr.is-you-better { background: #f0fdf4; }
.duel-cases-table tr.is-agent-better { background: #fff7ed; }
.duel-result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

body:has(.duel-arena) .fab-tongyi { display: none !important; }

.duel-lb-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    margin-bottom: 16px;
}
.duel-lb-stat {
    background: #fff; border: 1px solid var(--academic-cream-dark, #ebe8e0);
    border-radius: 10px; padding: 16px; text-align: center;
}
.duel-lb-stat strong {
    display: block; font-size: 1.5rem; color: var(--academic-navy-mid, #1a365d);
}
.duel-lb-stat span { font-size: .82rem; color: #64748b; }
.duel-lb-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.duel-lb-table th, .duel-lb-table td {
    padding: 12px 10px; text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.duel-lb-table th {
    font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
    color: #64748b; font-weight: 600;
}
.duel-lb-rank { font-weight: 700; color: var(--academic-navy-mid, #1a365d); }
.duel-lb-table tr.is-top td { background: #fffbeb; }
.duel-lb-table tr.is-top .duel-lb-rank { color: var(--academic-gold, #b8954a); }

.duel-endgame-hint {
    margin: 8px 0 0; font-size: .9rem; color: #9a3412;
    max-width: 42ch; line-height: 1.5;
}

.prep-form-card { margin-bottom: 0; }
.prep-form-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px;
}
.prep-draft-pre {
    white-space: pre-wrap; word-break: break-word;
    background: var(--academic-cream, #f7f5f0);
    border: 1px solid var(--academic-cream-dark, #ebe8e0);
    border-radius: 8px; padding: 14px; font-size: .88rem; line-height: 1.55;
    max-height: 420px; overflow: auto;
}
@media (max-width: 800px) {
    .prep-form-grid { grid-template-columns: 1fr; }
    .duel-lb-stats { grid-template-columns: 1fr; }
}

.demo-showcase {
    margin: 20px 0 8px;
    padding: 22px 24px;
    background: linear-gradient(135deg, #f7f5f0 0%, #fff 60%);
    border: 1px solid var(--academic-cream-dark, #ebe8e0);
    border-left: 4px solid var(--academic-navy-mid, #1a365d);
    border-radius: 14px;
    color: inherit;
    animation: portalFadeIn .45s ease;
}
.demo-showcase-kicker {
    margin: 0 0 6px; font-size: .72rem; letter-spacing: .16em; font-weight: 600;
    color: var(--academic-gold, #b8954a);
}
.demo-showcase h2 { font-size: 1.15rem; margin: 0 0 8px; color: var(--academic-ink, #1e293b); }
.demo-showcase-desc { font-size: .9rem; color: #64748b; margin: 0 0 16px; line-height: 1.55; }
.demo-showcase-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.demo-showcase .btn-outline-academic {
    border-color: #cbd5e1; color: var(--academic-navy-mid, #1a365d);
}
.demo-showcase .btn-outline-academic:hover {
    background: #f8fafc; border-color: var(--academic-navy-mid, #1a365d);
}
.demo-showcase-primary { box-shadow: none; }
.demo-chip {
    display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 4px;
    font-size: .7rem; font-weight: 800; letter-spacing: .04em;
    background: #e2e8f0; color: #334155; vertical-align: middle;
}
.demo-chip--outline { background: #f1f5f9; }
.portal-section-kicker {
    margin: 0 0 4px; font-size: .72rem; letter-spacing: .16em; font-weight: 600;
    color: var(--academic-gold, #b8954a); text-transform: uppercase;
}

/* 精选练习入口（产品向，非比赛条） */
.feature-shortcuts {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin: 0 0 24px; padding: 20px 22px;
    background: linear-gradient(135deg, #fff 0%, #f7f5f0 100%);
    border: 1px solid var(--academic-cream-dark, #ebe8e0);
    border-left: 4px solid var(--academic-navy-mid, #1a365d);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(15, 39, 68, .05);
}
.feature-shortcuts-text h2 {
    margin: 4px 0 0; font-size: 1.08rem; font-weight: 700; color: var(--academic-ink, #1e293b);
}
.feature-shortcuts-actions {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}

@media (max-width: 900px) {
    .duel-arena-grid, .duel-result-grid { grid-template-columns: 1fr; }
}

/* ===== S1 Agent timeline（镜头友好） ===== */
.agent-analyze-box {
    border-left: 3px solid var(--academic-navy-mid, #1a365d);
    background: linear-gradient(180deg, #faf9f7 0%, #fff 48px);
}
.agent-analyze-banner {
    display: flex; align-items: flex-start; gap: 12px;
    margin: 0 0 14px; padding: 12px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0f2744 0%, #1a365d 100%);
    color: #e2e8f0;
}
.agent-analyze-banner-kicker {
    margin: 0 0 4px; font-size: .68rem; letter-spacing: .2em;
    color: var(--academic-gold, #b8954a); font-weight: 600;
}
.agent-analyze-banner p {
    margin: 0; font-size: .88rem; line-height: 1.5; color: #cbd5e1;
}
.agent-analyze-intro {
    margin: 0 0 12px; font-size: .9rem; color: var(--academic-muted, #64748b); line-height: 1.55;
}
.agent-timeline-root { margin-top: 8px; }
.agent-timeline-summary {
    padding: 14px 16px; margin-bottom: 16px; border-radius: 10px;
    font-size: .95rem; line-height: 1.55; font-weight: 500;
    background: var(--academic-cream, #f7f5f0);
    border: 1px solid var(--academic-cream-dark, #ebe8e0);
    animation: agentSummaryIn .45s ease;
}
.agent-timeline-summary.is-pass {
    background: #f0fdf4; border-color: #bbf7d0; color: #166534;
}
.agent-timeline-summary.is-fail {
    background: #fff7ed; border-color: #fed7aa; color: #9a3412;
}
@keyframes agentSummaryIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}
.agent-timeline {
    list-style: none; margin: 0; padding: 0 0 0 4px;
    border-left: 2px solid var(--academic-cream-dark, #ebe8e0);
}
.agent-timeline-item {
    position: relative; padding: 0 0 20px 22px; opacity: .42;
    transition: opacity .3s ease;
}
.agent-timeline-item.is-running,
.agent-timeline-item.is-revealed,
.agent-timeline-item.is-done,
.agent-timeline-item.is-skipped { opacity: 1; }
.agent-timeline-item.is-revealed .agent-timeline-card,
.agent-timeline-item.is-done .agent-timeline-card {
    animation: agentCardReveal .4s cubic-bezier(.2,.8,.2,1);
}
@keyframes agentCardReveal {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: none; }
}
.agent-timeline-marker {
    position: absolute; left: -13px; top: 6px;
    width: 24px; height: 24px; border-radius: 50%;
    background: #fff; border: 2px solid var(--academic-navy-mid, #1a365d);
    display: flex; align-items: center; justify-content: center;
    transition: border-color .25s, box-shadow .25s, background .25s;
}
.agent-timeline-num {
    font-size: .65rem; font-weight: 700; color: var(--academic-navy-mid, #1a365d);
    letter-spacing: .02em;
}
.agent-timeline-item.is-running .agent-timeline-marker {
    border-color: var(--academic-gold, #b8954a);
    background: #fffbeb;
    box-shadow: 0 0 0 4px rgba(184, 149, 74, .22);
    animation: agentMarkerPulse 1.1s ease infinite;
}
.agent-timeline-item.is-done .agent-timeline-marker {
    background: var(--academic-navy-mid, #1a365d);
    border-color: var(--academic-navy-mid, #1a365d);
}
.agent-timeline-item.is-done .agent-timeline-num { color: #fff; }
.agent-timeline-item.is-skipped .agent-timeline-marker {
    border-color: #94a3b8;
}
@keyframes agentMarkerPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(184, 149, 74, .22); }
    50% { box-shadow: 0 0 0 8px rgba(184, 149, 74, .08); }
}
.agent-timeline-card {
    background: #fff; border: 1px solid var(--academic-cream-dark, #ebe8e0);
    border-radius: 10px; padding: 14px 16px;
    box-shadow: 0 1px 0 rgba(15, 39, 68, .04);
}
.agent-timeline-item.is-running .agent-timeline-card {
    border-color: #fde68a;
    background: #fffdf7;
}
.agent-timeline-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-bottom: 4px;
}
.agent-timeline-card-head strong {
    font-size: 1rem; color: var(--academic-ink, #1e293b);
}
.agent-timeline-role-pill {
    display: inline-block; margin-right: 6px;
    padding: 2px 8px; border-radius: 4px;
    font-size: .68rem; font-weight: 700; letter-spacing: .06em;
    background: #e2e8f0; color: #334155; vertical-align: middle;
}
.agent-timeline-status {
    font-size: .72rem; font-weight: 600; letter-spacing: .06em;
    color: var(--academic-muted, #64748b);
    text-transform: uppercase;
}
.agent-timeline-item.is-running .agent-timeline-status { color: var(--academic-gold, #b8954a); }
.agent-timeline-item.is-done .agent-timeline-status { color: #15803d; }
.agent-timeline-item.is-skipped .agent-timeline-status { color: #94a3b8; }
.agent-timeline-card-title {
    margin: 0 0 8px; font-size: .9rem; color: var(--academic-navy-mid, #1a365d);
    font-weight: 600;
}
.agent-timeline-card-body {
    margin: 0; white-space: pre-wrap; word-break: break-word;
    font-size: .88rem; line-height: 1.6; color: #334155;
    font-family: inherit; background: transparent; border: none; padding: 0;
}
.agent-timeline-empty { margin: 8px 0 0; font-size: .9rem; }

.agent-debate {
    margin-top: 20px; padding: 18px 16px 4px;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border: 1px solid #e2e8f0;
}
.agent-debate-title {
    margin: 0 0 14px; font-size: 1rem;
    color: var(--academic-navy-mid, #1a365d); font-weight: 700;
    letter-spacing: -.01em;
}
.agent-debate-list { display: flex; flex-direction: column; gap: 12px; }
.agent-debate-bubble {
    border-radius: 12px; padding: 14px 16px;
    border: 1px solid var(--academic-cream-dark, #ebe8e0);
    background: #fff; animation: agentDebateIn .45s cubic-bezier(.2,.8,.2,1);
}
.agent-debate-bubble.is-prosecutor {
    border-left: 4px solid #c2410c; background: #fff7ed;
}
.agent-debate-bubble.is-defender {
    border-left: 4px solid #1d4ed8; background: #eff6ff;
}
.agent-debate-bubble.is-verdict {
    border-left: 4px solid var(--academic-gold, #b8954a);
    background: #fffbeb;
    box-shadow: 0 8px 24px rgba(184, 149, 74, .12);
}
.agent-debate-role {
    display: inline-block; font-size: .75rem; font-weight: 800;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--academic-muted, #64748b); margin-bottom: 6px;
}
.agent-debate-bubble.is-prosecutor .agent-debate-role { color: #c2410c; }
.agent-debate-bubble.is-defender .agent-debate-role { color: #1d4ed8; }
.agent-debate-bubble.is-verdict .agent-debate-role { color: #92400e; }
.agent-debate-text { margin: 0; font-size: .95rem; line-height: 1.6; color: #1e293b; }
@keyframes agentDebateIn {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: none; }
}

/* ===== 周榜领奖台 ===== */
.duel-podium {
    display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 12px;
    align-items: end; margin-bottom: 20px;
}
.duel-podium-slot {
    text-align: center; padding: 18px 12px 14px;
    border-radius: 12px; border: 1px solid #e2e8f0;
    background: #fff; position: relative;
    animation: duelPodiumIn .5s ease both;
}
.duel-podium-slot.is-1 {
    order: 2; padding-top: 28px;
    background: linear-gradient(180deg, #fffbeb 0%, #fff 70%);
    border-color: #fde68a;
    box-shadow: 0 12px 28px rgba(184, 149, 74, .16);
}
.duel-podium-slot.is-2 { order: 1; animation-delay: .08s; }
.duel-podium-slot.is-3 { order: 3; animation-delay: .16s; }
.duel-podium-place {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    font-weight: 800; font-size: .95rem; margin-bottom: 8px;
    background: #e2e8f0; color: #334155;
}
.duel-podium-slot.is-1 .duel-podium-place {
    width: 44px; height: 44px; font-size: 1.1rem;
    background: linear-gradient(135deg, #b8954a, #d4a574); color: #fff;
}
.duel-podium-slot.is-2 .duel-podium-place { background: #cbd5e1; color: #0f2744; }
.duel-podium-slot.is-3 .duel-podium-place { background: #fdba74; color: #7c2d12; }
.duel-podium-name {
    margin: 0 0 4px; font-size: 1rem; font-weight: 700;
    color: var(--academic-ink, #1e293b); word-break: break-all;
}
.duel-podium-slot.is-1 .duel-podium-name { font-size: 1.15rem; }
.duel-podium-meta { margin: 0; font-size: .82rem; color: #64748b; }
@keyframes duelPodiumIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}
.duel-lb-table tr.is-rank-1 td { background: #fffbeb; }
.duel-lb-table tr.is-rank-2 td { background: #f8fafc; }
.duel-lb-table tr.is-rank-3 td { background: #fff7ed; }
.duel-lb-rank-badge {
    display: inline-flex; min-width: 1.6em; justify-content: center;
    font-weight: 800;
}
.duel-lb-table tr.is-rank-1 .duel-lb-rank-badge { color: #b8954a; }
.duel-lb-table tr.is-rank-2 .duel-lb-rank-badge { color: #64748b; }
.duel-lb-table tr.is-rank-3 .duel-lb-rank-badge { color: #c2410c; }

body:has(.duel-page) .fab-tongyi,
body:has(.duel-leaderboard-page) .fab-tongyi { display: none !important; }

@media (max-width: 640px) {
    .duel-podium { grid-template-columns: 1fr; }
    .duel-podium-slot.is-1,
    .duel-podium-slot.is-2,
    .duel-podium-slot.is-3 { order: 0; }
}

@media (max-width: 960px) {
    .landing-hero-inner { grid-template-columns: 1fr; }
    .landing-hero-panel { display: none; }
    .landing-metrics-inner { grid-template-columns: repeat(2, 1fr); }
    .landing-metric:nth-child(2) { border-right: none; }
    .landing-cap-grid { grid-template-columns: repeat(2, 1fr); }
    .landing-why-grid { grid-template-columns: 1fr; }
    .auth-portal { grid-template-columns: 1fr; min-height: auto; }
    .auth-portal-brand { padding: 32px 24px; }
    .auth-portal-footnote { display: none; }
}
@media (max-width: 600px) {
    .landing-metrics-inner { grid-template-columns: 1fr; }
    .landing-metric { border-right: none; border-bottom: 1px solid var(--academic-cream-dark); }
    .landing-cap-grid { grid-template-columns: 1fr; }
    .landing-flow-grid { grid-template-columns: 1fr; }
    .portal-hero { padding: 20px; }
}

/* ===== Storyline visual polish (录屏友好) ===== */
@keyframes portalFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
@keyframes landingHeroIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}
.landing-hero-copy { animation: landingHeroIn .55s ease both; }
.landing-hero-panel { animation: landingHeroIn .65s ease .12s both; }
.portal-hero { animation: portalFadeIn .4s ease; }
.portal-hero h1 { font-size: 1.7rem; }

.muted { color: #94a3b8; font-size: .85rem; }

.editor-toolbar-bar {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-top: 10px; padding: 10px 12px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
}
.editor-toolbar-bar #agent-analyze-btn { box-shadow: 0 2px 8px rgba(15, 39, 68, .12); }
.judge-empty-hint {
    margin: 0; padding: 18px 16px; font-size: .9rem; color: #64748b;
    background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px;
}
.judge-result-box {
    border-left: 4px solid #94a3b8;
    animation: portalFadeIn .4s ease;
}
.judge-result-box.is-pass { border-left-color: #16a34a; background: linear-gradient(180deg, #f0fdf4 0%, #fff 48px); }
.judge-result-box.is-fail { border-left-color: #dc2626; background: linear-gradient(180deg, #fff7ed 0%, #fff 48px); }
.judge-result-kicker {
    margin: 0 0 8px; font-size: .72rem; letter-spacing: .18em; font-weight: 700;
    color: var(--academic-gold, #b8954a);
}
.judge-result-box .verdict { font-size: 2rem; letter-spacing: .04em; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }

.duel-steps {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px;
}
.duel-step {
    padding: 14px; border-radius: 10px; background: #f8fafc; border: 1px solid #e2e8f0;
}
.duel-step-num {
    display: block; font-size: .72rem; font-weight: 800; letter-spacing: .12em;
    color: var(--academic-gold, #b8954a); margin-bottom: 6px;
}
.duel-step strong { display: block; margin-bottom: 4px; color: var(--academic-ink, #1e293b); }
.duel-step p { margin: 0; font-size: .85rem; color: #64748b; line-height: 1.45; }
.duel-mode-fieldset { border: none; padding: 0; margin: 0 0 14px; }
.duel-mode-fieldset legend {
    font-size: .9rem; font-weight: 600; margin-bottom: 8px; color: #334155;
}
.duel-mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.duel-mode-card { cursor: pointer; display: block; }
.duel-mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.duel-mode-card-inner {
    display: block; padding: 14px 16px; border-radius: 12px;
    border: 1.5px solid #e2e8f0; background: #fff; min-height: 110px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.duel-mode-card input:checked + .duel-mode-card-inner {
    border-color: var(--academic-navy-mid, #1a365d);
    background: #f7f5f0;
    box-shadow: 0 0 0 3px rgba(26, 54, 93, .12);
}
.duel-mode-tag {
    display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .08em;
    color: #64748b; margin-bottom: 6px;
}
.duel-mode-card input:checked + .duel-mode-card-inner .duel-mode-tag {
    color: var(--academic-gold, #b8954a);
}
.duel-mode-card-inner strong { display: block; margin-bottom: 4px; font-size: 1rem; }
.duel-mode-desc { display: block; font-size: .82rem; color: #64748b; line-height: 1.45; }
.duel-start-btn { width: 100%; margin-top: 4px; }

.admin-hero {
    margin-bottom: 18px; padding: 20px 22px; border-radius: 12px;
    background: linear-gradient(135deg, #f7f5f0 0%, #fff 70%);
    border: 1px solid var(--academic-cream-dark, #ebe8e0);
    border-left: 4px solid var(--academic-navy-mid, #1a365d);
}
.admin-hero-kicker {
    margin: 0 0 6px; font-size: .72rem; letter-spacing: .16em; font-weight: 700;
    color: var(--academic-gold, #b8954a);
}
.admin-hero h1, .admin-header h1 { margin: 0 0 6px; font-size: 1.45rem; }
.admin-hero-desc { margin: 0; font-size: .9rem; color: #64748b; line-height: 1.55; max-width: 56ch; }
.admin-panel-card { margin-top: 16px; }
.summary-card-link {
    font-size: .8rem; color: var(--color-primary, #2563eb); margin-top: 8px; display: inline-block;
}
.attention-list { list-style: none; padding: 0; margin: 0; }
.attention-list-item { padding: .65rem 0; border-bottom: 1px solid #f3f4f6; }
.attention-list-title { font-weight: 600; margin-left: .5rem; }
.attention-list-detail { font-size: .85rem; color: #6b7280; margin-top: .25rem; }
.admin-list { list-style: none; padding: 0; margin: 0; }
.admin-list-row {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: .5rem 0; border-bottom: 1px solid #f3f4f6;
}
.action-chip--featured {
    border-color: #fde68a !important;
    background: #fffbeb !important;
    color: #92400e !important;
    box-shadow: 0 4px 14px rgba(184, 149, 74, .15);
}
.action-chip--featured:hover {
    border-color: #b8954a !important; background: #fef3c7 !important; color: #78350f !important;
}
.prep-banner { margin-bottom: 14px; }

.stats-page-hero { margin-bottom: 12px; }
.stats-page-hero-row {
    display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem;
}
.stats-page-title { margin: 0; font-size: 1.45rem; }
.stats-page-desc { color: var(--color-text-muted, #64748b); margin: .35rem 0 0; font-size: .9rem; }
.stats-range-tabs { margin: 0; }
.stats-summary-text { line-height: 1.6; margin: 0; }
.stats-cards .stat-card { animation: portalFadeIn .4s ease both; }
.stats-cards .stat-card:nth-child(2) { animation-delay: .05s; }
.stats-cards .stat-card:nth-child(3) { animation-delay: .1s; }
.stats-cards .stat-card:nth-child(4) { animation-delay: .15s; }

.quiz-stem-preview { margin: 12px 0; }
.quiz-stem-image {
    max-width: min(100%, 520px); max-height: 360px; border-radius: 10px;
    border: 1px solid #e2e8f0; display: block; object-fit: contain; background: #f8fafc;
}
.exam-take-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; flex-wrap: wrap;
}
.exam-take-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.exam-progress-label { margin: 8px 0 0; font-size: .9rem; color: #64748b; }
.exam-timer {
    background: var(--academic-navy, #0f2744); color: #e2e8f0;
    padding: 10px 14px; border-radius: 10px; text-align: center; min-width: 96px;
}
.exam-timer-label { display: block; font-size: .7rem; letter-spacing: .08em; opacity: .75; }
.exam-timer strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.exam-timer.is-urgent { background: #9a3412; }
.exam-timer.is-critical { background: #7f1d1d; animation: duelTimerPulse .55s ease infinite; }
.exam-take-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.corrected-code-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.corrected-code-head h4 { margin: 0; }
.judge-next-steps {
    margin-top: 16px; padding-top: 14px; border-top: 1px dashed #e2e8f0;
}
.judge-next-title {
    margin: 0 0 8px; font-size: .82rem; font-weight: 700; letter-spacing: .06em;
    color: #64748b; text-transform: uppercase;
}
.judge-next-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mistake-mastery-hint {
    margin: 6px 0 0; font-size: .82rem; color: #64748b; line-height: 1.45;
}
.duel-fairness-badge {
    display: inline-block; margin: 10px 0 0; padding: 4px 10px; border-radius: 999px;
    font-size: .78rem; font-weight: 600; letter-spacing: .04em;
    background: rgba(15, 39, 68, .08); color: #334155;
}
.duel-result-banner.is-win .duel-fairness-badge { background: rgba(22, 163, 74, .12); color: #166534; }
.duel-result-banner.is-lose .duel-fairness-badge { background: rgba(194, 65, 12, .12); color: #9a3412; }
.prep-done-banner {
    display: flex; flex-direction: column; gap: 4px;
    margin: 0 0 14px; padding: 12px 14px; border-radius: 10px;
    background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: .9rem;
}
.prep-done-banner strong { font-size: .95rem; }
@keyframes btnPulseOnce {
    0%, 100% { box-shadow: 0 0 0 0 rgba(26, 54, 93, .35); }
    50% { box-shadow: 0 0 0 6px rgba(26, 54, 93, .08); }
}
.btn-pulse-once { animation: btnPulseOnce 1s ease 2; }

/* ===== 门户对齐 + 录屏观感 ===== */
.portal-home {
    display: flex; flex-direction: column; gap: 0;
    max-width: 100%;
    padding-bottom: 8px;
}
main.container:has(.portal-home) {
    background:
        radial-gradient(ellipse 80% 40% at 50% -5%, rgba(26, 54, 93, .04), transparent 55%),
        linear-gradient(180deg, #f4f6f9 0%, var(--color-bg, #f1f5f9) 120px);
}
.portal-home > .section-block,
.portal-home > .demo-showcase,
.portal-home > .feature-shortcuts,
.portal-home > .portal-hero,
.portal-home > .portal-quick-links {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}
.portal-home .section-block { margin-bottom: 24px; }
.portal-home .section-block-title {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 12px; font-size: 1.05rem; font-weight: 700;
    color: var(--academic-ink, #1e293b);
}
.portal-quick-links {
    display: block; margin-bottom: 24px;
    background: transparent; border: none; padding: 0;
}
.portal-quick-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.portal-home .quick-link--academic {
    min-height: 92px; padding: 22px 14px 16px;
    background: linear-gradient(165deg, #fff 0%, #fafbfc 100%);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 39, 68, .04);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.portal-home .quick-link--academic:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 39, 68, .09);
    border-color: #cbd5e1;
}
.portal-home .quick-link .ui-icon-wrap {
    width: 2.25rem; height: 2.25rem; border-radius: 10px;
}
.portal-home .todo-card {
    box-shadow: 0 4px 14px rgba(15, 39, 68, .05);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    margin-bottom: 0;
    transition: transform .2s, box-shadow .2s;
}
.portal-home .todo-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 39, 68, .08);
}
.portal-home .todo-card-list { gap: 12px; }
.portal-home .todo-progress { height: 8px; margin-top: 10px; }
.portal-home .todo-progress-fill {
    animation: todoFillIn .8s ease both;
}
@keyframes todoFillIn {
    from { transform: scaleX(0); transform-origin: left; }
    to { transform: scaleX(1); transform-origin: left; }
}

/* 概况：整块等宽条，三格均分，外缘与待办/快捷入口对齐 */
.portal-stat-strip {
    display: grid; grid-template-columns: repeat(3, 1fr);
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(15, 39, 68, .05);
    overflow: hidden;
}
.portal-stat-cell {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px; text-decoration: none; color: inherit;
    border-right: 1px solid var(--color-border);
    transition: background .15s;
}
.portal-stat-cell:last-child { border-right: none; }
.portal-stat-cell:hover { background: #f8fafc; }
.portal-stat-cell .label {
    color: #64748b; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
}
.portal-stat-cell .value {
    font-size: 1.65rem; font-weight: 700; color: #1e293b; line-height: 1.2; margin-top: 2px;
}
.portal-stat-cell.is-ok .value { color: #15803d; }
.portal-stat-cell.is-warn .value { color: #c2410c; }

.summary-cards--portal {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px; margin-bottom: 0;
}
.summary-card--link {
    text-decoration: none; color: inherit; cursor: pointer;
}
.summary-card--link .summary-card-cta {
    display: inline-block; margin-top: 8px;
    font-size: .78rem; font-weight: 600; color: var(--color-primary, #2563eb);
}
.portal-panel {
    padding: 20px 22px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(15, 39, 68, .05);
    border: 1px solid var(--color-border);
    background: #fff;
}
.portal-panel .section-block-title { margin-bottom: 12px; }
.portal-panel--spaced { margin-top: 14px; }
.portal-panel .text-muted-sm { margin: -4px 0 12px; }

.badge-video {
    background: #fee2e2; color: #991b1b; font-size: .68rem; font-weight: 700;
    padding: 2px 8px; border-radius: 4px; letter-spacing: .04em;
}
.badge-pdf {
    background: #dbeafe; color: #1e40af; font-size: .68rem; font-weight: 700;
    padding: 2px 8px; border-radius: 4px; letter-spacing: .04em;
}
.badge-link {
    background: #dcfce7; color: #166534; font-size: .68rem; font-weight: 700;
    padding: 2px 8px; border-radius: 4px; letter-spacing: .04em;
}
.badge-muted {
    background: #f1f5f9; color: #64748b; font-size: .68rem; font-weight: 700;
    padding: 2px 8px; border-radius: 4px;
}

.portal-home .recommend-row {
    display: flex; flex-direction: column; gap: 4px;
    padding: 12px 0; margin: 0;
}
.portal-home .recommend-row:not(:has(.recommend-row-header)) {
    flex-direction: row; align-items: center; justify-content: space-between; gap: 10px;
}
.portal-home .recommend-row + .recommend-row { border-top: 1px solid #f1f5f9; }
.portal-home .announcement-row {
    padding: 14px 0; margin: 0;
}
.portal-home .announcement-content {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.55;
}

/* 导航略提可读性 */
.nav-group-label {
    color: #94a3b8;
    padding: 0 6px 0 2px;
}
.nav-links a {
    font-size: .86rem; padding: 7px 11px;
}

/* 错题页区块对齐 */
.mistake-page-head .page-header { margin-bottom: 4px; }
.mistake-stats-bar {
    box-shadow: var(--shadow-card);
}

/* 对决页内容宽度与门户一致感 */
.duel-page, .duel-leaderboard-page { max-width: 920px; }
.duel-lobby .duel-start-form { max-width: 100%; }
.duel-mode-cards { align-items: stretch; }
.duel-mode-card-inner { height: 100%; }

@media (max-width: 900px) {
    .portal-quick-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-cards--portal { grid-template-columns: 1fr; }
    .portal-stat-strip { grid-template-columns: 1fr; }
    .portal-stat-cell { border-right: none; border-bottom: 1px solid var(--color-border); }
    .portal-stat-cell:last-child { border-bottom: none; }
    .feature-shortcuts { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 800px) {
    .duel-steps, .duel-mode-cards { grid-template-columns: 1fr; }
}

/* ===== Competition Visual System · 全站竞赛抛光层 ===== */
body {
    background:
        radial-gradient(ellipse 90% 40% at 50% -8%, rgba(26, 54, 93, .045), transparent 55%),
        var(--color-bg);
}
main.container {
    animation: portalFadeIn .35s ease both;
}

.card > .data-table,
.card > .table,
.card .data-table,
.card .table {
    border-radius: 8px; overflow: hidden;
}
.data-table th, .table th {
    background: linear-gradient(180deg, var(--academic-cream) 0%, #f1f5f9 100%);
    color: var(--academic-muted);
}

/* 实验室题面 */
.playground-left .problem-info h1 {
    font-size: 1.35rem; font-weight: 700; color: var(--academic-ink);
    letter-spacing: -.02em; margin-bottom: 10px;
}
.playground-left .problem-info h3 {
    font-size: .82rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--academic-gold);
    margin: 18px 0 8px; border: none;
}
.playground-left .problem-text,
.playground-left .problem-sample {
    background: var(--academic-cream);
    border: 1px solid var(--academic-cream-dark);
    border-radius: 8px; padding: 12px 14px;
    font-family: var(--font-mono); font-size: .86rem; line-height: 1.55;
}
.playground .editor-toolbar {
    margin-top: 12px; padding: 10px 0 4px;
    border-top: 1px solid var(--color-border);
}
.result-box {
    border-radius: 12px; border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    border-left: 4px solid var(--academic-navy-mid);
}
.verdict-pass { color: #15803d; }
.verdict-fail { color: #c2410c; }

/* 错题本 KPI */
.mistake-stats-bar {
    gap: 2rem; justify-content: space-evenly;
    background: linear-gradient(135deg, #fff 0%, var(--academic-cream) 100%);
    border: 1px solid var(--academic-cream-dark);
}
.mistake-advice-card {
    border-left: 4px solid var(--academic-gold) !important;
    background: linear-gradient(90deg, #fffcf5 0%, #fff 40%);
}
.resource-list-item:hover { border-color: #c9d4e4; background: #f8fafc; }
.resource-list-item.active {
    border-color: var(--academic-navy-mid); background: #eef2f7;
}

/* 学情 */
.stats-page-hero {
    background: linear-gradient(135deg, #fff 0%, var(--academic-cream) 100%) !important;
    border-left: 4px solid var(--academic-navy-mid);
}
.stats-chart-card {
    box-shadow: var(--shadow-card);
    transition: box-shadow .2s, transform .2s;
}
.stats-chart-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}
.stat-card-accent { border-top: 3px solid var(--academic-navy-mid); }
.stat-card-ok { border-top: 3px solid #15803d; }
.stat-card-warn { border-top: 3px solid #c2410c; }

/* 试卷 */
.exam-timer {
    border-radius: 10px !important;
    box-shadow: 0 4px 14px rgba(15, 39, 68, .2);
}
.exam-take-top {
    background: #fff; border: 1px solid var(--color-border);
    border-radius: 12px; padding: 16px 18px; margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}

/* 教师工作台 */
.admin-hero {
    background: linear-gradient(135deg, #fff 0%, var(--academic-cream) 100%) !important;
    border-radius: 12px; padding: 22px 24px; margin-bottom: 22px;
    box-shadow: var(--shadow-card);
}
.admin-panel-card { border-radius: 12px; }
.attention-list { list-style: none; padding: 0; margin: 0; }
.attention-list-item {
    padding: 12px 0; border-bottom: 1px dashed var(--color-border);
}
.attention-list-item:last-child { border-bottom: none; }

/* 通用列表卡 */
a.card.card-interactive {
    border-radius: 12px;
}

/* 描边按钮兼容 */
.btn-outline,
a.btn-outline {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 16px; font-size: .88rem; font-weight: 600;
    color: var(--academic-navy-mid); background: transparent;
    border: 1.5px solid #c9d4e4; border-radius: 7px;
    text-decoration: none; transition: all .2s;
}
.btn-outline:hover {
    border-color: var(--academic-navy-mid);
    background: rgba(26, 54, 93, .05);
}

/* 快速链接 */
.quick-link {
    display: flex; align-items: center; gap: 12px;
    padding: 16px; background: #fff; border: 1px solid var(--color-border);
    border-radius: 12px; text-decoration: none; color: inherit;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.quick-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: #cbd5e1;
}

/* 判题芯片 */
.verdict-chip {
    display: inline-flex; align-items: center; padding: 2px 8px;
    border-radius: 4px; font-size: .75rem; font-weight: 700;
}
.verdict-chip.pass { background: #dcfce7; color: #15803d; }
.verdict-chip.fail { background: #ffedd5; color: #c2410c; }

/* 模态 */
.modal-dialog {
    border: 1px solid rgba(15, 39, 68, .08);
    border-radius: 14px;
}
.modal-header {
    background: linear-gradient(180deg, var(--academic-cream) 0%, #fff 100%);
}

/* 题目列表行 */
.problem-row, .quiz-row, .exam-row, .resource-row {
    transition: background .15s;
}
.problem-row:hover, .quiz-row:hover, .exam-row:hover, .resource-row:hover {
    background: #f8fafc;
}

/* 论坛帖 */
.forum-post-card, .forum-thread-card {
    border-radius: 12px;
    box-shadow: var(--shadow-card);
}

/* 提交详情代码区 */
.submission-detail .code-block,
.card .code-block {
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.06);
}

/* 个人中心 / 资料页 */
.profile-card, .settings-card {
    border-radius: 12px;
    box-shadow: var(--shadow-card);
}

/* 备课编队头 */
.prep-page-head, .prep-hero {
    border-radius: 12px;
}

/* 资源列表激活态对齐学术色 */
.resource-list-item.active {
    box-shadow: inset 3px 0 0 var(--academic-gold);
}

/* 表格空态 */
.empty-hint {
    padding: 40px 20px;
    color: var(--academic-muted);
    background: linear-gradient(180deg, #fafbfc, #fff);
    border-radius: 10px;
}

@media (max-width: 900px) {
    .playground { flex-direction: column; }
    .playground-left, .playground-right { max-height: none; }
}
