/* ============================================================================
   app.css : the interactive map application — tabbar, toolbar, stage (SVG),
   node styles, detail panel, quiz engine, 三雲對照 tab, footer.
   Motion follows the house contract: spring rises, line-draws, one bounce.
   Reduced-motion fallbacks at the bottom.
   ============================================================================ */

/* ─── nav extras ─── */
.nav-tagline {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.12em;
  color: var(--text); white-space: nowrap;
}
@media (max-width: 760px) { .nav-tagline { display: none; } }
.nav-mock { height: 40px; padding: 0 16px; font-size: 13.5px; }
/* 引流:Otter Lab 產品入口 — 珊瑚色描邊與其他 ghost 鈕區隔 */
.nav-olab { border-color: rgba(255, 107, 107, 0.38); }
.nav-olab:hover { border-color: var(--coral); box-shadow: 0 0 18px -6px rgba(255, 107, 107, 0.55); }
@media (max-width: 480px) { .nav-olab { display: none; } /* 小螢幕由橋接區與 footer 承接 */ }

/* ─── compact hero ─── */
.maphero {
  position: relative; overflow: hidden;
  padding: calc(var(--nav-h) + clamp(28px, 4.5vw, 52px)) 0 clamp(18px, 2.5vw, 30px);
}
.maphero .wrap { position: relative; z-index: 2; }
.maphero-inner { display: flex; align-items: center; gap: clamp(18px, 3vw, 34px); }
.maphero .hero-logo { width: clamp(58px, 7vw, 84px); height: auto; margin: 0; flex-shrink: 0; }
.maphero .hero-badge { margin-bottom: 14px; text-transform: none; } /* iPAS 大小寫要保留 */
.maphero h1 { font-size: clamp(26px, 4.4vw, 44px); margin-bottom: 10px; text-wrap: balance; }
.maphero-sub { color: var(--text-secondary); font-size: clamp(14px, 1.5vw, 16.5px); max-width: 40em; }
.maphero-sub strong { color: var(--text); font-weight: 600; }
@media (max-width: 560px) { .maphero .hero-logo { display: none; } }

/* ─── tab bar (sticky under the nav) ─── */
.tabbar {
  position: sticky; top: var(--nav-h); z-index: 60;
  background: var(--bg-navbar);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border-block: 1px solid var(--border);
  margin-top: 10px;
}
.tabbar-row {
  display: flex; gap: 6px; align-items: center;
  overflow-x: auto; scrollbar-width: none;
  padding-block: 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
}
.tabbar-row::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: color var(--t-micro) var(--ease-smooth), background var(--t-micro) var(--ease-smooth), border-color var(--t-micro) var(--ease-smooth);
}
.tab-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.tab-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tab-btn[aria-selected="true"] {
  color: #0A0C10;
  background: linear-gradient(135deg, var(--coral), var(--orange));
  box-shadow: 0 6px 20px -8px rgba(255, 107, 107, 0.7);
}
.tab-btn .tab-n {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  opacity: 0.75;
}

/* ─── toolbar ─── */
.mapapp { padding-bottom: clamp(40px, 5vw, 64px); }
.maptool {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  padding: 14px 0 12px;
}
/* display:flex would defeat the hidden attribute — guard it explicitly */
.maptool[hidden], .panel[hidden] { display: none; }
.maptool-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: color var(--t-micro) var(--ease-smooth), border-color var(--t-micro) var(--ease-smooth), background var(--t-micro) var(--ease-smooth);
}
.cat-chip .cdot { width: 8px; height: 8px; border-radius: 999px; background: var(--c, var(--cyan)); box-shadow: 0 0 8px color-mix(in srgb, var(--c, var(--cyan)) 70%, transparent); flex-shrink: 0; }
.cat-chip:hover { color: var(--text); border-color: var(--border-strong); }
.cat-chip.on { color: var(--text); border-color: var(--border-cyan); background: rgba(0,229,255,0.07); }
.cat-chip:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.maptool-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.map-search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px; min-width: 230px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
}
.map-search svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.map-search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0;
  color: var(--text); font-family: var(--font-display); font-size: 13.5px;
}
.map-search input::placeholder { color: var(--text-muted); }
/* 觸控裝置輸入字級需 ≥16px,否則 iOS 聚焦搜尋框時會強制放大整頁 */
@media (max-width: 640px), (pointer: coarse) {
  .map-search input { font-size: 16px; }
}
.map-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.map-search-count { font-family: var(--font-mono); font-size: 11px; color: var(--cyan-soft); white-space: nowrap; }

