/* ===================================================================
   元太科技 (E Ink) 電子紙技術可視化互動平台 v3.0
   全面 UI/UX 升級版 - 紙質沉浸感 ✕ 實體電子紙全頁刷新 ✕ 極致微互動
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;600;700;900&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ══════════════════════════════════════════════════
   CSS 變數設計系統 (Design Tokens)
══════════════════════════════════════════════════ */
:root {
  /* 電子紙質淺色系主題 (預設) - 仿真實紙張溫潤微黃底色 */
  --bg: #F7F5EE;
  --bg-alt: #ECE8DD;
  --surface: #FFFFFF;
  --surface-raised: #FAF8F2;
  --surface-sunken: #E7E3D6;

  /* 電子墨水階調 (Ink Grayscale) */
  --ink-900: #121316;
  --ink-800: #1F2228;
  --ink-700: #323640;
  --ink-600: #4B5160;
  --ink-500: #666D80;
  --ink-400: #8891A4;
  --ink-300: #B2B9C8;
  --ink-200: #D8DCE6;
  --ink-100: #EEF1F6;

  /* 品牌與強調色 (E-Ink Blue & High-Tech Accents) */
  --accent: #1754EC;
  --accent-dim: #3B74FF;
  --accent-glow: rgba(23, 84, 236, 0.18);
  --accent-pulse: rgba(23, 84, 236, 0.08);

  /* 功能指示色 */
  --teal: #0D9488;
  --teal-dim: #14B8A6;
  --teal-glow: rgba(13, 148, 136, 0.15);
  --amber: #D97706;
  --amber-dim: #F59E0B;
  --rose: #E11D48;
  --rose-dim: #FB7185;
  --purple: #7C3AED;
  --purple-dim: #A855F7;
  --emerald: #059669;

  /* 邊框與分割線 */
  --border: rgba(25, 30, 45, 0.09);
  --border-subtle: rgba(25, 30, 45, 0.05);
  --border-hover: rgba(23, 84, 236, 0.38);
  --border-card: rgba(25, 30, 45, 0.08);

  /* 陰影系統 */
  --shadow-xs: 0 1px 3px rgba(18, 19, 22, 0.04), 0 1px 2px rgba(18, 19, 22, 0.03);
  --shadow-sm: 0 4px 12px rgba(18, 19, 22, 0.06), 0 2px 6px rgba(18, 19, 22, 0.03);
  --shadow-md: 0 10px 28px rgba(18, 19, 22, 0.08), 0 4px 12px rgba(18, 19, 22, 0.04);
  --shadow-lg: 0 20px 48px rgba(18, 19, 22, 0.11), 0 8px 20px rgba(18, 19, 22, 0.06);
  --shadow-xl: 0 32px 72px rgba(18, 19, 22, 0.14), 0 12px 28px rgba(18, 19, 22, 0.08);
  --glow-accent: 0 0 28px rgba(23, 84, 236, 0.16);

  /* 圓角弧度 */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  /* 尺寸與動畫曲線 */
  --nav-h: 66px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.18s;
  --t-med: 0.32s;
  --t-slow: 0.55s;

  /* 字體組合 */
  --font-sans: 'Plus Jakarta Sans', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;
}

