/* ============================================================
   C 语言求职笔试训练营 —— 样式表
   深色为主，克制、信息密度高，护眼长时间刷题
   ============================================================ */

:root {
  --bg:        #0b0f14;
  --bg-1:      #10161d;
  --bg-2:      #161e27;
  --bg-3:      #1d2733;
  --line:      #24303d;
  --line-soft: #1b242e;

  --fg:        #e3e9f0;
  --fg-1:      #aebbc9;
  --fg-2:      #7c8b9c;
  --fg-3:      #586676;

  --acc:       #35d0a5;
  --acc-dim:   #1d8a6c;
  --acc-soft:  rgba(53, 208, 165, .12);
  --blue:      #58a6ff;
  --blue-soft: rgba(88, 166, 255, .12);
  --amber:     #e3b341;
  --amber-soft:rgba(227, 179, 65, .12);
  --red:       #f2695f;
  --red-soft:  rgba(242, 105, 95, .12);
  --purple:    #b18cf0;
  --purple-soft: rgba(177, 140, 240, .12);

  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;

  --rad: 10px;
  --rad-sm: 7px;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  --side-w: 232px;
}

* { box-sizing: border-box; }

/* 关键：作者样式里的 display 会覆盖浏览器默认的 [hidden] { display:none }，
   导致 element.hidden = true 之后元素依然显示。.boot / .modal / .shell 都设了
   display，所以必须显式声明这一条，否则启动屏会一直盖在界面上。 */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

button { font-family: inherit; font-size: inherit; cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a3746; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a4a5d; }

/* ---------------------------------------------------------- 启动屏 */

.boot {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg); z-index: 999;
}
.boot-inner { text-align: center; }
.boot-logo {
  width: 62px; height: 62px; margin: 0 auto 18px;
  border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--acc), #1a7f9e);
  color: #04140f; font: 700 34px/1 var(--mono);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1 } 50% { transform: scale(.92); opacity: .7 } }
.boot-text { color: var(--fg-2); font-size: 14px; }

/* ---------------------------------------------------------- 布局 */

.shell {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  height: 100vh;
}

.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--acc), #1a7f9e);
  color: #04140f; font: 700 19px/1 var(--mono);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 14px; font-weight: 650; letter-spacing: .2px; }
.brand-text small { font-size: 11px; color: var(--fg-3); }

.nav { padding: 10px 10px; display: flex; flex-direction: column; gap: 1px; flex: 1; min-height: 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border: 0; border-radius: var(--rad-sm);
  background: transparent; color: var(--fg-1);
  font-size: 13.5px; text-align: left; width: 100%;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--bg-2); color: var(--fg); }
.nav-item.on { background: var(--acc-soft); color: var(--acc); font-weight: 600; }
.nav-item .ni { width: 16px; text-align: center; opacity: .85; font-size: 13px; }
.nav-item .badge {
  margin-left: auto; font-style: normal; font-size: 11px;
  background: var(--red); color: #fff; border-radius: 9px;
  padding: 1px 6px; font-weight: 700;
}

.side-foot { padding: 12px; border-top: 1px solid var(--line-soft); }
.engine-pill {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--fg-2); cursor: pointer;
  padding: 6px 9px; border-radius: var(--rad-sm);
  background: var(--bg-2); border: 1px solid var(--line-soft);
}
.engine-pill:hover { color: var(--fg-1); }
.engine-pill .dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--fg-3);
}
.engine-pill.local .dot { background: var(--acc); box-shadow: 0 0 7px var(--acc); }
.engine-pill.online .dot { background: var(--amber); box-shadow: 0 0 7px var(--amber); }
.engine-pill.none .dot { background: var(--red); }