.tool-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; min-width: 38px; padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: color var(--t-micro) var(--ease-smooth), border-color var(--t-micro) var(--ease-smooth), background var(--t-micro) var(--ease-smooth), transform var(--t-micro) var(--ease-spring);
}
.tool-btn:hover { color: var(--text); border-color: var(--border-cyan); transform: translateY(-1px); }
.tool-btn:active { transform: translateY(0); }
.tool-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tool-btn .qz-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--coral); box-shadow: 0 0 8px rgba(255,107,107,0.8); }
.tool-btn[aria-pressed="true"] {
  color: var(--text); border-color: rgba(255,107,107,0.5); background: rgba(255,107,107,0.1);
}
.zoom-group { display: inline-flex; gap: 6px; }
.zoom-group .tool-btn { padding: 0; width: 38px; font-size: 17px; font-weight: 500; }

/* ─── stage ─── */
.stage {
  position: relative;
  height: clamp(520px, calc(100dvh - 248px), 840px);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, #0E1218 0%, #0A0D12 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
.stage .dot-grid { opacity: 0.04; -webkit-mask-image: none; mask-image: none; }
.stage-svg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.stage-svg.dragging { cursor: grabbing; }
.stage-hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 7;
  padding: 6px 14px; border-radius: var(--r-pill);
  background: rgba(10, 12, 16, 0.75); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  white-space: nowrap; pointer-events: none;
  transition: opacity var(--t-quick) var(--ease-smooth);
}
.stage-hint.hide { opacity: 0; }
@media (max-width: 900px) { .stage-hint { left: 12px; transform: none; } }
@media (max-width: 640px) {
  /* svh:以「網址列展開」的小視窗計高,地圖底緣(含提示)不會被 iOS 工具列吃掉,
     且網址列收合時舞台不重排、相機不跳動 */
  .stage { height: clamp(420px, 62vh, 560px); height: clamp(420px, 62svh, 560px); }
  /* 提示膠囊在手機改用觸控文案(app.js),保留顯示 — 首次使用的唯一指引 */
  /* 分類 chips 改單列橫滑軌(與 tabbar 同語彙):AI 應用 16 顆 chips 換行
     會疊四列,把地圖推出首屏 */
  .maptool-cats {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  }
  .maptool-cats::-webkit-scrollbar { display: none; }
  .cat-chip { height: 34px; } /* 觸控命中區 */
  .map-search { flex: 1; }    /* 搜尋框吃滿該列 */
}

/* 邊緣漸隱 — 內容延伸出視窗的那一側才亮,是「還有更多」的視覺氣味 */
.sfade { position: absolute; z-index: 5; pointer-events: none; opacity: 0; transition: opacity 0.32s var(--ease-smooth); }
.sfade.f-t { inset: 0 0 auto 0; height: 54px; background: linear-gradient(180deg, rgba(9, 11, 16, 0.82), transparent); }
.sfade.f-b { inset: auto 0 0 0; height: 54px; background: linear-gradient(0deg, rgba(9, 11, 16, 0.82), transparent); }
.sfade.f-l { inset: 0 auto 0 0; width: 54px; background: linear-gradient(90deg, rgba(9, 11, 16, 0.82), transparent); }
.sfade.f-r { inset: 0 0 0 auto; width: 54px; background: linear-gradient(270deg, rgba(9, 11, 16, 0.82), transparent); }
.stage.of-t .sfade.f-t, .stage.of-b .sfade.f-b, .stage.of-l .sfade.f-l, .stage.of-r .sfade.f-r { opacity: 1; }

/* minimap — 方位儀表:視窗未涵蓋全圖時淡入,可點擊/拖曳導航 */
.minimap {
  position: absolute; right: 14px; bottom: 14px; z-index: 8;
  padding: 7px; border-radius: 12px;
  background: rgba(9, 12, 17, 0.78); border: 1px solid var(--border-strong);
  -webkit-backdrop-filter: blur(10px) saturate(130%); backdrop-filter: blur(10px) saturate(130%);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.8);
  animation: mmIn 0.3s var(--ease-smooth) both;
}
.minimap[hidden] { display: none; }
.minimap svg { display: block; cursor: crosshair; }
.mm-view { fill: rgba(0, 229, 255, 0.1); stroke: var(--cyan); }
@keyframes mmIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .minimap { display: none; } }