/* ══════════════════════════════════════════════════
   暗色科技主題 (Dark Mode)
══════════════════════════════════════════════════ */
[data-theme="dark"] {
  --bg: #0C0E14;
  --bg-alt: #131722;
  --surface: #181D2B;
  --surface-raised: #1F2537;
  --surface-sunken: #10131D;

  --ink-900: #F3F6FD;
  --ink-800: #E2E8F6;
  --ink-700: #CBD5EB;
  --ink-600: #A0B0D0;
  --ink-500: #7E90B4;
  --ink-400: #5D6E90;
  --ink-300: #3E4B66;
  --ink-200: #263045;
  --ink-100: #192030;

  --accent: #4D7BFF;
  --accent-dim: #799FFF;
  --accent-glow: rgba(77, 123, 255, 0.22);
  --accent-pulse: rgba(77, 123, 255, 0.08);

  --teal: #14B8A6;
  --teal-dim: #5EEAD4;
  --teal-glow: rgba(20, 184, 166, 0.2);
  --amber: #FBBF24;
  --rose: #FB7185;
  --purple: #A855F7;
  --purple-dim: #C084FC;
  --emerald: #34D399;

  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-hover: rgba(77, 123, 255, 0.45);
  --border-card: rgba(255, 255, 255, 0.06);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 32px 72px rgba(0, 0, 0, 0.8);
  --glow-accent: 0 0 36px rgba(77, 123, 255, 0.25);
}

/* ══════════════════════════════════════════════════
   全域基礎重置
══════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink-700);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background var(--t-med) var(--ease-smooth), color var(--t-med) var(--ease-smooth);
}

/* 頁面載入漸現 */
body.loaded {
  animation: pageAppear 0.55s var(--ease-out-expo) both;
}
@keyframes pageAppear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal 滾動進入視窗動畫 */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease-out-expo), transform 0.65s var(--ease-out-expo);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

img, canvas {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
input, select {
  font-family: var(--font-sans);
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); }

/* ══════════════════════════════════════════════════
   ⚡ 電子紙黑白全頁翻轉刷新波形特效 (E-Ink Full Refresh Flash)
══════════════════════════════════════════════════ */
.eink-flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  background: #000;
}
.eink-flash-overlay.refreshing {
  animation: einkFullWaveformFlash 0.75s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes einkFullWaveformFlash {
  0% { opacity: 0; background: #000000; }
  12% { opacity: 0.95; background: #000000; }
  28% { opacity: 0.98; background: #FFFFFF; }
  45% { opacity: 0.95; background: #000000; }
  68% { opacity: 0.98; background: #FFFFFF; }
  85% { opacity: 0.45; background: #F7F5EE; }
  100% { opacity: 0; }
}

/* ══════════════════════════════════════════════════
   頂部導覽列與進度指示條
══════════════════════════════════════════════════ */
.header-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(247, 245, 238, 0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  transition: all var(--t-fast) var(--ease-smooth);
}
[data-theme="dark"] .header-nav {
  background: rgba(12, 14, 20, 0.85);
}
.header-nav.scrolled {
  box-shadow: var(--shadow-sm);
  background: rgba(247, 245, 238, 0.95);
}
[data-theme="dark"] .header-nav.scrolled {
  background: rgba(12, 14, 20, 0.95);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* 品牌 Logo */
.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--ink-900);
  color: var(--bg);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.5px;
  transition: transform var(--t-fast) var(--ease-spring), box-shadow var(--t-fast);
}
.logo-group:hover .logo-icon {
  transform: rotate(-4deg) scale(1.06);
  box-shadow: var(--shadow-sm);
}
.logo-text h1 {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--ink-900);
  line-height: 1.15;
}
.logo-text p {
  font-size: 0.68rem;
  color: var(--ink-400);
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* 桌機導覽連結 */
.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  display: block;
  padding: 0.42rem 0.68rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-500);
  border-radius: var(--radius-xs);
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
  background: var(--accent-pulse);
}

/* 導覽動作按鈕組 (刷新、主題切換) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.action-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-600);
  transition: all var(--t-fast) var(--ease-smooth);
  box-shadow: var(--shadow-xs);
}
.action-pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.refresh-trigger-btn {
  background: var(--accent-pulse);
  border-color: rgba(23, 84, 236, 0.25);
  color: var(--accent);
}
.refresh-trigger-btn:hover {
  background: var(--accent);
  color: #FFFFFF;
}

/* 捲動指示進度條 */
.progress-bar {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--teal), var(--purple));
  z-index: 1001;
  transition: width 0.08s linear;
  border-radius: 0 2px 2px 0;
}

/* 漢堡選單 (手機用) */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: var(--radius-xs);
  transition: background var(--t-fast);
}
.hamburger-btn:hover { background: var(--surface-sunken); }
.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink-700);
  border-radius: 1px;
  transition: all var(--t-med) var(--ease-smooth);
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 手機抽屜選單 */
.mobile-nav-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 300px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  z-index: 1100;
  transform: translateX(100%);
  transition: transform var(--t-med) var(--ease-out-expo);
  padding: 1.5rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.mobile-nav-drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.drawer-title { font-size: 0.95rem; font-weight: 800; color: var(--ink-900); }
