/* 九九的专属课桌 · 桌面端布局 */
.shell-desktop { display: flex; min-height: 100vh; }

/* ---------- 左侧栏 ---------- */
.rail {
  width: 250px; flex: none; height: 100vh; position: sticky; top: 0;
  display: flex; flex-direction: column; padding: 22px 16px 16px;
  border-right: 1px solid var(--line);
}
.rail-top { display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-text b { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand-text i { font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.group-switch {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.group-switch:hover { border-color: var(--line-2); box-shadow: var(--sh-1); }
.gs-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.gs-name { font-size: 12.5px; font-weight: 500; flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-role { font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; flex: none; }
.gs-caret { width: 14px; height: 14px; color: var(--ink-3); flex: none; }

.nav { margin-top: 24px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px;
  border-radius: 9px; color: var(--ink-2); font-size: 13.5px;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-base);
}
.nav-item:hover { background: rgba(22, 24, 28, .04); color: var(--ink); }
.nav-item.is-active { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--sh-1); }
.nav-icon { width: 18px; height: 18px; color: var(--ink-3); transition: color var(--t-base); }
.nav-item:hover .nav-icon { color: var(--ink-2); }
.nav-item.is-active .nav-icon { color: var(--accent); }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.rail-bottom { margin-top: auto; padding-top: 14px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.user-card:hover { background: var(--surface); }
.user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.user-meta b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { font-size: 11.5px; color: var(--ink-3); }
.user-card .icon-btn { width: 30px; height: 30px; }

/* ---------- 主区域 ---------- */
.stage { flex: 1; min-width: 0; }
.stage-inner { max-width: 1080px; margin: 0 auto; padding: 22px 44px 80px; }
.stage-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 6px; }
.stage-crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.crumb-icon { width: 15px; height: 15px; }
.crumb-sep { width: 13px; height: 13px; color: var(--line-2); }
.crumb-current { color: var(--ink-2); }
.stage-tools { display: flex; align-items: center; gap: 6px; }
.bell-btn { position: relative; }
.bell-btn .dot { position: absolute; top: 8px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--paper); }

.view { padding-top: 6px; }

/* ---------- 页头 ---------- */
.page-head {
  position: relative; display: flex; align-items: flex-end; gap: 16px;
  padding: 24px 0 20px; margin-bottom: 22px; border-top: 1px solid var(--line);
}
.page-head::before {
  content: ""; position: absolute; top: -1px; left: 0; width: 44px; height: 2px; background: var(--accent);
}
.page-head-text { flex: 1; min-width: 0; }
.page-title { font-size: 27px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; }
.page-sub { font-size: 13px; color: var(--ink-3); margin-top: 7px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.back-btn { display: none; }
.head-count { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.head-count-label { font-size: 11.5px; color: var(--ink-3); }

/* ---------- 概览 ---------- */
.grid-2 { display: grid; grid-template-columns: 1.12fr .88fr; gap: 16px; align-items: start; }
.tile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.tile-grid-3 { grid-template-columns: repeat(3, 1fr); }
.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.tile-label { font-size: 11.5px; color: var(--ink-3); letter-spacing: .05em; }
.tile-value { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-hint { font-size: 11.5px; color: var(--ink-3); }

.hero {
  display: flex; align-items: center; gap: 28px; padding: 26px 28px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-1);
}
.hero-main { flex: 1; min-width: 0; }
.hero-eyebrow { font-size: 11.5px; color: var(--ink-3); letter-spacing: .1em; }
.hero-title { font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin-top: 8px; }
.hero-sub { font-size: 13px; color: var(--ink-3); margin-top: 7px; }
.hero-stats { display: flex; gap: 28px; margin-top: 20px; }
.hero-stats span { display: flex; flex-direction: column; gap: 2px; }
.hero-stats b { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hero-stats i { font-size: 11.5px; color: var(--ink-3); font-style: normal; }

/* ---------- 进度矩阵 ---------- */
.matrix-wrap { overflow: auto; margin: 0 -2px; padding-bottom: 2px; }
table.matrix { border-collapse: separate; border-spacing: 4px; min-width: 100%; }
.matrix th {
  font-size: 11.5px; font-weight: 500; color: var(--ink-3); text-align: center;
  padding: 4px 6px; white-space: nowrap;
}
.matrix th.sticky {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  text-align: left; padding-left: 0; color: var(--ink-2); font-size: 12.5px;
}
.matrix td { text-align: center; }
.cell { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: var(--paper-2); transition: transform var(--t-fast); }
.cell:hover { transform: scale(1.18); }
.cell-ok { background: var(--accent); }
.cell-info { background: var(--blue); }
.cell-warn { background: #C79A3C; }
.cell-alert { background: var(--alert); }
.cell-bad { background: var(--bad); }
.cell-muted { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 11.5px; color: var(--ink-3); }
.legend-item { display: flex; align-items: center; gap: 6px; }

/* ---------- 作答 ---------- */
.qlist { display: flex; flex-direction: column; gap: 14px; max-width: 780px; }
.qcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--sh-1);
}
.qcard-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.qnum { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent); }
.qtype { font-size: 11.5px; color: var(--ink-3); }
.qcard-status { margin-left: auto; }
.stem { font-size: 14.5px; line-height: 1.7; margin-bottom: 14px; }
.stem p + p { margin-top: 8px; }
.stem ul, .stem ol { list-style: disc; padding-left: 20px; margin: 8px 0; }
.stem code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-family: var(--mono); font-size: 12.5px; }
.stem pre { background: var(--surface-2); padding: 12px; border-radius: 10px; overflow: auto; font-size: 12.5px; margin: 10px 0; }
.stem a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.opts { display: flex; flex-direction: column; gap: 8px; }
.opts-row { flex-direction: row; }
.opt {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 11px; cursor: pointer;
  transition: border-color var(--t-base), background var(--t-base), transform var(--t-fast);
}
.opt:hover { border-color: var(--line-2); background: var(--surface-2); }
.opt:active { transform: scale(.995); }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt-mark {
  width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--line-2); flex: none;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  transition: background var(--t-base), border-color var(--t-base), color var(--t-base), transform 180ms var(--spring);
}
.opt-text { font-size: 13.5px; }
.opt input:checked ~ .opt-mark { background: var(--ink); border-color: var(--ink); color: #fff; transform: scale(1.04); }
.opt:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.opt input:focus-visible ~ .opt-mark { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt input:disabled ~ span { opacity: .72; }

.qcard-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.qcard-note { font-size: 12px; color: var(--ink-3); margin-top: 10px; }
.qcard-note-strong { color: var(--ink-2); }
.answer-block { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.answer-block > span { display: block; font-size: 10.5px; color: var(--ink-3); letter-spacing: .08em; margin-bottom: 5px; }
.summary-bar { display: flex; align-items: center; gap: 16px; }
.summary-main { flex: 1; }
.summary-text { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* ---------- 上传 ---------- */
.file-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px;
  border: 1px dashed var(--line-2); border-radius: 14px; background: var(--surface-2); cursor: pointer;
  transition: border-color var(--t-base), background var(--t-base);
}
.file-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { width: 22px; height: 22px; color: var(--ink-3); }
.drop-title { font-size: 13.5px; font-weight: 500; }
.drop-hint { font-size: 11.5px; color: var(--ink-3); }
.file-name { font-size: 12px; color: var(--ink-3); margin: 10px 0 2px; }
.err-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.err-item { font-size: 12.5px; color: var(--bad); background: var(--bad-soft); padding: 8px 10px; border-radius: 8px; }
.err-item b { margin-right: 8px; }

/* ---------- 家长 ---------- */
.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.kid-card {
  display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line);
  border-radius: 14px; transition: border-color var(--t-base), background var(--t-base);
}
.kid-card:hover { border-color: var(--line-2); background: var(--surface-2); }
.kid-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kid-main b { font-size: 14px; font-weight: 500; }
.kid-main i { font-size: 12px; color: var(--ink-3); font-style: normal; }
.inline-form { display: flex; gap: 8px; margin: 4px 0 12px; }
.inline-form .input { flex: 1; }

/* ---------- 设置 ---------- */
.profile-row { display: flex; align-items: center; gap: 12px; padding: 2px 0 14px; }
.profile-meta { flex: 1; display: flex; flex-direction: column; }
.profile-meta b { font-size: 15px; font-weight: 600; }
.profile-meta span { font-size: 12.5px; color: var(--ink-3); }
.kv-list { border-top: 1px solid var(--line); }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--ink-3); }
.kv b { font-weight: 500; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.switch-row:last-child { border-bottom: 0; }
.switch-text { flex: 1; display: flex; flex-direction: column; }
.switch-text b { font-size: 13.5px; font-weight: 500; }
.switch-text i { font-size: 11.5px; color: var(--ink-3); font-style: normal; margin-top: 2px; }
input.switch { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background var(--t-base); }
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--sh-1); transition: transform 220ms var(--spring);
}
input.switch:checked + .switch-track { background: var(--accent); }
input.switch:checked + .switch-track::after { transform: translateX(18px); }
input.switch:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-row.is-locked { cursor: default; }
.switch-row.is-locked .switch-text b { color: var(--ink-2); }

