/* 成果網站 v3：全黑產品發表頁風格。所有顏色、字級、間距都由下方 token 決定。
   定案為全黑（使用者 2026-11-26 選 A），淺色系統設定也維持深色，所以只宣告一套色票。 */
:root {
  color-scheme: dark;
  /* 表面：機殼黑 → 面板 → 抬升，用明度分層，不靠陰影 */
  --bg: #121612; --panel: #1B211B; --raise: #222A22; --well: #171D17;
  --line: #2C352C; --line2: #3A463A;
  --ink: #ECF1EA; --ink2: #A6B1A4;
  --green: #7FD13B; --green-hi: #93DE55; --green-wash: rgba(127, 209, 59, .10); --on-green: #121612;
  --amber: #E3B341;
  /* 字級：8 級，h1 / 內文 = 3.75 */
  --fs-hero: 60px; --fs-stat: 56px; --fs-h1: 44px; --fs-h2: 28px; --fs-title: 19px; --fs-body: 16px; --fs-meta: 14px; --fs-tag: 12px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --top-h: 56px; --col: 1120px; --radius: 6px;
  --font: "Barlow", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 64px); }
p { text-wrap: pretty; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-body)/1.75 var(--font); line-break: strict; overflow-wrap: anywhere; }
img { max-width: 100%; display: block; }
a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--green-hi); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: var(--col); margin: 0 auto; padding: 0 var(--sp-5); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--sp-4); top: var(--sp-2); background: var(--panel); color: var(--ink); padding: var(--sp-2) var(--sp-3); z-index: 50; }
h1, h2, h3 { line-height: 1.3; margin: 0; }
.eyebrow { color: var(--green); font-size: var(--fs-meta); font-weight: 700; margin: 0 0 var(--sp-3); }

/* 頂欄：黑底、目前頁用綠色底線（產品頁的頂欄處理） */
.top { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: var(--sp-5); height: var(--top-h); }
.top nav { margin-left: auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
/* 語言切換：頂欄最右邊的小框 */
.lang { flex: none; color: var(--ink2); font-size: var(--fs-tag); font-weight: 700; line-height: 1.5; text-decoration: none; padding: 3px 8px; border: 1px solid var(--line2); border-radius: 4px; }
.lang:hover { color: var(--ink); border-color: var(--ink2); text-decoration: none; }
.name { color: var(--ink); font-weight: 800; font-size: var(--fs-title); text-decoration: none; white-space: nowrap; }
.name span { color: var(--green); font-weight: 700; margin-left: var(--sp-2); }
.name:hover { color: var(--ink); }
.top nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--sp-5); }
.top nav a { display: block; color: var(--ink2); text-decoration: none; font-size: var(--fs-meta); font-weight: 700; line-height: 1.5; padding: 16px 0 13px; border-bottom: 3px solid transparent; white-space: nowrap; }
.top nav a:hover { color: var(--ink); }
.top nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--green); }

/* 按鈕：綠色實心黑字、4px 圓角；次要按鈕白框 */
.cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-6) 0 0; }
.btn { display: inline-flex; align-items: center; padding: 12px 22px; background: var(--green); color: var(--on-green); font-weight: 700; font-size: var(--fs-body); line-height: 1.5; border-radius: 4px; text-decoration: none; border: 1px solid var(--green); transition: background .2s, transform .2s var(--ease); }
.btn:hover { background: var(--green-hi); color: var(--on-green); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: rgba(236, 241, 234, .08); color: var(--ink); }

/* ── 首頁 hero：左論點、右晶片 ── */
.hero { background: radial-gradient(ellipse 55% 70% at 78% 50%, rgba(127, 209, 59, .13), transparent 70%), var(--bg); border-bottom: 1px solid var(--line); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: var(--sp-7); align-items: center; padding-top: var(--sp-8); padding-bottom: var(--sp-8); }
.hero h1 { font-size: var(--fs-hero); font-weight: 800; line-height: 1.15; margin-bottom: var(--sp-5); }
.lead { font-size: var(--fs-title); line-height: 1.7; margin: 0 0 var(--sp-4); max-width: 26em; }
.affil { color: var(--ink2); font-size: var(--fs-meta); margin: 0; max-width: 36em; }
.hero-chip { margin: 0; }
.hero-chip figcaption { color: var(--ink2); font-size: var(--fs-meta); text-align: center; margin-top: var(--sp-2); }