.drawer-close-btn {
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
}
.drawer-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--ink-700);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--t-fast);
  margin-bottom: 3px;
}
.drawer-link:hover {
  background: var(--accent-pulse);
  color: var(--accent);
}
.drawer-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.drawer-refresh-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
}
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1090;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med);
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

/* ══════════════════════════════════════════════════
   主要版面排版系統
══════════════════════════════════════════════════ */
.main-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 2.5rem) 1.5rem 6rem;
}
.section-block {
  margin-bottom: 6rem;
}

/* 區塊標題 */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 0.65rem;
}
.eyebrow-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.4; }
}

.section-title {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 800;
  color: var(--ink-900);
  line-height: 1.25;
  letter-spacing: -0.4px;
  margin-bottom: 0.65rem;
}
.section-desc {
  font-size: 0.98rem;
  color: var(--ink-500);
  max-width: 780px;
  line-height: 1.7;
}

/* 卡片與容器 */
.card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-pad-lg { padding: 2.25rem 2.5rem; }

/* ══════════════════════════════════════════════════
   英雄區 (Hero Section)
══════════════════════════════════════════════════ */
.hero-section {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 3.5rem 2.5rem 2.5rem;
  margin-bottom: 4.5rem;
  box-shadow: var(--shadow-md);
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -120px; right: -80px;
  width: 520px; height: 520px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  pointer-events: none;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
}
.tag-pill {
  padding: 0.3rem 0.75rem;
  background: var(--bg-alt);
  color: var(--ink-600);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
}
.tag-pill.featured {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px var(--accent-glow);
}

.hero-headline {
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: 900;
  color: var(--ink-900);
  line-height: 1.18;
  letter-spacing: -0.8px;
  margin-bottom: 1.5rem;
}
.word-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtext {
  font-size: 1.05rem;
  color: var(--ink-500);
  max-width: 820px;
  line-height: 1.75;
  margin-bottom: 2rem;
}
.hero-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.1rem 1.4rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 2.25rem;
  font-size: 0.88rem;
  color: var(--ink-700);
  line-height: 1.6;
}
.callout-icon { font-size: 1.25rem; flex-shrink: 0; }

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.metric-chip {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.25rem;
  transition: all var(--t-fast) var(--ease-smooth);
}
.metric-chip:hover {
  background: var(--surface);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-xs), var(--glow-accent);
  transform: translateY(-2px);
}
.metric-chip-val {
  font-size: 1.75rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--ink-900);
  line-height: 1;
  margin-bottom: 0.35rem;
}
.metric-chip-lbl {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-500);
  margin-bottom: 0.2rem;
}
.metric-chip-desc {
  font-size: 0.74rem;
  color: var(--ink-400);
  line-height: 1.4;
}

/* 官方出處跳轉小標籤 */
.ref-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  background: var(--accent-pulse);
  color: var(--accent);
  border: 1px solid rgba(23, 84, 236, 0.2);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 0.35rem;
  transition: all var(--t-fast);
}
.ref-link:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════
   1. 電泳物理與微膠囊模擬器 3.0
══════════════════════════════════════════════════ */
.simulator-wrapper {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.75rem;
}
@media (max-width: 980px) {
  .simulator-wrapper { grid-template-columns: 1fr; }
}

