:root {
  color-scheme: light;
  --ink: #2e293b;
  --muted: #696478;
  --purple: #6f47bb;
  --lilac: #f0eafb;
  --stroke: #dfdce5;
  --paper: #f8f8fb;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Geist", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
button, a, summary, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid #9570df; outline-offset: 3px; }
.icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.site-head { background: #fff; border-bottom: 1px solid var(--stroke); }
.head-inner, .page { max-width: 1232px; padding-inline: 42px; margin-inline: auto; }
.head-inner { height: 75px; display: flex; align-items: center; gap: clamp(32px,6vw,88px); }
.brand { display: flex; gap: 10px; align-items: center; flex: none; }
.brand > span { font-size: 20px; line-height: 1.2; font-weight: 780; letter-spacing: -.5px; }
.brand small { display: block; margin-top: 4px; color: #6e677b; font: 9px/1 var(--mono); letter-spacing: 2.2px; }
#nav { display: flex; align-self: stretch; gap: 29px; }
.nav-link { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; position: relative; font-size: 14px; font-weight: 590; color: #645f70; }
.nav-link .icon { width: 17px; }
.nav-link:hover, .nav-link.active { color: var(--purple); }
.nav-link.active::after { content: ""; height: 3px; background: var(--purple); border-radius: 3px 3px 0 0; position: absolute; bottom: 0; left: 0; right: 0; }
.save-state { margin-left: auto; white-space: nowrap; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #79a977; }
.save-state.temporary::before { background: #bc8a4e; }
.page { padding-top: 27px; padding-bottom: 44px; }
.banner { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: 177px; border-radius: 15px; background: #e9e1f8; border: 1px solid #dcd1ed; }
.banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(#8c77a826 1px,transparent 1px),linear-gradient(90deg,#8c77a826 1px,transparent 1px); background-size: 20px 20px; mask-image: linear-gradient(90deg,transparent 24%,#000 78%); }
.banner-copy { padding: 23px 33px 24px; position: relative; z-index: 1; }
.subject { display: flex; align-items: center; gap: 9px; color: #605077; font: 650 11px/1.3 var(--mono),var(--sans); letter-spacing: 1px; }
.subject-mark { width: 8px; height: 8px; margin-right: 1px; background: #7850b2; box-shadow: 3px -3px #c2addf; }
.slash { color: #a08bb7; }
h1,h2,h3,p { margin: 0; }
.banner h1 { font-size: clamp(33px,4vw,51px); line-height: 1.22; margin: 10px 0 7px; letter-spacing: -2.4px; font-weight: 800; color: #30263f; }
.banner p { font-size: 14px; color: #60556e; }
.banner-art { position: absolute; inset: -2px 3.5% -4px auto; width: 35%; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.banner-art img { height: 100%; max-width: 100%; object-fit: contain; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(235px, 27%); align-items: start; gap: 21px; margin-top: 22px; }
.panel { background: #fff; border: 1px solid var(--stroke); border-radius: 13px; min-width: 0; }
.practice { padding: 0 25px 22px; }
.card-bar { display: flex; align-items: center; justify-content: space-between; min-height: 51px; gap: 10px; border-bottom: 1px solid #ece9ef; }
.mode-label,.numbering,.source-tag,.panel-title,.list-head,.input-label,.action,.text-action,.tab-name,.answer-notice,.question-tag,.book-source { display: inline-flex; align-items: center; gap: 8px; }
.mode-label { font-weight: 680; font-size: 14px; }
.mode-label .icon { color: var(--purple); }
.round-no { font: 12px var(--mono); color: var(--muted); }
.round-no b { color: var(--ink); font-size: 15px; }
.round-progress { appearance: none; width: 84px; height: 6px; border: none; border-radius: 3px; overflow: hidden; background: #e8e5ed; color: #aa88d7; }
.round-progress::-webkit-progress-bar { background: #e8e5ed; border-radius: 3px; }
.round-progress::-webkit-progress-value { background: #aa88d7; border-radius: 3px; }
.round-progress::-moz-progress-bar { background: #aa88d7; border-radius: 3px; }
.question-top { padding: 20px 0 17px; }
.question-tag { font: 600 11px/1.5 var(--mono), var(--sans); color: #695583; letter-spacing: .2px; }
.id-tag { display: inline-block; padding: 2px 7px; border-radius: 4px; background: #f0eafa; color: #69469d; }
.question-tag .tag-sep { width: 3px; height: 3px; border-radius: 50%; background: #bbb1c8; }
.question-top h2 { margin: 8px 0 4px; font-size: clamp(22px,2.4vw,29px); line-height: 1.35; font-weight: 740; letter-spacing: -.85px; }
.question-top p { color: #615b6d; font-size: 14px; }
.editor { background: #272334; border: 1px solid #312a40; border-radius: 9px; color: #f0edf6; overflow: hidden; }
.editor-bar { display: flex; align-items: center; justify-content: space-between; background: #322d41; border-bottom: 1px solid #474053; padding: 0 15px; min-height: 33px; color: #d4cddf; font: 11px var(--mono); }
.tab-name .icon { color: #cfb7f6; width: 15px; }
.language { color: #c3b9d2; font: 10px var(--mono); }
.language::before { content: ""; width: 6px; height: 6px; display: inline-block; background: #bba2df; border-radius: 50%; margin-right: 6px; }
.code-lines { overflow-x: auto; padding: 13px 0 16px; font: 13px/1.88 var(--mono),var(--sans); tab-size: 4; }
.code-row { display: flex; width: 100%; }
.code-row.target-row { background: #b88be412; box-shadow: inset 2px 0 #b390d8; }
.line-no { flex: none; width: 44px; text-align: right; padding-right: 13px; color: #a196b4; user-select: none; font-size: 11px; line-height: 2.23; }
.code-row code { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; padding-right: 18px; font: inherit; }
.kw { color: #d5acf7; } .str { color: #c1dca2; } .num { color: #e8bd89; } .fn { color: #a9c3ee; } .cmt { color: #ab9db9; }
.code-row .cmt { display: block; padding: 4px 0 10px; color: #c1b7d0; white-space: pre-wrap; line-height: 1.75; }
.mobile-scope { display: none; }
.blank { display: inline-block; min-width: 58px; vertical-align: .05em; text-align: center; color: #e4c8ff; background: #48365c; border: 1px dashed #b390d8; border-radius: 4px; line-height: 1.4; font: 600 11px/1.55 var(--mono),var(--sans); letter-spacing: .5px; }
.answer-form { margin-top: 17px; }
.input-label { font-size: 13px; font-weight: 660; }
.answer-controls { display: flex; align-items: stretch; gap: 10px; margin-top: 7px; }
.answer-controls input { width: 1px; flex: 1 1 auto; font: 14px var(--mono),var(--sans); border: 1px solid #d9d3e1; background: #fcfbfd; border-radius: 7px; padding: 11px 13px; min-height: 44px; }
input::placeholder { color: #8a8395; font: 13px var(--sans); }
.answer-controls input:focus { outline: 2px solid #b99edc; outline-offset: 0; }
.action { min-height: 42px; padding: 9px 16px; font-size: 14px; font-weight: 650; border-radius: 7px; justify-content: center; background: #eee9f6; color: #503470; transition: background .15s, transform .15s; }
.action.primary { color: #fff; background: #7049ad; }
.action.primary:hover { background: #59358f; }
.action:hover { background: #e2d9ee; }
.action:active { transform: translateY(1px); }
.action .icon { width: 15px; }
.aids { display: flex; align-items: center; gap: 20px; margin-top: 14px; }
.text-action { padding: 3px 0; background: transparent; color: #70677c; font-size: 12px; }
.text-action:hover { color: var(--purple); } .text-action .icon { width: 15px; height: 15px; }
.keyboard { margin-left: auto; font: 11px var(--sans); color: #81788b; }
kbd { background: #f6f5f8; font: 10px var(--mono); border: 1px solid #e2dfe8; border-radius: 3px; padding: 1px 4px; }
.hint,.feedback { border-radius: 7px; padding: 12px 14px; margin-top: 13px; font-size: 13px; }
.hint { background: #f4f0f8; color: #645079; }
.feedback { background: #f8f0e7; color: #6d4c2d; }
.feedback.ok { background: #edf5e9; color: #3f6642; }
.feedback strong { display: block; margin-bottom: 3px; }
.feedback code,.reference-answer { font: 600 14px var(--mono); overflow-wrap: anywhere; }
.feedback .result-detail { margin-top: 5px; }
.after-answer { margin-top: 13px; display: flex; justify-content: flex-end; }
.side { display: grid; gap: 16px; }
.scope, .progress-card { padding: 16px; }
.panel-title { font-size: 16px; font-weight: 710; margin-bottom: 13px; }
.panel-title .icon { color: #79658e; width: 17px; }
.scope-list { display: grid; gap: 3px; }
.scope-btn { display: flex; align-items: center; min-height: 37px; padding: 6px 9px; gap: 9px; text-align: left; border-radius: 6px; background: transparent; font-size: 13px; }
.scope-btn:hover { background: #f7f4fa; }
.scope-btn.selected { background: #eee7f7; color: #624298; font-weight: 680; }
.scope-code { color: #89818f; font: 11px var(--mono); min-width: 17px; }
.scope-btn .icon { width: 15px; height: 15px; }
.scope-btn small { font: 11px var(--mono); margin-left: auto; color: #807587; }
.scope-divider { background: #eeeaf1; height: 1px; margin: 6px 8px; }
.scope-btn.unfilled { font-size: 12px; }
.meter-head { display: flex; align-items: center; justify-content: space-between; }
.meter-head .panel-title { margin: 0; }
.percent { font: 650 14px var(--mono); color: var(--purple); }
.track { background: #eeeaf3; height: 7px; border-radius: 7px; margin: 17px 0 13px; overflow: hidden; }
.track i { display: block; height: 100%; background: #9975c4; border-radius: inherit; transition: width .28s ease; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; }
.stat-pair > div + div { border-left: 1px solid #e8e4eb; padding-left: 18px; }
.stat-pair b { display: block; font: 650 22px/1.1 var(--mono); }
.stat-pair span { font-size: 11px; color: var(--muted); }
.collection { padding: 21px 23px; }
.list-head { justify-content: space-between; width: 100%; flex-wrap: wrap; margin-bottom: 14px; }
.list-head h2 { font-size: 20px; letter-spacing: -.6px; }
.count { color: var(--muted); font-size: 12px; font-weight: 500; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 13px; }
.search { display: flex; align-items: center; gap: 9px; flex: 1; min-width: min(100%,170px); padding: 0 10px; color: #837b91; border-radius: 6px; border: 1px solid var(--stroke); }
.search:focus-within { outline: 2px solid #b99edc; }
.search input { flex: 1; min-width: 0; padding: 8px 0; background: transparent; border: none; outline: none; }
.search input:focus-visible { outline: none; }
.filters select { background: #fff; border: 1px solid var(--stroke); padding: 8px 6px; border-radius: 6px; font-size: 13px; }
.only-open { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 3px; cursor: pointer; }
.only-open input { accent-color: var(--purple); }
.entry { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr) auto; align-items: center; column-gap: 10px; border-top: 1px solid #eae6ee; padding: 11px 1px; }
.entry-title { font-size: 14px; font-weight: 615; }
.book-source { margin-top: 3px; color: var(--muted); font: 10px/1.4 var(--mono); }
.entry .reference-answer { color: #705294; font-size: 13px; }
.entry .text-action { color: var(--purple); }
.ref-note { border-top: 1px solid var(--stroke); margin-top: 12px; padding-top: 13px; color: var(--muted); font-size: 12px; }
details.appendix { margin-top: 10px; }
details.appendix summary { color: #665576; cursor: pointer; }
details.appendix pre { padding: 13px; background: #f6f4f8; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 8px; font: 12px/1.7 var(--mono),var(--sans); }
.round-summary,.empty { padding: 35px 12px; text-align: center; }
.round-summary>.icon,.empty>.icon { width: 38px; height: 38px; color: #7b5da3; padding: 7px; border-radius: 9px; background: var(--lilac); }
.round-summary h2,.empty h3 { margin: 11px 0 6px; font-size: 22px; }
.round-summary p,.empty p { color: var(--muted); font-size: 14px; }
.result-list { margin: 18px auto; padding: 0; max-width: 410px; list-style: none; text-align: left; }
.result-list li { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid #eeeaf2; font-size: 13px; }
.result-list span { margin-left: auto; color: #88632e; font-size: 11px; }
.result-list .known { color: #487449; }
.empty .action { margin-top: 16px; }
#workspace { animation: arrive .22s ease both; }
@keyframes arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width:1450px) { .page { padding-top: 34px; } .layout { gap: 25px; margin-top: 25px; } }
@media (max-width:880px) {
  .head-inner,.page { padding-inline: 22px; }
  .head-inner { gap: 30px; }
  #nav { gap: 21px; }
  .layout { gap: 15px; grid-template-columns: minmax(0,1fr) 216px; }
  .practice,.collection { padding-inline: 17px; }
  .scope,.progress-card { padding: 13px; }
  .scope-btn { padding-inline: 5px; }
  .banner { min-height: 160px; } .banner-copy { padding-left: 25px; }
}
@media (max-width:700px) {
  .head-inner,.page { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .head-inner { height: auto; display: grid; grid-template-columns: 1fr auto; gap: 0; }
  .brand { margin-block: 12px 6px; } .brand img { width: 33px; height: 33px; }
  .brand > span { font-size: 17px; } .brand small { font-size: 8px; }
  .save-state { grid-column: 2; grid-row: 1; }
  #nav { grid-column: 1/-1; gap: 24px; }
  .nav-link { min-height: 44px; font-size: 13px; gap: 6px; }
  .page { padding-top: 15px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .banner { min-height: 118px; border-radius: 11px; }
  .banner-copy { max-width: 65%; padding: 15px 0 15px 16px; }
  .subject { font-size: 10px; gap: 5px; }
  .banner h1 { margin: 8px 0 5px; letter-spacing: -1.4px; font-size: clamp(26px,5.4vw,35px); }
  .banner p { font-size: 12px; line-height: 1.45; }
  .banner-art { width: 35%; right: 0; inset-block: 12px 3px; }
  .layout { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
  .layout>*,.side { width: 100%; }
  .mobile-scope { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
  .mobile-scope select { flex: 1; min-width: 0; min-height: 44px; padding: 8px 11px; background: white; border: 1px solid var(--stroke); border-radius: 7px; font-size: 16px; }
  .side { grid-template-columns: 1fr; }
  .side .scope { display: none; }
  .panel-title { font-size: 14px; gap: 5px; }
  .stat-pair > div + div { padding-left: 9px; }
  .practice { padding: 0 14px 16px; }
  .card-bar { min-height: 44px; }
  .question-top { padding: 15px 0 13px; }
  .code-lines { font-size: 13px; line-height: 1.8; padding-block: 11px; }
  .line-no { width: 29px; padding-right: 7px; line-height: 2.13; }
  .code-row code { padding-right: 11px; }
  .answer-controls { flex-direction: column; gap: 9px; }
  .answer-controls input { flex: auto; width: 100%; min-height: 48px; font-size: 16px; }
  .action { min-height: 48px; }
  .after-answer .action { width: 100%; }
  .aids { gap: 12px; margin-top: 7px; }
  .aids .text-action { flex: 1; min-height: 44px; justify-content: center; }
  .keyboard { display: none; }
  .collection { padding: 15px; }
  .search { flex-basis: 100%; }
  .search input, .filters select { min-height: 44px; font-size: 16px; }
  .only-open { min-height: 44px; }
  .entry { grid-template-columns: minmax(0,1fr) auto; row-gap: 1px; }
  .entry .reference-answer { grid-row: 2; grid-column: 1; }
  .entry .text-action { grid-column: 2; grid-row: 1 / 3; min-height: 44px; padding-left: 10px; }
  details.appendix summary { padding-block: 10px; min-height: 44px; }
  .result-list li { flex-wrap: wrap; }
  .round-summary .action { width: 100%; margin-top: 8px; }
}
@media (max-width:385px) {
  .head-inner,.page { padding-inline: 11px; }
  .side { grid-template-columns: 1fr; }
  .banner-art { right: -3%; }
  .round-progress { width: 48px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation: none !important; transition: none !important; } }
.filled { color: #ddedc2; background: #485447; border-radius: 3px; padding: 1px 3px; }