.side-actions { display: flex; gap: 12px; margin-top: 9px; padding: 0 3px; }
.linklike {
  border: 0; background: transparent; color: var(--fg-3);
  font-size: 11.5px; padding: 0; text-decoration: underline;
  text-decoration-color: transparent; transition: color .12s;
}
.linklike:hover { color: var(--fg-1); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  height: 50px; flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11,15,20,.86);
  backdrop-filter: blur(8px);
}
.crumbs { font-size: 13px; color: var(--fg-2); display: flex; align-items: center; gap: 7px; min-width: 0; }
.crumbs b { color: var(--fg); font-weight: 600; }
.crumbs .sep { color: var(--fg-3); opacity: .6; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.icon-btn {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--fg-1);
  width: 34px; height: 34px; border-radius: var(--rad-sm); font-size: 16px;
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--bg-3); color: var(--fg); }

.scroller { flex: 1; overflow-y: auto; min-height: 0; scroll-behavior: smooth; }
.page { max-width: 900px; margin: 0 auto; padding: 26px 24px 90px; }
.page.wide { max-width: 1240px; }

/* ---------------------------------------------------------- 通用组件 */

h1, h2, h3, h4 { line-height: 1.35; margin: 0; font-weight: 650; }
h1 { font-size: 25px; letter-spacing: -.2px; }
h2 { font-size: 19px; margin-top: 34px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
h3 { font-size: 16px; margin-top: 24px; margin-bottom: 9px; }
h4 { font-size: 14px; margin-top: 18px; margin-bottom: 7px; color: var(--fg-1); }
p { margin: 0 0 13px; color: var(--fg-1); }
.page-hd { margin-bottom: 24px; }
.page-hd .sub { color: var(--fg-2); font-size: 13.5px; margin-top: 5px; }
.muted { color: var(--fg-2); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.mt0 { margin-top: 0 } .mb0 { margin-bottom: 0 }
.mt8 { margin-top: 8px } .mt14 { margin-top: 14px } .mt20 { margin-top: 20px }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.card {
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--rad);
  padding: 18px;
}
.card.pad-sm { padding: 14px; }
.card + .card { margin-top: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--rad-sm);
  border: 1px solid var(--line); background: var(--bg-2); color: var(--fg);
  font-size: 13.5px; font-weight: 550; transition: .13s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-3); border-color: #33445a; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #04140f; font-weight: 650; }
.btn.primary:hover { background: #46e0b6; border-color: #46e0b6; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.danger { color: var(--red); border-color: rgba(242,105,95,.35); }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn.xs { padding: 3px 9px; font-size: 12px; }

/* 筛选胶囊（刷题页的章节 / 题型 / 难度 / 题量 / 顺序选择）。
   选中态由 JS 通过 .on 同步成 .primary；这里只负责胶囊外形。
   min-height 保证触屏上够得着（手机上限约 44px，32px 是桌面可用的下限）。 */
.chip { border-radius: 999px; min-height: 32px; display: inline-flex; align-items: center; }
.chip.on { font-weight: 650; }

input[type=text], input[type=number], textarea, select {
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--rad-sm);
  padding: 8px 11px; font-size: 13.5px; font-family: inherit;
  outline: none; transition: border-color .13s;
}
input:focus, textarea:focus, select:focus { border-color: var(--acc-dim); }
textarea { resize: vertical; line-height: 1.6; }

.tag {
  display: inline-block; padding: 1.5px 8px; border-radius: 20px;
  font-size: 11.5px; background: var(--bg-3); color: var(--fg-2);
  border: 1px solid var(--line-soft);
}
.tag.acc { background: var(--acc-soft); color: var(--acc); border-color: transparent; }
.tag.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.tag.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.tag.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.tag.purple { background: var(--purple-soft); color: var(--purple); border-color: transparent; }

.divider { height: 1px; background: var(--line-soft); margin: 22px 0; }

/* ---------------------------------------------------------- 进度条 / 环 */