.canvas-frame {
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.canvas-dots { display: flex; gap: 5px; }
.canvas-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.canvas-dots span:nth-child(1) { background: #FF5F57; }
.canvas-dots span:nth-child(2) { background: #FEBC2E; }
.canvas-dots span:nth-child(3) { background: #28C840; }

.canvas-title-chip {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-400);
  font-family: var(--font-mono);
}

.sim-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  transition: all var(--t-fast);
}
.sim-state-badge.active-pos { background: #DCFCE7; color: #15803D; }
.sim-state-badge.active-neg { background: #FEE2E2; color: #B91C1C; }
.sim-state-badge.active-gray { background: #E0E7FF; color: #4338CA; }
.sim-state-badge.bistable { background: #FEF3C7; color: #B45309; }

[data-theme="dark"] .sim-state-badge.active-pos { background: #14532D; color: #86EFAC; }
[data-theme="dark"] .sim-state-badge.active-neg { background: #450A0A; color: #FCA5A5; }
[data-theme="dark"] .sim-state-badge.active-gray { background: #28246E; color: #C7D2FE; }
[data-theme="dark"] .sim-state-badge.bistable { background: #451A03; color: #FCD34D; }

.canvas-main-container {
  width: 100%;
  background: var(--bg-alt);
}
#particleCanvas {
  width: 100%;
  height: 340px;
  display: block;
}

/* 即時波形示波器面板 */
.waveform-panel {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 0.65rem 1rem 0.75rem;
}
.waveform-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.waveform-title { color: var(--ink-600); }
.waveform-indicator {
  font-family: var(--font-mono);
  color: var(--accent);
}
#waveformCanvas {
  width: 100%;
  height: 64px;
  background: var(--surface-sunken);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  display: block;
}

/* 控制面板群組 */
.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.ctrl-panel {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.ctrl-panel-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink-900);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ctrl-val-display {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
}

.voltage-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.v-btn {
  padding: 0.65rem 0.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-600);
  font-size: 0.78rem;
  font-weight: 700;
  transition: all var(--t-fast) var(--ease-spring);
  text-align: center;
}
.v-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.v-btn.active-pos {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px var(--accent-glow);
}
.v-btn.active-neg {
  background: var(--rose);
  color: #fff;
  border-color: var(--rose);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.25);
}
.v-btn.active-gray {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}
.v-btn.active-bistable {
  background: var(--amber);
  color: #fff;
  border-color: var(--amber);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.25);
}

.sim-quick-actions {
  margin-top: 0.5rem;
}
.sim-action-btn {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  transition: all var(--t-fast);
}
.sim-action-btn:hover {
  background: var(--accent);
  color: #fff;
  border-style: solid;
}

/* 滑桿與標記 */
.custom-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--ink-200);
  outline: none;
  margin: 0.75rem 0 0.5rem;
}
.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  border: 2px solid #fff;
  transition: transform var(--t-fast);
}
.custom-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--ink-400);
  font-weight: 600;
}

/* 光學對比計 (E-Ink vs LCD) */
.optical-contrast-meter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.meter-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
}
.meter-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-800);
  margin-bottom: 0.4rem;
}
.meter-bar-track {
  height: 8px;
  background: var(--surface-sunken);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.meter-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--t-fast) ease-out;
}
.eink-fill { background: linear-gradient(90deg, #10B981, #059669); }
.lcd-fill { background: linear-gradient(90deg, #F59E0B, #EF4444); }
.meter-caption {
  font-size: 0.66rem;
  color: var(--ink-400);
  line-height: 1.35;
}

/* 解說盒與公式 */
.explain-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
}
.explain-box h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink-900);
  margin-bottom: 0.45rem;
}
.explain-box p {
  font-size: 0.82rem;
  color: var(--ink-500);
  line-height: 1.6;
}
.formula-pill {
  margin-top: 0.8rem;
  padding: 0.55rem 0.9rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  color: var(--ink-700);
  border: 1px dashed var(--border);
}

/* ══════════════════════════════════════════════════
   2. 技術名詞字典
══════════════════════════════════════════════════ */
.glossary-toolbar {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}
.search-wrap svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 0.72rem 2.4rem 0.72rem 2.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-900);
  font-size: 0.88rem;
  transition: all var(--t-fast);
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-clear-btn {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--ink-400);
  display: none;
  padding: 0.2rem 0.4rem;
}
.search-clear-btn.visible { display: block; }

