*,*::before,*::after{box-sizing:border-box}
:root{
  color-scheme:light;
  --bg:#faf7f2;--surface:#fff;--surface-2:#f1ece2;--line:rgba(58,58,58,.12);
  --text:#3a3a3a;--text-2:#6b675f;--text-3:#9b958b;
  --brand:#446f9c;--brand-press:#3d6690;--brand-soft:#e4edf6;--brand-text:#446f9c;--on-brand:#fff;
  --warm:#f0a640;--warm-soft:#fbe9cc;
  --ok:#4a6b37;--ok-soft:#e8f2e1;--bad:#b04a45;--bad-soft:#fce8e4;
  --font:ui-rounded,-apple-system,BlinkMacSystemFont,"SF Pro Rounded","PingFang TC","Noto Sans TC","Microsoft JhengHei",system-ui,sans-serif;
  --num:ui-rounded,"SF Pro Rounded",-apple-system,system-ui,sans-serif;
}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){
  color-scheme:dark;
  --bg:#202a3a;--surface:#2c394e;--surface-2:#18202c;--line:rgba(160,174,192,.22);
  --text:#fafafa;--text-2:#a0aec0;--text-3:#7a8799;
  --brand:#6ba4e8;--brand-press:#8bb8ee;--brand-soft:#24354b;--brand-text:#9cc4f1;--on-brand:#14202e;
  --warm:#e29a3c;--warm-soft:#4a3a22;
  --ok:#a7d68f;--ok-soft:#27402a;--bad:#f3a097;--bad-soft:#4a2a2a;
}}
:root[data-theme=dark]{
  color-scheme:dark;
  --bg:#202a3a;--surface:#2c394e;--surface-2:#18202c;--line:rgba(160,174,192,.22);
  --text:#fafafa;--text-2:#a0aec0;--text-3:#7a8799;
  --brand:#6ba4e8;--brand-press:#8bb8ee;--brand-soft:#24354b;--brand-text:#9cc4f1;--on-brand:#14202e;
  --warm:#e29a3c;--warm-soft:#4a3a22;
  --ok:#a7d68f;--ok-soft:#27402a;--bad:#f3a097;--bad-soft:#4a2a2a;
}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:17px;line-height:1.8}
a{color:var(--brand-text)}
a:focus-visible,button:focus-visible,input:focus-visible,label:focus-within{outline:3px solid var(--brand);outline-offset:2px;border-radius:6px}
h1,h2,h3,.quick-h,.toc-h{line-height:1.35;text-wrap:balance;margin:0}
p{margin:0}
p,li,td,th,.formula-expr,.formula-note,figcaption,.card-link span{overflow-wrap:anywhere}
.site{position:sticky;top:0;z-index:10;background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-bottom:1px solid var(--line);padding-top:env(safe-area-inset-top,0px)}
.site-in{max-width:1120px;margin:0 auto;padding:10px 20px;display:flex;align-items:center;gap:14px}
.logo{display:flex;align-items:center;gap:8px;text-decoration:none;color:var(--text);font-weight:700;font-size:18px}
.beta{font-size:12px;font-weight:700;color:var(--warm);background:var(--warm-soft);border-radius:999px;padding:2px 8px;white-space:nowrap}
.logo img{width:30px;height:30px;border-radius:8px}
.site nav{display:flex;gap:4px;flex-wrap:wrap;margin-left:auto}
.site-in .beta{margin-right:auto}
.site nav a{color:var(--text-2);text-decoration:none;font-size:15px;padding:6px 10px;border-radius:999px}
.site nav a[aria-current]{color:var(--brand-text);background:var(--brand-soft)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 18px;border-radius:999px;border:0;background:var(--brand);color:var(--on-brand);font:inherit;font-size:16px;font-weight:600;text-decoration:none;cursor:pointer}
.btn:hover{background:var(--brand-press)}
.btn.ghost{background:var(--surface);color:var(--brand-text);box-shadow:inset 0 0 0 1.5px var(--brand)}
.btn.small{min-height:38px;font-size:15px;padding:0 14px}
.site .btn{min-height:38px;font-size:15px}
.wrap{max-width:1120px;margin:0 auto;padding-inline:20px;padding-block:24px 64px;display:grid;grid-template-columns:minmax(0,1fr);gap:32px}
@media (min-width:1000px){.wrap{grid-template-columns:220px minmax(0,720px);justify-content:center;column-gap:48px}.toc{position:sticky;top:84px;align-self:start;grid-row:1/span 2}}
.crumbs{font-size:14px;color:var(--text-3);display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.crumbs a{color:var(--text-2);text-decoration:none}
.crumbs span[aria-hidden]{color:var(--text-3)}
.head h1{font-size:clamp(30px,6vw,42px);font-weight:800;letter-spacing:.01em}
.lead{display:grid;gap:10px;margin-top:14px;color:var(--text-2);font-size:18px}
.quick{margin-top:22px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:18px 20px}
.quick h2,.quick-h{font-size:16px;font-weight:700;color:var(--brand-text);margin-bottom:8px}
.quick ul{margin:0;padding-left:1.2em;display:grid;gap:6px}
.toc{font-size:15px}
.toc-h{font-size:13px;letter-spacing:.12em;color:var(--text-3);font-weight:600;margin-bottom:8px}
.toc ol{list-style:none;margin:0;padding:0;display:grid;gap:2px;border-left:2px solid var(--line)}
.toc a{display:block;padding:4px 12px;color:var(--text-2);text-decoration:none;margin-left:-2px;border-left:2px solid transparent}
.toc a:hover{color:var(--brand-text);border-left-color:var(--brand)}
@media (max-width:999px){.toc{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px 16px}.toc ol{border:0}.toc a{border:0;padding:3px 0;margin:0}}
main{display:grid;gap:44px;min-width:0}
.block{display:grid;gap:14px;scroll-margin-top:84px;min-width:0}
.block>*,.panel>*{min-width:0}
.block h2{font-size:26px;font-weight:800}
.block p{max-width:66ch}
.block ol.steps,.block ul.tips{margin:0;padding-left:1.3em;display:grid;gap:10px;max-width:66ch}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:16px}
.seg{display:inline-flex;background:var(--surface-2);border-radius:999px;padding:3px;gap:2px}
.seg button{border:0;background:transparent;color:var(--text-2);font:inherit;font-size:15px;padding:6px 14px;border-radius:999px;cursor:pointer;min-height:36px}
.seg button[aria-pressed=true]{background:var(--surface);color:var(--text);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.t99-bar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;margin-bottom:12px}
.t99-say{min-height:1.8em;font-size:18px;color:var(--brand-text);font-weight:600}
.t99-scroll{overflow-x:auto}
.t99{border-collapse:separate;border-spacing:3px;width:100%;min-width:300px;font-family:var(--num);font-variant-numeric:tabular-nums;text-align:center}
.t99 th{font-size:14px;color:var(--text-3);font-weight:600;padding:4px 0}
.t99 td{padding:0}
.t99 button{width:100%;min-width:0;padding:0;aspect-ratio:1/1;max-height:56px;border:0;border-radius:10px;background:var(--surface-2);color:var(--text);font:inherit;font-size:clamp(14px,2.6vw,18px);font-weight:600;cursor:pointer}
.t99 button.sq{background:var(--warm-soft)}
.t99 button.hl{background:var(--brand-soft);color:var(--brand-text)}
.t99 button.on{background:var(--brand);color:var(--on-brand)}
.t99.hide button:not(.shown){color:transparent}
.t99.hide button:not(.shown)::after{content:"?";color:var(--text-3)}
.t99-foot{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.kj{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px 18px;margin:0;padding:0;list-style:none}
.kj li{display:flex;justify-content:space-between;gap:10px;border-bottom:1px dashed var(--line);padding:4px 0}
.kj b{font-weight:600}
.kj span{color:var(--text-3);font-family:var(--num);font-variant-numeric:tabular-nums;white-space:nowrap}
.kj-group{display:grid;gap:10px}
.kj-group h3{font-size:16px;color:var(--text-2)}
.try-picks{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px}
.chip{border:1.5px solid var(--line);background:var(--surface);color:var(--text);font:inherit;font-size:15px;border-radius:999px;padding:4px 14px;cursor:pointer;min-height:38px}
.chip[aria-pressed=true]{border-color:var(--brand);background:var(--brand-soft);color:var(--brand-text);font-weight:600}
.try-stage{display:grid;justify-items:center;gap:14px;padding:18px 8px;text-align:center}
.try-dots{display:flex;gap:6px}
.try-dots i{width:10px;height:10px;border-radius:50%;background:var(--surface-2)}
.try-dots i.ok{background:var(--ok)}
.try-dots i.bad{background:var(--bad)}
.try-dots i.now{box-shadow:0 0 0 2px var(--brand)}
.try-q{font-family:var(--num);font-size:clamp(40px,10vw,56px);font-weight:700;font-variant-numeric:tabular-nums;letter-spacing:.02em}
.try-form{display:flex;gap:10px;align-items:center}
.try-form input{width:120px;height:52px;font:inherit;font-family:var(--num);font-size:26px;text-align:center;border-radius:14px;border:2px solid var(--line);background:var(--surface);color:var(--text)}
.try-msg{min-height:1.8em;font-weight:600}
.try-msg.ok{color:var(--ok)}
.try-msg.bad{color:var(--bad)}
.try-done{font-size:22px;font-weight:700}
.ws-form{display:grid;gap:14px}
.ws-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.ws-row>span{color:var(--text-2);font-size:15px;min-width:4.5em}
.ws-row label{display:inline-flex;align-items:center;gap:6px;border:1.5px solid var(--line);border-radius:999px;padding:4px 12px;font-size:15px;cursor:pointer;min-height:38px;background:var(--surface)}
.ws-row label:has(input:checked){border-color:var(--brand);background:var(--brand-soft);color:var(--brand-text)}
.ws-row input{accent-color:var(--brand);margin:0}
.sheet{display:none;margin-top:16px}
.sheet.ready{display:block}
.sheet-hint{font-size:14px;color:var(--text-3);margin:8px 0 0}
/* 紙面：螢幕上每頁一張白紙卡片；列印時每頁剛好一張 A4（見下方 @media print） */
.sheet-pg,.sheet-key{background:#fff;color:#222;border-radius:12px;padding:24px;border:1px solid var(--line);margin-top:14px;display:flex;flex-direction:column}
.sheet-head{display:flex;justify-content:space-between;align-items:flex-end;flex-wrap:wrap;gap:10px 24px;border-bottom:2px solid #222;padding-bottom:10px}
.sheet-head-sub{font-size:15px;padding-bottom:6px}
.sheet-head-sub span{color:#555}
.sheet-name{display:grid;gap:2px}
.sheet-name b{font-size:21px;letter-spacing:.02em}
.sheet-meta{font-size:14px;color:#555}
.sheet-fields{display:flex;flex-wrap:wrap;gap:6px 18px;font-size:15px}
.sheet-fields span{display:inline-flex;align-items:flex-end;gap:4px;white-space:nowrap}
.sheet-fields i{display:inline-block;width:6.5em;border-bottom:1.5px solid #222;height:1.2em}
.sheet-fields .sheet-score i{width:3.5em}
.sheet-tip{margin:10px 0 0;font-size:15px;color:#333}
.sheet-grid{display:grid;gap:12px 16px;margin-top:14px;font-family:var(--num);font-size:19px;font-variant-numeric:tabular-nums}
.sheet-grid u,.sq-ans u{display:inline-block;min-width:2.6em;border-bottom:1.5px solid #222;text-decoration:none;text-align:center}
.sq{position:relative;break-inside:avoid;min-width:0}
.sq-n{color:#666;font-size:.8em;margin-right:6px}
.L-h{grid-template-columns:repeat(3,minmax(0,1fr))}
.L-h .sq{white-space:nowrap;display:flex;align-items:center;min-height:40px}
/* 直式和列式題：每題一個框，框的高度就是計算空間 */
.L-v,.L-vd{grid-template-columns:repeat(4,minmax(0,1fr))}
.L-vm,.L-vd2,.L-wd{grid-template-columns:repeat(3,minmax(0,1fr))}
.L-w{grid-template-columns:repeat(2,minmax(0,1fr))}
.sheet-grid:not(.L-h) .sq{border:1px solid #cfc9bd;border-radius:8px;padding:8px 10px;display:flex;flex-direction:column;align-items:center}
.L-v .sq{min-height:170px}
.L-vm .sq,.L-vd .sq,.L-vd2 .sq,.L-wd .sq{min-height:260px}
.L-w .sq{min-height:170px}
.sheet-grid:not(.L-h) .sq-n{position:absolute;top:6px;left:9px}
.sq .vert-svg{max-width:100%;height:auto;margin-top:18px;color:#222;flex:none}
.sq-q{align-self:flex-start;margin-top:22px;padding-left:2px}
.sq-ans{margin:auto 0 0;align-self:flex-end;font-size:17px;display:flex;gap:4px;align-items:flex-end;white-space:nowrap}
.L-vd .sq-ans u,.L-vd2 .sq-ans u{min-width:2em;margin-right:6px}
.sheet-url{margin:14px 0 0;font-size:13px;color:#666}
.sheet-key{display:none}
.sheet-key.show{display:flex}
.sheet-key-h{display:flex;gap:10px;align-items:baseline;margin:0 0 10px;border-bottom:2px solid #222;padding-bottom:6px}
.sheet-key-h b{font-size:18px}
.sheet-key-h span{color:#555}
.sheet-key ol{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px 14px;font-family:var(--num);font-size:15px}
.sheet-key ol:not(.L-h){grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.sheet-key li{break-inside:avoid;min-width:0}
.sheet-key ol:not(.L-h) li{display:grid;gap:2px;align-content:start;justify-items:start}
.sheet-key small{font-size:12px;color:#555}
.sheet-key .vert-svg{max-width:100%;height:auto;color:#333}
.sheet-key ol.L-vm,.sheet-key ol.L-vd2,.sheet-key ol.L-wd{grid-template-columns:repeat(3,minmax(0,1fr))}
.sheet-key ol.L-w{grid-template-columns:repeat(5,minmax(0,1fr))}
@media (max-width:640px){
  .sheet-pg,.sheet-key{padding:16px}
  .L-h,.L-v,.L-vm,.L-vd,.L-vd2,.L-wd{grid-template-columns:repeat(2,minmax(0,1fr))}
  .L-w{grid-template-columns:1fr}
  .sheet-key ol,.sheet-key ol:not(.L-h){grid-template-columns:repeat(2,minmax(0,1fr))}
}
.cta{margin-top:4px}
.calc-f{display:grid;gap:4px;font-size:14px;color:var(--text-2)}
.calc-f input,.calc-f select{height:46px;min-width:120px;font:inherit;font-size:18px;border-radius:12px;border:2px solid var(--line);background:var(--surface);color:var(--text);padding:0 10px}
.calc-wide{flex:1 1 100%}.calc-wide input{width:100%}
.calc-hint{margin:0 0 10px;font-size:14px;color:var(--text-2)}
.calc-out{margin-top:14px;display:grid;gap:8px}
.calc-big{font-size:20px;font-weight:700;color:var(--brand-text)}
.calc-vert{font-family:ui-monospace,Menlo,monospace;font-size:22px;line-height:1.5;background:var(--surface-2);border-radius:12px;padding:12px 18px;overflow-x:auto;margin:0;justify-self:start}
.formulas{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px}
.formula{display:grid;gap:4px;background:var(--brand-soft);border-radius:14px;padding:14px 16px}
.formula-name{font-size:14px;color:var(--brand-text);font-weight:600}
.formula-expr{font-size:21px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.5}
.formula-note{font-size:14px;color:var(--text-2)}
.example{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:16px 18px;display:grid;gap:8px}
.example-q{font-weight:600}
.example-no{display:inline-block;margin-right:8px;font-size:13px;color:var(--brand-text);background:var(--brand-soft);border-radius:999px;padding:0 8px}
.example-steps{margin:0;padding-left:1.3em;display:grid;gap:4px;color:var(--text-2)}
.example-a{font-weight:700;color:var(--ok)}
.fig{margin:0;display:grid;gap:6px;justify-items:center;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:16px}
.fig svg{width:100%;max-width:420px;height:auto;color:var(--text)}
.fig figcaption{font-size:14px;color:var(--text-2)}
.tbl{overflow-x:auto;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.tbl table{border-collapse:collapse;width:100%;font-size:15px;font-variant-numeric:tabular-nums}
.tbl th,.tbl td{padding:9px 12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.tbl th:first-child,.tbl td:first-child{white-space:nowrap}
.tbl th{background:var(--surface-2);font-weight:600;color:var(--text-2)}
.tbl tr:last-child td{border-bottom:0}
.note{font-size:14px;color:var(--text-2)}
.cast{margin:0;padding-left:1.2em;color:var(--text-2)}
.script{display:grid;gap:8px;margin:0;padding:0;list-style:none}
.script li{display:grid;grid-template-columns:5.5em minmax(0,1fr);gap:10px}
.script b{color:var(--brand-text);font-weight:600}
.hub-h{font-size:15px;color:var(--text-2);font-weight:600;margin:4px 0 8px}
.cards{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}
.cards-tight{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
.card-link{display:grid;gap:2px;height:100%;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:var(--surface);text-decoration:none;color:var(--text)}
.card-link:hover{border-color:var(--brand);background:var(--brand-soft)}
.card-link b{font-weight:700;color:var(--brand-text)}
.card-link span{font-size:14px;color:var(--text-2);line-height:1.6}
.related{display:grid;gap:18px}
.faq{display:grid;gap:0;border:1px solid var(--line);border-radius:16px;background:var(--surface);overflow:hidden}
.faq details{border-bottom:1px solid var(--line)}
.faq details:last-child{border:0}
.faq summary{cursor:pointer;padding:14px 18px;font-weight:600;list-style:none;display:flex;justify-content:space-between;gap:12px}
.faq summary::after{content:"+";color:var(--text-3);font-weight:400}
.faq details[open] summary::after{content:"−"}
.faq summary::-webkit-details-marker{display:none}
.faq p{padding:0 18px 16px;color:var(--text-2)}
.foot{border-top:1px solid var(--line);color:var(--text-3);font-size:14px}
.foot-in{max-width:1120px;margin:0 auto;padding:24px 20px calc(24px + env(safe-area-inset-bottom,0px));display:flex;flex-wrap:wrap;gap:8px 20px;justify-content:space-between}
.foot a{color:var(--text-2)}
@media (max-width:600px){body{font-size:16px}.block h2{font-size:22px}.site nav{display:none}.lead{font-size:17px}.script li{grid-template-columns:1fr;gap:0}}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
#print-root{display:none}
@page{size:A4;margin:12mm}
@media print{
  body>*:not(#print-root){display:none!important}
  #print-root{display:block!important;color:#000;background:#fff}
  body{background:#fff;font-size:12pt}
  #print-root .t99-bar,#print-root .t99-foot{display:none}
  #print-root .t99-scroll{overflow:visible}
  #print-root .t99 button{background:#fff!important;color:#000!important;border:1px solid #999;max-height:none;font-size:14pt}
  #print-root .t99.hide button:not(.shown){color:transparent!important}
  #print-root .t99.hide button:not(.shown)::after{content:""}
  #print-root{padding:0 .6mm;box-sizing:border-box}
  #print-root .sheet,#print-root .sheet-doc{margin:0;padding:0}
  #print-root .sheet-hint{display:none}
  /* 每頁固定一張 A4（扣掉 12mm 邊界後高 273mm，留 3mm 給印表機誤差），格子用 --rows 平均分配高度，不會有一列掉到下一頁 */
  #print-root .sheet-pg{height:270mm;margin:0;padding:0;border:0;border-radius:0;break-after:page;overflow:hidden}
  #print-root .sheet-pg.last{break-after:auto}
  #print-root .sheet-grid{flex:1;min-height:0;grid-template-rows:repeat(var(--rows),minmax(0,1fr));gap:4mm 4mm;font-size:15pt}
  #print-root .L-h{grid-template-columns:repeat(3,minmax(0,1fr));gap:0 6mm;font-size:16pt}
  #print-root .L-v,#print-root .L-vd{grid-template-columns:repeat(4,minmax(0,1fr))}
  #print-root .L-vm,#print-root .L-vd2,#print-root .L-wd{grid-template-columns:repeat(3,minmax(0,1fr))}
  #print-root .L-w{grid-template-columns:repeat(2,minmax(0,1fr))}
  #print-root .sq{min-height:0!important}
  #print-root .sheet-url{margin-top:3mm}
  #print-root .sheet-key{break-before:page;margin:0;padding:0;border:0;border-radius:0}
  #print-root .sheet-key ol{grid-template-columns:repeat(5,minmax(0,1fr))}
  #print-root .sheet-key ol:not(.L-h){grid-template-columns:repeat(4,minmax(0,1fr))}
  #print-root .sheet-key ol.L-vm,#print-root .sheet-key ol.L-vd2,#print-root .sheet-key ol.L-wd{grid-template-columns:repeat(3,minmax(0,1fr))}
  #print-root .sheet-key ol.L-w{grid-template-columns:repeat(5,minmax(0,1fr))}
}

.vert-box{background:var(--surface-2);border-radius:12px;padding:6px 10px;display:block;width:fit-content;justify-self:start;max-width:100%;overflow-x:auto;margin:8px 0 4px}.vert-svg{display:block;max-width:100%;height:auto}.vert-list{display:flex;flex-wrap:wrap;gap:12px;margin-top:8px}.vert{margin:0;display:grid;gap:4px;justify-items:start}.vert figcaption{font-size:14px;color:var(--ink-2,inherit)}
.nb{white-space:nowrap}
.ws-form{grid-template-columns:minmax(0,1fr)}.ws-row{min-width:0}.calc-f{max-width:100%;min-width:0}.calc-f select{max-width:100%;min-width:0}.calc-f input{max-width:100%}
