@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600;700&family=Noto+Sans+TC:wght@400;500;600;700;800;900&display=swap");

:root {
  color-scheme: light;
  --canvas: #e9e4d8;
  --paper: #f8f5ee;
  --paper-strong: #fffdf8;
  --sidebar: #efeadf;
  --ink: #171915;
  --ink-2: #4b5049;
  --muted: #777b73;
  --line: #cbc5b9;
  --line-strong: #272a25;
  --accent: #ef542f;
  --accent-soft: #ffe4da;
  --yellow: #f5d45d;
  --green: #267657;
  --blue: #365ac9;
  --code-bg: #1b1d1a;
  --code-ink: #f3f0e7;
  --shadow: 0 18px 50px rgba(35, 31, 24, .12);
  --font: "Noto Sans TC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --row-h: 88px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #11120f;
  --paper: #191a16;
  --paper-strong: #1f211c;
  --sidebar: #161713;
  --ink: #f4f0e7;
  --ink-2: #c2c2b7;
  --muted: #8e9188;
  --line: #3b3d35;
  --line-strong: #e2ddd1;
  --accent: #ff6b45;
  --accent-soft: #44231c;
  --yellow: #e8c64e;
  --green: #66b691;
  --blue: #8ea8ff;
  --code-bg: #0d0e0c;
  --code-ink: #f3f0e7;
  --shadow: 0 22px 56px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--canvas); }