.filter-chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-chip {
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-500);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--t-fast);
}
.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px var(--accent-glow);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.1rem;
}
.term-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast) var(--ease-smooth);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.term-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.term-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}
.term-card:hover::before { opacity: 1; }

.term-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.35rem;
}
.term-zh {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--ink-900);
}
.term-cat-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  color: var(--ink-500);
  flex-shrink: 0;
}
.term-en {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--accent);
  margin-bottom: 0.65rem;
}
.term-def {
  font-size: 0.85rem;
  color: var(--ink-600);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════
   3. 彩色電子紙三大架構 ✕ 色彩工作室
══════════════════════════════════════════════════ */
.color-tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (max-width: 960px) { .color-tech-grid { grid-template-columns: 1fr; } }

.color-tech-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.color-tech-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.ctc-header {
  padding: 1.5rem 1.6rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.ctc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.7rem;
}
.kaleido .ctc-badge { background: #EFF6FF; color: #2563EB; }
.gallery .ctc-badge { background: #FDF2F8; color: #BE185D; }
.spectra .ctc-badge { background: #FFFBEB; color: #B45309; }

[data-theme="dark"] .kaleido .ctc-badge { background: #1E3A5F; color: #93C5FD; }
[data-theme="dark"] .gallery .ctc-badge { background: #4A1D3A; color: #F9A8D4; }
[data-theme="dark"] .spectra .ctc-badge { background: #3B2800; color: #FCD34D; }

.ctc-accent-bar {
  height: 4px;
  border-radius: 2px;
  margin-bottom: 0.85rem;
}
.kaleido .ctc-accent-bar { background: linear-gradient(90deg, #3B82F6, #6366F1); }
.gallery .ctc-accent-bar { background: linear-gradient(90deg, #EC4899, #F43F5E); }
.spectra .ctc-accent-bar { background: linear-gradient(90deg, #F59E0B, #EF4444); }

.ctc-name {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--ink-900);
  line-height: 1.15;
  margin-bottom: 0.25rem;
}
.ctc-subtitle {
  font-size: 0.82rem;
  color: var(--ink-400);
  font-weight: 500;
}
.ctc-body {
  padding: 1.4rem 1.6rem;
  flex-grow: 1;
}

/* 圖層物理堆疊剖面 */
.layer-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 1.4rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.stack-item {
  padding: 0.45rem 0.85rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
}
.sl-light { background: #FFF9C4; color: #78350F; }
.sl-cfa { background: linear-gradient(90deg, #FF6B6B, #4ECDC4, #45B7D1); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.sl-cmyw { background: linear-gradient(90deg, #00FFFF 25%, #FF00FF 50%, #FFFF00 75%, #FFFFFF 100%); color: #111; }
.sl-bw { background: #1C1C1E; color: #F5F5F7; }
.sl-spectra { background: linear-gradient(90deg, #111 16%, #DC2626 33%, #EA580C 50%, #EAB308 66%, #2563EB 83%, #fff 100%); color: #fff; }
.sl-tft { background: #3F3F46; color: #E4E4E7; }

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.feature-list li {
  display: flex;
  gap: 0.55rem;
  font-size: 0.84rem;
  color: var(--ink-600);
  align-items: flex-start;
}
.feature-list .check-icon { color: var(--teal); font-weight: bold; }
.feature-list .warn-icon { color: var(--amber); }

.ctc-footer {
  padding: 1rem 1.6rem;
  border-top: 1px solid var(--border);
  background: var(--surface-raised);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ══ 彩色工作室 (Color Studio) ══ */
.color-studio-section {
  background: var(--surface);
  border: 1px solid var(--border-card);
}
.studio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.studio-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink-900);
  margin-bottom: 0.35rem;
}
.studio-desc {
  font-size: 0.88rem;
  color: var(--ink-500);
  max-width: 650px;
}

.sample-picker {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.picker-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-500);
}
.sample-btn {
  padding: 0.38rem 0.75rem;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  transition: all var(--t-fast);
}
.sample-btn:hover { border-color: var(--accent); color: var(--accent); }
.sample-btn.active {
  background: var(--ink-900);
  color: #fff;
  border-color: var(--ink-900);
}
[data-theme="dark"] .sample-btn.active {
  background: var(--accent);
  border-color: var(--accent);
}

.tech-mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .tech-mode-tabs { grid-template-columns: repeat(2, 1fr); }
}
.tech-tab-btn {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: all var(--t-fast);
}
.tech-tab-btn .tab-badge {
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
}
.tech-tab-btn strong {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink-900);
}
.tech-tab-btn small {
  font-size: 0.72rem;
  color: var(--ink-400);
}
.tech-tab-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.tech-tab-btn.active {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 4px 18px var(--accent-glow);
  outline: 2px solid var(--accent);
}

.studio-preview-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 960px) {
  .studio-preview-grid { grid-template-columns: 1fr; }
}

.studio-viewport-wrap {
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
}
.viewport-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.viewport-badge {
  font-size: 0.76rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent);
}
.viewport-tip {
  font-size: 0.7rem;
  color: var(--ink-400);
}

.viewport-canvas-box {
  position: relative;
  width: 100%;
  cursor: crosshair;
  background: #111;
}
#colorStudioCanvas {
  width: 100%;
  height: 380px;
  display: block;
}

/* 微觀放大鏡 (Loupe) */
.studio-loupe {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 0 10px rgba(0,0,0,0.4);
  pointer-events: none;
  overflow: hidden;
  background: #fff;
  display: none;
  transform: translate(-50%, -50%);
  z-index: 20;
}
.studio-loupe.active { display: block; }
#loupeCanvas {
  width: 140px;
  height: 140px;
}
.loupe-tag {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 800;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* 規格記分卡 */
.studio-spec-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.spec-card-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--ink-900);
}
.spec-card-desc {
  font-size: 0.85rem;
  color: var(--ink-500);
  line-height: 1.6;
}
.spec-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.spec-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed var(--border);
}
.sm-label { color: var(--ink-400); font-weight: 600; }
.sm-value { color: var(--ink-900); font-weight: 700; font-family: var(--font-mono); }
.spec-verdict {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: var(--ink-700);
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════
   4. 技術演進時間軸
══════════════════════════════════════════════════ */
.timeline-filters {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.tl-filter-btn {
  padding: 0.4rem 0.85rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-500);
  transition: all var(--t-fast);
}
.tl-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.tl-filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.timeline-wrapper {
  position: relative;
  padding-left: 48px;
}
.timeline-wrapper::before {
  content: '';
  position: absolute;
  left: 18px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--teal), var(--purple));
  opacity: 0.25;
  border-radius: 1px;
}

.tl-item {
  position: relative;
  margin-bottom: 2rem;
  transition: transform var(--t-fast);
}
.tl-dot {
  position: absolute;
  left: -38px;
  top: 8px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-pulse);
  transition: all var(--t-fast);
}
.tl-item:hover .tl-dot {
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-glow), 0 0 16px var(--accent-glow);
  transform: scale(1.15);
}
.tl-item.key-breakthrough .tl-dot {
  border-color: var(--rose);
  background: #FFF0F2;
}
.tl-item.key-breakthrough:hover .tl-dot {
  background: var(--rose);
  box-shadow: 0 0 0 6px rgba(225, 29, 72, 0.2);
}

.tl-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.6rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
}
.tl-item:hover .tl-card {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
  transform: translateX(4px);
}
.tl-item.key-breakthrough .tl-card {
  border-left: 4px solid var(--rose);
}

.tl-year {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--accent-pulse);
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.4rem;
}
.tl-item.key-breakthrough .tl-year {
  color: var(--rose);
  background: rgba(225, 29, 72, 0.08);
}
.tl-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--ink-900);
  margin-bottom: 0.35rem;
}
.tl-desc {
  font-size: 0.86rem;
  color: var(--ink-600);
  line-height: 1.6;
  margin-bottom: 0.65rem;
}
.citation-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-500);
  background: var(--bg-alt);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  transition: all var(--t-fast);
}
.citation-tag:hover {
  background: var(--accent-pulse);
  color: var(--accent);
}