.bar { height: 6px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), #4fd1c5); border-radius: 4px; transition: width .4s ease; }
.bar.blue > i { background: linear-gradient(90deg, var(--blue), #79c0ff); }
.bar.amber > i { background: linear-gradient(90deg, var(--amber), #f0c674); }

.ring { --p: 0; --c: var(--acc); width: 76px; height: 76px; flex: none; position: relative; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring .bg { stroke: var(--bg-3); }
.ring .fg { stroke: var(--c); stroke-dasharray: 201; stroke-dashoffset: calc(201 - 201 * var(--p) / 100); transition: stroke-dashoffset .5s ease; }
.ring .txt {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 15px; font-weight: 700; font-family: var(--mono);
}

/* ---------------------------------------------------------- 统计卡 */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: var(--bg-1); border: 1px solid var(--line-soft);
  border-radius: var(--rad); padding: 14px 16px;
}
.stat .k { font-size: 11.5px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-size: 24px; font-weight: 700; font-family: var(--mono); margin-top: 3px; letter-spacing: -.5px; }
.stat .v small { font-size: 13px; color: var(--fg-3); font-weight: 400; }
.stat.acc .v { color: var(--acc); }
.stat.blue .v { color: var(--blue); }
.stat.amber .v { color: var(--amber); }

/* ---------------------------------------------------------- 章节列表 */

.chapter-list { display: flex; flex-direction: column; gap: 9px; }
.chapter-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: var(--rad);
  background: var(--bg-1); border: 1px solid var(--line-soft);
  cursor: pointer; transition: .14s;
}
.chapter-row:hover { border-color: #2e3d4d; background: var(--bg-2); transform: translateX(2px); }
.chapter-num {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  display: grid; place-items: center; font: 700 14px/1 var(--mono);
  background: var(--bg-3); color: var(--fg-2);
}
.chapter-row.done .chapter-num { background: var(--acc-soft); color: var(--acc); }
.chapter-row.started .chapter-num { background: var(--blue-soft); color: var(--blue); }
.chapter-main { flex: 1; min-width: 0; }
.chapter-main .t { font-size: 14.5px; font-weight: 600; }
.chapter-main .s { font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.chapter-meta { display: flex; align-items: center; gap: 12px; flex: none; }
.weight { display: flex; gap: 2px; }
.weight i { width: 4px; height: 13px; border-radius: 2px; background: var(--bg-3); }
.weight i.on { background: var(--amber); }

/* ---------------------------------------------------------- 内容块 */

.block { margin-bottom: 16px; }
.block:last-child { margin-bottom: 0; }

.code-wrap {
  border: 1px solid var(--line-soft); border-radius: var(--rad);
  overflow: hidden; background: #0a0e13; margin: 14px 0;
}
.code-hd {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px; background: var(--bg-1);
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px; color: var(--fg-2);
}
.code-hd .cap { font-weight: 550; color: var(--fg-1); }
.code-hd .acts { margin-left: auto; display: flex; gap: 6px; }
.code-body { position: relative; }
.code-body pre {
  margin: 0; padding: 13px 15px; overflow-x: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.65;
  tab-size: 4;
}
.code-body code { font-family: inherit; }
.code-out {
  border-top: 1px solid var(--line-soft); background: #080b0f;
  padding: 10px 15px; font-family: var(--mono); font-size: 12.5px;
  white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto;
}
.code-out .lbl { color: var(--fg-3); font-family: var(--sans); font-size: 11px; display: block; margin-bottom: 3px; }
.code-out.err { color: var(--red); }
.code-out.warn { color: var(--amber); }

/* 语法高亮 */
.tk-com  { color: #5d6f82; font-style: italic; }
.tk-str  { color: #a5d6a7; }
.tk-num  { color: #f0a35e; }
.tk-kw   { color: #ff7b72; }
.tk-typ  { color: #79c0ff; }
.tk-fn   { color: #d2a8ff; }
.tk-pre  { color: #e3b341; }
.tk-op   { color: #8b98a5; }
.tk-id   { color: var(--fg); }

table.tbl { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.5px; }
table.tbl caption { text-align: left; font-size: 12.5px; color: var(--fg-2); padding-bottom: 7px; }
table.tbl th, table.tbl td { border: 1px solid var(--line-soft); padding: 8px 11px; text-align: left; vertical-align: top; }
table.tbl th { background: var(--bg-2); font-weight: 600; color: var(--fg); font-size: 13px; }
table.tbl td { color: var(--fg-1); }
table.tbl tbody tr:nth-child(even) td { background: rgba(255,255,255,.012); }
table.tbl code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-3); padding: 1px 5px; border-radius: 4px; }

ul.blist, ol.blist { margin: 0 0 14px; padding-left: 22px; color: var(--fg-1); }
ul.blist li, ol.blist li { margin-bottom: 5px; }

.callout {
  border-left: 3px solid var(--blue); background: var(--blue-soft);
  border-radius: 0 var(--rad-sm) var(--rad-sm) 0;
  padding: 12px 15px; margin: 14px 0;
}
.callout .ct { font-weight: 650; font-size: 13px; margin-bottom: 4px; color: var(--blue); }
.callout .cx { font-size: 13.5px; color: var(--fg-1); }
.callout .cx p:last-child { margin-bottom: 0; }
.callout.tip  { border-color: var(--acc); background: var(--acc-soft); }
.callout.tip .ct { color: var(--acc); }
.callout.warn { border-color: var(--amber); background: var(--amber-soft); }
.callout.warn .ct { color: var(--amber); }
.callout.trap { border-color: var(--red); background: var(--red-soft); }
.callout.trap .ct { color: var(--red); }
/* info 的外观与 .callout 基础样式一致，这里显式写出来，
   让 schema 里声明的四种 tone（tip/warn/trap/info）在 CSS 里都查得到 */
.callout.info { border-color: var(--blue); background: var(--blue-soft); }
.callout.info .ct { color: var(--blue); }

.pycmp {
  border: 1px solid var(--line-soft); border-radius: var(--rad);
  overflow: hidden; margin: 14px 0; background: var(--bg-1);
}
.pycmp .hd {
  padding: 7px 13px; font-size: 12px; font-weight: 600; color: var(--purple);
  background: var(--purple-soft); border-bottom: 1px solid var(--line-soft);
}
.pycmp .tx { padding: 12px 15px; font-size: 13.5px; color: var(--fg-1); }
.pycmp .tx p:last-child { margin-bottom: 0; }
.pycmp .split { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-soft); }
.pycmp .col { min-width: 0; }
.pycmp .col + .col { border-left: 1px solid var(--line-soft); }
.pycmp .col .lab {
  font-size: 11px; padding: 5px 13px; color: var(--fg-3);
  background: var(--bg-2); border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
}
.pycmp .col pre { margin: 0; padding: 11px 13px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; }

code.inline {
  font-family: var(--mono); font-size: 12.8px;
  background: var(--bg-3); padding: 1.5px 5px; border-radius: 4px;
  color: #ffc9a8; word-break: break-word;
}

/* ---------------------------------------------------------- 刷题 */

.q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.q-stem { font-size: 15.5px; line-height: 1.75; margin-bottom: 16px; color: var(--fg); }
.q-stem p { color: var(--fg); margin-bottom: 10px; }
.q-stem p:last-child { margin-bottom: 0; }

.opts { display: flex; flex-direction: column; gap: 9px; }
.opt {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 14px; border-radius: var(--rad-sm);
  border: 1px solid var(--line-soft); background: var(--bg-1);
  cursor: pointer; transition: .13s; text-align: left; width: 100%;
  color: var(--fg-1); font-size: 14px; line-height: 1.6;
}
.opt:hover:not(.locked) { border-color: #33445a; background: var(--bg-2); }
.opt .key {
  width: 23px; height: 23px; flex: none; border-radius: 6px;
  display: grid; place-items: center; font: 700 12px/1 var(--mono);
  background: var(--bg-3); color: var(--fg-2); margin-top: 1px;
}
.opt.sel { border-color: var(--blue); background: var(--blue-soft); }
.opt.sel .key { background: var(--blue); color: #06101d; }
.opt.right { border-color: var(--acc); background: var(--acc-soft); }
.opt.right .key { background: var(--acc); color: #04140f; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .key { background: var(--red); color: #fff; }
.opt.locked { cursor: default; }
.opt .txt { flex: 1; min-width: 0; }
.opt .txt code { font-family: var(--mono); font-size: 12.8px; }

.judge-opts { display: flex; gap: 11px; }
.judge-opts .opt { justify-content: center; font-weight: 600; }

.fill-row { display: flex; gap: 10px; align-items: center; }
.fill-row input { flex: 1; font-family: var(--mono); }

.verdict {
  border-radius: var(--rad); padding: 14px 16px; margin-top: 16px;
  border: 1px solid var(--line-soft); background: var(--bg-1);
  animation: fadeUp .22s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.verdict.ok { border-color: rgba(53,208,165,.4); background: var(--acc-soft); }
.verdict.no { border-color: rgba(242,105,95,.4); background: var(--red-soft); }
.verdict .vh { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; margin-bottom: 9px; }
.verdict.ok .vh { color: var(--acc); }
.verdict.no .vh { color: var(--red); }
/* 「判题服务暂时不可用」用琥珀色，刻意区别于红色的「答错」 */
.verdict.warn { border-color: rgba(227,179,65,.4); background: var(--amber-soft); }
.verdict.warn .vh { color: var(--amber); }
.verdict .vb { font-size: 13.5px; color: var(--fg-1); }
.verdict .vb p { color: var(--fg-1); }
.verdict .sect { margin-top: 11px; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.07); }
.verdict .sect .lbl { font-size: 11.5px; color: var(--fg-3); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }

.q-nav { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); }

/* 答题卡 */
.qcard-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.qcard-grid button {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line-soft);
  background: var(--bg-2); color: var(--fg-2); font: 600 11.5px/1 var(--mono);
  display: grid; place-items: center;
}
.qcard-grid button:hover { border-color: #33445a; }
.qcard-grid button.cur { outline: 2px solid var(--blue); outline-offset: 1px; }
.qcard-grid button.ok { background: var(--acc-soft); color: var(--acc); border-color: transparent; }
.qcard-grid button.no { background: var(--red-soft); color: var(--red); border-color: transparent; }
.qcard-grid button.done { background: var(--bg-3); color: var(--fg-1); }

/* ---------------------------------------------------------- 实验室 */

.lab { display: grid; grid-template-columns: 1fr 340px; gap: 14px; align-items: start; }
.editor-wrap {
  border: 1px solid var(--line-soft); border-radius: var(--rad);
  overflow: hidden; background: #0a0e13; display: flex; flex-direction: column;
}
.editor-bar {
  display: flex; align-items: center; gap: 9px; padding: 7px 12px;
  background: var(--bg-1); border-bottom: 1px solid var(--line-soft); font-size: 12px;
}
.editor-area { position: relative; display: flex; min-height: 340px; }
.editor-area .gutter {
  flex: none; padding: 13px 8px 13px 12px; text-align: right;
  font: 13px/1.65 var(--mono); color: var(--fg-3); user-select: none;
  background: #080b0f; border-right: 1px solid var(--line-soft);
  white-space: pre; overflow: hidden;
}
.editor-area textarea {
  flex: 1; border: 0; border-radius: 0; background: transparent; color: var(--fg);
  font: 13px/1.65 var(--mono); padding: 13px 15px; resize: none;
  white-space: pre; overflow: auto; tab-size: 4; outline: none;
  caret-color: var(--acc);
}
.editor-area textarea::selection { background: rgba(53,208,165,.28); }
.io-panel { margin-top: 14px; }
.io-panel .io-hd { font-size: 12px; color: var(--fg-2); margin-bottom: 6px; }
.io-panel textarea { width: 100%; font-family: var(--mono); font-size: 12.5px; }

.console {
  border: 1px solid var(--line-soft); border-radius: var(--rad);
  background: #080b0f; overflow: hidden;
}
.console .c-hd {
  padding: 7px 13px; background: var(--bg-1); border-bottom: 1px solid var(--line-soft);
  font-size: 12px; color: var(--fg-2); display: flex; align-items: center; gap: 8px;
}
.console .c-bd {
  padding: 12px 14px; font: 12.5px/1.65 var(--mono);
  white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto;
  min-height: 60px; color: var(--fg-1);
}
.console .c-bd.err { color: var(--red); }
.console .c-bd.warn { color: var(--amber); }
.console .c-bd .ph { color: var(--fg-3); }
.stderr-line { color: var(--amber); }

/* ---------------------------------------------------------- 模拟考 */

.exam-timer {
  font-family: var(--mono); font-size: 15px; font-weight: 700;
  padding: 4px 12px; border-radius: var(--rad-sm);
  background: var(--bg-2); border: 1px solid var(--line);
}
.exam-timer.low { color: var(--red); border-color: rgba(242,105,95,.4); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .45 } }

.result-hero { text-align: center; padding: 30px 20px; }
.result-hero .score {
  font: 700 60px/1 var(--mono); letter-spacing: -2px;
  background: linear-gradient(120deg, var(--acc), var(--blue));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.result-hero .grade { font-size: 15px; color: var(--fg-2); margin-top: 8px; }

/* ---------------------------------------------------------- 错题本 */

.wrong-item {
  border: 1px solid var(--line-soft); border-radius: var(--rad);
  background: var(--bg-1); padding: 15px 17px; margin-bottom: 11px;
}
.wrong-item .wh { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; flex-wrap: wrap; }
.wrong-item .ws { font-size: 14.5px; color: var(--fg); margin-bottom: 10px; }
.wrong-item .wa { font-size: 13px; color: var(--fg-1); }

/* ---------------------------------------------------------- 热力图 */

.heat { display: flex; gap: 3px; flex-wrap: wrap; }
.heat i {
  width: 11px; height: 11px; border-radius: 2.5px; background: var(--bg-3);
  display: block; cursor: default;
}
.heat i[data-l="1"] { background: #134e3f; }
.heat i[data-l="2"] { background: #1d8a6c; }
.heat i[data-l="3"] { background: #2ab88f; }
.heat i[data-l="4"] { background: #46e0b6; }

/* ---------------------------------------------------------- 弹窗 / 提示 */

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.62);
  display: grid; place-items: center; z-index: 200; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-box {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow);
  max-width: 560px; width: 100%; max-height: 84vh; overflow: auto; padding: 22px;
}
.modal-box h3 { margin-top: 0; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; }

.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--fg);
  padding: 9px 17px; border-radius: 20px; font-size: 13px; box-shadow: var(--shadow);
  animation: toastIn .2s ease; max-width: 80vw;
}
.toast.ok { border-color: rgba(53,208,165,.5); }
.toast.no { border-color: rgba(242,105,95,.5); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* ---------------------------------------------------------- 工具类 */

.only-mobile { display: none; }
.hidden { display: none !important; }

.empty { text-align: center; padding: 44px 20px; color: var(--fg-3); }
.empty .e-ico { font-size: 34px; margin-bottom: 12px; opacity: .5; }
.empty .e-t { font-size: 14.5px; color: var(--fg-2); margin-bottom: 5px; }

.kbd {
  font-family: var(--mono); font-size: 11px; padding: 1.5px 6px;
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; background: var(--bg-2); color: var(--fg-2);
}

/* ---------------------------------------------------------- 响应式 */

@media (max-width: 1080px) {
  .lab { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 150;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 140;
  }
  .only-mobile { display: grid; }
  .page { padding: 18px 15px 80px; }
  .pycmp .split { grid-template-columns: 1fr; }
  .pycmp .col + .col { border-left: 0; border-top: 1px solid var(--line-soft); }
  h1 { font-size: 21px; }
}