/* ── SVG map pieces ── */
.rg-frame {
  fill: color-mix(in srgb, var(--c) 5%, transparent); stroke: color-mix(in srgb, var(--c) 26%, transparent); stroke-width: 1.2; rx: 16;
  pointer-events: none;
  transition: fill 0.28s var(--ease-smooth), stroke 0.28s var(--ease-smooth);
}
.rg-label {
  font-family: var(--font-mono); font-size: calc(12.5px * var(--rgk, 1)); font-weight: 500; letter-spacing: 0.08em;
  fill: color-mix(in srgb, var(--c) 78%, #fff 8%);
  pointer-events: none;
  transition: font-size 0.3s var(--ease-smooth);
}
.edge { stroke: rgba(255,255,255,0.15); stroke-width: 1.4; stroke-dasharray: 5 5; fill: none; }

.node { cursor: pointer; outline: none; }
.node circle.core {
  fill: #10141C;
  stroke: var(--c, var(--cyan));
  stroke-width: 2;
  transition: stroke var(--t-micro) var(--ease-smooth), fill var(--t-micro) var(--ease-smooth);
}
.node text {
  font-family: var(--font-display); font-size: 12.5px; font-weight: 500;
  fill: var(--text-secondary); text-anchor: middle;
  transition: fill var(--t-micro) var(--ease-smooth);
  pointer-events: none;
}
.node .qz-mark { fill: var(--coral); opacity: 0.9; }
.node:hover circle.core, .node:focus-visible circle.core { fill: #16202C; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c, var(--cyan)) 60%, transparent)); }
.node:hover text, .node:focus-visible text { fill: var(--text); }
.node:focus-visible circle.core { stroke: var(--cyan); }
.node.sel circle.core {
  stroke: var(--cyan); stroke-width: 2.6;
  filter: drop-shadow(0 0 10px var(--cyan-glow));
}
.node.sel text { fill: #fff; }

/* entrance: nodes spring-rise in (batch stagger set inline), edges + regions fade/draw.
   NB: the rise animates the INNER .nin group — a CSS transform on .node itself
   would override its SVG transform="translate(x,y)" attribute and collapse
   every node onto the origin. */
.stage-svg .rg { opacity: 0; transition: opacity var(--t-base) var(--ease-smooth); }
.stage-svg .edge { stroke-dashoffset: 60; opacity: 0; transition: opacity var(--t-base) var(--ease-smooth), stroke-dashoffset var(--t-draw) var(--ease-draw); }
.stage-svg .node .nin { opacity: 0; transform: translateY(10px); transition: opacity var(--t-base) var(--ease-spring), transform var(--t-base) var(--ease-spring); transition-delay: var(--nd, 0s); }
.stage-svg.drawn .rg { opacity: 1; }
.stage-svg.drawn .edge { opacity: 1; stroke-dashoffset: 0; }
.stage-svg.drawn .node .nin { opacity: 1; transform: none; }

/* 語意縮放 — 拉遠(far)時節點標籤退為「微縮紋理」:永遠可見但變小變淡、
   微染領地色(地圖式 zoom-to-read 誘導),區域升級為可點擊的「領地卡」,
   區域標籤以 --rgk 反向放大維持可讀;點擊區域即飛入。 */
.stage-svg .node text { transition: opacity 0.26s var(--ease-smooth), fill var(--t-micro) var(--ease-smooth); }
.stage-svg.far .node text {
  opacity: 0.62;
  fill: color-mix(in srgb, var(--c) 28%, var(--text-secondary));
}
.stage-svg.far .edge { opacity: 0.5; }
.stage-svg.far .rg-frame {
  fill: color-mix(in srgb, var(--c) 9%, transparent);
  stroke: color-mix(in srgb, var(--c) 42%, transparent);
  pointer-events: all; cursor: pointer;
}
.stage-svg.far .rg:hover .rg-frame { fill: color-mix(in srgb, var(--c) 15%, transparent); stroke: color-mix(in srgb, var(--c) 62%, transparent); }
.stage-svg.far .rg-label { fill: color-mix(in srgb, var(--c) 90%, #fff 10%); }

/* 搜尋定位脈衝 */
.node.ping circle.core { animation: nodePing 1.1s var(--ease-smooth) 2; }
@keyframes nodePing {
  0% { stroke-width: 2; }
  35% { stroke-width: 5.5; filter: drop-shadow(0 0 18px var(--cyan-glow)); }
  100% { stroke-width: 2; }
}

/* search / quiz-highlight states */
.stage-svg.filtering .node, .stage-svg.filtering .edge { opacity: 0.14; }
.stage-svg.far.filtering .node.hit text { opacity: 1; }
.stage-svg.filtering .node.hit { opacity: 1; }
.stage-svg.filtering .node.hit circle.core { filter: drop-shadow(0 0 10px var(--cyan-glow)); stroke: var(--cyan); }
.stage-svg.quizzing .node { opacity: 0.16; }
.stage-svg.quizzing .edge { opacity: 0.1; }
.stage-svg.quizzing .node.has-quiz { opacity: 1; }
.stage-svg.quizzing .node.has-quiz circle.core {
  stroke: var(--coral);
  filter: drop-shadow(0 0 10px rgba(255, 107, 107, 0.7));
}

/* ─── detail panel (right drawer / mobile bottom sheet) ─── */
.panel {
  position: fixed; z-index: 120;
  top: 0; right: 0; bottom: 0;
  width: min(440px, 100vw);
  padding: 14px;
  display: flex;
  pointer-events: none;
}
.panel-card {
  pointer-events: auto;
  display: flex; flex-direction: column;
  width: 100%;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, #10141C 0%, #0B0E14 100%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  transform: translateX(calc(100% + 20px));
  transition: transform var(--t-base) var(--ease-spring);
}
.panel.open .panel-card { transform: none; }
.panel-scrim {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(6, 8, 12, 0.55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity var(--t-quick) var(--ease-smooth);
}
.panel-scrim.show { opacity: 1; }
@media (max-width: 640px) {
  .panel { top: auto; left: 0; width: 100%; max-height: 82dvh; padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .panel-card { transform: translateY(calc(100% + 20px)); }
  body.panel-lock { overflow: hidden; } /* 底部抽屜開啟時鎖住背景頁面捲動 */
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.panel-close {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-strong);
  color: var(--text-secondary); font-size: 14px; cursor: pointer;
  transition: color var(--t-micro) var(--ease-smooth), border-color var(--t-micro) var(--ease-smooth);
}
.panel-close:hover { color: var(--text); border-color: var(--border-cyan); }
.panel-close:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.panel-body { padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
.panel-body h3 { font-size: 21px; margin-bottom: 6px; }
.panel-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.panel-sec { margin-top: 18px; }
.panel-sec > h4 {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--cyan);
  margin-bottom: 10px;
}
.panel-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.panel-tags .tag.metric { border-color: rgba(255,107,107,0.3); color: #FFB4A8; background: rgba(255,107,107,0.06); }
.panel-mile {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 12px; color: var(--success-fg);
  padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--success-bg); border: 1px solid var(--success-border);
}
.panel-kv { list-style: none; display: grid; gap: 8px; font-size: 13px; }
.panel-kv li { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed rgba(255,255,255,0.07); }
.panel-kv li:last-child { border-bottom: 0; padding-bottom: 0; }
.panel-kv .k { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); padding-top: 2px; }
.panel-kv .v { color: var(--text-secondary); }
.panel-links { display: flex; flex-wrap: wrap; gap: 8px; }
.panel-links .btn { height: 38px; padding: 0 16px; font-size: 13px; }

/* markdown-lite output */
.md { font-size: 14px; line-height: 1.85; color: var(--text-secondary); }
.md p { margin-bottom: 10px; }
.md h2, .md h3, .md h4 { color: var(--text); margin: 16px 0 8px; font-size: 15.5px; letter-spacing: 0; }
.md h2 { font-size: 17px; }
.md ul, .md ol { margin: 0 0 10px; padding-inline-start: 20px; }
.md li { margin-bottom: 4px; }
.md strong { color: var(--text); font-weight: 600; }
.md blockquote {
  margin: 10px 0; padding: 10px 14px;
  border-inline-start: 3px solid var(--cyan);
  background: rgba(0,229,255,0.05); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--cyan-soft);
}
.md a { color: var(--cyan-soft); border-bottom: 1px solid var(--border-cyan); word-break: break-all; }
.md a:hover { color: var(--cyan); }
.md hr { border: 0; border-top: 1px dashed var(--border-strong); margin: 14px 0; }

/* ── quiz engine inside the panel ── */
.quiz-block {
  margin-top: 20px; padding: 16px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
}
.quiz-block .quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.quiz-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; }
.quiz-title .qz-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--coral); box-shadow: 0 0 8px rgba(255,107,107,0.8); }
.quiz-progress { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; }
.quiz-progress em { font-style: normal; color: var(--cyan); }
.quiz-src { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); display: block; margin-bottom: 10px; }
.quiz-q { font-size: 14px; font-weight: 600; line-height: 1.75; margin-bottom: 14px; white-space: pre-line; }

.quiz-opts { list-style: none; display: grid; gap: 8px; }
.quiz-opt {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: start;
  padding: 10px 12px; border-radius: var(--r);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-display); font-size: 13px; line-height: 1.6;
  cursor: pointer;
  transition: border-color var(--t-micro) var(--ease-smooth), background var(--t-micro) var(--ease-smooth),
              color var(--t-micro) var(--ease-smooth), opacity var(--t-quick) var(--ease-smooth);
}
.quiz-opt:hover:not(:disabled) { border-color: var(--border-cyan); background: rgba(0, 229, 255, 0.05); color: var(--text); }
.quiz-opt:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.quiz-opt:disabled { cursor: default; }
.quiz-key {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.quiz-opt.is-correct { border-color: var(--success-border); background: var(--success-bg); color: var(--text); }
.quiz-opt.is-correct .quiz-key { background: rgba(16,185,129,0.25); border-color: var(--success-border); color: var(--success-fg); }
.quiz-opt.is-wrong { border-color: rgba(255, 107, 107, 0.45); background: rgba(127, 29, 29, 0.35); color: var(--text); }
.quiz-opt.is-wrong .quiz-key { background: rgba(255,107,107,0.2); border-color: rgba(255,107,107,0.5); color: var(--coral); }
.quiz-opt.is-dim { opacity: 0.38; }

/* the verdict stamp — the page's ONE reserved bounce (with the logo dot) */
.quiz-verdict { display: none; align-items: center; gap: 8px; margin-top: 12px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; }
.quiz-verdict.show { display: inline-flex; animation: verdictStamp var(--t-quick) var(--ease-bounce) both; }
.quiz-verdict.ok { color: var(--success-fg); }
.quiz-verdict.bad { color: var(--coral); }
@keyframes verdictStamp { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }

.quiz-expl {
  display: none;
  margin-top: 12px; padding: 13px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.025); border: 1px solid var(--border);
  font-size: 13px; line-height: 1.8; color: var(--text-secondary);
  white-space: pre-line;
}
.quiz-expl.show { display: block; animation: quizRowIn var(--t-base) var(--ease-spring) both; }
@keyframes quizRowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.quiz-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.quiz-foot .btn { height: 38px; padding: 0 18px; font-size: 13.5px; }
.quiz-foot [hidden] { display: none; }