/* ══════════════════════════════════════════════════
   5. 系統拓撲與硬體節點檢測器
══════════════════════════════════════════════════ */
.path-toggle-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.path-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--ink-600);
  font-size: 0.84rem;
  font-weight: 700;
  transition: all var(--t-fast);
}
.path-btn:hover { border-color: var(--accent); color: var(--accent); }
.path-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.flow-canvas-wrapper {
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
#flowCanvas {
  width: 100%;
  height: 300px;
  display: block;
}

/* 節點詳細資訊卡 (Node Detail Inspector) */
.node-detail-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  transition: all var(--t-fast);
}
.ndc-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.65rem;
}
.ndc-icon {
  font-size: 1.6rem;
  width: 44px; height: 44px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
}
.ndc-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink-900);
}
.ndc-sub {
  font-size: 0.74rem;
  color: var(--ink-400);
}
.ndc-power-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--teal-glow);
  color: var(--teal);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
}
.ndc-desc {
  font-size: 0.84rem;
  color: var(--ink-600);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.ndc-specs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.spec-tag {
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  color: var(--ink-700);
}

.node-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.55rem;
}
.node-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  text-align: center;
  transition: all var(--t-fast);
}
.node-chip:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.node-chip.active {
  border-color: var(--accent);
  background: var(--accent-pulse);
  outline: 2px solid var(--accent);
}
.node-chip strong {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-900);
  margin-bottom: 0.15rem;
}
.node-chip span {
  font-size: 0.7rem;
  color: var(--ink-400);
}