/* 晶片 SVG */
.chip { width: 100%; height: auto; display: block; line-height: 1.5; }
.chip .blk rect { fill: url(#cellrows); stroke: var(--line2); stroke-width: 1.5; transition: fill .2s, stroke .2s; }
.chip .b-inst { font: 700 12px/1.5 var(--font); fill: #7E8A7C; }
.chip .b-name { font: 700 19px/1.5 var(--font); fill: var(--ink); }
.chip .b-num { font: 700 30px/1.5 var(--font); fill: var(--green); }
.chip .b-unit { font: 400 14px/1.5 var(--font); fill: var(--ink2); }
.chip a.blk { cursor: pointer; }
.chip a.blk:hover rect, .chip a.blk:focus-visible rect, .chip .blk.on rect { fill: #1F2E19; stroke: var(--green); stroke-width: 2.5; }
.chip a.blk:focus-visible { outline: none; }
.chip .blk.on .b-name { fill: var(--green); }
.sig { stroke-dasharray: 9 91; animation: sig 4s linear infinite; }
@keyframes sig { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }

/* 數字帶 */
.stats { background: var(--panel); border-bottom: 1px solid var(--line); }
.stats ul { list-style: none; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats li + li { border-left: 1px solid var(--line); }
.stats a { display: block; padding: var(--sp-6) var(--sp-5); color: var(--ink); text-decoration: none; height: 100%; transition: background .2s; }
.stats a:hover { background: var(--raise); color: var(--ink); }
.stats b { display: block; font-size: var(--fs-stat); font-weight: 700; line-height: 1; color: var(--green); font-variant-numeric: tabular-nums; }
.stats small { line-height: 1.5; font-size: var(--fs-title); color: var(--ink); font-weight: 700; margin-left: var(--sp-1); }
.stats span { display: block; color: var(--ink2); font-size: var(--fs-meta); margin-top: var(--sp-3); line-height: 1.5; }

/* 橫帶與區段標題：標題上方一條綠色短線 */
.band { padding: var(--sp-9) 0 var(--sp-8); }
.band-news { background: var(--panel); border-top: 1px solid var(--line); }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h2::before { content: ""; display: block; width: 36px; height: 3px; background: var(--green); margin-bottom: var(--sp-4); }
.legend { color: var(--ink2); font-size: var(--fs-meta); margin: var(--sp-3) 0 var(--sp-6); line-height: 2; }
/* 英文圖例較長：每個等級是一組，整組換行 */
.legend:lang(en) { max-width: 52em; }
.legend .lg { display: inline-block; margin-right: var(--sp-5); }
.feature-in:lang(en) p:not(.eyebrow):not(.cta) { max-width: 28em; }

/* 代表作：16:9 大圖卡，整張可點 */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); }
.card { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .25s var(--ease), border-color .25s; }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--green); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); z-index: 2; }
.card:hover, .card:focus-within { transform: translateY(-4px); border-color: var(--line2); }
.card:hover::before, .card:focus-within::before { transform: scaleX(1); }
.c-img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--well); }
.c-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .c-img img { transform: scale(1.04); }
.c-body { display: flex; flex-direction: column; flex: 1; padding: var(--sp-5); }
.c-body .eyebrow { margin-bottom: var(--sp-2); }
.card h3 { font-size: var(--fs-title); font-weight: 700; line-height: 1.45; }
.card h3[lang="en"] { font-weight: 700; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card h3 a:focus-visible { outline: none; }
.card:focus-within { outline: 2px solid var(--green); outline-offset: 3px; }
.c-who { color: var(--ink2); font-size: var(--fs-meta); margin: var(--sp-2) 0 var(--sp-4); }
.c-foot { margin: auto 0 0; display: flex; justify-content: space-between; align-items: center; }
.more { color: var(--green); font-weight: 700; font-size: var(--fs-meta); }

/* 近況：左標題、右時間軸 */
.news-in { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--sp-7); }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--sp-4); padding: 0 0 var(--sp-4) var(--sp-5); }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--green); }
.timeline li:first-child::before { background: var(--green); }
.timeline time { color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }
.timeline p { margin: 0; max-width: 36em; }