/* ─── 三雲對照 tab ─── */
.akira-view { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding: clamp(18px, 3vw, 32px); }
.cv-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; }
.cv-head h2 { font-size: clamp(19px, 2.4vw, 25px); }
.cv-head p { color: var(--text-muted); font-size: 13px; }
.cv-list { display: grid; gap: 10px; }
.cv-role { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-card); overflow: hidden; }
.cv-role > summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  transition: background var(--t-micro) var(--ease-smooth);
}
.cv-role > summary::-webkit-details-marker { display: none; }
.cv-role > summary:hover { background: rgba(255,255,255,0.03); }
.cv-role > summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.cv-rid { font-family: var(--font-mono); font-size: 11px; color: var(--cyan); letter-spacing: 0.1em; flex-shrink: 0; }
.cv-role > summary h3 { font-size: 15px; flex: 1; }
.cv-caret { color: var(--text-muted); transition: transform var(--t-micro) var(--ease-spring); flex-shrink: 0; }
.cv-role[open] > summary .cv-caret { transform: rotate(45deg); }
.cv-desc { padding: 0 16px 12px; color: var(--text-secondary); font-size: 13px; line-height: 1.7; }
.cv-clouds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 16px 16px; }
@media (max-width: 860px) { .cv-clouds { grid-template-columns: 1fr; } }
.cv-cloud { border: 1px solid var(--border); border-radius: var(--r); padding: 13px; background: rgba(255,255,255,0.02); }
.cv-cloud-name { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 3px; }
.cv-cloud.azure .cv-cloud-name { color: #7EB6FF; }
.cv-cloud.aws .cv-cloud-name { color: #FFC46B; }
.cv-cloud.gcp .cv-cloud-name { color: #8EE59B; }
.cv-svc { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.cv-was { font-size: 11.5px; color: var(--text-muted); margin-bottom: 10px; }
.cv-sub { margin-top: 10px; }
.cv-sub-head { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; }
.cv-items { list-style: none; display: grid; gap: 5px; }
.cv-items li { font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); }
.cv-items .n { color: var(--text); font-weight: 600; }
.cv-items .cv-tag {
  display: inline-block; margin-inline-start: 6px; padding: 1px 7px;
  border-radius: var(--r-pill); border: 1px solid var(--border-cyan);
  background: rgba(0,229,255,0.07); color: var(--cyan-soft);
  font-family: var(--font-mono); font-size: 9.5px; vertical-align: 1px;
}

/* ─── Otter Lab 產品橋接(引流 otterlab.co)─── */
.bridge { padding: clamp(36px, 5.5vw, 64px) 0 clamp(30px, 4.5vw, 56px); }
.bridge-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
  gap: clamp(20px, 3vw, 40px); flex-wrap: wrap;
  padding: clamp(26px, 4vw, 44px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}
.bridge-card .dot-grid {
  -webkit-mask-image: radial-gradient(ellipse 85% 110% at 18% 25%, #000 25%, transparent 72%);
  mask-image: radial-gradient(ellipse 85% 110% at 18% 25%, #000 25%, transparent 72%);
}
.bridge-copy { position: relative; z-index: 1; max-width: 60ch; }
.bridge-kicker {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--coral); margin-bottom: 12px;
}
.bridge-copy h2 { font-size: clamp(21px, 2.6vw, 28px); line-height: 1.28; letter-spacing: -0.01em; }
.bridge-sub { margin-top: 10px; color: var(--text-secondary); font-size: 14px; line-height: 1.85; }
.bridge-tags { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.bridge-cta { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }
.bridge-cta .btn { min-width: 176px; }
@media (max-width: 760px) { .bridge-cta { flex-direction: row; flex-wrap: wrap; } .bridge-cta .btn { min-width: 0; flex: 1 1 auto; } }

/* ─── footer ─── */
.footer { border-top: 1px solid var(--border); padding: 40px 0 32px; }
.footer-grid { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.footer-brand .mark { width: 26px; height: 26px; }
.footer-brand .lab { font-weight: 300; color: var(--coral); }
.footer-note { margin-top: 12px; font-size: 12.5px; color: var(--text-muted); max-width: 52ch; line-height: 1.7; }
.footer-note a { color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.footer-note a:hover { color: var(--cyan-soft); border-color: var(--border-cyan); }
.footer-col h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; font-weight: 500; }
.footer-col ul { list-style: none; display: grid; gap: 9px; font-size: 13.5px; }
.footer-col a { color: var(--text-secondary); transition: color var(--t-micro) var(--ease-smooth); }
.footer-col a:hover { color: var(--text); }
.footer-legal {
  margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
}

/* ─── Reduced motion — composed static end-states ─── */
@media (prefers-reduced-motion: reduce) {
  .stage-svg .rg, .stage-svg .edge, .stage-svg .node .nin {
    opacity: 1 !important; transform: none !important; transition: none !important; stroke-dashoffset: 0 !important;
  }
  .stage-svg.filtering .node:not(.hit), .stage-svg.quizzing .node:not(.has-quiz) { opacity: 0.14 !important; }
  .stage-svg.quizzing .edge, .stage-svg.filtering .edge { opacity: 0.1 !important; }
  .panel-card { transition: none !important; }
  .panel-scrim { transition: none !important; }
  .quiz-verdict.show, .quiz-expl.show { animation: none !important; }
  .tab-btn, .tool-btn, .cat-chip, .cv-caret, .panel-close { transition: none !important; }
  .rg-label, .rg-frame, .stage-svg .node text, .sfade { transition: none !important; }
  .node.ping circle.core, .minimap { animation: none !important; }
}