/* ══════════════════════════════════════════════════
   6. 運算外移架構評估表格
══════════════════════════════════════════════════ */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-md);
}
.tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.tech-table th {
  background: var(--surface-raised);
  color: var(--ink-700);
  font-weight: 700;
  padding: 1rem 1.2rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tech-table td {
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--border-card);
  color: var(--ink-600);
  vertical-align: middle;
}
.tech-table tr:last-child td { border-bottom: none; }
.tech-table tr:hover td { background: var(--surface-raised); }
.tech-table tr.highlight td { background: var(--accent-pulse); }

.best-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  background: #DCFCE7;
  color: #15803D;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
}
[data-theme="dark"] .best-badge {
  background: #14532D;
  color: #86EFAC;
}

/* ══════════════════════════════════════════════════
   7. BLE ✕ 輕量電源互動試算
══════════════════════════════════════════════════ */
.calc-presets-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.preset-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-500);
}
.preset-chip {
  padding: 0.4rem 0.85rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-600);
  transition: all var(--t-fast);
}
.preset-chip:hover { border-color: var(--accent); color: var(--accent); }
.preset-chip.active {
  background: var(--ink-900);
  color: #fff;
  border-color: var(--ink-900);
}
[data-theme="dark"] .preset-chip.active {
  background: var(--accent);
  border-color: var(--accent);
}