body {
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
::selection { color: #171915; background: var(--yellow); }
.sky { display: none; }

.app-shell { height: 100%; display: grid; grid-template-rows: 82px minmax(0, 1fr); }
.topbar {
  display: grid;
  grid-template-columns: 248px minmax(300px, 680px) 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--paper-strong);
}
.brand { min-width: 0; display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand-mark {
  width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto;
  color: var(--paper-strong); background: var(--ink);
  font: 700 15px var(--mono); letter-spacing: -.08em;
  border-radius: 6px;
  box-shadow: 6px 6px 0 var(--yellow);
}
.brand b { display: block; font-size: 18px; font-weight: 900; letter-spacing: .08em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; }

.global-search {
  height: 52px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 0 12px 0 16px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--paper); transition: box-shadow .16s, transform .16s;
}
.global-search:focus-within { box-shadow: 4px 4px 0 var(--yellow); transform: translate(-2px, -2px); }
.global-search > span { color: var(--accent); font: 700 25px var(--mono); }
.global-search input { min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.global-search input::placeholder { color: var(--muted); }
kbd {
  min-width: 27px; height: 26px; display: inline-grid; place-items: center; padding: 0 7px;
  border: 1px solid var(--line); border-bottom: 3px solid var(--line);
  border-radius: 5px; color: var(--ink-2); background: var(--paper-strong); font: 600 11px var(--mono);
}
.top-stats { justify-self: end; display: flex; gap: 28px; }
.top-stats span { display: grid; text-align: right; }
.top-stats b { color: var(--ink); font: 700 20px var(--mono); }
.top-stats small { color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 8px; }
.icon-button {
  width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 6px;
  cursor: pointer; color: var(--ink); background: var(--paper); font-size: 19px; transition: .16s;
}
.icon-button:hover { color: var(--paper-strong); background: var(--ink); transform: translateY(-2px); }

.workspace { min-height: 0; display: grid; grid-template-columns: 248px 390px minmax(0, 1fr); }
.vault-panel, .index-panel, .detail-panel { min-height: 0; }
.vault-panel { overflow: auto; padding: 28px 18px 20px; border-right: 1px solid var(--line-strong); background: var(--sidebar); }
.section-kicker { color: var(--accent); font: 700 12px var(--mono); letter-spacing: .06em; }
.vault-panel h1 { margin: 13px 0 12px; font-size: 34px; line-height: 1.18; font-weight: 900; letter-spacing: -.045em; }
.vault-panel > p { margin: 0 0 23px; color: var(--ink-2); font-size: 15px; line-height: 1.75; }
.vault-list { display: grid; gap: 9px; }
.vault-card {
  width: 100%; min-height: 78px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; text-align: left;
  background: var(--paper); transition: border-color .16s, transform .16s, box-shadow .16s;
}
.vault-card:hover { border-color: var(--line-strong); transform: translateX(3px); }
.vault-card.is-active { color: var(--paper-strong); border-color: var(--ink); background: var(--ink); box-shadow: 5px 5px 0 var(--yellow); }
.vault-card > span:nth-child(2) { min-width: 0; }
.vault-card b { display: block; font-size: 16px; font-weight: 800; }
.vault-card small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.vault-card.is-active small, .vault-card.is-active strong { color: #c8c8bf; }
.vault-card strong { color: var(--ink-2); font: 700 12px var(--mono); }
.vault-orb { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 5px; font: 700 14px var(--mono); }
.vault-orb.apcs { color: var(--accent); background: var(--accent-soft); }
.vault-orb.zerojudge { color: #8a6910; background: #fff0ad; }
.vault-orb.leetcode { color: var(--blue); background: #e4e9ff; }
.vault-card.is-active .vault-orb { color: #171915; border-color: var(--yellow); background: var(--yellow); }

.progress-card {
  display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 13px;
  margin-top: 22px; padding: 15px 12px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.progress-ring {
  --progress: 0deg; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle, var(--sidebar) 57%, transparent 59%), conic-gradient(var(--accent) var(--progress), var(--line) 0);
}
.progress-ring span { font: 700 12px var(--mono); }
.progress-card b { display: block; margin: 5px 0 2px; font-size: 14px; }
.progress-card small { display: block; color: var(--muted); font-size: 11px; line-height: 1.45; }
.daily-button {
  width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px;
  margin-top: 13px; padding: 13px; border: 1px solid var(--line-strong); border-radius: 7px; cursor: pointer; text-align: left;
  color: #171915; background: var(--yellow); transition: transform .16s, box-shadow .16s;
}
.daily-button:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--line-strong); }
.daily-button > span:first-child { font-size: 22px; }
.daily-button b, .daily-button small { display: block; }
.daily-button b { font-size: 14px; }
.daily-button small { margin-top: 2px; color: #55564f; font-size: 11px; }
.daily-button i { font-style: normal; font-size: 18px; }
.shortcut-card { display: grid; gap: 9px; margin-top: 16px; color: var(--muted); font-size: 11px; }
.shortcut-card span { display: flex; align-items: center; gap: 6px; }

.index-panel { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); border-right: 1px solid var(--line-strong); background: var(--paper-strong); }
.index-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 28px 22px 17px; }
.index-head h2 { margin: 6px 0 0; font-size: 28px; line-height: 1.2; font-weight: 900; letter-spacing: -.035em; }
.result-count { color: var(--ink-2); font: 600 12px var(--mono); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 0 16px 14px; }
.filters label { position: relative; }
.filters label > span:first-child { position: absolute; z-index: 1; left: 11px; top: 7px; color: var(--muted); font-size: 10px; pointer-events: none; }
.filters select {
  width: 100%; height: 55px; padding: 21px 28px 5px 10px; border: 1px solid var(--line); border-radius: 5px; outline: 0;
  color: var(--ink); background: var(--paper); font-size: 14px; appearance: none;
}
.filters select:focus { border-color: var(--line-strong); box-shadow: 3px 3px 0 var(--yellow); }
.solution-toggle {
  grid-column: 1 / -1; height: 44px; display: flex; align-items: center; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 5px; cursor: pointer; background: var(--paper);
}
.solution-toggle input { width: 17px; height: 17px; accent-color: var(--accent); }
.solution-toggle > span:first-of-type { position: static; margin-left: 8px; color: var(--ink-2); font-size: 13px; pointer-events: auto; }
.list-status { min-height: 30px; padding: 0 20px 8px; color: var(--muted); font-size: 12px; }
.problem-scroll { position: relative; min-height: 0; overflow: auto; outline: none; border-top: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
.problem-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.problem-spacer { width: 1px; opacity: 0; }
.problem-pool { position: absolute; inset: 0 7px 0 0; pointer-events: none; }
.problem-row {
  position: absolute; left: 10px; right: 4px; height: calc(var(--row-h) - 8px);
  display: grid; grid-template-columns: 66px 1fr 22px; align-items: center; gap: 8px;
  padding: 11px 10px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; text-align: left; pointer-events: auto;
  background: transparent; contain: layout paint style; transition: background .14s, border-color .14s, transform .14s;
}
.problem-row[hidden] { display: none; }
.problem-row:hover { border-color: var(--line); background: var(--paper); transform: translateX(2px); }
.problem-row.is-active { color: var(--paper-strong); border-color: var(--ink); background: var(--ink); }
.problem-row.is-active::before { content: ""; position: absolute; inset: 8px auto 8px -1px; width: 5px; background: var(--yellow); }
.problem-row.is-solved .problem-state { border-color: var(--green); background: var(--green); }
.problem-number { color: var(--accent); font: 700 13px var(--mono); white-space: nowrap; }
.problem-row.is-active .problem-number { color: var(--yellow); }
.problem-copy { min-width: 0; }
.problem-copy b, .problem-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.problem-copy b { font-size: 15px; line-height: 1.35; font-weight: 700; }
.problem-copy small { margin-top: 6px; color: var(--muted); font: 500 11px var(--mono); }
.problem-row.is-active .problem-copy small { color: #bdbdb4; }
.problem-state { width: 9px; height: 9px; justify-self: center; border: 1px solid var(--muted); border-radius: 50%; }

.detail-panel { position: relative; overflow: auto; padding: 42px clamp(34px, 5vw, 82px) 72px; background: var(--paper); scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
.detail-panel::before { content: ""; position: fixed; top: 82px; right: 0; left: 638px; height: 5px; z-index: 2; background: var(--accent); }
.loading-state { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 18px; color: var(--muted); font-size: 16px; }
.loading-orbit { width: 48px; height: 48px; border: 6px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.detail-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font: 600 12px var(--mono); }
.detail-breadcrumb span { color: var(--accent); }
.detail-breadcrumb b { color: var(--line); }
.detail-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 28px; margin-top: 22px; padding-bottom: 30px; border-bottom: 2px solid var(--line-strong); }
.detail-id { display: inline-flex; align-items: center; gap: 9px; color: var(--accent); font: 700 15px var(--mono); }
.detail-id::before { content: ""; width: 30px; height: 4px; background: var(--accent); }
.detail-hero h2 { max-width: 900px; margin: 12px 0 16px; font-size: clamp(44px, 5.4vw, 76px); line-height: 1.03; font-weight: 900; letter-spacing: -.065em; text-wrap: balance; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { display: inline-flex; align-items: center; min-height: 31px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-2); background: var(--paper-strong); font-size: 12px; }
.tag.hot { color: #765400; border-color: #caa93a; background: #fff3bd; }
.tag.solution { color: var(--green); border-color: var(--green); }
.hero-actions { display: flex; gap: 8px; }
.action-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 5px; cursor: pointer; text-decoration: none; color: var(--ink); background: var(--paper-strong); font-size: 14px; font-weight: 700; transition: .16s; }
.action-button:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--yellow); }
.action-button.primary { color: #fff; border-color: var(--accent); background: var(--accent); }
.action-button.primary:hover { box-shadow: 4px 4px 0 var(--line-strong); }

.mission-bar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 11px 16px; margin: 20px 0 30px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-strong); }
.mission-bar > span { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.status-buttons { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.status-button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; color: var(--muted); background: transparent; font-size: 12px; }
.status-button:hover { border-color: var(--line-strong); color: var(--ink); }
.status-button.is-active { color: #fff; border-color: var(--green); background: var(--green); }
.nav-buttons { grid-column: 2; grid-row: 1; display: flex; gap: 6px; }
.nav-buttons button { width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: 4px; cursor: pointer; color: var(--ink); background: var(--paper); font-size: 17px; }
.nav-buttons button:hover:not(:disabled) { color: #fff; background: var(--ink); }
.nav-buttons button:disabled { opacity: .3; cursor: default; }

.solution-shell, .workbench { max-width: 1000px; }
.solution-intro { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; margin-bottom: 30px; }
.signal-card { min-height: 142px; padding: 22px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper-strong); }
.signal-card:first-child { border-top: 7px solid var(--accent); }
.signal-card.gold { border-top: 7px solid var(--yellow); }
.signal-card strong { display: block; margin-top: 10px; font-size: 23px; line-height: 1.35; font-weight: 900; letter-spacing: -.025em; }
.signal-card p { margin: 9px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.75; }
.solution-content { display: grid; gap: 14px; }
.solution-content .sec { display: flex; align-items: center; gap: 11px; margin: 28px 0 2px; color: var(--ink); font-size: 25px; font-weight: 900; letter-spacing: -.025em; }
.solution-content .sec .no { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 4px; color: #fff; background: var(--accent); font: 700 13px var(--mono); }
.solution-content .q, .solution-content .fml, .solution-content .tip, .solution-content .io .box2 { border: 1px solid var(--line); border-radius: 6px; background: var(--paper-strong); color: var(--ink-2); font-size: 17px; line-height: 1.9; }
.solution-content .q, .solution-content .fml, .solution-content .tip { padding: 20px 22px; }
.solution-content .fml { border-left: 7px solid var(--yellow); }
.solution-content .fml b { color: #735300; }
.solution-content .tip { border-left: 7px solid var(--green); }
.solution-content .tip .tg { display: inline-flex; margin-right: 9px; padding: 3px 8px; border-radius: 3px; color: #fff; background: var(--green); font-size: 12px; font-weight: 800; }
.solution-content .bul2 { margin: 0; padding: 18px 22px 18px 46px; border-left: 3px solid var(--accent); color: var(--ink-2); font-size: 17px; line-height: 1.9; }
.solution-content .io { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.solution-content .io .box2 { padding: 18px; white-space: pre-wrap; font-family: var(--mono); }
.solution-content .io .h { display: block; margin-bottom: 9px; color: var(--accent); font: 700 12px var(--mono); }
.solution-content .code { position: relative; overflow: auto; margin: 0; padding: 52px 22px 22px; border: 0; border-radius: 6px; color: var(--code-ink); background: var(--code-bg); white-space: pre; font: 500 14px/1.8 var(--mono); box-shadow: 7px 7px 0 var(--yellow); }
.solution-content .code .ttl { position: absolute; top: 16px; left: 21px; color: #aaa99f; font: 700 11px var(--mono); letter-spacing: .05em; }
.copy-code { position: sticky; left: 100%; bottom: 0; float: right; margin: 10px 0 0 14px; padding: 7px 11px; border: 1px solid #77786f; border-radius: 4px; cursor: pointer; color: #171915; background: var(--yellow); font: 700 11px var(--mono); }
.solution-content code { color: var(--blue); font-family: var(--mono); font-size: .92em; }
.solution-content .code code { color: inherit; }

.workbench-lead { padding: 25px; border: 1px solid var(--line-strong); border-left: 9px solid var(--accent); border-radius: 6px; background: var(--paper-strong); }
.workbench-lead h3 { margin: 9px 0; font-size: 29px; line-height: 1.35; font-weight: 900; letter-spacing: -.03em; }
.workbench-lead p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.85; }
.compass-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin: 16px 0; }
.compass-card { padding: 18px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper-strong); }
.compass-card span { color: var(--muted); font: 700 11px var(--mono); }
.compass-card b { display: block; margin-top: 9px; font-size: 15px; line-height: 1.55; }
.thinking-steps { display: grid; gap: 10px; counter-reset: thinking; margin-top: 16px; }
.thinking-step { display: grid; grid-template-columns: 43px 1fr; gap: 14px; align-items: start; padding: 18px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper-strong); }
.thinking-step::before { counter-increment: thinking; content: counter(thinking, decimal-leading-zero); width: 41px; height: 41px; display: grid; place-items: center; color: #fff; background: var(--ink); font: 700 12px var(--mono); }
.thinking-step b { display: block; margin-bottom: 6px; font-size: 16px; }
.thinking-step p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.75; }
.note-panel { margin-top: 16px; padding: 20px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper-strong); }
.note-panel label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; font-size: 15px; font-weight: 800; }
.note-panel label span { color: var(--muted); font: 500 11px var(--mono); }
.note-panel textarea { width: 100%; min-height: 170px; resize: vertical; border: 1px solid var(--line); border-radius: 5px; outline: 0; padding: 15px; color: var(--ink); background: var(--paper); font: 500 16px/1.75 var(--font); }
.note-panel textarea:focus { border-color: var(--line-strong); box-shadow: 4px 4px 0 var(--yellow); }
.premium-notice { margin-top: 14px; padding: 13px 15px; border: 1px solid #b89520; border-radius: 5px; color: #715300; background: #fff2b7; font-size: 13px; }
.empty-state { min-height: 55vh; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 16px; }
.empty-state b { color: var(--ink); font-size: 22px; }
.mobile-back { display: none; width: max-content; margin-bottom: 16px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 26px; max-width: min(440px, calc(100% - 32px)); padding: 13px 18px; border: 1px solid var(--line-strong); border-radius: 5px; opacity: 0; transform: translate(-50%, 16px); pointer-events: none; color: var(--paper-strong); background: var(--ink); box-shadow: var(--shadow); font-size: 14px; transition: .18s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.mobile-vaults { display: none; }

body.focus-mode .vault-panel, body.focus-mode .index-panel { display: none; }
body.focus-mode .workspace { grid-template-columns: 1fr; }
body.focus-mode .detail-panel { padding-inline: max(34px, calc((100vw - 1100px) / 2)); }
body.focus-mode .detail-panel::before { left: 0; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 220px minmax(260px, 1fr) auto; }
  .top-stats { display: none; }
  .workspace { grid-template-columns: 220px 350px minmax(0, 1fr); }
  .detail-panel::before { left: 570px; }
  .vault-panel { padding-inline: 14px; }
  .detail-panel { padding-inline: 30px; }
  .detail-hero { grid-template-columns: 1fr; }
  .hero-actions { justify-self: start; }
}

@media (max-width: 920px) {
  body { overflow: auto; }
  .app-shell { min-height: 100%; height: auto; grid-template-rows: 72px auto; }
  .topbar { position: sticky; z-index: 10; top: 0; grid-template-columns: auto 1fr auto; gap: 11px; padding: 10px 13px; }
  .brand > span:last-child, .top-stats, #focusButton { display: none; }
  .brand-mark { width: 44px; height: 44px; box-shadow: 4px 4px 0 var(--yellow); }
  .global-search { height: 48px; }
  .global-search kbd { display: none; }
  .workspace { display: grid; grid-template-columns: minmax(330px, 40vw) 1fr; min-height: calc(100vh - 72px); }
  .vault-panel { display: none; }
  .index-panel { min-height: calc(100vh - 72px); }
  .detail-panel { min-height: calc(100vh - 72px); max-height: calc(100vh - 72px); padding: 30px 24px 100px; }
  .detail-panel::before { top: 72px; left: max(330px, 40vw); }
  .mobile-vaults { position: fixed; z-index: 12; right: 14px; bottom: 14px; left: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper-strong); box-shadow: var(--shadow); }
  .mobile-vaults button { height: 43px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font: 700 12px var(--mono); }
  .mobile-vaults button.is-active { color: #fff; background: var(--ink); }
  .solution-intro { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .workspace { display: block; min-height: 0; }
  .index-panel { min-height: calc(100vh - 72px); border-right: 0; }
  .detail-panel { display: none; min-height: calc(100vh - 72px); max-height: none; }
  .detail-panel::before { display: none; }
  body.mobile-detail .index-panel { display: none; }
  body.mobile-detail .detail-panel { display: block; }
  .index-head { padding-top: 24px; }
  .index-head h2 { font-size: 30px; }
  .problem-copy b { font-size: 16px; }
  .detail-hero h2 { font-size: 44px; }
  .hero-actions { width: 100%; }
  .hero-actions .action-button { flex: 1; }
  .solution-intro, .compass-grid, .solution-content .io { grid-template-columns: 1fr; }
  .solution-content .q, .solution-content .fml, .solution-content .tip, .solution-content .bul2 { font-size: 16px; }
  .solution-content .code { padding-inline: 17px; font-size: 13px !important; line-height: 1.75; box-shadow: 5px 5px 0 var(--yellow); }
  .mobile-back { display: inline-flex; }
  .note-panel label { align-items: flex-start; gap: 8px; }
}

@media (max-width: 420px) {
  .topbar { grid-template-columns: 40px 1fr 42px; padding-inline: 10px; }
  .brand-mark { width: 40px; height: 40px; font-size: 13px; box-shadow: none; }
  .global-search { height: 44px; padding-inline: 11px; }
  .global-search input { font-size: 15px; }
  .detail-panel { padding-inline: 18px; }
  .detail-hero h2 { font-size: 39px; }
  .status-buttons { gap: 5px; }
  .status-button { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@keyframes spin { to { transform: rotate(360deg); } }