/* 全幅照片帶 */
.feature { position: relative; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
/* 照片只佔右側，左緣用遮罩淡入：文字永遠落在純色底上，不和照片裡的字疊在一起 */
.feature-bg, .phero-bg { position: absolute; top: 0; right: 0; width: 62%; height: 100%; object-fit: cover;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
.feature-bg { width: 50%; object-position: 0 50%; opacity: .7; }
.feature::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(18, 22, 18, .6), transparent 40%); pointer-events: none; }
.feature-in { position: relative; z-index: 1; padding-top: var(--sp-9); padding-bottom: var(--sp-9); }
.feature h2 { font-size: var(--fs-h1); font-weight: 800; margin-bottom: var(--sp-4); }
.feature p:not(.eyebrow):not(.cta) { max-width: 32em; font-size: var(--fs-title); line-height: 1.7; margin: 0; }

/* ── 分頁頁首 ── */
.phero { position: relative; overflow: hidden; min-height: 340px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.phero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg), transparent 35%); pointer-events: none; }
.phero-trace { background: radial-gradient(ellipse 45% 80% at 82% 50%, rgba(127, 209, 59, .13), transparent 70%), var(--bg); }
.phero-trace::after { display: none; }
.phero-chip { position: absolute; right: max(var(--sp-5), calc((100% - var(--col)) / 2 + var(--sp-5))); top: 50%; width: 300px; transform: translateY(-50%); }
.phero-in { position: relative; z-index: 1; width: 100%; padding-top: var(--sp-8); padding-bottom: var(--sp-7); }
.phero h1 { font-size: var(--fs-h1); font-weight: 800; line-height: 1.2; margin-bottom: var(--sp-3); }
.desc { color: var(--ink2); font-size: var(--fs-title); margin: 0; max-width: 30em; }

/* 段落導覽：黏在頂欄下方，目前段落綠色底線 */
.subnav { position: sticky; top: var(--top-h); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.subnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--sp-6); overflow-x: auto; scrollbar-width: none; }
.subnav a { display: block; padding: var(--sp-3) 0 9px; color: var(--ink2); text-decoration: none; font-size: var(--fs-meta); font-weight: 700; white-space: nowrap; border-bottom: 3px solid transparent; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current] { color: var(--ink); border-bottom-color: var(--green); }

/* ── 分頁內容 ── */
.content { padding-top: var(--sp-4); padding-bottom: var(--sp-9); }
.content > section { padding-top: var(--sp-8); }
.content > section > h2 { margin-bottom: var(--sp-5); }
.sec-note, .aside { color: var(--ink2); font-size: var(--fs-meta); max-width: 36em; }
.sec-note { margin: calc(var(--sp-3) * -1) 0 var(--sp-5); }
[id] { scroll-margin-top: calc(var(--top-h) + 64px); }

/* 條目卡：左照片或徽章、右三行 */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); }
.entry { position: relative; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--sp-5); padding: var(--sp-5); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .25s, transform .25s var(--ease); }
.entry.has-photo { grid-template-columns: 280px minmax(0, 1fr); }
.entry::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; border-radius: var(--radius) var(--radius) 0 0; background: var(--green); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.entry:hover { border-color: var(--line2); transform: translateY(-2px); }
.entry:hover::before { transform: scaleX(1); }
.left { min-width: 0; }
.badge { display: block; text-align: center; padding: var(--sp-2) var(--sp-1); background: var(--well); border: 1px solid var(--line2); color: var(--green); font-weight: 700; font-size: var(--fs-meta); line-height: 1.4; border-radius: 4px; }
.thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.right { min-width: 0; }
.right p { margin: 0; }
.e-title { font-size: var(--fs-title); font-weight: 700; line-height: 1.45; }
.e-title[lang="en"] { font-weight: 700; }
.e-who { color: var(--ink); margin-top: var(--sp-1) !important; }
.e-where { max-width: 36em; color: var(--ink2); font-size: var(--fs-meta); margin-top: var(--sp-1) !important; }
.e-body { margin-top: var(--sp-3); }
.e-body p { margin: 0 0 var(--sp-3); max-width: 36em; }
sup { line-height: 0; }

/* 證據等級標籤 */
.tag { display: inline-block; font-size: var(--fs-tag); line-height: 1.6; padding: 0 7px; border-radius: 3px; white-space: nowrap; vertical-align: 1px; font-weight: 700; }
.tag-a { background: var(--green-wash); color: var(--green); border: 1px solid var(--green); }
.tag-b { color: var(--ink2); border: 1px solid var(--ink2); }
.tag-w { color: var(--amber); border: 1px dashed var(--amber); }

