:root{--bg:#0f172a;--surface:#1e293b;--surface-2:#334155;--card:#f8fafc;--ink:#0f172a;--ink-light:#f8fafc;--muted:#94a3b8;--accent:#f59e0b;--accent-2:#38bdf8;--ok:#22c55e;--warn:#f97316;--bad:#ef4444;--radius:14px}*{box-sizing:border-box}body{background:var(--bg);color:var(--ink-light);margin:0;font-family:system-ui,-apple-system,Noto Sans TC,Microsoft JhengHei,sans-serif;line-height:1.45}.app-shell{max-width:1240px;margin:0 auto;padding:16px}.top-bar{background:var(--surface);border-radius:var(--radius);border:2px solid #334155;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:14px 18px;display:flex}.brand h1{color:var(--accent);margin:0;font-size:1.25rem}.brand small{color:var(--muted)}.controls-row{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.nav-tabs{flex-wrap:wrap;gap:8px;margin:14px 0;display:flex}.btn{cursor:pointer;background:var(--surface-2);color:var(--ink-light);touch-action:manipulation;border:2px solid #0000;border-radius:10px;padding:9px 14px;font-size:.92rem;font-weight:700;transition:transform 80ms}.btn:hover{filter:brightness(1.08)}.btn:active{transform:scale(.98)}.btn.active{background:var(--accent);color:#0f172a}.btn.secondary{background:#1e293b;border-color:#475569}.btn.danger{background:var(--bad);color:#fff}.btn.ok{background:var(--ok);color:#052e16}.grid-2{grid-template-columns:minmax(320px,460px) 1fr;align-items:start;gap:16px;display:grid}@media (width<=900px){.grid-2{grid-template-columns:1fr}}.panel{background:var(--surface);border-radius:var(--radius);border:2px solid #334155;padding:16px}.canvas-card{color:var(--ink);background:linear-gradient(#f1f5f9 0%,#e2e8f0 100%);border-radius:12px;flex-direction:column;align-items:center;padding:10px;display:flex}.designer-tabs{flex-wrap:wrap;gap:6px;margin:12px 0;display:flex}.designer-tabs button{flex:88px;padding:8px 6px;font-size:.84rem}.field-group{background:#0f172a;border:1px solid #334155;border-radius:10px;margin-bottom:10px;padding:12px}.field-group h4{color:var(--accent-2);justify-content:space-between;align-items:center;margin:0 0 8px;font-size:.92rem;display:flex}.chip-grid{flex-wrap:wrap;gap:6px;display:flex}.chip{color:#f8fafc;cursor:pointer;background:#1e293b;border:2px solid #475569;border-radius:10px;flex-direction:column;justify-content:center;align-items:center;gap:2px;min-width:56px;min-height:46px;padding:6px 10px;font-weight:700;display:inline-flex}.chip.selected{border-color:var(--accent);color:#fef08a;background:#451a03}.chip .sub{color:#cbd5e1;font-size:.72rem;font-weight:500}.stepper-row{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.stepper-val{text-align:center;background:#1e293b;border:1px solid #475569;border-radius:8px;min-width:68px;padding:6px 10px;font-size:1.05rem;font-weight:800}.swatch{border:2px solid #fff;border-radius:6px;width:22px;height:22px;display:inline-block}.badge{border-radius:999px;padding:2px 8px;font-size:.78rem;font-weight:700;display:inline-block}.badge.ok{color:#86efac;background:#14532d}.badge.bad{color:#fecaca;background:#7f1d1d}.badge.warn{color:#fed7aa;background:#7c2d12}.unit-table{border-collapse:collapse;width:100%;margin-top:8px;font-size:.88rem}.unit-table th,.unit-table td{text-align:left;border-bottom:1px solid #334155;padding:6px 8px}.alert-box{border-radius:10px;margin:8px 0;padding:10px 12px;font-size:.9rem}.alert-box.warn{color:#fed7aa;background:#431407;border:1px solid #f97316}.alert-box.ok{color:#bbf7d0;background:#052e16;border:1px solid #22c55e}.alert-box.bad{color:#fecaca;background:#450a0a;border:1px solid #ef4444}input[type=text],textarea,select{color:#f8fafc;background:#0f172a;border:1px solid #475569;border-radius:8px;padding:8px 10px;font-size:.92rem}.log-box{background:#020617;border:1px solid #334155;border-radius:8px;max-height:240px;padding:10px;font-family:ui-monospace,Consolas,monospace;font-size:.82rem;overflow-y:auto}@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline-offset:2px;outline:3px solid #facc15}html[data-reduced-motion=true] *,html[data-reduced-motion=true] :before,html[data-reduced-motion=true] :after{scroll-behavior:auto!important;transition:none!important;animation:none!important}html[data-high-contrast=true]{--bg:#000;--surface:#0a0a0a;--surface-2:#171717;--muted:#e2e8f0;--accent:#facc15;--accent-2:#7dd3fc;--ok:#4ade80;--bad:#f87171}html[data-high-contrast=true] .panel,html[data-high-contrast=true] .top-bar,html[data-high-contrast=true] .field-group,html[data-high-contrast=true] .btn.secondary{border-width:2px!important;border-color:#fff!important}html[data-high-contrast=true] .chip{background:#000;border-color:#e2e8f0}html[data-high-contrast=true] .chip.selected{color:#fef08a;background:#422006;border-color:#facc15}