.calc-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.75rem;
}
@media (max-width: 880px) { .calc-layout { grid-template-columns: 1fr; } }

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}
.calc-group-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 0.55rem;
}
.calc-val-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.radio-option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.radio-option { position: relative; }
.radio-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.radio-option label {
  display: block;
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.radio-option label:hover { border-color: var(--accent); color: var(--accent); }
.radio-option input:checked + label {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 3px 12px var(--accent-glow);
}

/* 能耗拆解長條圖 (Stacked Energy Bar) */
.energy-breakdown-box {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.1rem;
}
.breakdown-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-800);
  margin-bottom: 0.5rem;
}
.stacked-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.6rem;
  background: var(--ink-200);
}
.bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}
.seg-standby { background: #3B82F6; }
.seg-comm { background: #8B5CF6; }
.seg-epd { background: #10B981; }

.breakdown-legend {
  display: flex;
  gap: 0.9rem;
  font-size: 0.7rem;
  color: var(--ink-500);
  flex-wrap: wrap;
}
.breakdown-legend span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-standby { background: #3B82F6; }
.dot-comm { background: #8B5CF6; }
.dot-epd { background: #10B981; }

/* 結果面板 */
.calc-results {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.calc-results-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink-900);
}
.result-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.result-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 0.8rem;
  text-align: center;
  transition: all var(--t-fast);
}
.result-metric:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-xs), var(--glow-accent);
}
.rm-val {
  font-size: 1.55rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}
.rm-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-400);
}
.verdict-chip {
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.84rem;
  color: var(--ink-700);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════
   8. 生成式 AI 工作流程
══════════════════════════════════════════════════ */
.ai-flow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.ai-step-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
}
.ai-step-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--accent));
}
.ai-step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.step-num {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--purple);
  background: rgba(124, 58, 237, 0.1);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}
[data-theme="dark"] .step-num {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple-dim);
}
.ai-step-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--ink-900);
  margin-bottom: 0.45rem;
}
.ai-step-desc {
  font-size: 0.83rem;
  color: var(--ink-500);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════
   9. 來源索引庫
══════════════════════════════════════════════════ */
.citation-filters {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.cit-filter-btn {
  padding: 0.4rem 0.85rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-500);
  transition: all var(--t-fast);
}
.cit-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.cit-filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.citations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1rem;
}
.citation-item {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--t-fast);
}
.citation-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.cit-source {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cit-tag {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--ink-500);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}
.cit-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-800);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}
.cit-open-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-pulse);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  transition: all var(--t-fast);
}
.cit-open-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ══════════════════════════════════════════════════
   頁尾
══════════════════════════════════════════════════ */
.page-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-raised);
  padding: 3.5rem 1.5rem;
  text-align: center;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
}
.footer-quote {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-600);
  margin-bottom: 0.85rem;
  line-height: 1.6;
}
.footer-meta {
  font-size: 0.8rem;
  color: var(--ink-400);
}

/* ══════════════════════════════════════════════════
   全螢幕響應式適配
══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .hero-headline { font-size: 2.2rem; }
  .section-title { font-size: 1.55rem; }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger-btn { display: flex; }
  .hero-section { padding: 2rem 1.25rem 1.75rem; }
  .card-pad-lg { padding: 1.5rem 1.25rem; }
  .main-wrapper { padding-left: 1rem; padding-right: 1rem; }
  .voltage-btns { grid-template-columns: repeat(2, 1fr); }
  .optical-contrast-meter { grid-template-columns: 1fr; }
  .radio-option-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-metrics { grid-template-columns: 1fr 1fr; }
  .glossary-grid { grid-template-columns: 1fr; }
  .citations-grid { grid-template-columns: 1fr; }
  .result-metrics { grid-template-columns: 1fr; }
}

/* 印刷模式優化 */
@media print {
  .header-nav, .theme-toggle-btn, .hamburger-btn, .mobile-nav-drawer, .drawer-overlay, .progress-bar, .eink-flash-overlay {
    display: none !important;
  }
  .main-wrapper { padding-top: 1rem; }
  .card, .term-card, .color-tech-card { break-inside: avoid; }
}
