:root{font-family:"Noto Sans TC","Microsoft JhengHei",system-ui,sans-serif;color:#1f2730;background:#f5f7f6;font-synthesis:none}*{box-sizing:border-box}body{margin:0;min-height:100vh}button,input,select,textarea{font:inherit}button{cursor:pointer}.workspace{max-width:1370px;margin:0 auto;padding:30px 32px 70px}.page-header{border-bottom:1px solid #dce3e0;padding-bottom:24px;margin-bottom:0}.brand{display:flex;align-items:center;gap:9px;color:#206d60;font-size:11px;font-weight:800;letter-spacing:0}.brand-mark{display:grid;place-items:center;width:28px;height:28px;border:1px solid #168a72;background:#e8f3ef;color:#147562;font-size:23px;line-height:1}.header-row{display:flex;align-items:end;justify-content:space-between;gap:24px;margin-top:17px}h1{font-size:28px;line-height:1.25;letter-spacing:0;margin:0 0 8px}.page-header p{font-size:13px;color:#62716e;line-height:1.65;margin:0;max-width:680px}.category-tabs{display:flex;flex-wrap:wrap;gap:5px;border-bottom:1px solid #ccd7d2}.category-tabs[hidden]{display:none}.category-tab{border:0;border-bottom:2px solid transparent;background:transparent;color:#52635d;padding:9px 14px;font-size:13px;font-weight:700}.category-tab[aria-selected=true]{border-color:#117861;color:#126a57}.mode-tabs{display:flex;flex-wrap:wrap;gap:0;border-bottom:1px solid #dce3e0;margin:0 0 27px}.mode-tabs button{background:transparent;border:0;border-bottom:2px solid transparent;color:#697873;font-size:13px;font-weight:700;padding:14px 18px 12px}.mode-tabs button:first-child{padding-left:4px}.mode-tabs button[aria-selected=true]{color:#116d58;border-bottom-color:#138269}.mode-tabs button:focus-visible,.category-tab:focus-visible{outline:2px solid #80cdb2;outline-offset:-2px}.layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(380px,.87fr);gap:28px;align-items:start}.controls{min-width:0}.control-section{padding:0 0 24px;margin:0 0 25px;border-bottom:1px solid #dce3e0}.control-section:last-child{border:0}.section-heading{display:flex;align-items:baseline;gap:12px;margin-bottom:5px}.section-number,.section-kicker{font-size:11px;line-height:1.4;font-weight:800;color:#258672}.section-heading h2,.output h2{font-size:17px;line-height:1.35;margin:0}.hint{color:#687670;line-height:1.65;font-size:12px;margin:0 0 15px}.field{margin-top:15px}.field-label{display:block;font-size:12px;font-weight:700;color:#475651;margin-bottom:7px}.choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:13px}.choice{position:relative;cursor:pointer;min-width:0}.choice input{position:absolute;opacity:0;width:1px;height:1px}.choice-body{display:block;height:100%;min-height:62px;border:1px solid #d4deda;border-radius:6px;background:#fff;padding:10px 12px;transition:background .15s,border-color .15s,box-shadow .15s}.choice-title{display:block;font-size:13px;font-weight:700;line-height:1.4}.choice-detail{display:block;color:#73817b;font-size:11px;line-height:1.45;margin-top:3px}.choice input:checked+.choice-body{border-color:#12816a;background:#e9f5f0;box-shadow:inset 0 0 0 1px #12816a}.choice input:focus-visible+.choice-body{outline:3px solid #9fd8c5;outline-offset:2px}.checkbox-field{display:flex;align-items:flex-start;gap:9px;margin-top:13px;font-size:12px;line-height:1.6;color:#394841;cursor:pointer}.checkbox-field input{margin:3px 0 0;accent-color:#138269;width:15px;height:15px;flex:none}.field input[type=text],.field select,.field textarea{display:block;width:100%;border:1px solid #c9d5d0;border-radius:5px;padding:9px 11px;background:#fff;color:#1f2730;font-size:13px;line-height:1.5}.field textarea{resize:vertical;min-height:80px}.field input:focus-visible,.field select:focus-visible,.field textarea:focus-visible,#result:focus-visible{outline:2px solid #80cdb2;outline-offset:1px}.dependent{border-left:2px solid #b2d7c9;margin:13px 0 0 3px;padding:1px 0 1px 14px}.dependent .field:first-child{margin-top:8px}.output{position:sticky;top:20px;min-width:0;background:#fff;border:1px solid #d4ded9;border-radius:6px;padding:21px;box-shadow:0 8px 28px #1e47300b}.output-header{display:flex;justify-content:space-between;align-items:end;gap:10px;margin-bottom:13px}.output h2{margin-top:4px}.char-count{font-size:11px;color:#82908b;white-space:nowrap}#result{display:block;width:100%;min-height:540px;max-height:70vh;resize:vertical;border:1px solid #cbd6d1;border-radius:5px;background:#fbfcfb;color:#27342f;padding:14px;font-size:12px;line-height:1.85}#result:disabled{color:#788680}.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.actions button{border:1px solid #146d59;border-radius:5px;background:#177d64;color:white;padding:9px 12px;font-size:12px;font-weight:700;min-height:36px}.actions button.secondary{background:#fff;color:#176e59}.actions button.quiet{background:transparent;color:#53645d;border-color:transparent;margin-left:auto}.actions button:hover:not(:disabled){filter:brightness(.94)}.actions button:disabled{opacity:.5;cursor:not-allowed}.status{min-height:18px;font-size:12px;color:#197057;margin:9px 0 0}.status.error{color:#a0443b}.output-note{margin:9px 0 0;padding-top:13px;border-top:1px solid #e5ebe7;color:#75837d;font-size:11px;line-height:1.65}.is-hidden{display:none!important}@media(max-width:900px){.layout{grid-template-columns:1fr}.output{position:static}#result{min-height:370px;max-height:none}.workspace{padding:22px 20px 50px}}@media(max-width:560px){.workspace{padding:17px 14px 40px}.header-row{display:block}.category-tabs{margin-top:16px}.choices{grid-template-columns:1fr}.choice-body{min-height:55px}.output{padding:15px}.actions button.quiet{margin-left:0}h1{font-size:23px}}
.mode-tabs[hidden]{display:none}

/* 展示模式與設定區塊的色彩層次 */
:root{background:#edf2ed}
.page-header{background:#e0ece4;border:1px solid #c3d8cc;border-radius:12px;padding:24px;margin-bottom:18px}
.mode-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;border:0;margin-bottom:28px;padding:0}
.mode-tabs button,.mode-tabs button:first-child{display:flex;align-items:center;justify-content:center;gap:10px;min-height:64px;padding:16px 20px;border:1px solid #99b7a8;border-radius:8px;background:#e0ece4;color:#285d48;font-size:16px;transition:background .15s,border-color .15s}
.mode-tabs button::before{content:'◇';font-size:23px;line-height:1}
.mode-tabs button[data-mode=backlit]{background:#f7e8ce;border-color:#d4b278;color:#79501a}
.mode-tabs button[data-mode=backlit]::before{content:'☀'}
.mode-tabs button[data-mode=held]::before{content:'✋'}
.mode-tabs button[aria-selected=true]{background:#24634e;border-color:#24634e;color:#fffaf0;box-shadow:0 3px 0 #164632}
.mode-tabs button[data-mode=backlit][aria-selected=true]{background:#845719;border-color:#845719;color:#fffaf0;box-shadow:0 3px 0 #5f3c0f}
.mode-tabs button[aria-selected=true]::after{content:'✓';font-weight:800;font-size:18px}
.mode-tabs button:hover{border-color:currentColor}
.mode-tabs button:focus-visible,.category-tab:focus-visible{outline:3px solid #234b71;outline-offset:4px}
.control-section{--section-bg:#e5eee7;--section-border:#bfd3c4;--section-ink:#2b6348;background:var(--section-bg);border:1px solid var(--section-border);border-radius:10px;padding:20px;margin-bottom:18px}
.control-section[data-section=angle]{--section-bg:#e5edf5;--section-border:#bdcfdf;--section-ink:#355e81}
.control-section[data-section=backlight],.control-section[data-section=extras]{--section-bg:#f6ead6;--section-border:#dfcaa8;--section-ink:#79551f}
.control-section:last-child{border:1px solid var(--section-border);margin-bottom:0}
.section-heading{align-items:center;gap:10px;margin-bottom:8px}
.section-number{display:grid;place-items:center;min-width:28px;height:28px;border-radius:5px;background:var(--section-ink);color:#fffaf0}
.section-heading h2{color:var(--section-ink)}
.hint{color:#4b5d56}
.choice-body{background:#fcfdf9;border-color:var(--section-border)}
.choice input:checked+.choice-body{border-color:var(--section-ink);background:#fcfdf9;box-shadow:inset 0 0 0 1px var(--section-ink)}
.choice-title{color:#283e34}.choice-detail{color:#54675d}
.output{background:#dfeaf3;border-color:#b7cddd;box-shadow:none;padding:23px}
.output h2,.section-kicker{color:#2b5274}.char-count{color:#4b647a}
#result{background:#f7fafc;border-color:#a9c1d3;color:#263d50}
.actions button{background:#315f82;border-color:#315f82}
.actions button.secondary{background:#edf4f9;color:#315f82}
.actions button.quiet{color:#435c70}.actions button:focus-visible{outline:3px solid #234b71;outline-offset:3px}
.output-note{border-color:#b7cddd;color:#4b647a}
@media(max-width:560px){.page-header{padding:18px}.mode-tabs{grid-template-columns:1fr;gap:8px;margin-bottom:22px}.mode-tabs button,.mode-tabs button:first-child{min-height:60px;padding:13px 8px;font-size:15px;gap:6px}.control-section{padding:16px}.output{padding:16px}}
@media(prefers-reduced-motion:reduce){.mode-tabs button,.choice-body{transition:none}}

/* 明暗主題切換 */
:root{color-scheme:light}
.header-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.theme-toggle{min-height:40px;padding:8px 12px;border:1px solid #99b7a8;border-radius:6px;background:#f3f8f3;color:#285d48;font-size:12px;font-weight:700;white-space:nowrap}
.theme-toggle:hover{background:#d4e4d8}
.theme-toggle:focus-visible{outline:3px solid #234b71;outline-offset:3px}
:root[data-theme=dark]{color-scheme:dark;color:#e0e9e3;background:#141c19}
[data-theme=dark] .page-header{background:#22362c;border-color:#3d594b}
[data-theme=dark] .brand{color:#a7d7be}
[data-theme=dark] .brand-mark{background:#2a4437;color:#b0dfc6;border-color:#79ac93}
[data-theme=dark] .page-header p{color:#bbcdc1}
[data-theme=dark] .theme-toggle{background:#2b4436;border-color:#6b917d;color:#e0eede}
[data-theme=dark] .theme-toggle:hover{background:#385742}
[data-theme=dark] .mode-tabs button{background:#253e31;border-color:#5b826d;color:#c4e3ce}
[data-theme=dark] .mode-tabs button[data-mode=backlit]{background:#423522;border-color:#977849;color:#f0d39d}
[data-theme=dark] .mode-tabs button[aria-selected=true]{background:#a7d4b7;border-color:#a7d4b7;color:#183424;box-shadow:0 3px 0 #628b70}
[data-theme=dark] .mode-tabs button[data-mode=backlit][aria-selected=true]{background:#e4bd77;border-color:#e4bd77;color:#35250d;box-shadow:0 3px 0 #957543}
[data-theme=dark] .control-section{--section-bg:#23372d;--section-border:#456252;--section-ink:#aad6b8}
[data-theme=dark] .control-section[data-section=angle]{--section-bg:#233440;--section-border:#486173;--section-ink:#afcfe6}
[data-theme=dark] .control-section[data-section=backlight],[data-theme=dark] .control-section[data-section=extras]{--section-bg:#3b3225;--section-border:#766246;--section-ink:#e5c48f}
[data-theme=dark] .section-number{color:#1c2c23}
[data-theme=dark] .hint,[data-theme=dark] .field-label,[data-theme=dark] .checkbox-field{color:#d0dbd1}
[data-theme=dark] .choice-body{background:#19271f}
[data-theme=dark] .choice input:checked+.choice-body{background:#304437}
[data-theme=dark] .choice-title{color:#e1ebe3}
[data-theme=dark] .choice-detail{color:#bbcec0}
[data-theme=dark] .field input[type=text],[data-theme=dark] .field select,[data-theme=dark] .field textarea{background:#18221d;border-color:#64786b;color:#e1ebe3}
[data-theme=dark] input::placeholder,[data-theme=dark] textarea::placeholder{color:#a8b9ae}
[data-theme=dark] .dependent{border-color:#6d9680}
[data-theme=dark] .checkbox-field input{accent-color:#aad6b8}
[data-theme=dark] .output{background:#223441;border-color:#4b687c}
[data-theme=dark] .output h2,[data-theme=dark] .section-kicker{color:#b8d8ee}
[data-theme=dark] .char-count,[data-theme=dark] .output-note{color:#bacbd9}
[data-theme=dark] #result{background:#15242e;border-color:#506d82;color:#dde7ed}
[data-theme=dark] .actions button{background:#b0cfe5;border-color:#b0cfe5;color:#203a4d}
[data-theme=dark] .actions button.secondary{background:#2d4658;color:#d5e5f0;border-color:#7897ae}
[data-theme=dark] .actions button.quiet{background:transparent;border-color:transparent;color:#c1d2df}
[data-theme=dark] .output-note{border-color:#4b687c}
[data-theme=dark] .status{color:#b3dcbf}
[data-theme=dark] .status.error{color:#ffb9ad}
[data-theme=dark] .category-tabs{border-color:#5b826d}
[data-theme=dark] .category-tab{color:#bbcdc1}
[data-theme=dark] .category-tab[aria-selected=true]{color:#b7e0c6;border-color:#b7e0c6}
[data-theme=dark] button:focus-visible{outline-color:#e5c48f}
