/* 第 6 章頁面樣式，色票沿用 style.css */
html{scroll-padding-top:96px}
nav a[aria-current="page"]{color:#d7613b;border-bottom:2px solid #d7613b}
nav{flex-shrink:0}
a:focus-visible,button:focus-visible,input:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:3px solid #1f6b59;outline-offset:2px}
.chintro{padding-top:56px;padding-bottom:30px}
.chintro h1{font-size:clamp(30px,4vw,48px);letter-spacing:-.03em;margin:14px 0}
.chintro h1 small,.demo h2 small{display:block;font-size:.42em;letter-spacing:.02em;color:var(--muted);font-weight:500;margin-top:6px}
.demo h2 small{font-size:.5em}
.toc{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}
.toc a{background:#fff;border:1px solid #d4e3dc;border-radius:30px;padding:11px 18px;font-weight:700;font-size:14px;color:#285c4c;min-height:44px;display:inline-flex;align-items:center}
.toc a:hover{background:#e7f5ee}
.demo{background:#fff;border:1px solid #e1ece7;border-radius:22px;padding:30px;margin-top:26px;margin-bottom:26px;max-width:1216px}
.demo .simple{background:#f3f8f5;border-radius:10px;padding:12px 14px;line-height:1.7}
.hint{color:var(--muted);font-size:14px;line-height:1.7}
.btn,.modebar button{border:0;background:#1f6b59;color:#fff;border-radius:10px;padding:12px 18px;font-weight:700;min-height:44px}
.btn.alt{background:#e7f2ec;color:#285c4c}
.btn:disabled{opacity:.45;cursor:not-allowed}
.row{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}
.result{background:#f3f8f5;border-radius:10px;padding:12px 14px;font-size:15px;line-height:1.7;min-height:46px}
.think{background:#fff5ed;border-radius:14px;padding:6px 20px 16px;margin-top:24px}
.think h3{font-size:16px;color:#bb6344;margin:14px 0 6px}
.think p{margin:6px 0;line-height:1.8;color:#5b4a42}
.think details{margin-top:8px}

/* 流程圖 */
.modebar{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.modebar button{background:#e7f2ec;color:#285c4c}
.modebar button[aria-pressed="true"]{background:#1f6b59;color:#fff}
.flow-layout{display:grid;grid-template-columns:minmax(260px,340px) 1fr;gap:22px;align-items:start}
.flowchart{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:0}
.flowchart li{position:relative;padding-bottom:22px}
.flowchart li:after{content:"▼";position:absolute;left:24px;bottom:2px;font-size:13px;color:#7aa597}
.flowchart li:last-child{padding-bottom:0}
.flowchart li:last-child:after{content:none}
.flowchart button{width:100%;display:flex;gap:12px;align-items:center;text-align:left;background:#f8fbf9;border:2px solid #d4e3dc;border-radius:14px;padding:10px 12px;min-height:56px;color:var(--ink)}
.flowchart button .num{flex:none;width:30px;height:30px;border-radius:50%;background:var(--dark);color:#bde9d8;display:grid;place-items:center;font-weight:900;font-size:14px}
.flowchart button b{display:block;font-size:15px}
.flowchart button small{display:block;color:var(--muted);font-size:12px}
.flowchart button[aria-current="step"]{border-color:#e7784f;background:#fff0e5;box-shadow:0 0 0 4px #fce1d4}
.flowchart button.visited{background:#e4f4ec}
.flowchart button:disabled{opacity:.45;cursor:not-allowed}
.fbadge{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#fcd34d;color:#5b3d00;font-weight:900;font-size:13px;flex:none;margin-left:auto}
.flow-loop{margin:8px 0 0;font-size:13px;color:#a55d42;font-weight:700}
.flow-detail{background:#f3f8f5;border-radius:16px;padding:20px 22px;min-height:260px;line-height:1.75}
.flow-detail h3{margin:0 0 4px;font-size:21px}
.flow-detail h3 small{display:block;font-size:13px;color:var(--muted);font-weight:500}
.flow-detail dl{margin:12px 0}
.flow-detail dt{font-weight:900;font-size:13px;color:#397d68;letter-spacing:.06em;margin-top:10px}
.flow-detail dd{margin:2px 0 0}
.flow-detail .funding{display:inline-block;background:#fef3c7;border-radius:8px;padding:4px 10px;font-weight:700;font-size:14px}
.flow-detail .nofunding{display:inline-block;background:#e7eeea;border-radius:8px;padding:4px 10px;font-size:14px;color:#4a625b}
.casebox{border-left:5px solid #e7784f;background:#fff;border-radius:10px;padding:12px 16px;margin-top:14px}
.casebox b{color:#bb6344}
.case-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.legend{font-size:13px;color:var(--muted);display:flex;gap:8px;align-items:center;margin:14px 0 0}
.legend .fbadge{margin:0;width:20px;height:20px}

/* 分類器 */
.cls-round{margin-top:14px}
.cls-round h3{font-size:18px;margin:6px 0}
.cls-status{font-size:14px;color:var(--muted);margin:6px 0}
.cls-pool{display:flex;flex-wrap:wrap;gap:10px;min-height:64px;padding:12px;border:2px dashed #cfe0d8;border-radius:14px;background:#fbfdfc}
.cls-pool.target-ok,.cls-bin.target-ok{border-color:#e7784f;background:#fff7f1}
.cls-bins{display:grid;gap:12px;margin-top:14px}
.cls-bins.n2{grid-template-columns:repeat(2,1fr)}
.cls-bins.n5{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
.cls-bin{border:2px solid #cfe0d8;border-radius:14px;padding:10px;background:#f8fbf9;min-height:110px}
.cls-bin.d0{border-color:#93c5fd;background:#f1f7ff}.cls-bin.d1{border-color:#fcd34d;background:#fffaeb}.cls-bin.d2{border-color:#c4b5fd;background:#f6f4ff}.cls-bin.d3{border-color:#fda4af;background:#fff5f6}.cls-bin.d4{border-color:#86d6b5;background:#f0fbf6}
.cls-bin.target-ok{border-color:#e7784f}
.cls-binbtn{width:100%;background:#fff;border:1px solid #cfe0d8;border-radius:10px;padding:8px 10px;font-weight:900;font-size:14px;min-height:44px;text-align:left;color:var(--ink)}
.cls-binbtn small{display:block;font-weight:500;color:var(--muted);font-size:12px}
.cls-items{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.cls-card{background:#fff;border:2px solid #d4e3dc;border-radius:12px;padding:10px 12px;text-align:left;font-size:14px;line-height:1.55;color:var(--ink);min-height:44px;max-width:100%;touch-action:manipulation}
.cls-pool .cls-card{flex:1 1 240px;max-width:360px}
.cls-card.sel{border-color:#e7784f;background:#fff0e5;box-shadow:0 0 0 4px #fce1d4}
.cls-card.ok{border-color:#35946f;background:#e4f4ec}
.cls-card.bad{border-color:#d9534f;background:#fdeceb}
.cls-card .mark{display:block;font-weight:900;font-size:13px;margin-top:6px}
.cls-card .why{display:block;font-size:13px;color:#4a625b;margin-top:4px}
.cls-ghost{position:fixed;z-index:50;pointer-events:none;opacity:.9;max-width:260px;box-shadow:0 10px 30px #0003}
.cls-card.dragging{opacity:.4}
.cls-card[data-mouse]{cursor:grab}

/* GAS */
.gas{margin-top:30px;border-top:1px solid #e7eeea;padding-top:20px}
.gas h3 small{font-size:13px;color:var(--muted);font-weight:500}
.gas-goal{background:#e4f1ea;border-radius:10px;padding:12px 14px}
fieldset.gas-pick{border:0;padding:0;margin:14px 0}
.gas-pick legend{font-weight:700;margin-bottom:8px;font-size:14px}
.pills{display:flex;flex-wrap:wrap;gap:8px}
.pill{position:relative}
.pill input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
.pill span{display:flex;align-items:center;justify-content:center;min-width:64px;min-height:44px;border:2px solid #cfe0d8;border-radius:30px;padding:0 16px;font-weight:900;background:#fff}
.pill input:checked+span{background:#1f6b59;color:#fff;border-color:#1f6b59}
.pill input:focus-visible+span{outline:3px solid #e7784f;outline-offset:2px}
.gas-desc{background:#f3f8f5;border-radius:10px;padding:12px 14px;line-height:1.7;min-height:52px}
.gas h4{margin:20px 0 8px}
.gas-q{border:1px solid #e1ece7;border-radius:12px;padding:12px 14px;margin:0 0 10px}
.gas-q legend{font-weight:700;padding:0 6px;font-size:14px}
.gas-q p{margin:4px 0 10px;line-height:1.7}
.gas-q .pills .pill span{min-width:52px;min-height:44px;padding:0 12px}
.gas-q.ok{border-color:#35946f;background:#f0faf5}
.gas-q.bad{border-color:#d9534f;background:#fff6f5}
.gas-q .fb{font-size:14px;color:#4a625b;margin-top:8px}

@media(max-width:1050px){.flow-layout{grid-template-columns:1fr}}
@media(max-width:720px){
.demo{padding:20px 16px;border-radius:16px}
.cls-bins.n2{grid-template-columns:1fr}
.flow-detail{padding:16px}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

.cls-round .result:empty,#gasResult:empty{min-height:0;padding:0;background:none}
.cls-dock{display:none}
@media(max-width:720px){
.cls-dock{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;position:fixed;left:0;right:0;bottom:0;z-index:40;padding:10px 12px calc(10px + env(safe-area-inset-bottom));background:#fffef5;border-top:2px solid #e7784f;box-shadow:0 -6px 20px #0002}
.cls-dockbtn{min-height:44px;padding:6px 8px;border:1px solid #cfe0d8;border-radius:10px;background:#fff;font-weight:900;font-size:14px;color:var(--ink)}
.cls-round:has(.cls-dock){padding-bottom:170px}
}
