/* ══════════════════════════════════════════════════════════
   THEME B · 儀器面板 Instrument Panel
   參考 getlayers Evolve / Artefakt 風格
   ・純黑底，八欄藍圖格線 + 交點十字
   ・白色字只分兩種強度，層級靠字體與大小寫
   ・天藍漸層只用在「儀器」：按鈕外框、進度條、啟用狀態
   ・零圓角、零陰影，卡片只剩細線與角落括號
   載入順序：styles-b.css 之後。只作用在 html[data-skin="b"]
══════════════════════════════════════════════════════════ */

/* ── Tokens（!important 是為了蓋過 shared.js 寫在 html style 上的 --a1~--a4） ── */
html[data-skin="b"] {
  --bg-base:  #000000 !important;
  --bg-mid:   #050505 !important;
  --glass-1:  rgba(255,255,255,0.02) !important;
  --glass-2:  rgba(255,255,255,0.035) !important;
  --glass-3:  rgba(255,255,255,0.06) !important;
  --glass-4:  rgba(255,255,255,0.09) !important;
  --border-1: rgba(255,255,255,0.15) !important;
  --border-2: rgba(255,255,255,0.20) !important;
  --border-3: rgba(255,255,255,0.32) !important;
  --border-a: rgba(53,194,180,0.55) !important;
  --a1: #97feed !important;
  --a2: #35c2b4 !important;
  --a3: #1f9e94 !important;
  --a4: #d6fff8 !important;
  --a5: #ff1f4a !important;
  --a6: #35c2b4 !important;
  --t0: #ffffff !important;
  --t1: rgba(255,255,255,0.88) !important;
  --t2: rgba(255,255,255,0.64) !important;
  --t3: rgba(255,255,255,0.46) !important;
  --t4: rgba(255,255,255,0.15) !important;
  --glow-a1: transparent !important;
  --glow-a2: transparent !important;
  --glow-a3: transparent !important;
  --f-heading: 'Inter Tight', 'Noto Sans TC', sans-serif !important;
  --f-display: 'Inter Tight', 'Noto Sans TC', sans-serif !important;
  --f-mono:    'Space Mono', 'Noto Sans TC', 'Courier New', monospace !important;
  --r-sm: 0px !important; --r-md: 0px !important; --r-lg: 0px !important; --r-xl: 0px !important;

  /* B 專用 */
  --b-ramp: linear-gradient(90deg, #97feed 0%, #35c2b4 45%, #1f9e94 100%);
  --b-mark: rgba(255,255,255,0.55);
  --b-mark-on: #97feed;
  --b-grid: rgba(255,255,255,0.055);
  --b-cross: #666666;
  --b-ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

/* ── 全域：零圓角、零陰影、零光暈 ── */
html[data-skin="b"] *,
html[data-skin="b"] *::before,
html[data-skin="b"] *::after {
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
html[data-skin="b"] ::selection { background: rgba(151,254,237,0.28); color: #fff; }
html[data-skin="b"] :focus-visible { outline: 1px solid #97feed !important; outline-offset: 3px; }

/* ── 底：純黑 + 八欄藍圖格線 + 交點十字 ── */
html[data-skin="b"] body { background: #000 !important; color: var(--t1); }
html[data-skin="b"] body::after { display: none !important; }
html[data-skin="b"] body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cpath d='M6 1v10M1 6h10' stroke='%23666' stroke-width='1'/%3E%3C/svg%3E"),
    linear-gradient(90deg, var(--b-grid) 1px, transparent 1px),
    linear-gradient(var(--b-grid) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 160px 160px;
  background-position: -6px -6px, 0 0, 0 0;
}
html[data-skin="b"] .ripple-container,
html[data-skin="b"] .mode-toggle,
html[data-skin="b"] #tweaksMode,
html[data-skin="b"] #tweaksTheme,
html[data-skin="b"] .tw-lbl:has(+ #tweaksMode),
html[data-skin="b"] .tw-lbl:has(+ #tweaksTheme) { display: none !important; }

/* ── 字 ── */
html[data-skin="b"] .sec-h2,
html[data-skin="b"] .page-hero-h1,
html[data-skin="b"] h1, html[data-skin="b"] h2, html[data-skin="b"] h3 {
  font-family: var(--f-display);
}
html[data-skin="b"] .sec-h2 {
  font-weight: 400; letter-spacing: -0.025em; line-height: 1.05; color: #fff;
}
html[data-skin="b"] .grad-text,
html[data-skin="b"] .hero-proof-num,
html[data-skin="b"] .page-hero-h1 {
  background: none !important;
  -webkit-text-fill-color: #fff !important;
  color: #fff !important;
}
html[data-skin="b"] .page-hero-h1 { font-weight: 400; letter-spacing: -0.03em; }
html[data-skin="b"] .sec-label {
  color: rgba(255,255,255,0.6); letter-spacing: 0.18em;
}
html[data-skin="b"] .sec-label::before {
  width: 8px; height: 8px; background: none;
  border: 1px solid #97feed;
}
html[data-skin="b"] .sec-divider,
html[data-skin="b"] .page-hero::after {
  background: var(--border-1) !important; opacity: 1 !important; height: 1px;
}

/* ── 導覽列 ── */
html[data-skin="b"] nav {
  background: rgba(0,0,0,0.72) !important;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-1);
}
html[data-skin="b"] nav.scrolled { background: rgba(0,0,0,0.88) !important; border-color: var(--border-2); }
html[data-skin="b"] .nav-logo-mark { border-color: var(--border-2); }
html[data-skin="b"] .nav-wordmark { font-family: var(--f-mono); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; }
html[data-skin="b"] .nav-links a {
  text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.6);
  border-color: transparent !important; background: transparent !important;
}
html[data-skin="b"] .nav-links a:hover,
html[data-skin="b"] .nav-links a.active,
html[data-skin="b"] .nav-links a.active-page,
html[data-skin="b"] .nav-links a[aria-current="page"] { color: #fff !important; }
html[data-skin="b"] .nav-links a::after,
html[data-skin="b"] .nav-links a.active-page::after { height: 1px; background: var(--b-ramp); }
html[data-skin="b"] .nav-more-menu,
html[data-skin="b"] .mobile-nav-drawer,
html[data-skin="b"] .toc-dot .toc-tip {
  background: rgba(0,0,0,0.96) !important; border: 1px solid var(--border-2);
}
html[data-skin="b"] .nav-more-menu a:hover { background: rgba(255,255,255,0.05); border-color: transparent; }
html[data-skin="b"] .lang-pill { background: transparent; border-color: var(--border-2); }
html[data-skin="b"] .lang-btn.on { background: rgba(151,254,237,0.1); color: #97feed; }

/* ── 儀器：按鈕（天藍漸層只出現在這裡） ── */
html[data-skin="b"] .btn-primary,
html[data-skin="b"] .nav-cta {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-image: var(--b-ramp) 1 !important;
  color: #97feed !important;
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 400;
  transition: background .3s var(--b-ease), color .3s var(--b-ease);
}
html[data-skin="b"] .btn-primary::before { display: none; }
html[data-skin="b"] .btn-primary::after { content: '>>'; font-family: var(--f-mono); font-size: 11px; color: #1f9e94; margin-left: 4px; }
html[data-skin="b"] .btn-primary:hover,
html[data-skin="b"] .nav-cta:hover {
  background: rgba(151,254,237,0.08) !important; color: #fff !important; transform: none !important;
}
html[data-skin="b"] .btn-secondary {
  background: transparent !important; border: 1px solid var(--border-2) !important;
  color: rgba(255,255,255,0.8) !important; text-transform: uppercase; letter-spacing: 0.1em;
}
html[data-skin="b"] .btn-secondary:hover { border-color: rgba(255,255,255,0.5) !important; color: #fff !important; transform: none !important; }

/* ── 卡片：實心黑底蓋住格線，細線 + 四角括號 ── */
html[data-skin="b"] .glass,
html[data-skin="b"] .glass-2,
html[data-skin="b"] .glass-card,
html[data-skin="b"] .stat-card,
html[data-skin="b"] .r-card,
html[data-skin="b"] .news-card,
html[data-skin="b"] .equip-card,
html[data-skin="b"] .stu-card,
html[data-skin="b"] .course-card,
html[data-skin="b"] .tl-card,
html[data-skin="b"] .cta-card,
html[data-skin="b"] .profile-card,
html[data-skin="b"] .about-pi-card,
html[data-skin="b"] .sitemap {
  --m: var(--b-mark);
  background:
    linear-gradient(var(--m), var(--m)) left top / 9px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) left top / 1px 9px no-repeat,
    linear-gradient(var(--m), var(--m)) right top / 9px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) right top / 1px 9px no-repeat,
    linear-gradient(var(--m), var(--m)) left bottom / 9px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) left bottom / 1px 9px no-repeat,
    linear-gradient(var(--m), var(--m)) right bottom / 9px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) right bottom / 1px 9px no-repeat,
    #000 !important;
  border: 1px solid var(--border-1) !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  transition: border-color .3s var(--b-ease) !important;
}
html[data-skin="b"] .glass-card:hover,
html[data-skin="b"] .stat-card:hover,
html[data-skin="b"] .r-card:hover,
html[data-skin="b"] .news-card:hover,
html[data-skin="b"] .equip-card:hover,
html[data-skin="b"] .stu-card:hover,
html[data-skin="b"] .course-card:hover,
html[data-skin="b"] .tl-card:hover {
  --m: var(--b-mark-on);
  border-color: rgba(151,254,237,0.35) !important;
  transform: none !important;
}
html[data-skin="b"] .glass-card::after,
html[data-skin="b"] .r-card::after,
html[data-skin="b"] .profile-card::after { display: none !important; }
html[data-skin="b"] .profile-card::before { background: var(--border-1); }

/* 數字：白、細、等寬數字 */
html[data-skin="b"] .stat-n,
html[data-skin="b"] .hero-proof-num,
html[data-skin="b"] .equip-stat-n,
html[data-skin="b"] .pos-n {
  font-family: var(--f-display); font-weight: 300 !important; color: #fff !important;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
html[data-skin="b"] .stat-card::before { height: 1px; }

/* ── 標籤類：全部變成細線方框、等寬大寫 ── */
html[data-skin="b"] .tag-pill,
html[data-skin="b"] .micro-tag,
html[data-skin="b"] .status-pill,
html[data-skin="b"] .tech-chip,
html[data-skin="b"] .equip-tag,
html[data-skin="b"] .badge,
html[data-skin="b"] .gal-tab,
html[data-skin="b"] .proj-tab {
  background: transparent !important;
  border: 1px solid var(--border-1) !important;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase; letter-spacing: 0.08em;
}
html[data-skin="b"] .micro-tag.hi,
html[data-skin="b"] .gal-tab.on,
html[data-skin="b"] .proj-tab.on {
  color: #97feed !important; border-color: rgba(151,254,237,0.45) !important;
}
html[data-skin="b"] .tag-pill:hover { color: #fff; border-color: var(--border-3) !important; }

/* 狀態燈：方形，只閃不發光 */
html[data-skin="b"] .pulse-dot,
html[data-skin="b"] .s-dot { background: #97feed !important; animation: b-blink 2.4s steps(1) infinite !important; }
html[data-skin="b"] .s-dot.b { animation-delay: .6s !important; }
html[data-skin="b"] .s-dot.v { animation-delay: 1.2s !important; }
@keyframes b-blink { 0%, 70% { opacity: 1; } 71%, 100% { opacity: .25; } }

/* ── 首頁 Hero ── */
html[data-skin="b"] .hero { cursor: default; }
html[data-skin="b"] .hero::after { background: linear-gradient(to top, #000 0%, rgba(0,0,0,0) 100%); }
html[data-skin="b"] .hero-eyebrow { color: rgba(255,255,255,0.6); }
html[data-skin="b"] .hero-h1 { font-weight: 400; letter-spacing: -0.045em; line-height: 0.88; }
html[data-skin="b"] .hero-h1 .line1 { color: #fff; }
html[data-skin="b"] .hero-h1 .line2 { font-weight: 300; color: rgba(255,255,255,0.4); }
html[data-skin="b"] .hero-fullname { text-transform: uppercase; letter-spacing: 0.12em; }
html[data-skin="b"] .hero-proof { gap: 0; border-top: 1px solid var(--border-1); padding-top: 18px; }
html[data-skin="b"] .hero-proof-item { padding-right: 28px; margin-right: 28px; border-right: 1px solid var(--border-1); }
html[data-skin="b"] .hero-proof-item:last-child { border-right: 0; margin-right: 0; }
html[data-skin="b"] .hero-proof-num { font-size: 40px; }
html[data-skin="b"] .scroll-cue-line { background: linear-gradient(to bottom, #97feed, transparent); }

/* ── 其他區塊 ── */
html[data-skin="b"] .ticker-wrap { background: #000; border-color: var(--border-1); }
html[data-skin="b"] .ticker-label { background: #000; color: #97feed; }
html[data-skin="b"] .tk b { color: #fff; }
html[data-skin="b"] footer { background: #000 !important; backdrop-filter: none; border-top: 1px solid var(--border-1); }
html[data-skin="b"] .toc-rail { background: rgba(0,0,0,0.8); border-color: var(--border-1); }
html[data-skin="b"] .toc-dot { width: 8px; height: 8px; background: transparent; border-color: var(--border-3); }
html[data-skin="b"] .toc-dot.active { background: #97feed; border-color: #97feed; }
html[data-skin="b"] #scroll-progress { height: 2px !important; background: transparent !important; }
html[data-skin="b"] #scroll-progress-fill { background: var(--b-ramp) !important; }
html[data-skin="b"] #backToTop { background: #000 !important; border: 1px solid var(--border-2) !important; color: #fff; }
html[data-skin="b"] .page-hero { border-bottom: 1px solid var(--border-1); }

/* 進入動畫：統一一條減速曲線 */
html[data-skin="b"] .rv { transition: opacity .7s var(--b-ease), transform .7s var(--b-ease); transform: translateY(12px); }
html[data-skin="b"] .rv.in { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html[data-skin="b"] .pulse-dot,
  html[data-skin="b"] .s-dot { animation: none !important; }
}

/* ── 修正與補強 ── */
/* 首屏地形：左側淡出，讓文字區乾淨 */
html[data-skin="b"] #hero-particles {
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.35) 30%, #000 62%);
          mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.35) 30%, #000 62%);
}
/* 標籤蓋住背後的格線與地形 */
html[data-skin="b"] .tag-pill,
html[data-skin="b"] .micro-tag,
html[data-skin="b"] .status-pill { background: #000 !important; }
/* 數字帶：四欄等寬，原本第一張跨兩欄造成最後一張落單 */
html[data-skin="b"] .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
html[data-skin="b"] .stat-card:nth-child(1) { grid-column: auto !important; }
html[data-skin="b"] .stat-card + .stat-card { border-left-width: 0 !important; }
html[data-skin="b"] .stat-card .stat-n,
html[data-skin="b"] .stat-card:nth-child(1) .stat-n { font-size: clamp(40px, 4.4vw, 60px); }
@media (max-width: 768px) {
  html[data-skin="b"] .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-skin="b"] .stat-card:nth-child(3) { border-left-width: 1px !important; }
  html[data-skin="b"] .stat-card:nth-child(n+3) { border-top-width: 0 !important; }
  html[data-skin="b"] .hero-proof-item { padding-right: 16px; margin-right: 16px; }
  html[data-skin="b"] .hero-proof-num { font-size: 32px; }
}
@media (max-width: 768px) {
  html[data-skin="b"] #hero-particles {
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 45%, rgba(0,0,0,0.6) 75%, #000 100%);
            mask-image: linear-gradient(180deg, transparent 0%, transparent 45%, rgba(0,0,0,0.6) 75%, #000 100%);
  }
}
@media (max-width: 480px) {
  html[data-skin="b"] .hero-proof-item { padding-right: 12px; margin-right: 12px; }
  html[data-skin="b"] .hero-proof-num { font-size: 28px; }
}

/* ── 頁內分頁標籤（tabs-b.js）：黏在導覽列下方，一次只顯示一個區塊 ── */
html[data-skin="b"] .page-tabs {
  position: sticky; top: 64px; z-index: 400;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-1); border-bottom: 1px solid var(--border-1);
}
html[data-skin="b"] .page-tabs .wrap {
  display: flex; overflow-x: auto; scrollbar-width: none;
  padding-top: 0 !important; padding-bottom: 0 !important;
}
html[data-skin="b"] .page-tabs .wrap::-webkit-scrollbar { display: none; }
html[data-skin="b"] .page-tab {
  position: relative; display: inline-flex; align-items: baseline; gap: 10px;
  padding: 18px 24px; white-space: nowrap; text-decoration: none;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--t3); border-right: 1px solid var(--border-1);
  transition: color .2s;
}
html[data-skin="b"] .page-tab:first-child { border-left: 1px solid var(--border-1); }
html[data-skin="b"] .page-tab:hover { color: var(--t1); }
html[data-skin="b"] .page-tab:focus-visible { outline: 1px solid #97feed; outline-offset: -1px; }
html[data-skin="b"] .page-tab .pt-n { font-size: 10px; color: var(--t4); }
html[data-skin="b"] .page-tab .pt-c { font-size: 10px; color: #97feed; }
html[data-skin="b"] .page-tab[aria-selected="true"] { color: #fff; background: rgba(255,255,255,0.03); }
html[data-skin="b"] .page-tab[aria-selected="true"] .pt-n { color: #97feed; }
html[data-skin="b"] .page-tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--b-ramp);
}
/* 分頁模式下，區塊間的分隔線和右側小圓點導覽用不到 */
html.has-tabs .sec-divider,
html.has-tabs .toc-rail { display: none !important; }
html.has-tabs section[role="tabpanel"] { border-top: 0 !important; }
html.has-tabs section[hidden] { display: none !important; }
@media (max-width: 768px) {
  html[data-skin="b"] .page-tabs { top: 60px; }
  html[data-skin="b"] .page-tab { padding: 15px 13px; gap: 6px; font-size: 11px; letter-spacing: .05em; flex: 1 0 auto; justify-content: center; }
  html[data-skin="b"] .page-tab .pt-n { display: none; }
}

/* ── 修正：手機版遮罩關閉時是透明但仍會吃掉點擊，導致內容連結點不到 ── */
.mobile-nav-overlay { pointer-events: none; }
.mobile-nav-overlay.open { pointer-events: auto; }
/* overflow-x:hidden 會讓 body 變成捲動容器，黏著標籤因此失效；clip 一樣裁掉橫向溢出但不影響 sticky */
html[data-skin="b"],
html[data-skin="b"] body { overflow-x: clip !important; }
/* 往下捲導覽列收起時，標籤列補到最上緣 */
html[data-skin="b"] .page-tabs { transition: top .3s var(--b-ease); }
html[data-skin="b"].nav-up .page-tabs { top: 0; }
/* 導覽列：七項加右側按鈕，中寬螢幕只留中文，避免換行 */
html[data-skin="b"] .nav-links a, html[data-skin="b"] .nav-wordmark, html[data-skin="b"] .lang-btn { white-space: nowrap; }
@media (max-width: 1360px) { html[data-skin="b"] .nav-links .nl-en { display: none; } }

/* ── 首頁掃描穿越（scan-b.js）：320vh 的軌道裡放一個黏著舞台，文字釘在四角 ── */
html[data-skin="b"] .scan-track { position: relative; height: 320vh; background: #000; padding: 0; }
html[data-skin="b"] .scan-stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
html[data-skin="b"] .scan-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
html[data-skin="b"] .scan-stage::after {   /* 下緣淡出，接到下一段 */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18vh; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,.85));
}
html[data-skin="b"] .scan-ui { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
html[data-skin="b"] .scan-block { position: absolute; max-width: 30rem; will-change: opacity, transform; }
html[data-skin="b"] .scan-intro { left: 48px; bottom: 120px; max-width: 40rem; }
html[data-skin="b"] .scan-eyebrow {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--t2);
}
html[data-skin="b"] .scan-title {
  font-family: var(--f-display); font-weight: 400; letter-spacing: -.035em; line-height: .92;
  font-size: clamp(56px, 10vw, 148px); color: #fff;
}
html[data-skin="b"] .scan-title span {
  font-family: var(--f-mono); font-size: .16em; letter-spacing: .3em; margin-left: .6em; vertical-align: .9em; color: #97feed;
}
html[data-skin="b"] .scan-block p { margin: 18px 0 0; font-size: 15px; line-height: 1.75; color: var(--t1); max-width: 34rem; }
html[data-skin="b"] .scan-ch h3 {
  margin: 10px 0 0; font-family: var(--f-display); font-weight: 400; letter-spacing: -.03em; line-height: 1;
  font-size: clamp(40px, 6vw, 84px); color: #fff;
}
html[data-skin="b"] .scan-n { font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em; color: #97feed; }
html[data-skin="b"] .scan-ch.ch1 { left: 48px; top: 120px; }
html[data-skin="b"] .scan-ch.ch2 { right: 48px; top: 120px; text-align: right; }
html[data-skin="b"] .scan-ch.ch2 p { margin-left: auto; }
html[data-skin="b"] .scan-ch.ch3 { left: 48px; bottom: 120px; }
html[data-skin="b"] .scan-hud {
  position: absolute; left: 48px; right: 48px; bottom: 36px; display: flex; align-items: center; gap: 24px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--t3);
}
html[data-skin="b"] .scan-steps { display: flex; gap: 18px; margin: 0; padding: 0; list-style: none; white-space: nowrap; }
html[data-skin="b"] .scan-steps li { transition: color .3s; }
html[data-skin="b"] .scan-steps li.done { color: var(--t2); }
html[data-skin="b"] .scan-steps li.on { color: #97feed; }
html[data-skin="b"] .scan-rule { flex: 1; height: 1px; background: var(--border-1); position: relative; overflow: hidden; }
html[data-skin="b"] .scan-rule i { position: absolute; inset: 0; background: var(--b-ramp); transform-origin: left; transform: scaleX(0); }
html[data-skin="b"] [data-hud="count"] { min-width: 15ch; text-align: right; white-space: nowrap; }
/* 掃描穿越之後的原首頁：上方不必再留導覽列高度的大留白 */
html[data-skin="b"] .scan-track + .hero { border-top: 1px solid var(--border-1); }

@media (max-width: 768px) {
  html[data-skin="b"] .scan-track { height: 280vh; }
  html[data-skin="b"] .scan-intro, html[data-skin="b"] .scan-ch.ch1, html[data-skin="b"] .scan-ch.ch3 { left: 20px; right: 20px; }
  html[data-skin="b"] .scan-ch.ch2 { left: 20px; right: 20px; text-align: left; }
  html[data-skin="b"] .scan-ch.ch2 p { margin-left: 0; }
  html[data-skin="b"] .scan-intro, html[data-skin="b"] .scan-ch.ch3 { bottom: 96px; }
  html[data-skin="b"] .scan-ch.ch1, html[data-skin="b"] .scan-ch.ch2 { top: 92px; }
  html[data-skin="b"] .scan-block p { font-size: 14px; }
  html[data-skin="b"] .scan-hud { left: 20px; right: 20px; bottom: 28px; gap: 14px; }
  html[data-skin="b"] .scan-steps { gap: 10px; }
  html[data-skin="b"] [data-hud="count"] { display: none; }
}

/* 降級：不黏著，一張靜態圖，三幕文字排成一列 */
html[data-skin="b"] .scan-static { height: auto; }
html[data-skin="b"] .scan-static .scan-stage { position: relative; height: auto; min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; }
html[data-skin="b"] .scan-static .scan-ui { position: relative; inset: auto; padding: 120px 48px 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
html[data-skin="b"] .scan-static .scan-block { position: static; max-width: none; }
html[data-skin="b"] .scan-static .scan-intro { grid-column: 1 / -1; }
html[data-skin="b"] .scan-static .scan-ch.ch2 { text-align: left; }
html[data-skin="b"] .scan-static .scan-ch h3 { font-size: 40px; }
html[data-skin="b"] .scan-static .scan-hud { display: none; }
@media (max-width: 768px) { html[data-skin="b"] .scan-static .scan-ui { grid-template-columns: 1fr; padding: 96px 20px 40px; } }
/* 文字壓在點雲上時的上下暗幕（B 風格不用文字陰影） */
html[data-skin="b"] .scan-ui::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.72) 0%, rgba(0,0,0,0) 34%, rgba(0,0,0,0) 56%, rgba(0,0,0,.78) 100%);
}
@media (max-width: 768px) {
  html[data-skin="b"] .scan-ui::before { background: linear-gradient(to bottom, rgba(0,0,0,.85) 0%, rgba(0,0,0,.2) 42%, rgba(0,0,0,.2) 52%, rgba(0,0,0,.88) 100%); }
}

/* ── 點雲作品（pcview-b.js）：卡片與全螢幕瀏覽器 ── */
html[data-skin="b"] .pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-top: 28px; }
html[data-skin="b"] .pc-card { display: flex; flex-direction: column; min-width: 0; padding: 0; text-align: left; background: #000;
  border: 1px solid var(--border-1); color: var(--t1); cursor: pointer; font: inherit; transition: border-color .25s; }
html[data-skin="b"] .pc-card:hover, html[data-skin="b"] .pc-card:focus-visible { border-color: var(--border-a); outline: none; }
html[data-skin="b"] .pc-thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #050505; border-bottom: 1px solid var(--border-1); }
html[data-skin="b"] .pc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--b-ease, ease); }
html[data-skin="b"] .pc-card:hover .pc-thumb img { transform: scale(1.04); }
html[data-skin="b"] .pc-open { position: absolute; right: 12px; bottom: 12px; padding: 6px 10px; font: 11px/1 var(--f-mono); letter-spacing: .08em;
  color: var(--a1); border: 1px solid var(--border-a); background: rgba(0,0,0,.6); }
html[data-skin="b"] .pc-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
html[data-skin="b"] .pc-meta { font: 11px/1.4 var(--f-mono); color: var(--t3); letter-spacing: .06em; }
html[data-skin="b"] .pc-title { font: 500 18px/1.3 var(--f-heading); color: var(--t0); }
html[data-skin="b"] .pc-desc { font-size: 13px; line-height: 1.6; color: var(--t2); }
html[data-skin="b"] .pc-empty { color: var(--t3); font: 12px var(--f-mono); }

#pcViewer { position: fixed; inset: 0; z-index: 5000; background: #000; display: none; }
#pcViewer.on { display: block; }
html.pcv-lock, html.pcv-lock body { overflow: hidden !important; }
#pcViewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#pcViewer canvas:active { cursor: grabbing; }
#pcViewer .pcv-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding: 20px 24px; pointer-events: none; background: linear-gradient(#000c, #0000); }
#pcViewer .pcv-meta { font: 11px/1.4 'Space Mono', monospace; color: rgba(255,255,255,.5); letter-spacing: .06em; }
#pcViewer .pcv-title { font: 500 22px/1.3 'Inter Tight', 'Noto Sans TC', sans-serif; color: #fff; margin-top: 4px; }
#pcViewer .pcv-btn { pointer-events: auto; min-height: 36px; padding: 0 12px; background: rgba(0,0,0,.6); color: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.2); font: 12px/1 'Space Mono', 'Noto Sans TC', monospace; cursor: pointer; }
#pcViewer .pcv-btn:hover, #pcViewer .pcv-btn:focus-visible { border-color: rgba(53,194,180,.55); color: #fff; outline: none; }
#pcViewer .pcv-btn[aria-pressed="true"] { color: #97feed; border-color: rgba(53,194,180,.55); }
#pcViewer .pcv-btn:disabled { opacity: .35; cursor: default; }
#pcViewer .pcv-close { min-width: 40px; font-size: 16px; }
#pcViewer .pcv-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(#0000, #000c); }
#pcViewer .pcv-size { display: inline-flex; align-items: center; gap: 6px; font: 11px 'Space Mono', monospace; color: rgba(255,255,255,.5); }
#pcViewer .pcv-size .pcv-btn { min-width: 36px; padding: 0; }
#pcViewer .pcv-hint { margin-left: auto; font: 11px 'Space Mono', 'Noto Sans TC', monospace; color: rgba(255,255,255,.46); }
#pcViewer .pcv-load { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(260px, 70vw); text-align: center;
  font: 11px 'Space Mono', monospace; color: #97feed; letter-spacing: .1em; }
#pcViewer .pcv-load[hidden] { display: none; }
#pcViewer .pcv-load i { display: block; height: 1px; margin-top: 10px; background: rgba(255,255,255,.15); }
#pcViewer .pcv-load b { display: block; height: 100%; background: #97feed; transform-origin: left; transform: scaleX(0); }
@media (max-width: 640px) {
  #pcViewer .pcv-top { padding: 14px 16px; }
  #pcViewer .pcv-title { font-size: 18px; }
  #pcViewer .pcv-bar { padding-left: 16px; padding-right: 16px; }
  #pcViewer .pcv-hint { width: 100%; margin-left: 0; }
}

/* ── 首頁開場（scan-b.js）：黑幕、品牌字、照下載量填滿的細線；之後黑幕變透明，讓點雲聚成字樣 ── */
html.intro-on, html.intro-on body { overflow: hidden !important; }
html.intro-fade nav, html.intro-fade .scan-ui { transition: opacity .9s ease !important; }
html.intro-on nav, html.intro-on .scan-ui { opacity: 0 !important; pointer-events: none; }
.scan-veil { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; background: #000; transition: background-color .9s ease, opacity .6s ease; cursor: pointer; }
.scan-veil.clear { background: rgba(0,0,0,0); }
.scan-veil.gone { opacity: 0; pointer-events: none; }
.scan-veil .si-brand { font: 300 15px/1 'Inter Tight', 'Noto Sans TC', sans-serif; letter-spacing: .5em; text-indent: .5em; color: #fff; }
.scan-veil .si-rule { position: relative; display: block; width: 180px; max-width: 60vw; height: 1px; background: rgba(255,255,255,.15); overflow: hidden; }
.scan-veil .si-rule b { position: absolute; inset: 0; background: #97feed; transform-origin: left; transform: scaleX(0); }
.scan-veil .si-num { font: 11px/1 'Space Mono', monospace; letter-spacing: .2em; color: rgba(255,255,255,.6); font-variant-numeric: tabular-nums; }
.scan-veil .si-brand, .scan-veil .si-rule, .scan-veil .si-num { transition: opacity .5s ease; }
.scan-veil.clear .si-brand, .scan-veil.clear .si-rule, .scan-veil.clear .si-num { opacity: 0; }
.scan-veil .si-skip { position: absolute; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom)); padding: 8px 12px; background: none;
  border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.6); font: 11px/1 'Space Mono', 'Noto Sans TC', monospace; letter-spacing: .08em; cursor: pointer; }
.scan-veil .si-skip:hover, .scan-veil .si-skip:focus-visible { color: #fff; border-color: rgba(53,194,180,.55); outline: none; }

/* ── 段落標題：關掉舊站的捲動視差（標題會上下位移，和下方文字疊在一起） ── */
html[data-skin="b"] .sec-h2, html[data-skin="b"] .sec-label { translate: none; }
html[data-skin="b"] .sec-h2:not(.rv-scale), html[data-skin="b"] .sec-label { transform: none !important; }
html[data-skin="b"] .sec-h2.rv-scale.in { transform: none !important; }

/* ── 一腦三場域：手機上選單改成兩欄格子，原本四顆按鈕和標籤擠成直條 ── */
@media (max-width: 768px) {
  html[data-skin="b"] .arch-body { grid-template-columns: minmax(0, 1fr) !important; }
  html[data-skin="b"] .arch-nav { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
    border-right: 0 !important; border-bottom: 1px solid var(--border-1); padding: 14px !important; }
  html[data-skin="b"] .arch-nav > div:first-child { grid-column: 1 / -1; padding: 0 0 8px !important; margin: 0 !important; }
  html[data-skin="b"] .arch-nav-btn { white-space: normal; justify-content: flex-start; text-align: left; min-height: 44px; }
  html[data-skin="b"] .arch-content { padding: 22px 18px !important; }
  html[data-skin="b"] .arch-header { flex-wrap: wrap; gap: 6px; }
}

/* ── 教學頁實務經歷：分類標籤原本佔一欄 auto，長標籤把案名擠成直條、整組撐出畫面 → 標籤移到案名下方 ── */
html[data-skin="b"] .practice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
html[data-skin="b"] .practice-group { min-width: 0; }
html[data-skin="b"] .pg-item { grid-template-columns: 38px minmax(0, 1fr) !important; row-gap: 2px; }
html[data-skin="b"] .pg-cat { grid-column: 2 !important; text-align: left; white-space: normal !important; }
@media (max-width: 768px) { html[data-skin="b"] .practice-grid { grid-template-columns: minmax(0, 1fr) !important; } }

/* ── 作品頁研究案例：手機上專案資訊框蓋住圖說 → 移到圖下方 ── */
@media (max-width: 768px) {
  html[data-skin="b"] .proj-hud { position: static !important; inset: auto !important; transform: none !important;
    margin: 0 !important; max-width: none !important; border-width: 1px 0 0 !important; }
}

/* ── 首頁 hero：舊站的捲動視差以頁首為基準，現在 hero 在掃描段之後，會被往下推、淡掉、下緣的數字被切掉 → 關掉 ── */
html[data-skin="b"] .hero-left, html[data-skin="b"] .hero .profile-card { transform: none !important; opacity: 1 !important; }

/* 研究團隊頁的作品連結會跳到 students 頁的卡片，留出導覽列高度 */
html[data-skin="b"] .stu-card[id] { scroll-margin-top: 88px; }

/* ── EN mode: hide Chinese-only duplicates (2026-11-30) ── */
html[lang="en"] .zh-only,
html[lang="en"] .en-note,
html[lang="en"] .tm-h1-zh,
html[lang="en"] .course-name-en,
html[lang="en"] .proj-title,
html[lang="en"] .proj-body { display: none !important; }
html[lang="en"] .proj-title-en {
  font-family: var(--f-display); font-size: 18px; font-weight: 700;
  color: var(--t0); letter-spacing: 0; line-height: 1.3; margin-bottom: 14px;
}
html[lang="en"] .proj-body-en {
  font-family: inherit; font-size: 14px; color: var(--t2);
  border-left: 0; padding-left: 0;
}
/* scan copy sits on top of the point cloud: keep it readable */
html[data-skin="b"] .scan-block p, html[data-skin="b"] .scan-block h3, html[data-skin="b"] .scan-block .scan-n {
  text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 0 14px rgba(0,0,0,.85);
}
/* English labels are wider: switch to the menu button before the nav runs off the edge */
@media (max-width: 1000px) {
  html[lang="en"][data-skin="b"] .nav-links { display: none !important; }
  html[lang="en"][data-skin="b"] .nav-hamburger { display: flex !important; }
}
@media (max-width: 860px) {
  html[data-skin="b"] .nav-links { display: none !important; }
  html[data-skin="b"] .nav-hamburger { display: flex !important; }
}