/* 條目內照片列 */
.strip { display: grid; grid-template-columns: 1fr 1fr 1.7fr; gap: var(--sp-2); margin: var(--sp-4) 0; }
.strip figure { margin: 0; min-width: 0; }
.strip img { width: 100%; height: 180px; object-fit: cover; border-radius: 4px; }
.strip figcaption { color: var(--ink2); font-size: var(--fs-meta); margin-top: var(--sp-1); }

/* ICLAB 段：影片、四格數據、功能清單、名次表 */
.content h3 { font-size: var(--fs-title); font-weight: 700; margin: var(--sp-7) 0 var(--sp-3); }
.vid { margin: var(--sp-5) 0; }
.vid video { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--line); background: var(--well); }
.vid figcaption { color: var(--ink2); font-size: var(--fs-meta); margin-top: var(--sp-2); max-width: 36em; }
.dims { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); margin: var(--sp-6) 0; }
.dims div { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: 0 0 var(--radius) var(--radius); padding: var(--sp-5) var(--sp-4); }
.dims b { display: block; font-size: var(--fs-h1); font-weight: 700; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.dims span { display: block; color: var(--ink2); font-size: var(--fs-meta); line-height: 1.5; margin-top: var(--sp-2); }
.feat { margin: 0; padding-left: 1.2em; }
.feat li { margin: 0 0 var(--sp-3); max-width: 36em; }
.feat li::marker { color: var(--green); }
.feat b { font-weight: 700; color: var(--ink); }
.tbl-wrap { overflow-x: auto; margin: var(--sp-3) 0; }
.rank { border-collapse: collapse; width: 100%; font-size: var(--fs-meta); min-width: 560px; }
.rank caption { max-width: 36em; text-align: left; color: var(--ink2); padding-bottom: var(--sp-3); }
.rank th, .rank td { padding: var(--sp-3) var(--sp-4) var(--sp-3) 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.rank th { color: var(--ink2); font-weight: 700; }
.rank .r { text-align: right; font-variant-numeric: tabular-nums; color: var(--green); font-weight: 700; }
.rank td:not(:last-child), .rank th:not(:last-child) { white-space: nowrap; }
.rank td:last-child { min-width: 260px; }

footer { border-top: 1px solid var(--line); color: var(--ink2); font-size: var(--fs-meta); }
footer .wrap { padding-top: var(--sp-6); padding-bottom: var(--sp-7); }
footer p { margin: 0; }

/* ── 窄螢幕 ── */
@media (max-width: 960px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); }
  .hero-chip { max-width: 420px; }
  .cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .phero-chip { opacity: .35; }
}
@media (max-width: 720px) {
  :root { --fs-hero: 38px; --fs-h1: 32px; --fs-stat: 44px; --fs-h2: 24px; }
  .wrap { padding: 0 var(--sp-4); }
  .top { position: static; }
  /* 手機：第一列名字＋語言切換，第二列導覽 */
  .top-in { height: auto; flex-wrap: wrap; gap: 0 var(--sp-4); padding-top: var(--sp-3); }
  .lang { margin-left: auto; }
  .top nav { order: 3; width: 100%; margin-left: 0; }
  .top nav ul { gap: var(--sp-4); }
  .top nav a { padding: 10px 0 9px; }
  .subnav { top: 0; }
  html { scroll-padding-top: 64px; }
  [id] { scroll-margin-top: 64px; }
  .hero-in { padding-top: var(--sp-7); padding-bottom: var(--sp-7); }
  .chip .b-inst { display: none; }
  .stats ul { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 0; }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stats a { padding: var(--sp-5) var(--sp-4); }
  .band { padding: var(--sp-8) 0 var(--sp-7); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .news-in { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .feature-in { padding-top: var(--sp-8); padding-bottom: var(--sp-8); }
  .phero { min-height: 260px; }
  .phero-bg, .feature-bg { width: 100%; opacity: .18; -webkit-mask-image: none; mask-image: none; }
  .phero-chip { display: none; }
  .entry, .entry.has-photo { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-4); }
  .badge { display: inline-block; padding: var(--sp-1) var(--sp-3); }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip .wide { grid-column: 1 / -1; }
  .strip img { height: 140px; }
  .dims { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* 減少動態：訊號停住、走線靜態亮著，其餘轉場全部關掉 */
@media (prefers-reduced-motion: reduce) {
  .sig { animation: none; stroke-dasharray: none; opacity: .5; }
  *, *::before, *::after { transition: none !important; }
  .card:hover, .entry:hover, .btn:hover { transform: none; }
  .card:hover .c-img img { transform: none; }
}
