* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #2563eb; --primary-d: #1d4ed8; --bg: #f1f5f9; --card: #ffffff;
  --ink: #0f172a; --sub: #64748b; --line: #e2e8f0; --ok: #16a34a; --bad: #dc2626;
  --warn: #f59e0b; --side: #0f172a; --side-ink: #cbd5e1;
}
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.btn { background: var(--primary); color: #fff; border: none; padding: 8px 16px; border-radius: 8px; font-size: 14px; }
.btn:hover { background: var(--primary-d); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f8fafc; }
.btn.danger { background: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: none; color: var(--primary); font-size: 13px; padding: 2px 4px; }
.link.danger { color: var(--bad); }

/* 登录 / 注册（高级版） */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); background: #f6f8fc; }

/* 左侧品牌区 */
.auth-brand { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; padding: 64px clamp(32px, 6vw, 88px); color: #e6edf9; background: radial-gradient(1200px 820px at 12% 8%, #1e3a8a 0%, #0b1220 56%, #070b14 100%); }
.auth-glow { position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; }
.auth-glow-a { width: 520px; height: 520px; top: -140px; left: -120px; background: radial-gradient(circle, rgba(59,130,246,.55), transparent 65%); animation: authFloat 16s ease-in-out infinite; }
.auth-glow-b { width: 460px; height: 460px; bottom: -180px; right: -100px; background: radial-gradient(circle, rgba(124,58,237,.45), transparent 65%); animation: authFloat 18s ease-in-out infinite reverse; }
.auth-grid { position: absolute; inset: 0; z-index: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse at 38% 32%, #000 18%, transparent 74%); mask-image: radial-gradient(ellipse at 38% 32%, #000 18%, transparent 74%); }
.auth-brand-inner { position: relative; z-index: 2; width: 100%; max-width: 540px; }
.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-logo-mark { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, #3b82f6, #6366f1); box-shadow: 0 10px 26px rgba(59,130,246,.42); }
.auth-logo-text { font-size: 19px; font-weight: 700; letter-spacing: .5px; color: #fff; }
.auth-logo-text em { margin-left: 5px; font-style: normal; font-weight: 400; font-size: 13px; letter-spacing: 2px; color: #93c5fd; }
.auth-brand-title { margin-top: 46px; font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; line-height: 1.24; letter-spacing: .5px; color: #fff; }
.auth-brand-title span { background: linear-gradient(92deg, #60a5fa, #a78bfa 58%, #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-brand-sub { margin-top: 16px; font-size: 15px; letter-spacing: 1px; color: #9fb0c9; }
.auth-features { list-style: none; margin-top: 42px; display: flex; flex-direction: column; gap: 18px; }
.auth-features li { display: flex; align-items: flex-start; gap: 14px; }
.auth-feature-icon { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #93c5fd; background: rgba(96,165,250,.12); border: 1px solid rgba(96,165,250,.28); }
.auth-features strong { display: block; margin-bottom: 3px; font-size: 14.5px; color: #eaf2ff; }
.auth-features span { font-size: 13px; line-height: 1.5; color: #8fa2bd; }
.auth-brand-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; letter-spacing: .5px; color: #7185a3; }

/* 右侧表单区 */
.auth-main { position: relative; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-main::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(700px 520px at 82% 0%, rgba(37,99,235,.08), transparent 70%); }
.auth-panel { position: relative; width: 100%; max-width: 404px; animation: authRise .6s cubic-bezier(.2,.7,.2,1) both; }
.auth-mobile-brand { display: none; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 2px; color: #2563eb; }
.auth-eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #2563eb, #7c3aed); }
.auth-panel h2 { margin-top: 12px; font-size: 26px; font-weight: 800; letter-spacing: .3px; color: #0f172a; }
.auth-panel-head p { margin-top: 8px; font-size: 13.5px; color: #64748b; }

/* 输入框 */
.auth-field { margin-top: 18px; }
.auth-field > label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: #475569; }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input > .auth-input-icon { position: absolute; left: 14px; color: #94a3b8; pointer-events: none; transition: color .2s; }
.auth-input input, .auth-input select { width: 100%; height: 48px; padding: 0 14px 0 42px; border: 1px solid #dbe3ee; border-radius: 12px; background: #fff; font-size: 14.5px; color: #0f172a; transition: border-color .2s, box-shadow .2s, background .2s; }
#lg-pw { padding-right: 46px; }
.auth-input input::placeholder { color: #a3aec0; }
.auth-input input:focus, .auth-input select:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.auth-input:focus-within > .auth-input-icon { color: #2563eb; }
.auth-eye { position: absolute; right: 7px; width: 34px; height: 34px; display: grid; place-items: center; border: none; border-radius: 8px; background: transparent; color: #94a3b8; }
.auth-eye:hover { background: #f1f5f9; color: #475569; }
.auth-eye.on { color: #2563eb; }

/* 主按钮 */
.auth-submit { width: 100%; height: 48px; margin-top: 24px; border-radius: 12px; font-size: 15px; font-weight: 600; letter-spacing: 3px; background: linear-gradient(135deg, #2563eb, #4f46e5); box-shadow: 0 10px 24px rgba(37,99,235,.28); transition: transform .18s, box-shadow .18s, background .18s; }
.auth-submit:hover { background: linear-gradient(135deg, #1d4ed8, #4338ca); transform: translateY(-1px); box-shadow: 0 14px 30px rgba(37,99,235,.34); }
.auth-submit:active { transform: translateY(0); box-shadow: 0 6px 16px rgba(37,99,235,.26); }

/* 切换 */
.auth-switch { margin-top: 22px; text-align: center; font-size: 13px; color: #64748b; }
.auth-switch .link { font-weight: 600; color: #2563eb; }
.auth-switch span { font-size: 12px; color: #94a3b8; }
.auth-shell .err { min-height: 20px; margin-top: 12px; font-size: 13px; color: var(--bad); }
.auth-shell .err:not(:empty) { padding: 9px 12px; border: 1px solid #fecaca; border-radius: 10px; background: #fef2f2; }

@keyframes authRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes authFloat { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(30px, -24px, 0) scale(1.06); } }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; background: radial-gradient(900px 600px at 50% -10%, #e8effc, #f6f8fc 60%); }
  .auth-brand { display: none; }
  .auth-main { min-height: 100vh; padding: 40px 20px; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
  .auth-mobile-brand .auth-logo-mark { width: 40px; height: 40px; border-radius: 12px; }
  .auth-mobile-brand strong { font-size: 17px; color: #0f172a; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-panel, .auth-glow-a, .auth-glow-b { animation: none; }
}

/* 布局 */
.layout { min-height: 100vh; }
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 210px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; overflow-y: auto; z-index: 40; }
.sidebar .logo { padding: 20px; font-size: 17px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar nav { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar nav button { text-align: left; background: none; border: none; color: var(--side-ink); padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.sidebar nav button:hover { background: rgba(255,255,255,.06); }
.sidebar nav button.active { background: var(--primary); color: #fff; }
.sidebar .who { margin-top: auto; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.sidebar .who .role { color: #38bdf8; }
.main { margin-left: 210px; min-height: 100vh; padding: 24px; }
.main h2 { font-size: 19px; margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; overflow-x: auto; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.sub { color: var(--sub); } .small { font-size: 13px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: #eff6ff; color: var(--primary-d); border: 1px solid #bfdbfe; }
.tag.green { background: #f0fdf4; color: var(--ok); border-color: #bbf7d0; }
.tag.orange { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.tag.red { background: #fef2f2; color: var(--bad); border-color: #fecaca; }
.tag.gray { background: #f8fafc; color: var(--sub); border-color: var(--line); }

/* 站内考试提醒 */
.reminder { background: #fffbeb; border-color: #fde68a; }
.reminder-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.reminder-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px dashed #fde68a; }
.reminder-head + .reminder-item { border-top: none; padding-top: 0; }
.reminder-remain { color: #b45309; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--sub); font-weight: 600; font-size: 13px; background: #f8fafc; }
tr:hover td { background: #f8fafc; }
.stem-cell { max-width: 420px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat-box .num { font-size: 26px; font-weight: 700; color: var(--primary-d); }
.stat-box .lbl { color: var(--sub); font-size: 13px; margin-top: 4px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.bar-row .bl { width: 56px; text-align: right; color: var(--sub); }
.bar-track { flex: 1; background: #eef2f7; height: 20px; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 6px; }
.bar-row .bv { width: 70px; color: var(--sub); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: 640px; max-width: 96vw; max-height: 90vh; overflow-y: auto; padding: 22px; }
.modal.wide { width: 860px; }
.modal h3 { font-size: 17px; margin-bottom: 14px; }
.form-grid label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--sub); }
.form-grid label > input, .form-grid label > select, .form-grid label > textarea { width: 100%; margin-top: 5px; color: var(--ink); }
.form-field { margin-bottom: 12px; font-size: 13px; color: var(--sub); }
.form-field .lbl { margin-bottom: 6px; }
.class-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.class-pick label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); font-size: 13px; cursor: pointer; background: #fff; margin-bottom: 0; }
.class-pick label:hover { border-color: var(--primary); }
.class-pick label > input { width: auto; margin: 0; accent-color: var(--primary); }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-row input[type=text] { flex: 1; }

/* 提示条 */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.warn { background: var(--warn); color: #1c1917; }
.toast.err { background: var(--bad); }

/* 答题页 */
.exam-layout { display: flex; gap: 16px; align-items: flex-start; }
.answer-card { width: 230px; flex-shrink: 0; position: sticky; top: 24px; }
.ac-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 10px; }
.ac-cell { height: 34px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 13px; position: relative; }
.ac-cell.done { background: var(--primary); color: #fff; border-color: var(--primary); }
.ac-cell.cur { outline: 2px solid var(--ink); outline-offset: 1px; }
.ac-cell.marked::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.exam-main { flex: 1; min-width: 0; }
.countdown { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.countdown.low { color: var(--bad); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .45; } }
.q-options { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.q-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; cursor: pointer; background: #fff; }
.q-opt:hover { border-color: var(--primary); }
.q-opt.sel { border-color: var(--primary); background: #eff6ff; }
.q-opt .k { font-weight: 700; color: var(--primary-d); }
.fill-input { width: 100%; margin-top: 12px; }
.score-big { font-size: 44px; font-weight: 800; color: var(--primary-d); }
.review-item .mine-ok { color: var(--ok); font-weight: 600; }
.review-item .mine-bad { color: var(--bad); font-weight: 600; }
.checkrow { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 7px; background: #fff; }
.checkrow input[type=number] { width: 64px; }
.paper-pick { max-height: 300px; overflow-y: auto; }
.empty { color: var(--sub); text-align: center; padding: 28px 0; }

/* 编程题与 AI */
.btn.ai { background: #7c3aed; }
.btn.ai:hover { background: #6d28d9; }
.code-editor, .code-ta { width: 100%; font-family: Consolas, "Courier New", monospace; font-size: 13.5px; line-height: 1.65; background: #0f172a; color: #e2e8f0; border: 1px solid #334155; border-radius: 10px; padding: 12px 14px; tab-size: 2; }
.code-editor:focus, .code-ta:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.18); }
.code-view { font-family: Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.65; background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; word-break: break-all; margin: 8px 0; overflow-x: auto; }
.judge-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.case-row { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.case-row .case-io { flex: 1; line-height: 1.7; word-break: break-all; }
.case-row code { background: #e2e8f0; border-radius: 4px; padding: 0 5px; font-family: Consolas, "Courier New", monospace; }
.ai-box { background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
@media (max-width: 860px) { .sidebar { width: 64px; } .main { margin-left: 64px; } .sidebar nav button, .sidebar .who { font-size: 0; } .sidebar .logo { font-size: 13px; padding: 14px 8px; } .exam-layout { flex-direction: column; } .answer-card { position: static; width: 100%; } }