/* ---------- 通知 ---------- */
.notif { align-items: flex-start; }
.notif-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; flex: none; }
.notif.is-unread .row-title { font-weight: 600; }
.notif-time { font-size: 11.5px; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 8px; }

/* ---------- 自适应 ---------- */
@media (max-width: 1180px) {
  .rail { width: 216px; }
  .stage-inner { padding: 20px 30px 72px; }
}
@media (max-width: 1040px) {
  .grid-2 { grid-template-columns: 1fr; }
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { flex-wrap: wrap; gap: 20px; }
}

/* ---------- 交付前修订 ---------- */
.page-head { align-items: center; }
.back-btn { display: inline-flex; }
.card .empty { padding: 26px 12px 24px; }
.card-list { padding: 6px; }
.card-list .row { padding: 12px 10px; }
.measure { max-width: 780px; }
.hero-cta { margin-left: auto; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 34px 32px; box-shadow: var(--sh-2); }
table.matrix { width: auto; min-width: 0; }
.matrix th, .matrix td { width: 38px; }
.matrix th.sticky { min-width: 128px; width: auto; }


/* 题干与解析中的配图 */
.stem img, .answer-block img, .opt img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}


/* ===== 交互补充：题目导航 / 批改 / 审计 / 披露 ===== */
button.row { width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.qnav-wrap { position: sticky; top: 0; z-index: 6; margin: 0 0 14px; padding: 10px 0 8px; background: var(--paper); border-bottom: 1px solid transparent; }
.qnav-wrap::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--line); opacity: 0; }
.qcard { scroll-margin-top: 110px; }
.qnav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.qnav::-webkit-scrollbar { display: none; }
.qnav-btn {
  flex: 0 0 auto; min-width: 44px; height: 32px; padding: 0 8px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.qnav-btn:hover { transform: translateY(-1px); border-color: var(--ink-3); }
.qnav-btn.is-ok { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); color: var(--accent-ink, #1F6B4A); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.qnav-btn.is-info { border-color: color-mix(in srgb, var(--blue) 50%, var(--line)); color: var(--blue-ink, #1E4E79); background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.qnav-btn.is-alert, .qnav-btn.is-bad { border-color: color-mix(in srgb, var(--alert) 50%, var(--line)); color: var(--alert); background: color-mix(in srgb, var(--alert) 9%, var(--surface)); }
.qnav-btn.is-warn { border-color: #C79A3C; color: #8A6416; background: #FBF3DF; }

.qcard-save { margin-left: auto; margin-right: 8px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.qcard-save[data-state="busy"] { color: var(--ink-2); }
.qcard-save[data-state="err"] { color: var(--alert); }

.redo-box { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: #FDF3F1; border: 1px solid #F0D6D0; }
.redo-note { margin: 0 0 6px; font-size: 13px; color: #8E3B2C; }
.redo-hint { margin: 0 0 10px; font-size: 12px; color: var(--ink-2); }

.grade-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 10px; }
.grade-list { display: flex; flex-direction: column; gap: 12px; }
.grade-row { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.grade-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.grade-head b { font-size: 14px; }
.grade-answer { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.grade-note { margin: 0; font-size: 12px; color: var(--ink-2); }
.grade-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.grade-tpl { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.chip-tpl { cursor: pointer; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 11px; }
.chip-tpl:hover { border-color: var(--ink-3); }

.matrix td button.cell { border: 0; padding: 0; cursor: pointer; }
.matrix td button.cell:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }
.row-bad { background: #FDF6F4; }

.stem-sheet { max-height: 30vh; overflow: auto; padding: 10px 12px; border-radius: 10px; background: var(--paper-2); }
.sheet-sub { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ctx-block { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--paper-2); }
.ctx-block h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; }
.ctx-block p { margin: 0; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.ctx-block summary { cursor: pointer; font-size: 12px; color: var(--ink-3); }

.disclosure { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.disclosure-row { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--paper-2); font-size: 12px; color: var(--ink-2); }
.disclosure-row b { flex: 0 0 68px; color: var(--ink); }

.qlist-plain .qcard { box-shadow: none; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tab-btn { padding: 7px 14px; border-radius: 9px; font-size: 13px; color: var(--ink-2); text-decoration: none; transition: background var(--t-fast), color var(--t-fast); }
.tab-btn:hover { color: var(--ink); }
.tab-btn.is-active { background: var(--paper-2); color: var(--ink); font-weight: 600; }

a.tile { color: inherit; text-decoration: none; transition: transform var(--t-fast), border-color var(--t-fast); }
a.tile:hover { transform: translateY(-2px); border-color: var(--ink-3); }
a.tile:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }
