@charset "UTF-8";
/* Mensura family styling, with Quadratic's own green palette.
   The only remote resource is the optional Google Fonts stylesheet. */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+HK:wght@400;500;600;700;800;900&display=swap');
:root {
  --paper:#f2f4eb; --white:#fffef9; --ink:#243b36; --muted:#64766a;
  --line:#dce2d2; --green:#234d41; --green-dark:#17392e;
  --mint:#dcebc6; --soft:#eaf0e2; --radius:14px;
  --ok:#2d6a4f; --ok-soft:#e7f3e6; --bad:#8b4a2a; --bad-soft:#faf0da;
  font-family:"Noto Sans HK",system-ui,-apple-system,"PingFang HK",sans-serif;
  color:var(--ink); background:var(--paper); font-synthesis:none;
}
* { box-sizing:border-box; }
body { margin:0; font-size:16px; background-color:var(--paper);
  background-image:linear-gradient(#334b3610 1px,transparent 1px),linear-gradient(90deg,#334b3610 1px,transparent 1px);
  background-size:22px 22px; min-height:100vh; }
button,input,select,textarea { font:inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; color:inherit; border:0; background:transparent; }
button:disabled { cursor:default; opacity:.45; }
a { color:inherit; text-decoration:none; }
button:focus-visible,a:focus-visible { outline:3px solid #789e62; outline-offset:4px; }
input:focus,textarea:focus,select:focus { outline:3px solid #789e62; outline-offset:2px; }
[hidden] { display:none!important; }
h1,h2,h3,p { margin-top:0; }
p { line-height:1.8; }
.app-shell { width:min(100%,652px); margin:0 auto; padding:28px 20px 48px; }
.sidebar { position:relative; padding:0; }
.brand { display:flex; align-items:center; gap:13px; width:fit-content; max-width:100%;
  font-size:24px; font-weight:900; letter-spacing:.48px; line-height:1.4; }
.brand-icon { display:grid; place-items:center; flex-shrink:0; width:56px; height:56px;
  position:relative; font:italic 43px Georgia,serif; background:var(--green); color:var(--mint);
  border-radius:19px; box-shadow:4px 4px 0 #bfd69c; transform:rotate(-5deg); }
.brand-icon span { font:17px Arial,sans-serif; position:absolute; right:5px; top:6px; }
.brand small { display:block; font-size:12px; font-weight:400; letter-spacing:.4px; color:var(--muted); margin-top:4px; }
.sidebar-bottom { display:flex; justify-content:flex-end; margin:12px 0 3px; }
nav { display:flex; gap:8px; margin:17px 0 0; }
.nav-item { display:flex; align-items:center; justify-content:center; gap:8px; min-height:47px;
  border:2px solid var(--line); border-radius:var(--radius); background:var(--white);
  flex:1; padding:10px 8px; font-size:14px; font-weight:700; box-shadow:0 3px 0 var(--line); }
.nav-item>span:first-child { font-size:20px; line-height:1; }
.nav-item.active { background:var(--mint); border-color:#9fb78b; box-shadow:0 3px 0 #9fb78b; }
.nav-end { font-size:11px; font-weight:700; }
.nav-item[data-view="practice"] .nav-end,.nav-item[data-view="map"] .nav-end { display:none; }
.nav-item:hover:not(.active) { background:var(--soft); }
.page-content { padding:0; }
.page-heading { margin:19px 0 22px; }
h1 { font-size:24px; font-weight:900; line-height:1.6; letter-spacing:.48px; margin-bottom:7px; }
.page-heading p { font-size:14px; color:var(--muted); margin:0; }
.practice-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:22px; }
.segmented { display:flex; gap:5px; }
.segmented button { padding:9px 11px; min-height:44px; border-radius:11px; font-size:13px;
  border:2px solid var(--line); background:var(--white); font-weight:500; }
.segmented button.selected { background:var(--green); border-color:var(--green); color:white; font-weight:700; }
.topic-label { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); }
select { background:var(--white); border:2px solid var(--line); border-radius:11px;
  padding:10px 8px; min-height:44px; font-size:13px; color:var(--ink); max-width:100%; }
.practice-layout { display:block; }
.exercise-column { min-width:0; }
.progress-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:9px; }
.progress-heading>span { font-size:12px; color:var(--muted); font-weight:700; }
.text-button { padding:9px 2px; min-height:40px; font-size:13px; font-weight:500; color:var(--muted); }
.text-button:hover { text-decoration:underline; }
.progress-track { height:9px; border-radius:9px; overflow:hidden; background:var(--line); margin-bottom:18px; }
.progress-track>div { height:100%; width:0; background:#86a76b; transition:width .25s; }
.question-card { border:2px solid var(--green); border-radius:17px; padding:22px 24px 0;
  background:var(--white); box-shadow:4px 4px 0 var(--green); }
.card-kicker { display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between; margin-bottom:23px; }
.question-tag { font-size:11px; font-weight:700; background:var(--mint); border-radius:6px; padding:5px 8px; }
.card-kicker>span:last-child { font-size:12px; color:var(--muted); }
.question-context,.question-text { font-family:inherit; font-size:18px; font-weight:500;
  line-height:1.85; margin-bottom:2px; overflow-wrap:anywhere; }
.question-context-zh,.question-text-zh { font-size:16px; font-weight:500; color:var(--muted);
  line-height:1.85; margin:0 0 12px; overflow-wrap:anywhere; }
.equation { font:500 32px/1.65 Georgia,"Times New Roman",serif; text-align:center; margin:16px 0 20px; overflow-wrap:anywhere; }
.question-text { margin-bottom:2px; }
.question-text-zh { margin-bottom:25px; }
.question-text mark { color:inherit; background:var(--mint); border-radius:3px; padding:2px; }
.question-footer { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap;
  gap:6px 14px; border-top:1px solid var(--line); padding:8px 0; }
.question-footer>span { font-size:12px; color:var(--muted); }
.hint-button { font-size:13px; font-weight:700; color:var(--green); min-height:44px; padding:8px 0; }
.hint-box { border-top:1px solid var(--line); font-size:14px; line-height:1.85; padding:14px 0 20px; }
.thinking-card { margin-top:24px; }
.answer-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 12px; margin-bottom:12px; }
.answer-heading h2 { display:flex; align-items:center; gap:9px; font-size:17px; font-weight:700; margin:0; }
.step-circle { display:grid; place-items:center; width:25px; height:25px; border-radius:8px;
  font-size:13px; background:var(--mint); color:var(--green); font-weight:800; flex-shrink:0; }
.answer-heading>span { font-size:12px; color:var(--muted); }
.input-label { display:block; font-size:13px; color:var(--muted); margin:9px 0; }
textarea,input { width:100%; min-width:0; padding:14px; font-size:16px; line-height:1.8;
  border:2px solid var(--line); border-radius:var(--radius); color:var(--ink); background:#fff; }
textarea { resize:vertical; min-height:125px; }
textarea::placeholder,input::placeholder { color:#82917c; font-size:14px; }
.mc-options { display:flex; flex-direction:column; gap:10px; }
.mc-option { display:flex; align-items:flex-start; gap:12px; width:100%; text-align:left;
  border:2px solid var(--line); background:var(--white); border-radius:var(--radius);
  padding:14px 16px; min-height:52px; font-size:15px; font-weight:500; line-height:1.65;
  box-shadow:0 3px 0 var(--line); }
.mc-letter { flex-shrink:0; width:28px; height:28px; display:grid; place-items:center;
  background:var(--mint); color:var(--green); border-radius:8px; font-weight:800; font-size:13px; margin-top:1px; }
.mc-option.selected { background:var(--mint); border-color:#9bb582; box-shadow:0 3px 0 #9bb582; }
.mc-option.is-correct { background:var(--ok-soft); border-color:var(--ok); box-shadow:0 3px 0 var(--ok); }
.mc-option.is-wrong { background:var(--bad-soft); border-color:var(--bad); box-shadow:0 3px 0 #d4b48a; }
.answer-zone { min-height:108px; background:#fff; border-radius:var(--radius);
  border:2px dashed var(--line); padding:10px 14px; display:flex; flex-direction:column; }
.answer-zone.is-correct { border:2px solid var(--ok); background:var(--ok-soft); }
.answer-zone.is-wrong { border:2px solid var(--bad); background:var(--bad-soft); }
.answer-label { font-size:12px; color:var(--muted); font-weight:700; }
.answer-display { flex:1; display:flex; align-items:center; justify-content:center; flex-wrap:wrap;
  font-family:Georgia,"Times New Roman",serif; font-size:32px; padding:8px 0; overflow-wrap:anywhere; overflow-x:auto; min-height:52px; }
.answer-msg { margin:0; min-height:18px; font-size:13px; color:var(--bad); text-align:center; font-weight:500; }
.placeholder { font-family:"Noto Sans HK",system-ui,sans-serif; font-size:15px; color:#82917c; }
.pad-dock { margin-top:14px; }
.keypad { display:grid; grid-template-columns:1fr 1fr; gap:8px 12px; margin-bottom:12px; }
.pad-letters,.pad-nums { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.pad-bottom { grid-column:1 / -1; display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.key { height:48px; border-radius:10px; background:var(--white); font-size:19px;
  border:1.5px solid var(--line); box-shadow:0 3px 0 var(--line);
  display:flex; align-items:center; justify-content:center; gap:2px;
  user-select:none; -webkit-user-select:none; }
.key:active { transform:translateY(3px); box-shadow:0 0 0 var(--line); }
.key:disabled { opacity:.45; transform:none; }
.k-var { font-family:Georgia,"Times New Roman",serif; font-style:italic; font-size:22px; background:#fff; }
.k-sym { font-family:Georgia,"Times New Roman",serif; font-style:normal; font-size:21px; background:#fff; }
.k-num { font-family:Georgia,"Times New Roman",serif; font-style:normal; font-size:20px; background:#f7f9f0; }
.k-op { font-family:Georgia,"Times New Roman",serif; font-size:19px; background:var(--soft); border-color:#c9d4bc; box-shadow:0 3px 0 #c9d4bc; }
.k-op sup { font-size:12px; margin-top:-8px; }
.k-ctrl { font-size:15px; font-weight:700; background:var(--soft); border-color:#c9d4bc; box-shadow:0 3px 0 #c9d4bc; }
.thinking-actions { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:center; gap:12px; }
.thinking-actions .text-button { font-size:15px; padding:14px 8px; border-radius:var(--radius); }
.primary,.secondary { display:inline-flex; justify-content:center; align-items:center; gap:14px;
  min-height:52px; border-radius:var(--radius); padding:14px 17px; font-size:16px; font-weight:700;
  background:var(--green); color:white; box-shadow:0 4px 0 var(--green-dark); }
.secondary { background:var(--white); color:var(--green); border:2px solid var(--line); box-shadow:0 3px 0 var(--line); }
.primary:hover:not(:disabled) { background:#30614f; }
.primary:active:not(:disabled),.secondary:active:not(:disabled),.nav-item:active,.mc-option:active:not(:disabled),.key:active { transform:translateY(2px); box-shadow:0 1px 0 var(--green-dark); }
.mc-option:active:not(:disabled) { box-shadow:0 1px 0 var(--line); }
.validation { color:#94581e; font-size:13px; margin:0 0 12px; }
.result-banner { border-radius:12px; padding:14px 16px; margin-bottom:16px; font-size:16px; font-weight:700; line-height:1.7; }
.result-banner.ok { background:var(--ok-soft); color:var(--ok); border:2px solid var(--ok); }
.result-banner.bad { background:var(--bad-soft); color:var(--bad); border:2px solid #d4b48a; }
.result-banner .expected { display:block; font-weight:500; font-size:15px; margin-top:4px; color:var(--ink); }
.result-banner .expected-math { font-family:Georgia,"Times New Roman",serif; font-size:22px; font-weight:700; }
.answer-card { margin-top:28px; padding:22px; border:2px solid #b7cba3; border-radius:17px;
  background:#f8fbf2; scroll-margin-top:18px; }
.answer-card .reference-badge { font-size:12px; }
.reference-row { display:grid; grid-template-columns:80px minmax(0,1fr); gap:15px; padding:15px 0; border-bottom:1px solid var(--line); }
.reference-row:last-child { border:0; }
.reference-row .label { color:var(--muted); font-size:13px; padding-top:3px; font-weight:500; }
.reference-row .value { font-size:15px; line-height:1.85; overflow-wrap:anywhere; }
.reference-row.formula .value { font-size:19px; font-weight:700; }
.trap { color:#805d2b; background:#faf0da; border-radius:12px; padding:14px; margin-top:15px; font-size:14px; line-height:1.8; }
.next-button { width:100%; margin-top:18px; }
.page-footer { border-top:1px solid var(--line); padding-top:18px; margin-top:32px;
  display:flex; justify-content:space-between; gap:8px 18px; flex-wrap:wrap; color:var(--muted); font-size:11px; line-height:1.8; }
.footer-dot { margin:0 6px; }
.section-intro { margin-bottom:24px; }
.section-intro p,.map-intro { font-size:14px; color:var(--muted); }
.section-intro .primary { width:100%; }
.list-item { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:20px;
  margin-bottom:14px; background:var(--white); border:2px solid var(--line); border-radius:var(--radius); }
.list-item h3 { font:500 20px/1.6 Georgia,serif; margin:0 0 7px; overflow-wrap:anywhere; }
.list-item p { font-size:12px; color:var(--muted); margin:0; }
.list-item .secondary { font-size:13px; white-space:nowrap; min-height:44px; }
.empty-state { text-align:center; padding:35px 20px; border:2px solid var(--line); border-radius:var(--radius); background:var(--white); }
.empty-state>div { font-size:36px; color:#8aa26c; margin-bottom:12px; }
.empty-state h2 { font-size:21px; line-height:1.6; }
.empty-state p { font-size:14px; color:var(--muted); }
.empty-state .text-button { display:block; margin:12px auto 0; }
.map-grid { display:grid; gap:16px; }
.map-card { padding:22px; border:2px solid var(--line); border-radius:var(--radius); background:var(--white); overflow-wrap:anywhere; }
.map-label { font-size:12px; color:var(--muted); margin-bottom:10px; }
.map-card h3 { font-size:20px; line-height:1.6; margin-bottom:10px; }
.map-card p { font-size:14px; color:var(--muted); margin-bottom:10px; }
.map-card .map-tool { font-size:19px; color:var(--green); font-weight:700; }
dialog { width:min(650px,calc(100% - 24px)); max-height:90vh; padding:27px; background:var(--white);
  border:2px solid var(--green); border-radius:17px; color:var(--ink); box-shadow:5px 5px 0 var(--green); }
dialog::backdrop { background:#15281e70; }
.editor-heading { display:flex; align-items:start; justify-content:space-between; gap:12px; }
.eyebrow { color:var(--muted); font-size:11px; margin-bottom:10px; }
.editor-heading h2 { font-size:23px; font-weight:900; line-height:1.6; margin-bottom:12px; }
.close-button { font-size:28px; min-width:44px; min-height:44px; line-height:1; }
.editor-note { color:var(--muted); font-size:13px; }
#editor-form>label,.editor-grid>label { display:block; font-size:14px; margin-top:17px; }
#editor-form input,#editor-form textarea,#editor-form select { width:100%; margin-top:7px; font-size:16px; }
#editor-form textarea { min-height:80px; }
.editor-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.editor-actions,.editor-backup { display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-top:22px; }
.editor-actions>button { font-size:14px; }
.editor-backup { border-top:1px solid var(--line); padding-top:12px; }
#editor-message { font-size:13px; line-height:1.8; color:var(--green); margin-top:15px; }
#toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); max-width:90vw;
  padding:14px 20px; border-radius:var(--radius); background:var(--green); color:#fff; font-size:14px; z-index:10; }
@media(max-width:480px) {
  .app-shell { padding:22px 16px 34px; }
  .brand { font-size:23px; gap:12px; }
  .brand-icon { width:50px; height:50px; font-size:39px; border-radius:17px; }
  .brand small { font-size:11px; }
  .page-heading { margin-top:16px; }
  h1 { font-size:22px; }
  .page-heading p { font-size:13px; }
  .nav-item { padding:9px 7px; font-size:13px; gap:6px; }
  .practice-toolbar { gap:8px; }
  .segmented { gap:4px; }
  .segmented button { font-size:12px; padding:8px; }
  .topic-label { gap:5px; font-size:12px; }
  .topic-label select { font-size:12px; max-width:110px; padding:9px 6px; }
  .question-card { padding:19px 18px 0; }
  .question-context,.question-text { font-size:17px; }
  .question-context-zh,.question-text-zh { font-size:15px; }
  .equation { font-size:29px; }
  .answer-heading>span { font-size:11px; }
  .answer-card { padding:19px 16px; }
  .reference-row { grid-template-columns:65px minmax(0,1fr); gap:11px; }
  .reference-row .label { font-size:12px; }
  .reference-row .value { font-size:14px; }
  .reference-row.formula .value { font-size:18px; }
  .thinking-actions { gap:8px; }
  .thinking-actions .text-button { font-size:14px; padding:13px 3px; }
  .thinking-actions .primary { padding:14px 10px; font-size:15px; gap:9px; }
  .key { height:46px; font-size:18px; }
  .k-var { font-size:20px; }
  .k-ctrl { font-size:14px; }
  .answer-display { font-size:28px; }
  .list-item { padding:17px 14px; align-items:start; }
  .list-item h3 { font-size:17px; }
  .list-item .secondary { padding:10px; }
  .editor-grid { grid-template-columns:1fr; gap:0; }
  dialog { padding:22px 18px; }
  .editor-heading h2 { font-size:21px; }
}
@media(max-width:360px) {
  .app-shell { padding-left:12px; padding-right:12px; }
  .nav-item { font-size:12px; gap:5px; padding:9px 5px; }
  .practice-toolbar { flex-wrap:wrap; }
  .topic-label { margin-left:auto; }
  .question-context,.question-text { font-size:16px; }
  .equation { font-size:27px; }
  .keypad { gap:6px 8px; }
  .pad-letters,.pad-nums,.pad-bottom { gap:4px; }
  .key { height:44px; font-size:17px; }
}
@media(prefers-reduced-motion:reduce) { * { transition:none!important; scroll-behavior:auto!important; animation:none!important; } }
