/* Layout: HUD 機台介面 — 黏頂狀態列、斜切面板、兩側直排刻度；■1–■5 對應頁面五個區段。
   主題色由頁尾 script 的 SITE_PALETTE 決定，只換色票，結構不變。 */
:root {
  color-scheme: dark;
  --bg: #02080b;
  --panel: #061820;
  --panel-2: #0a2430;
  --c1: #53d3ff;
  --c1-ink: #021117;
  --c2: #ff4f8b;
  --ink: #e3f8ff;
  --dim: #7fa7b6;
  --line: #1b4757;
  --ok: #3ee8a0;
  --warn: #ffb547;
  --crit: #ff5a4f;
  --f-display: "Rajdhani", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --f-body: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  --f-mono: "Share Tech Mono", Consolas, "Noto Sans TC", monospace;
  --cut: 16px;
}
:root[data-palette="volt"] {
  --bg: #060605;
  --panel: #12110a;
  --panel-2: #1a190d;
  --c1: #ffeb00;
  --c1-ink: #0a0900;
  --c2: #00f0ff;
  --ink: #f6f5e6;
  --dim: #aaa67e;
  --line: #48451d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.7 var(--f-body);
  background-image:
    linear-gradient(color-mix(in srgb, var(--c1) 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--c1) 3%, transparent) 1px, transparent 1px);
  background-size: 100% 32px, 32px 100%;
  transition: background-color .3s ease;
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  /* 掃描線在影片區挖洞（形狀同影片外框內緣，不含邊框）：--hole-* 由 site.js 依影片位置更新 */
  -webkit-mask-image: linear-gradient(#000, #000), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 90' preserveAspectRatio='none'%3E%3Cpath d='M3 9H112L120 3H157V81H48L40 87H3Z'/%3E%3C/svg%3E");
  -webkit-mask-composite: xor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%, var(--hole-w, 0px) var(--hole-h, 0px);
  -webkit-mask-position: 0 0, var(--hole-x, 0px) var(--hole-y, 0px);
  mask-image: linear-gradient(#000, #000), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 90' preserveAspectRatio='none'%3E%3Cpath d='M3 9H112L120 3H157V81H48L40 87H3Z'/%3E%3C/svg%3E");
  mask-composite: exclude;
  mask-repeat: no-repeat;
  mask-size: 100% 100%, var(--hole-w, 0px) var(--hole-h, 0px);
  mask-position: 0 0, var(--hole-x, 0px) var(--hole-y, 0px);
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--c2); outline-offset: 3px; }
.mono { font-family: var(--f-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }

/* 斜切框：外層當邊框，內層當底 */
.frame {
  position: relative; padding: 1px; background: var(--line);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.frame > .fi {
  height: 100%; background: var(--panel);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.frame.hot { background: var(--c1); }
.frame.alt { background: var(--c2); }

/* 兩側直排刻度 */
.rail { position: fixed; top: 50%; transform: translateY(-50%); z-index: 5; display: none; gap: 18px; align-items: center;
  writing-mode: vertical-rl; color: var(--dim); font: 12px/1 var(--f-mono); letter-spacing: .14em; pointer-events: none; }
.rail.l { left: 14px; transform: translateY(-50%) rotate(180deg); }
.rail.r { right: 14px; color: color-mix(in srgb, var(--c1) 70%, var(--dim)); }
.rail b { color: var(--c1); font-weight: 400; }
@media (min-width: 1340px) { .rail { display: flex; } }

/* ── 頂部狀態列 ── */
.hud {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.hud .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark { --cut: 9px; width: 46px; height: 46px; flex: 0 0 46px; }
.brand-mark .fi { display: grid; place-items: center; background: var(--panel-2); }
.brand-mark img { width: 34px; height: 34px; object-fit: contain; }
.brand-text strong { display: block; color: var(--c1); font: 700 22px/1 var(--f-display); letter-spacing: .16em; }
.brand-text span { display: block; margin-top: 4px; color: var(--dim); font: 11px/1 var(--f-mono); letter-spacing: .12em; white-space: nowrap; }
.telemetry { display: flex; gap: 22px; margin-left: auto; color: var(--dim); font: 13px/1 var(--f-mono); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.telemetry b { color: var(--c1); font-weight: 400; }
.hud-actions { display: flex; align-items: center; gap: 12px; }

.btn {
  --cut: 10px; position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 22px;
  border: 0; background: var(--c1); color: var(--c1-ink); text-decoration: none; cursor: pointer;
  font: 700 15px/1 var(--f-display); letter-spacing: .12em;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: filter .15s ease, transform .15s ease;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--c1); box-shadow: inset 0 0 0 1px var(--c1); }
.btn.ghost:hover { background: color-mix(in srgb, var(--c1) 12%, transparent); }
.btn .zh { font-family: var(--f-body); font-weight: 700; letter-spacing: .06em; }

/* ── Hero ── */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding-block: 56px 40px; align-items: start; }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--c1); font: 13px/1.4 var(--f-mono); letter-spacing: .14em; }
.eyebrow i { width: 10px; height: 10px; background: var(--c2); }
.glitch {
  position: relative; margin: 0; color: var(--c1);
  font: 700 clamp(92px, 15vw, 196px)/.82 var(--f-display); letter-spacing: .04em;
  text-shadow: 0 0 28px color-mix(in srgb, var(--c1) 35%, transparent);
  transition: font-size .3s ease;
}
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; opacity: 0; pointer-events: none; text-shadow: none; }
.glitch::before { color: var(--c2); animation: glitchA 6s steps(1) infinite; }
.glitch::after { color: var(--ink); animation: glitchB 6s steps(1) infinite; }
@keyframes glitchA {
  0%, 90%, 100% { opacity: 0; transform: none; clip-path: inset(0); }
  91% { opacity: .9; transform: translate(-7px, 2px); clip-path: inset(8% 0 62% 0); }
  93% { opacity: .9; transform: translate(6px, -2px); clip-path: inset(58% 0 18% 0); }
  95% { opacity: .9; transform: translate(-3px, 0); clip-path: inset(32% 0 44% 0); }
}
@keyframes glitchB {
  0%, 91%, 100% { opacity: 0; transform: none; clip-path: inset(0); }
  92% { opacity: .7; transform: translate(5px, 0); clip-path: inset(70% 0 6% 0); }
  94% { opacity: .7; transform: translate(-5px, 1px); clip-path: inset(14% 0 70% 0); }
}
.hero h2 { margin: 26px 0 0; font: 900 clamp(24px, 3vw, 36px)/1.35 var(--f-body); letter-spacing: .02em; text-wrap: balance; }
.hero h2 em { font-style: normal; color: var(--c1); }
.lead { max-width: 34em; margin: 16px 0 0; color: var(--dim); font-size: 16px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.protocol { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.protocol-id { display: grid; gap: 6px; color: var(--c1); font: 12px/1.1 var(--f-mono); letter-spacing: .18em; }
.protocol-id .bars { display: grid; gap: 4px; }
.protocol-id .bars i { display: block; height: 3px; background: var(--c1); }
.protocol-id .bars i:nth-child(2) { width: 70%; margin-left: 30%; }
.protocol-id .bars i:nth-child(3) { width: 85%; }
.protocol p { margin: 0; color: var(--dim); font: 12px/1.6 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
.protocol p .zh-line { display: block; margin-top: 4px; font-family: var(--f-body); text-transform: none; letter-spacing: .04em; }

/* Hero 右側 HUD 卡 */
.hud-card .fi { display: grid; gap: 20px; padding: 22px; }
.hc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--dim); font: 12px/1 var(--f-mono); letter-spacing: .12em; }
.hc-row b { color: var(--c1); font-weight: 400; }
.load-line { position: relative; height: 3px; background: var(--c1); }
.load-line::after { content: ""; position: absolute; right: 38%; top: -9px; border: 6px solid transparent; border-top-color: var(--c1); }
.queue { display: flex; align-items: center; gap: 16px; }
.queue-bar { flex: 1; height: 22px; background: var(--c2); clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.queue-num { font: 600 34px/1 var(--f-display); color: var(--c2); font-variant-numeric: tabular-nums; }
.queue-num small { font-size: 18px; vertical-align: super; color: var(--ink); }
.ticks { display: flex; gap: 4px; }
.ticks i { width: 9px; height: 18px; background: var(--c1); }
.ticks i.off { background: color-mix(in srgb, var(--c1) 18%, transparent); }
.feed { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg); margin-inline: -12px; } /* 抵銷卡片左右內距，讓影片更寬 */
.feed video { position: absolute; inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px); object-fit: cover; filter: saturate(.8) contrast(1.05); }
.feed-tint { position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--c1) 20%, transparent), color-mix(in srgb, var(--bg) 45%, transparent)); mix-blend-mode: multiply; pointer-events: none; }
.feed-scan { position: absolute; inset: 0; pointer-events: none; }
.feed-scan::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 120% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55)); }
/* 壓在影片上的邊框：各邊粗細不同（左上、右下粗，右上、左下細），內緣有斜切角和一條亮線 */
.feed-frame { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.ff-mask { fill: var(--bg); } /* 影片比 .feed 內縮 1px：邊緣像素只剩邊框底色，避免小數像素的抗鋸齒讓影片從邊框外緣透出 */
.ff-line { fill: none; stroke: var(--c1); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.feed-tag { position: absolute; top: 3.5%; left: 3%; z-index: 3; display: flex; align-items: center; gap: 6px; color: var(--ink); font: 11px/1 var(--f-mono); letter-spacing: .14em; }
.feed-label { position: absolute; right: 3%; bottom: 2.2%; z-index: 3; display: flex; align-items: baseline; gap: 10px; color: var(--c1); font: 13px/1 var(--f-mono); letter-spacing: .12em; }
.feed-label small { color: var(--ink); font-size: 10px; opacity: .85; }
.zone { display: flex; align-items: center; gap: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.zone-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--c1); color: var(--c1); }
.zone-icon svg { width: 26px; height: 26px; }
.zone strong { display: block; font: 700 20px/1.2 var(--f-body); }
.zone strong em { font-style: normal; color: var(--ok); }
.zone span { color: var(--dim); font: 11px/1.4 var(--f-mono); letter-spacing: .1em; }

.hatch { height: 20px; margin-block: 8px 0; border-block: 1px solid var(--c1);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c1) 70%, transparent) 0 2px, transparent 2px 12px); }

/* ── 區段標頭 ── */
section.block { padding-block: 72px 8px; scroll-margin-top: 80px; }
.sec-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 28px; }
.sec-num { display: flex; align-items: center; gap: 6px; color: var(--c1); font: 700 22px/1 var(--f-display); }
.sec-num i { width: 9px; height: 9px; background: var(--c1); }
.sec-num b { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--c1); font-weight: 700; }
.sec-bar { position: relative; padding: 10px 22px; background: var(--c1); color: var(--c1-ink);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 100%, 0 100%); }
.sec-bar h2 { margin: 0; font: 900 clamp(20px, 2.4vw, 28px)/1.2 var(--f-body); letter-spacing: .06em; }
.sec-bar small { display: block; font: 12px/1.2 var(--f-mono); letter-spacing: .16em; opacity: .75; }
.sec-meta { color: var(--dim); font: 12px/1.5 var(--f-mono); letter-spacing: .12em; text-align: right; }

/* 頂部選單 */
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a { padding: 8px 12px; color: var(--dim); font: 500 14px/1 var(--f-body); letter-spacing: .08em; text-decoration: none; }
.site-nav a:hover { color: var(--c1); }
.site-nav a b { margin-right: 6px; color: var(--c1); font: 12px/1 var(--f-mono); font-weight: 400; }

/* ■1 關於雨幕 */
.about { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; }
.bio .fi { padding: 28px; }
.bio-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.bio-head strong { font: 700 24px/1 var(--f-display); letter-spacing: .14em; }
.bio-head strong span { margin-left: 10px; color: var(--c1); font-family: var(--f-body); letter-spacing: .2em; }
.bio-head > span { color: var(--dim); font: 11px/1.4 var(--f-mono); letter-spacing: .1em; text-align: right; }
.bio p { margin: 20px 0 6px; color: color-mix(in srgb, var(--ink) 86%, var(--dim)); max-width: 40em; }
.bio p strong { color: var(--c1); }
.facts { margin: 14px 0 0; }
.facts > div { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts svg { width: 28px; height: 28px; color: var(--c1); }
.facts dt { font-weight: 700; font-size: 16px; line-height: 1.3; }
.facts dt small { display: block; color: var(--dim); font: 11px/1.4 var(--f-mono); letter-spacing: .12em; }
.facts dd { margin: 0; padding-right: 12px; border-right: 1px solid var(--dim); color: var(--c1); font: 15px/1.3 var(--f-mono); text-align: right; }
.swatch { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; background: var(--c1); }

.loop .fi { padding: 22px; }
.panel-title { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px; color: var(--ink); font: 700 16px/1.3 var(--f-body); }
.panel-title span { color: var(--dim); font: 11px/1.6 var(--f-mono); letter-spacing: .12em; }
.loop-note { margin: 0 0 8px; color: var(--dim); font-size: 13px; }

/* ■2 我們做什麼 */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pillar { --cut: 22px; }
.pillar .fi { display: flex; flex-direction: column; gap: 14px; padding: 24px; transition: background .2s ease; }
.pillar:hover { background: var(--c1); }
.pillar:hover .fi { background: var(--panel-2); }
.pillar.alt:hover { background: var(--c2); }
.pillar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stage { padding: 4px 10px; border: 1px solid var(--c1); color: var(--c1); font: 12px/1 var(--f-mono); letter-spacing: .14em; }
.pillar.alt .stage { border-color: var(--c2); color: var(--c2); }
.hex { width: 64px; height: 72px; display: grid; place-items: center; color: var(--c1);
  background: color-mix(in srgb, var(--c1) 10%, transparent);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.pillar.alt .hex { color: var(--c2); background: color-mix(in srgb, var(--c2) 12%, transparent); }
.hex svg { width: 32px; height: 32px; }
.pillar h3 { margin: 0; font: 700 24px/1.3 var(--f-body); }
.pillar.alt h3 { color: var(--c2); }
.pillar .code { display: block; color: var(--dim); font: 13px/1 var(--f-mono); letter-spacing: .12em; }
.pillar p { margin: 0; color: var(--dim); font-size: 14px; }
.items { display: grid; gap: 0; margin: auto 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.items li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.items li svg { width: 20px; height: 20px; color: var(--c1); transition: transform .2s ease; }
.pillar.alt .items li svg { color: var(--c2); }
.items li b { font-weight: 500; }
.items li:hover svg { transform: scale(1.18); }
.items li span { color: var(--dim); font: 12px/1.6 var(--f-mono); letter-spacing: .08em; }
/* 2077 面板 .cy：頂端標籤頁、左側粗條往下收細、右下大斜角加粗、右側外掛短條。不改全站 .frame；
   外框畫在 ::before，內層 .fi 用不同內縮的多邊形挖空，邊框才能各邊粗細不同。
   可調：--tab 標籤高、--lb 左粗條寬、--be 粗條長度、--bk 右下斜角；.cy.sm 是小卡尺寸 */
.frame.cy { --acc: var(--c1); --bc: color-mix(in srgb, var(--acc) 42%, var(--line)); --tab: 30px; --lb: 6px; --be: 62%; --bk: 30px; --tn: 10px;
  padding: var(--tab) 0 0; }
:root .frame.cy.cy { background: none; clip-path: none; } /* 蓋過各元件 hover／狀態時換 background 的寫法，改用 --bc 換框色 */
.frame.cy.sm { --tab: 24px; --lb: 4px; --be: 48%; --bk: 22px; --tn: 8px; }
.frame.cy.sm.featured { --lb: 6px; --be: 62%; --bk: 30px; --tn: 10px; } /* 消息頁置頂的大卡 */
.frame.cy.bare { --tab: 0px; }
.frame.cy.sm.bare { --lb: 3px; --be: 55%; --bk: 16px; --tn: 6px; }
.frame.cy.alt { --acc: var(--c2); }
.frame.cy:is(a, .pillar, .role, .shop-card, .pos):hover, a:hover > .frame.cy, .frame.cy:focus-visible { --bc: color-mix(in srgb, var(--acc) 80%, var(--line)); }
/* 各元件的狀態色 */
.act.now .frame.cy, .pos.root.cy, dialog > .frame.cy { --bc: color-mix(in srgb, var(--acc) 70%, var(--line)); }
.pos.multi.cy, .menu .frame.cy { --acc: var(--c2); }
.res-card.cy.hot { --acc: var(--warn); --bc: color-mix(in srgb, var(--warn) 60%, var(--line)); }
.res-card.cy.full { --acc: var(--crit); --bc: color-mix(in srgb, var(--crit) 65%, var(--line)); }
:root .user-pop.cy { box-shadow: none; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55)); }
dialog > .frame.cy > :is(.dlg-close, .md-close, .login-modal-close) { top: calc(var(--tab) + 14px); }
dialog > .frame.cy > .cy-rail { display: none; } /* 彈窗會捲動，框外的短條會撐出橫向捲軸 */
.frame.cy::before { content: ""; position: absolute; inset: var(--tab) 0 0; pointer-events: none; transition: background-color .2s ease;
  background:
    linear-gradient(135deg, transparent 50%, var(--acc) 50%) right bottom / calc(var(--bk) + 18px) calc(var(--bk) + 18px) no-repeat,
    linear-gradient(var(--acc), var(--acc)) left top / var(--lb) var(--be) no-repeat,
    var(--bc);
  clip-path: polygon(0 0, calc(100% - var(--tn)) 0, 100% var(--tn), 100% calc(100% - var(--bk)), calc(100% - var(--bk)) 100%, 0 100%); }
.frame.cy > .fi { position: relative; height: 100%;
  clip-path: polygon(var(--lb) 1px, calc(100% - var(--tn) - .5px) 1px, calc(100% - 1px) calc(var(--tn) + .5px), calc(100% - 1px) calc(100% - var(--bk) - 8px),
    calc(100% - var(--bk) - 8px) calc(100% - 1px), 1px calc(100% - 1px), 1px calc(var(--be) + var(--lb) - 1px), var(--lb) var(--be)); }
.cy-tab { position: absolute; top: 0; left: 0; right: 0; height: var(--tab); display: flex; align-items: flex-end; gap: 10px; pointer-events: none; }
.cy-tab b { align-self: stretch; display: flex; align-items: center; padding: 0 26px 0 12px; background: var(--acc); color: var(--c1-ink);
  font: 700 14px/1 var(--f-display); letter-spacing: .14em; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 100%, 0 100%); }
.cy-tab span { margin: 0 0 5px auto; color: var(--dim); font: 10px/1 var(--f-mono); letter-spacing: .16em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cy-tab span::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 7px; vertical-align: 1px; background: var(--acc); }
.cy-tab i { width: 34px; height: 6px; margin: 0 4px 6px 0; flex: none;
  background: repeating-linear-gradient(-45deg, var(--acc) 0 3px, transparent 3px 6px); opacity: .7; }
.cy.sm .cy-tab b { padding: 0 20px 0 10px; font-size: 12px; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 100%, 0 100%); }
.cy.sm .cy-tab i { width: 22px; height: 5px; margin-bottom: 5px; }
.cy-rail { position: absolute; right: -6px; top: calc(var(--tab) + 22%); width: 3px; height: 64px; background: var(--acc); pointer-events: none; }
.cy-rail::after { content: ""; position: absolute; left: 0; top: 76px; width: 3px; height: 12px; background: var(--acc); opacity: .5; }
.cy.sm .cy-rail { right: -5px; height: 40px; }
.cy.sm .cy-rail::after { top: 48px; height: 8px; }
.legal-doc .md { margin: 0; padding: calc(var(--tab, 0px) + 30px) clamp(22px, 4vw, 48px) calc(var(--bk, 0px) + 28px) calc(var(--lb, 0px) + clamp(20px, 4vw, 40px)); }
.frame.cy .items li { position: relative; padding-right: 14px; }
.frame.cy .items li::after { content: ""; position: absolute; right: 0; top: 12px; bottom: 12px; width: 5px;
  border: 1px solid var(--line); border-left: 0; transition: border-color .2s ease; }
.frame.cy .items li:hover::after { border-color: var(--acc); }
.service-rule { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px 18px; border: 1px solid var(--line); border-left: 4px solid var(--c1); color: var(--dim); font-size: 13px; }
.service-rule svg { width: 22px; height: 22px; flex: 0 0 22px; color: var(--c1); }
.service-rule strong { color: var(--ink); }

/* ■4 核心團隊 */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.member { --cut: 14px; }
.member .fi { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 16px; align-items: start; padding: 20px; }
.member .hex { width: 58px; height: 66px; font: 900 24px/1 var(--f-body); }
.member.lead { background: var(--c1); }
.member h3 { margin: 0; font: 900 21px/1.2 var(--f-body); letter-spacing: .06em; }
.member .role { display: block; margin-top: 4px; color: var(--c1); font: 13px/1.3 var(--f-mono); letter-spacing: .1em; }
.member p { margin: 10px 0 0; color: var(--dim); font-size: 14px; line-height: 1.65; }
.member.crew .hex { color: var(--c2); background: color-mix(in srgb, var(--c2) 12%, transparent); }
.member.crew .role { color: var(--c2); }

/* ■5 雨幕的下一幕 */
.chapter-lead { max-width: 46em; margin: -8px 0 28px; color: var(--dim); font-size: 16px; }
.acts { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.acts::before { content: ""; position: absolute; top: 15px; left: 10%; right: 10%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--c1) 0 10px, transparent 10px 16px); opacity: .6; }
.act { position: relative; display: grid; gap: 14px; align-content: start; }
.act-dot { position: relative; z-index: 1; justify-self: center; display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--c1); background: var(--bg); transform: rotate(45deg); }
.act-dot i { width: 10px; height: 10px; background: var(--c1); }
.act.now .act-dot { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c1) 18%, transparent), 0 0 24px color-mix(in srgb, var(--c1) 50%, transparent); }
.act:not(.now) .act-dot i { background: transparent; border: 1px solid var(--c1); }
.act .frame { --cut: 14px; }
.act.now .frame { background: var(--c1); }
.act .fi { display: grid; gap: 10px; padding: 18px; }
.act-num { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--dim); font: 12px/1 var(--f-mono); letter-spacing: .12em; }
.act-num em { font-style: normal; padding: 3px 7px; border: 1px solid var(--line); color: var(--dim); }
.act.now .act-num em { border-color: var(--c1); color: var(--c1); }
.act h3 { margin: 0; color: var(--c1); font: 900 24px/1.2 var(--f-body); letter-spacing: .12em; }
.act .goal { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.55; }
.act dl { display: grid; gap: 10px; margin: 4px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); }
.act dt { color: var(--dim); font: 11px/1.3 var(--f-mono); letter-spacing: .12em; }
.act dd { margin: 3px 0 0; color: color-mix(in srgb, var(--ink) 86%, var(--dim)); font-size: 13px; line-height: 1.6; }
.closing { margin: 40px 0 0; padding: 26px 28px; border-block: 1px solid var(--c1); text-align: center; font: 700 clamp(18px, 2.2vw, 24px)/1.7 var(--f-body); text-wrap: balance; }
.closing em { font-style: normal; color: var(--c1); }

/* 合作聯絡 */
.contact { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 56px; }
.contact h2 { margin: 0; font: 900 clamp(26px, 3.4vw, 40px)/1.3 var(--f-body); text-wrap: balance; }
.contact h2 em { font-style: normal; color: var(--c1); }
.contact p { margin: 12px 0 0; color: var(--dim); }
.contact-card .fi { display: grid; gap: 0; padding: 8px 22px; }
.contact-card .fi > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.contact-card .fi > div:last-child { border-bottom: 0; }
.contact-card dt { display: flex; align-items: center; gap: 8px; color: var(--dim); font: 12px/1.6 var(--f-mono); letter-spacing: .12em; }
.contact-card dt svg { width: 18px; height: 18px; color: var(--c1); }
.contact-card dd { margin: 0; color: var(--ink); }
.contact-card dd .btn { justify-self: start; }
.contact-card dd.todo { color: var(--warn); font-family: var(--f-mono); font-size: 13px; }

/* 狀態標籤 */
.chip { display: inline-flex; align-items: center; gap: 7px; color: var(--st); font: 13px/1 var(--f-mono); letter-spacing: .08em; white-space: nowrap; }
.chip::before { content: ""; width: 8px; height: 8px; background: var(--st); }
.chip.warn::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 10px; height: 9px; }
.chip.crit::before { clip-path: polygon(20% 0, 50% 30%, 80% 0, 100% 20%, 70% 50%, 100% 80%, 80% 100%, 50% 70%, 20% 100%, 0 80%, 30% 50%, 0 20%); width: 10px; height: 10px; }
.ok { --st: var(--ok); } .warn { --st: var(--warn); } .crit { --st: var(--crit); } .idle { --st: var(--dim); }

/* ■3 營運面板 */
.console-note { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: -10px 0 22px; color: var(--dim); font: 13px/1.5 var(--f-mono); letter-spacing: .08em; }
.sample { padding: 4px 10px; border: 1px solid var(--c2); color: var(--c2); }
.console { --cut: 26px; }
.console > .fi { display: grid; gap: 1px; padding: 0; background: var(--line); }
.console-row { display: grid; gap: 1px; background: var(--line); }
.console-row > * { min-width: 0; background: var(--panel); }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 16px; align-items: center; padding: 22px; }
.kpi svg { width: 78px; height: 78px; }
.kpi .val { display: block; font: 600 32px/1 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.kpi .val small { font-size: 16px; color: var(--dim); }
.kpi .lbl { display: block; margin-top: 6px; color: var(--dim); font-size: 13px; }
.kpi .delta { display: block; margin-top: 4px; color: var(--c1); font: 12px/1 var(--f-mono); }
.mid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.pane { padding: 22px; }
.pane-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.pane-head strong { font: 700 16px/1.3 var(--f-body); }
.pane-head span { color: var(--dim); font: 11px/1.3 var(--f-mono); letter-spacing: .12em; }
.chart-box { position: relative; }
.chart-box svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-box .axis { fill: var(--dim); font: 11px var(--f-mono); }
.chart-box .grid { stroke: var(--line); stroke-dasharray: 2 4; }
.chart-box .bar { fill: color-mix(in srgb, var(--c1) 55%, var(--panel)); transition: fill .12s ease; }
.chart-box .bar.today { fill: var(--c1); }
.chart-box .hit { fill: transparent; cursor: crosshair; }
.chart-box .bar.hl { fill: var(--c2); }
.chart-box .endlbl { fill: var(--ink); font: 600 14px var(--f-display); }
.tip { position: absolute; z-index: 3; padding: 8px 10px; border: 1px solid var(--c1); background: var(--bg); color: var(--ink); font: 12px/1.5 var(--f-mono); pointer-events: none; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.tip b { color: var(--c1); font-weight: 400; }
.quota-big { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 12px; }
.quota-big strong { font: 600 46px/1 var(--f-display); color: var(--c1); font-variant-numeric: tabular-nums; }
.quota-big span { color: var(--dim); font-size: 13px; }
.segs { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; }
.segs i { height: 16px; background: color-mix(in srgb, var(--c1) 16%, transparent); }
.segs i.on { background: var(--c1); }
.quota-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--dim); font: 12px/1.4 var(--f-mono); }
.buffer-title { margin: 24px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: 14px; }
.buffer-title span { display: block; color: var(--dim); font: 11px/1.4 var(--f-mono); letter-spacing: .12em; font-weight: 400; }
.buffer { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.buffer div { display: grid; gap: 4px; text-align: center; }
.buffer b { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line); color: var(--dim); font: 600 18px/1 var(--f-display); }
.buffer b.hit { border-color: var(--c2); background: color-mix(in srgb, var(--c2) 16%, transparent); color: var(--ink); }
.buffer small { color: var(--dim); font: 10px/1 var(--f-mono); }
.bottom { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
th { padding: 0 12px 10px; color: var(--dim); font: 11px/1.2 var(--f-mono); letter-spacing: .12em; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--f-mono); }
td .agent { font-weight: 700; }
td .agent small { display: block; color: var(--dim); font: 11px/1.3 var(--f-mono); font-weight: 400; }
.meter { width: 90px; height: 6px; background: color-mix(in srgb, var(--c1) 16%, transparent); }
.meter i { display: block; height: 100%; background: var(--c1); }
.log { margin: 0; padding: 0; list-style: none; font: 13px/1.55 var(--f-mono); }
.log li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--dim); }
.log .chip { font-size: 12px; }
.log p { grid-column: 1 / -1; margin: 0; color: var(--ink); font-family: var(--f-body); font-size: 13px; }

/* 頁尾選單 */
footer { padding-block: 72px 40px; }
.menu { display: grid; gap: 14px; }
.menu a { display: grid; gap: 8px; text-decoration: none; }
.menu .idx { display: flex; flex-direction: column; gap: 6px; color: var(--ink); font: 600 22px/1 var(--f-display); }
.menu .idx::before { content: ""; width: 28px; height: 3px; background: var(--c1); }
.menu .frame { --cut: 14px; background: var(--c2); }
.menu .fi { display: grid; gap: 8px; padding: 14px 18px; background: color-mix(in srgb, var(--c2) 10%, var(--bg)); transition: background .15s ease; }
.menu a:hover .fi { background: color-mix(in srgb, var(--c2) 24%, var(--bg)); }
.menu .fi strong { color: var(--c2); font: 700 18px/1.2 var(--f-body); }
.menu .fi span { color: var(--ink); font: 12px/1 var(--f-mono); letter-spacing: .12em; }
.menu-bar { margin-top: 14px; padding: 8px 18px; background: var(--c1); color: var(--c1-ink); font: 700 15px/1.4 var(--f-body); letter-spacing: .3em; text-align: center;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--dim); font: 12px/1.6 var(--f-mono); letter-spacing: .06em; }
.legal span:first-child { display: flex; gap: 10px; align-items: flex-start; }
.legal svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--warn); }


.menu { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .acts { grid-template-columns: 1fr; gap: 16px; }
  .acts::before { top: 0; bottom: 0; left: 15px; right: auto; width: 2px; height: auto;
    background: repeating-linear-gradient(180deg, var(--c1) 0 10px, transparent 10px 16px); }
  .act { grid-template-columns: 32px minmax(0, 1fr); gap: 16px; }
  .act-dot { justify-self: start; margin-top: 16px; }
  .menu { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1040px) {
  .telemetry { display: none; }
  .hero, .about, .contact { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mid, .bottom { grid-template-columns: 1fr; }
}
@media (max-width: 900px) { .site-nav { display: none; } .hud-actions { margin-left: auto; } }
@media (max-width: 700px) {
  .hud .wrap { gap: 10px; }
  .brand-text span { display: none; }
  .sec-head { grid-template-columns: auto minmax(0, 1fr); }
  .sec-meta { display: none; }
  .kpis { grid-template-columns: 1fr; }
  .menu { grid-template-columns: 1fr; }
  .buffer { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .closing br, .contact h2 br { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .glitch::before, .glitch::after { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* ───────── 正式站追加 ───────── */
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; background: var(--c1); color: var(--c1-ink); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* ■3 幕後系統：鎖定預覽 */
.locked > .fi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.locked-copy { display: grid; gap: 14px; align-content: center; padding: 30px; }
.locked-copy h3 { margin: 0; font: 900 24px/1.35 var(--f-body); }
.locked-copy p { margin: 0; color: var(--dim); }
.locked-copy ul { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.locked-copy li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.locked-copy li::before { content: ""; width: 8px; height: 8px; background: var(--c1); }
.locked-copy .btn { justify-self: start; }
.locked-visual { position: relative; min-height: 320px; border-left: 1px solid var(--line); overflow: hidden; }
.ghost-grid { position: absolute; inset: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 10px; filter: blur(5px); opacity: .55; }
.ghost-grid span { border: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--c1) 22%, transparent), transparent 70%); }
.ghost-grid span.wide { grid-column: span 2; }
.ghost-grid span.tall { grid-row: span 2; }
.lock-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 20px; text-align: center;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--bg) 82%, transparent) 0 38%, transparent 72%); }
.lock-overlay svg { width: 34px; height: 34px; color: var(--c2); }
.lock-overlay strong { color: var(--c2); font: 700 26px/1 var(--f-display); letter-spacing: .22em; }
.lock-overlay span { color: var(--ink); font-size: 14px; }

/* ■4 團隊樹狀圖 */
.team-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -8px 0 22px; color: var(--dim); font-size: 13px; }
.team-legend span { display: inline-flex; align-items: center; gap: 8px; }
.team-legend i { width: 14px; height: 14px; border: 1px solid var(--c1); }
.team-legend i.root { background: var(--c1); }
.team-legend i.group { border-color: var(--c2); border-style: dashed; }
.org-scroll { overflow-x: auto; padding: 4px 0 12px; }
.org { display: flex; justify-content: center; min-width: max-content; }
.org ul { position: relative; display: flex; justify-content: center; margin: 0; padding: 28px 0 0; list-style: none; }
.org li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 28px 8px 0; }
.org li::before, .org li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 28px; border-top: 1px solid var(--c1); }
.org li::after { right: auto; left: 50%; border-left: 1px solid var(--c1); }
.org li:only-child { padding-top: 0; }
.org li:only-child::before, .org li:only-child::after { display: none; }
.org li:first-child::before, .org li:last-child::after { border: 0; }
.org li:last-child::before { border-right: 1px solid var(--c1); }
.org ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 28px; border-left: 1px solid var(--c1); }
.org > ul { padding-top: 0; }
.org > ul > li { padding-top: 0; }
.org > ul > li::before, .org > ul > li::after { display: none; }

.avatar { width: 52px; height: 58px; display: grid; place-items: center; overflow: hidden; color: var(--c1); font: 900 20px/1 var(--f-body);
  background: color-mix(in srgb, var(--c1) 14%, transparent); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.t-zh { display: block; margin-top: 3px; color: var(--c1); font-size: 13px; font-weight: 700; line-height: 1.35; }
.t-en { display: block; margin-top: 2px; color: var(--dim); font: 11px/1.35 var(--f-mono); letter-spacing: .05em; }
.team-empty { padding: 28px; border: 1px dashed var(--line); color: var(--dim); text-align: center; }

.member-dialog { width: min(860px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 0; background: transparent; color: var(--ink); }
.member-dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(3px); }
.member-dialog > .frame { --cut: 20px; background: var(--c1); }
.member-dialog .fi { display: grid; gap: 0; padding: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tags li { padding: 4px 10px; border: 1px solid color-mix(in srgb, var(--c1) 50%, var(--line)); color: var(--c1); font-size: 12px; }

/* 表單（登入與管理後台共用） */
.field { display: grid; gap: 6px; color: var(--dim); font-size: 13px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--bg);
  color: var(--ink); font: 15px/1.5 var(--f-body);
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--c1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c1) 18%, transparent); }
.field small { color: var(--dim); font-size: 12px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--c1); }
.form-error { margin: 0; color: var(--crit); font-size: 14px; }
.form-error:empty { display: none; }

/* 登入頁 */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding-block: 40px; }
.login-card { --cut: 20px; width: min(440px, 100%); background: var(--c1); }
.login-card > .fi { display: grid; gap: 18px; padding: 32px; }
.login-card h1 { margin: 0; font: 900 26px/1.3 var(--f-body); }
.login-card form { display: grid; gap: 16px; }
.login-card .btn { justify-content: center; }
.login-back { color: var(--dim); font-size: 13px; text-align: center; }

@media (max-width: 1040px) {
  .locked > .fi { grid-template-columns: 1fr; }
  .locked-visual { min-height: 240px; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .org { display: block; min-width: 0; }
  .org ul { display: block; padding: 0 0 0 18px; }
  .org > ul { padding-left: 0; }
  .org li { display: block; padding: 10px 0 0 18px; }
  .org > ul > li { padding: 0; }
  .org li::before, .org li:first-child::before, .org li:last-child::before, .org li:only-child::before {
    display: block; top: 0; left: 0; right: auto; width: 16px; height: 42px; border: 0; border-left: 1px solid var(--c1); border-bottom: 1px solid var(--c1); }
  .org li::after, .org li:first-child::after, .org li:only-child::after {
    display: block; top: 0; bottom: 0; left: 0; right: auto; width: 0; height: auto; border: 0; border-left: 1px solid var(--c1); }
  .org li:last-child::after { display: none; }
  .org > ul > li::before, .org > ul > li::after, .org ul ul::before { display: none; }
}

/* ───────── 圖示（Iconify sprite） ───────── */
/* :where() 讓各元件自己的圖示尺寸可以覆蓋這個預設值 */
:where(svg.i) { display: inline-block; width: 1em; height: 1em; flex: 0 0 auto; fill: currentColor; vertical-align: -.125em; }

/* ───────── 動態：呼吸燈、跑馬燈、雨幕、掃描線、進場 ───────── */
.lamp { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--ok); vertical-align: 1px;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: breathe 2.4s ease-in-out infinite; }
.lamp.crit { background: var(--crit); animation-name: breatheCrit; animation-duration: 1.2s; }
.lamp.c1 { background: var(--c1); animation-name: breatheC1; }
@keyframes breathe { 0%, 100% { opacity: .55; box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 50% { opacity: 1; box-shadow: 0 0 0 5px transparent, 0 0 10px var(--ok); } }
@keyframes breatheCrit { 0%, 100% { opacity: .35; } 50% { opacity: 1; box-shadow: 0 0 10px var(--crit); } }
@keyframes breatheC1 { 0%, 100% { opacity: .55; } 50% { opacity: 1; box-shadow: 0 0 10px var(--c1); } }
.live-tag { display: inline-flex; align-items: center; color: var(--ok); }
.sec-meta .lamp { margin-right: 6px; }

.ticker { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 68px); z-index: 45; overflow: hidden; height: 28px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent); color: var(--dim); font: 12px/28px var(--f-mono); letter-spacing: .12em; white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-track { display: inline-flex; gap: 40px; padding-left: 40px; animation: tick 48s linear infinite; }
.ticker-track span::before { content: "▸ "; color: var(--c1); }
.ticker-track span:nth-child(3n)::before { color: var(--c2); }
@keyframes tick { to { transform: translateX(-50%); } }

/* 全站數位雨：固定在畫面最底層（z-index -1 在 body 內容之下、背景之上） */
.rain-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: -1; }

.scan { overflow: hidden; }
.scan::after { content: ""; position: absolute; left: 0; right: 0; top: -30%; height: 30%; pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--c1) 9%, transparent) 70%, color-mix(in srgb, var(--c1) 28%, transparent) 100%);
  animation: scanY 7s linear infinite; animation-delay: var(--scan-delay, 0s); }
@keyframes scanY { 0% { transform: translateY(0); } 60%, 100% { transform: translateY(440%); } }

.sec-bar { overflow: hidden; }
.sec-bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent); animation: sweep 5.5s ease-in-out infinite; }
@keyframes sweep { 0%, 70% { left: -40%; } 100% { left: 120%; } }

html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0s); }
html.js .reveal.in { opacity: 1; transform: none; }
/* 標題列：觀察外層 .sec-head（被 clip-path 隱藏的元素不會觸發 IntersectionObserver） */
html.js .sec-head.reveal { opacity: 1; transform: none; }
html.js .sec-head.reveal .sec-bar { clip-path: inset(0 100% 0 0); transition: clip-path .8s cubic-bezier(.7, 0, .2, 1); }
html.js .sec-head.reveal.in .sec-bar { clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 100%, 0 100%); }
html.js .sec-head.reveal .sec-num, html.js .sec-head.reveal .sec-meta { opacity: 0; transition: opacity .6s ease .45s; }
html.js .sec-head.reveal.in .sec-num, html.js .sec-head.reveal.in .sec-meta { opacity: 1; }

/* Hero HUD 卡的即時跳動 */
.hc-row span { display: inline-flex; align-items: center; }
.load-line { overflow: visible; }
.load-line::after { display: none; }
.load-line i { position: absolute; top: -9px; left: 62%; border: 6px solid transparent; border-top-color: var(--c1); transform: translateX(-50%); transition: left 1.2s cubic-bezier(.2, .8, .2, 1); }
.queue-bar { position: relative; overflow: hidden; background: color-mix(in srgb, var(--c2) 30%, transparent); }
.queue-bar i { position: absolute; inset: 0 auto 0 0; width: 72%; background: var(--c2); transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.queue-bar i::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(0, 0, 0, .25) 6px 8px); animation: queueFlow 1s linear infinite; }
@keyframes queueFlow { to { background-position: 8px 0; } }
.ticks i { transition: opacity .3s ease; }
.ticks i.blink { animation: tickBlink .9s steps(2) infinite; }
@keyframes tickBlink { 50% { opacity: .25; } }
[data-flux] { font-variant-numeric: tabular-nums; }

/* ■1 雨幕循環：四個模組卡、資料封包沿路徑流動 */
.loop .fi { padding: 22px; }
.loop-map { position: relative; width: min(100%, 460px); aspect-ratio: 230 / 200; margin: 6px auto 0; }
.loop-map svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring .track { fill: none; stroke: color-mix(in srgb, var(--c1) 35%, transparent); stroke-width: 1.2; stroke-dasharray: 2 5; }
.ring .flow { fill: none; stroke: var(--c1); stroke-width: 2; stroke-dasharray: 10 15; animation: loopFlow 3.5s linear infinite; opacity: .55; }
@keyframes loopFlow { to { stroke-dashoffset: -25; } }
.ring .chev path { fill: none; stroke: var(--c1); stroke-width: 2; stroke-linecap: square; }
.ring .packet { fill: var(--c1); filter: drop-shadow(0 0 4px var(--c1)); }
.ring .packet.alt { fill: var(--c2); filter: drop-shadow(0 0 4px var(--c2)); }
.loop-core { position: absolute; left: 50%; top: 50%; width: 26%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-content: center; text-align: center; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c1) 16%, transparent), transparent 70%); }
.loop-core::before, .loop-core::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--c1) 55%, transparent); animation: spin 18s linear infinite; }
.loop-core::after { inset: 12%; border-style: solid; border-color: transparent var(--c1) transparent var(--c1); animation-duration: 6s; animation-direction: reverse; opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }
.loop-core strong { color: var(--c1); font: 700 clamp(16px, 4vw, 24px)/1 var(--f-display); letter-spacing: .16em; }
.loop-core span { margin-top: 4px; color: var(--dim); font: 10px/1.4 var(--f-mono); letter-spacing: .14em; }
.loop-node { position: absolute; width: 40%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; padding: 10px 8px; text-align: center;
  border: 1px solid color-mix(in srgb, var(--c1) 60%, var(--line)); background: var(--panel-2);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); transition: border-color .2s ease, transform .2s ease; }
.loop-node:hover { border-color: var(--c1); transform: translate(-50%, -52%); }
.loop-node svg { width: 24px; height: 24px; color: var(--c1); }
.loop-node b { color: var(--c1); font: 900 16px/1.2 var(--f-body); letter-spacing: .12em; }
.loop-node span { color: var(--ink); font-size: 12px; line-height: 1.4; }
.loop-node.back { border-color: color-mix(in srgb, var(--c2) 60%, var(--line)); }
.loop-node.back svg, .loop-node.back b { color: var(--c2); }
.loop-node.n1 { left: 22.6%; top: 23%; }
.loop-node.n2 { left: 77.4%; top: 23%; }
.loop-node.n3 { left: 77.4%; top: 77%; }
.loop-node.n4 { left: 22.6%; top: 77%; }

/* ■2 卡片 hover 故障效果 */
.pillar:hover h3 { animation: glitchShake .35s steps(2) 1; }
@keyframes glitchShake { 25% { transform: translate(-2px, 1px); text-shadow: 2px 0 var(--c2); } 50% { transform: translate(2px, -1px); text-shadow: -2px 0 var(--c1); } 75% { transform: none; } }
.hex { position: relative; }
.hex::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, currentColor 30%, transparent) 50%, transparent 60%); background-size: 100% 300%; animation: hexScan 3.2s linear infinite; }
@keyframes hexScan { from { background-position: 0 100%; } to { background-position: 0 -200%; } }

/* ■3 鎖定區 */
.lock-ring { position: relative; display: grid; place-items: center; width: 74px; height: 74px; border: 1px solid color-mix(in srgb, var(--c2) 60%, transparent); border-radius: 50%; }
.lock-ring::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--c2) 50%, transparent); animation: spin 14s linear infinite; }
.lock-overlay strong { animation: flicker 4s steps(1) infinite; }
@keyframes flicker { 0%, 92%, 96%, 100% { opacity: 1; } 94% { opacity: .3; } 98% { opacity: .6; } }
.ghost-grid span { animation: ghostPulse 3s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .35s); }
@keyframes ghostPulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }

/* ■4 團隊：職位卡（一個職位可以多人、一人可以多職） */
.pos { --cut: 12px; width: 232px; text-align: left; }
.pos > .fi { display: grid; gap: 10px; padding: 14px; }
.pos.root { width: 262px; background: var(--c1); }
.pos.root > .fi { background: var(--panel-2); }
.pos.multi { background: color-mix(in srgb, var(--c2) 55%, var(--line)); }
.pos-head { display: flex; justify-content: space-between; gap: 8px; color: var(--dim); font: 11px/1.3 var(--f-mono); letter-spacing: .1em; }
.pos-head b { color: var(--c1); font-weight: 400; }
.pos.multi .pos-head b { color: var(--c2); }
.pos .t-zh { margin: 0; font-size: 16px; font-weight: 900; color: var(--ink); }
.pos .t-en { margin: 0; }
.pos-people { display: grid; gap: 6px; margin: 0; padding: 8px 0 0; border-top: 1px dashed var(--line); list-style: none; }
.person-chip { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 4px 8px 4px 4px; border: 1px solid transparent;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.person-chip:hover, .person-chip:focus-visible { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 10%, transparent); outline: none; }
.person-chip .avatar { width: 34px; height: 38px; font-size: 14px; }
.person-chip strong { display: block; font-size: 15px; line-height: 1.3; }
.person-chip small { display: block; color: var(--dim); font-size: 11px; line-height: 1.3; }
.person-chip .lamp { margin: 0; }
.pos-empty { margin: 0; padding: 8px 0 0; border-top: 1px dashed var(--line); color: var(--dim); font-size: 13px; }

@media (max-width: 700px) {
  .loop-node { width: 44%; padding: 8px 4px; }
  .loop-node b { font-size: 14px; }
  .loop-node span { font-size: 11px; }
  .loop-node svg { width: 20px; height: 20px; }
  .pos, .pos.root { width: 100%; }
  .ticker { top: calc(env(safe-area-inset-top, 0px) + 68px); }
}
@media (prefers-reduced-motion: reduce) {
  .lamp, .ticker-track, .scan::after, .sec-bar::after, .ring .flow, .loop-core::before, .loop-core::after, .hex::after,
  .lock-ring::before, .lock-overlay strong, .ghost-grid span, .queue-bar i::after, .ticks i.blink { animation: none !important; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html.js .sec-head.reveal .sec-bar { clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 100%, 0 100%); transition: none; }
  html.js .sec-head.reveal .sec-num, html.js .sec-head.reveal .sec-meta { opacity: 1; }
}

/* ───────── 自訂捲軸（前後台共用） ───────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); border-left: 1px solid var(--line); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--c1), color-mix(in srgb, var(--c1) 45%, var(--c2))); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--c1); box-shadow: 0 0 8px var(--c1); }
::-webkit-scrollbar-corner { background: var(--bg); }
@supports not selector(::-webkit-scrollbar) { html { scrollbar-color: var(--c1) var(--bg); scrollbar-width: thin; } }
::selection { background: var(--c1); color: var(--c1-ink); }

/* 頂部導覽：獨立頁面 */
.site-nav a { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.site-nav a[aria-current="page"] { color: var(--c1); }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--c1); box-shadow: 0 0 8px var(--c1); }
.site-nav a em { padding: 1px 5px; border: 1px solid var(--c2); color: var(--c2); font: 10px/1.3 var(--f-mono); font-style: normal; letter-spacing: .1em; }
.hud-actions .btn svg { width: 18px; height: 18px; }

/* ■3 加入雨幕 */
.join-lead { max-width: 46em; margin: -8px 0 24px; color: var(--dim); font-size: 16px; }
.roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.role { --cut: 18px; }
.role > .fi { display: flex; flex-direction: column; gap: 12px; height: 100%; padding: 22px; }
.role:hover { background: var(--c1); }
.role.alt:hover { background: var(--c2); }
.role .hex { width: 54px; height: 60px; }
.role .hex svg { width: 28px; height: 28px; }
.role.alt .hex { color: var(--c2); background: color-mix(in srgb, var(--c2) 12%, transparent); }
.role h3 { margin: 0; font: 900 20px/1.3 var(--f-body); }
.role.alt h3 { color: var(--c2); }
.role .code { display: block; color: var(--dim); font: 12px/1 var(--f-mono); letter-spacing: .12em; }
.role p { margin: 0; color: var(--dim); font-size: 14px; }
.role-tags { display: grid; gap: 6px; margin: auto 0 0; padding: 12px 0 0; border-top: 1px dashed var(--line); list-style: none; font-size: 13px; }
.role-tags li::before { content: "▸ "; color: var(--c1); }
.join-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 18px 22px; border: 1px solid var(--line); border-left: 4px solid var(--c1); }
.join-cta > div strong, .join-cta > div span { display: block; }
.join-cta > div strong { font-size: 16px; }
.join-cta > div span { margin-top: 4px; color: var(--dim); font-size: 14px; }
.join-cta .btn svg { width: 18px; height: 18px; }

/* ───────── 內頁共用標頭 ───────── */
.page-hero { position: relative; padding-block: 56px 32px; border-bottom: 1px solid var(--line); }
.page-hero h1 { margin: 0; font: 700 clamp(56px, 9vw, 112px)/.9 var(--f-display); letter-spacing: .06em; color: var(--c1); text-shadow: 0 0 28px color-mix(in srgb, var(--c1) 35%, transparent); }
.page-hero h1 small { display: block; margin-top: 12px; color: var(--ink); font: 900 clamp(22px, 3vw, 30px)/1.3 var(--f-body); letter-spacing: .08em; text-shadow: none; }
.page-hero p { max-width: 40em; margin: 14px 0 0; color: var(--dim); }

/* 消息頁 */
.news-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 24px; }
.news-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.news-filter button { min-height: 38px; padding: 0 16px; border: 1px solid var(--line); background: transparent; color: var(--dim); font: 700 14px/1 var(--f-body); letter-spacing: .08em; cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%); }
.news-filter button:hover { color: var(--ink); border-color: var(--c1); }
.news-filter button[aria-pressed="true"] { background: var(--c1); border-color: var(--c1); color: var(--c1-ink); }
.news-count { color: var(--dim); font: 12px var(--f-mono); letter-spacing: .12em; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding-bottom: 64px; }
.news-card { --cut: 18px; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.news-card:hover, .news-card:focus-visible { background: var(--c1); transform: translateY(-3px); outline: none; }
.news-card > .fi { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.news-card.featured { grid-column: 1 / -1; }
.news-card.featured > .fi { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-rows: auto; }
.news-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--accent, var(--c1)) 30%, transparent), transparent 60%),
              repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent, var(--c1)) 10%, transparent) 0 2px, transparent 2px 14px), var(--panel-2); }
.news-thumb::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, .25) 3px 4px); }
.news-thumb svg { width: 30%; height: auto; max-width: 120px; color: var(--accent, var(--c1)); filter: drop-shadow(0 0 18px var(--accent, var(--c1))); transition: transform .4s ease; }
.news-card:hover .news-thumb svg { transform: scale(1.08) rotate(-3deg); }
.news-thumb .stamp { position: absolute; top: 12px; left: 12px; z-index: 1; padding: 4px 10px; background: var(--accent, var(--c1)); color: var(--c1-ink); font: 700 12px/1.2 var(--f-display); letter-spacing: .16em; }
.news-body { display: grid; align-content: start; gap: 10px; padding: 20px 22px 24px; }
.news-meta { display: flex; gap: 12px; color: var(--dim); font: 12px var(--f-mono); letter-spacing: .1em; }
.news-body h2 { margin: 0; font: 900 20px/1.4 var(--f-body); text-wrap: balance; }
.news-card.featured .news-body { align-content: center; padding: 32px; }
.news-card.featured .news-body h2 { font-size: clamp(22px, 2.6vw, 32px); }
.news-body p { margin: 0; color: var(--dim); font-size: 14px; }
.news-more { color: var(--c1); font: 700 13px var(--f-display); letter-spacing: .16em; }
.news-empty { grid-column: 1 / -1; padding: 40px; border: 1px dashed var(--line); color: var(--dim); text-align: center; }
.article-dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 0; background: transparent; color: var(--ink); }
.article-dialog::backdrop { background: rgba(0, 0, 0, .78); backdrop-filter: blur(4px); }
.article-dialog > .frame { --cut: 22px; background: var(--c1); }
.article-dialog .fi { max-height: calc(100vh - 40px); overflow-y: auto; }
.article-dialog .news-thumb { aspect-ratio: 21 / 8; }
.article-body { display: grid; gap: 14px; padding: 26px 30px 32px; }
.article-body h2 { margin: 0; font: 900 clamp(24px, 3vw, 32px)/1.35 var(--f-body); }
.article-body p { margin: 0; color: color-mix(in srgb, var(--ink) 88%, var(--dim)); font-size: 16px; line-height: 1.85; }


/* 商店頁 */
.shop-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 24px; padding: 16px 20px; border: 1px solid var(--c2); background: color-mix(in srgb, var(--c2) 8%, transparent); }
.shop-banner strong { color: var(--c2); font: 700 18px/1 var(--f-display); letter-spacing: .2em; }
.shop-banner span { color: var(--ink); }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding-block: 28px 64px; }
.shop-card { --cut: 18px; }
.shop-card > .fi { position: relative; display: grid; gap: 12px; height: 100%; padding: 0 0 22px; }
.shop-card .news-thumb { aspect-ratio: 16 / 10; }
.shop-card .lock-tag { position: absolute; top: 12px; right: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--c2); background: var(--bg); color: var(--c2); font: 12px var(--f-mono); letter-spacing: .12em; }
.shop-card .lock-tag svg { width: 14px; height: 14px; }
.shop-card h2, .shop-card p, .shop-card ul { margin: 0; padding-inline: 22px; }
.shop-card h2 { font: 900 22px/1.3 var(--f-body); }
.shop-card p { color: var(--dim); font-size: 14px; }
.shop-card ul { display: grid; gap: 6px; list-style: none; font-size: 14px; }
.shop-card ul li::before { content: "▸ "; color: var(--c1); }
.shop-card .price { padding-inline: 22px; color: var(--dim); font: 13px var(--f-mono); letter-spacing: .1em; }

@media (max-width: 1100px) {
  .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-grid, .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .roles, .news-grid, .shop-grid { grid-template-columns: 1fr; }
  .news-card.featured > .fi { grid-template-columns: 1fr; }
  .news-card.featured .news-body { padding: 22px; }
  .article-body { padding: 22px; }
}

/* 頂部個人選單 */
.user-menu { position: relative; }
.user-chip { display: grid; grid-template-columns: 34px auto auto auto; align-items: center; gap: 10px; min-height: 44px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s ease; }
.user-chip:hover, .user-chip[aria-expanded="true"] { border-color: var(--c1); }
.user-chip .avatar { width: 34px; height: 38px; font-size: 14px; }
.user-meta { display: grid; text-align: left; line-height: 1.2; }
.user-meta strong { font-size: 14px; }
.user-meta small { color: var(--c1); font: 10px/1.3 var(--f-mono); letter-spacing: .14em; }
.user-chip .lamp { margin: 0; }
.user-chip > svg { width: 14px; height: 14px; color: var(--dim); transition: transform .2s ease; }
.user-chip[aria-expanded="true"] > svg { transform: rotate(180deg); }
.user-pop { --cut: 14px; position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 250px; background: var(--c1); box-shadow: 0 18px 40px rgba(0, 0, 0, .55); animation: popIn .16s ease; }
.user-pop .fi { display: grid; padding: 6px; background: var(--panel-2); }
.user-pop-head { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.user-pop-head .avatar { width: 40px; height: 44px; font-size: 16px; }
.user-pop-head strong { display: block; font-size: 15px; }
.user-pop-head small { display: block; color: var(--dim); font-size: 12px; }
.user-pop a, .user-pop button, .user-pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; background: transparent; color: var(--ink); font: 14px var(--f-body); text-align: left; text-decoration: none; cursor: pointer; }
.user-pop a:hover, .user-pop button:hover, .user-pop a:focus-visible, .user-pop button:focus-visible { background: color-mix(in srgb, var(--c1) 14%, transparent); outline: none; }
.user-pop svg { width: 18px; height: 18px; color: var(--c1); }
.user-pop .is-soon { color: var(--dim); cursor: default; }
.user-pop .is-soon em { margin-left: auto; padding: 1px 5px; border: 1px solid var(--c2); color: var(--c2); font: 10px/1.3 var(--f-mono); font-style: normal; letter-spacing: .1em; }
.user-pop .user-logout { margin-top: 4px; border-top: 1px solid var(--line); }
.user-pop .user-logout svg { color: var(--crit); }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } }
@media (max-width: 700px) { .user-meta { display: none; } .user-chip { grid-template-columns: 34px auto auto; } }
.user-balance { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; margin: 2px 0 4px; padding: 10px; border: 1px solid var(--line); background: var(--bg); }
.user-balance span { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; }
.user-balance b { color: var(--c1); font: 600 20px/1 var(--f-display); }
.user-balance em { padding: 1px 5px; border: 1px solid var(--c2); color: var(--c2); font: 10px/1.3 var(--f-mono); font-style: normal; letter-spacing: .1em; }

/* 雨幕電台（首頁右下角） */
.radio { position: fixed; right: clamp(28px, 4.5vw, 72px); bottom: calc(clamp(34px, 6vh, 64px) + env(safe-area-inset-bottom, 0px)); z-index: 70; display: grid; justify-items: start; width: min(252px, calc(100vw - 56px)); gap: 10px; pointer-events: none; }
.radio > * { pointer-events: auto; }
.radio-dock { display: flex; align-items: center; gap: 8px; }
/* 收起時：播放鍵在左側，NOW PLAYING 標籤從它左邊長出來、把播放鍵往右推到定位；展開面板靠右對齊 */
/* 展開的面板以播放鍵為中心置中（播放鍵寬 58px，中心在 29px 處）；窄螢幕改成靠右避免超出畫面 */
.radio-panel { justify-self: start; margin-left: calc(29px - min(330px, 100vw - 36px) / 2); }
@media (max-width: 600px) { .radio-panel { justify-self: end; margin-left: 0; } }
/* 手機版隱藏音樂播放器：按鈕會落在畫面正中間擋到內容 */
@media (max-width: 600px) { .radio { display: none; } }
.radio-play { position: relative; width: 58px; height: 58px; display: grid; place-items: center; border: 0; background: var(--c1); color: var(--c1-ink); cursor: pointer;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); transition: transform .2s ease, filter .2s ease; }
.radio-play::before { content: ""; position: absolute; inset: 2px; background: var(--panel-2); clip-path: inherit; transition: opacity .2s ease; }
.radio-play svg { position: relative; width: 24px; height: 24px; color: var(--c1); transition: color .2s ease; }
.radio-play:hover { transform: scale(1.06); }
.radio.is-playing .radio-play::before { opacity: 0; }
.radio.is-playing .radio-play svg { color: var(--c1-ink); }
.radio.is-playing .radio-play { animation: radioPulse 1.6s ease-in-out infinite; }
@keyframes radioPulse { 50% { filter: drop-shadow(0 0 12px var(--c1)); } }

/* 收起時的 NOW PLAYING 標籤：只在播放中且面板收起時出現 */
.radio-now { display: flex; align-items: center; gap: 10px; max-width: 0; overflow: hidden; padding: 0; border: 1px solid transparent; background: var(--panel-2); color: var(--ink); font: inherit; text-align: left; cursor: pointer; opacity: 0;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); transition: max-width .45s cubic-bezier(.2, .8, .2, 1), opacity .3s ease, padding .45s ease, border-color .3s ease; }
.radio.is-playing:not(.is-open) .radio-now { max-width: 186px; padding: 8px 12px; border-color: var(--c1); opacity: 1; }
.radio-now:hover { background: color-mix(in srgb, var(--c1) 14%, var(--panel-2)); }
.radio-now-text { min-width: 0; }
.radio-now-text small { display: block; color: var(--c2); font: 10px/1.2 var(--f-mono); letter-spacing: .16em; }
.radio-now-text b { display: block; max-width: 116px; overflow: hidden; font-size: 12px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 18px; }
.eq i { width: 3px; height: 100%; background: var(--c1); transform-origin: bottom; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; background: var(--c2); }
.eq i:nth-child(3) { animation-delay: -.6s; }
.eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* 面板展開／收起：從右下角以斜切方式掃開，展開時閃爍一下並跑一道掃描線 */
.radio-panel { width: min(330px, calc(100vw - 36px)); transform-origin: 100% 100%;
  clip-path: polygon(100% 100%, 100% 100%, 100% 100%, 100% 100%); opacity: 0; visibility: hidden; transform: translateY(12px) scale(.96);
  transition: clip-path .4s cubic-bezier(.7, 0, .3, 1), opacity .25s ease .1s, transform .4s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .4s; }
.radio.is-open .radio-panel { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); opacity: 1; visibility: visible; transform: none;
  transition: clip-path .55s cubic-bezier(.2, .8, .2, 1), opacity .2s ease, transform .55s cubic-bezier(.2, .8, .2, 1), visibility 0s; animation: panelFlicker .55s steps(1) 1; }
@keyframes panelFlicker { 0% { filter: brightness(2.2); } 15% { filter: none; } 25% { filter: brightness(1.8) hue-rotate(40deg); } 35%, 100% { filter: none; } }
.radio-panel .frame { --cut: 16px; background: var(--c1); }
.radio-panel .fi { position: relative; display: grid; gap: 10px; padding: 14px 16px 16px; background: var(--panel-2); overflow: hidden; }
.radio-scan { position: absolute; left: 0; right: 0; top: -20%; height: 20%; pointer-events: none; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--c1) 40%, transparent)); opacity: 0; }
.radio.is-open .radio-scan { animation: panelScan .7s ease-out .1s 1; }
@keyframes panelScan { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(600%); } }
.radio-head { display: flex; align-items: center; justify-content: space-between; color: var(--c2); font: 12px var(--f-mono); letter-spacing: .16em; }
.radio-head span { display: inline-flex; align-items: center; gap: 8px; }
.radio-head svg { width: 18px; height: 18px; }
.radio-close { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--c2); background: color-mix(in srgb, var(--c2) 14%, transparent); color: var(--c2); cursor: pointer; transition: background .15s ease, color .15s ease; }
.radio-close:hover, .radio-close:focus-visible { background: var(--c2); color: var(--bg); outline: none; }
.radio-close svg { width: 22px; height: 22px; }
.radio canvas { width: 100%; height: 46px; display: block; border-bottom: 1px solid var(--line); }
.radio-title strong { display: block; overflow: hidden; color: var(--ink); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.radio-title small { display: block; color: var(--dim); font: 11px var(--f-mono); letter-spacing: .06em; }
.radio-progress { position: relative; height: 6px; background: color-mix(in srgb, var(--c1) 18%, transparent); cursor: pointer; }
.radio-progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--c1); box-shadow: 0 0 8px var(--c1); }
.radio-progress:focus-visible { outline: 2px solid var(--c2); outline-offset: 3px; }
.radio-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--dim); font: 12px var(--f-mono); }
.radio-vol { display: inline-flex; align-items: center; gap: 6px; color: var(--c1); }
.radio-vol svg { width: 16px; height: 16px; }
.radio-vol input { width: 90px; accent-color: var(--c1); }
.radio-sfx { padding: 2px 8px; border: 1px solid var(--line); background: none; color: var(--dim); font: 11px var(--f-body); white-space: nowrap; cursor: pointer; }
.radio-sfx[aria-pressed="true"] { border-color: var(--c1); color: var(--c1); }
.radio-sfx::before { content: "OFF "; font-family: var(--f-mono); }
.radio-sfx[aria-pressed="true"]::before { content: "ON "; }
@media (prefers-reduced-motion: reduce) {
  .radio.is-playing .radio-play, .eq i, .radio.is-open .radio-panel, .radio.is-open .radio-scan { animation: none; }
  .radio-panel, .radio.is-open .radio-panel, .radio-now { transition: none; }
}

/* 登入：Discord 按鈕 */
.login-help { margin: 8px 0 0; color: var(--dim); font-size: 14px; }
.discord-btn { justify-content: center; min-height: 52px; background: #5865f2; color: #fff; font-size: 16px; }
.discord-btn svg { width: 22px; height: 22px; }
.discord-btn:hover { filter: brightness(1.12); }
.user-chip .avatar img, .user-pop-head .avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 登入彈窗 */
.login-modal { width: min(440px, calc(100% - 32px)); padding: 0; border: 0; background: transparent; color: var(--ink); }
.login-modal::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px); }
.login-modal[open] { animation: modalIn .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.login-modal > .frame { --cut: 20px; background: var(--c1); }
.login-modal .fi { position: relative; display: grid; gap: 14px; padding: 28px; }
.login-modal h2 { margin: 0; font: 900 24px/1.3 var(--f-body); }
.login-modal .eyebrow { margin: 0; }
.login-modal form { display: grid; gap: 14px; }
.avatar { position: relative; }
.avatar > b { font: inherit; }
.avatar > img { position: absolute; inset: 0; }
@media (prefers-reduced-motion: reduce) { .login-modal[open] { animation: none; } }

/* 中文斷行：小句不拆開，剩下的行尾由瀏覽器平衡 */
.cl { display: inline-block; }
main p, .dialog p, dialog p { text-wrap: pretty; }

/* 個人資料頁 */
.me-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.me-card .fi { padding: 24px; }
.me-wide { grid-column: 1 / -1; }
.me-id { display: flex; align-items: center; gap: 18px; }
.me-id h2 { margin: 0; font: 900 26px/1.2 var(--f-body); }
.me-avatar { width: 68px; height: 76px; font-size: 26px; }
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-role { display: inline-block; margin-top: 6px; padding: 2px 10px; border: 1px solid var(--c1); color: var(--c1); font: 12px var(--f-mono); letter-spacing: .12em; }
.me-facts { display: grid; gap: 0; margin: 22px 0 0; }
.me-facts > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px dashed var(--line); }
.me-facts dt { color: var(--dim); font: 12px/1.8 var(--f-mono); letter-spacing: .12em; }
.me-facts dd { margin: 0; overflow-wrap: anywhere; }
.me-label { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--dim); font: 12px var(--f-mono); letter-spacing: .16em; }
.me-label svg { width: 18px; height: 18px; color: var(--c1); }
.me-balance { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.me-balance b { color: var(--c1); font: 600 64px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.me-balance span { color: var(--dim); font-size: 18px; }
.me-note { margin: 14px 0 0; color: var(--dim); font-size: 13px; }
.me-checkin { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.me-streak { margin: 0; min-width: 0; color: var(--dim); font-size: 14px; overflow-wrap: anywhere; }
.me-checkin .btn svg { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; }
.me-checkin .btn:disabled { opacity: .55; cursor: default; filter: none; transform: none; }
.me-ledger { display: grid; gap: 0; margin: 0 0 14px; padding: 0; list-style: none; }
.me-ledger li:not(.me-empty) { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px dashed var(--line); }
.me-ledger li:first-child { border-top: 0; }
.ml-main b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.ml-main time { color: var(--dim); font: 12px var(--f-mono); }
.me-ledger em { flex: 0 0 auto; font: 600 20px var(--f-display); font-style: normal; font-variant-numeric: tabular-nums; }
.me-ledger em.plus { color: var(--ok); }
.me-ledger em.minus { color: var(--crit); }
.me-empty { margin: 0; color: var(--dim); }
.me-loading { margin: 32px 0; color: var(--dim); }
@media (max-width: 760px) { .me-grid { grid-template-columns: 1fr; } .me-balance b { font-size: 52px; } }
.user-pop a.user-balance { color: inherit; text-decoration: none; }

/* 名稱太長時用 … 截斷，不撐開版面（Discord 名稱可以很長） */
.user-chip { grid-template-columns: 34px minmax(0, auto) auto auto; max-width: 260px; }
.user-meta { min-width: 0; max-width: 150px; }
.user-meta strong, .user-meta small, .user-pop-head strong, .user-pop-head small, .person-chip strong, .person-chip small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.person-chip > span:nth-child(2) { min-width: 0; }
.user-pop-head > div { min-width: 0; }
@media (max-width: 700px) { .user-chip { grid-template-columns: 34px auto auto; } }

/* 消息：卡片連結、鎖定標籤、文章頁與 markdown 內文 */
a.news-card { display: block; color: inherit; text-decoration: none; }
.news-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.news-thumb .lock-tag, .lock-tag { position: absolute; top: 12px; right: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--bg); border: 1px solid var(--c2); color: var(--c2); font: 11px var(--f-mono); letter-spacing: .1em; }
.news-thumb .lock-tag svg { width: 14px; height: 14px; }
.news-card.is-locked .news-thumb svg:not(.lock-tag svg) { opacity: .45; }
.article-wrap { max-width: 820px; padding-bottom: 64px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin: 28px 0 8px; color: var(--dim); font: 13px var(--f-mono); letter-spacing: .1em; text-decoration: none; }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--c1); }
.article-page h1 { margin: 10px 0 0; font: 900 clamp(28px, 4vw, 42px)/1.3 var(--f-body); text-wrap: balance; }
.a-excerpt { margin: 14px 0 0; color: var(--dim); font-size: 17px; line-height: 1.8; }
.a-cover { margin: 24px 0 0; border: 1px solid var(--line); }
.a-cover img { display: block; width: 100%; max-height: 420px; object-fit: cover; }
.md { margin-top: 28px; font-size: 16px; line-height: 1.95; color: color-mix(in srgb, var(--ink) 90%, var(--dim)); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.8em 0 .6em; line-height: 1.4; font-weight: 900; color: var(--ink); }
.md h1 { font-size: 28px; } .md h2 { font-size: 23px; padding-left: 12px; border-left: 4px solid var(--c1); } .md h3 { font-size: 19px; } .md h4 { font-size: 16px; }
.md p { margin: 0 0 1.1em; }
.md a { color: var(--c1); text-decoration: underline; text-underline-offset: 3px; }
.md ul, .md ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.md li { margin: .3em 0; }
.md blockquote { margin: 1.2em 0; padding: 14px 18px; border-left: 3px solid var(--c2); background: color-mix(in srgb, var(--c2) 8%, transparent); color: var(--dim); }
.md blockquote > :first-child { margin-top: 0; }
.md blockquote > :last-child { margin-bottom: 0; }
.md code { padding: 2px 6px; background: color-mix(in srgb, var(--c1) 12%, var(--bg)); font: .9em var(--f-mono); }
.md pre { margin: 1.2em 0; padding: 16px; overflow-x: auto; border: 1px solid var(--line); background: var(--bg); }
.md pre code { padding: 0; background: none; }
.md img { display: block; max-width: 100%; height: auto; margin: 1.4em auto; }
.md hr { margin: 2em 0; border: 0; border-top: 1px dashed var(--line); }
.md table { width: 100%; margin: 1.2em 0; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); font-size: 14px; }
.md th, .md td { padding: 8px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; }
.md th:last-child, .md td:last-child { border-right: 0; }
.md tr:last-child td { border-bottom: 0; }
.md th { background: color-mix(in srgb, var(--c1) 10%, transparent); }
.a-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 24px; border-top: 1px dashed var(--line); }
.reactions { display: flex; flex-wrap: wrap; gap: 8px; }
.reactions button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: transparent; color: var(--dim); font: 14px var(--f-body); cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.reactions button svg { width: 18px; height: 18px; }
.reactions button b { font: 600 14px var(--f-mono); color: var(--ink); }
.reactions button:hover { border-color: var(--c1); color: var(--ink); }
.reactions button[aria-pressed="true"] { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 14%, transparent); color: var(--c1); }
.a-hint { margin: 12px 0 0; color: var(--dim); font-size: 13px; }
.a-hint a { color: var(--c1); }
.lock-card { --cut: 18px; margin-top: 32px; }
.lock-card .fi { display: grid; justify-items: start; gap: 12px; padding: 32px; }
.lock-card svg { width: 40px; height: 40px; color: var(--c2); }
.lock-card h2 { margin: 0; font: 900 24px/1.4 var(--f-body); }
.lock-card p { margin: 0; color: var(--dim); }

/* 文章彈窗 */
.article-dialog .md { margin-top: 4px; }
.article-dialog .a-excerpt { margin: 0; }
.article-dialog .a-actions { margin-top: 22px; }
.article-dialog .article-media img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.d-wait { margin: 0; color: var(--dim); }
.d-lock { display: grid; justify-items: start; gap: 12px; padding: 8px 0 4px; }
.d-lock svg { width: 36px; height: 36px; color: var(--c2); }
.d-lock p { margin: 0; color: var(--dim); }

/* ── 彈窗關閉鈕（全站統一）：44px 實心主色，右上與左下切角一樣大（對等），整顆放在框內、離邊框與斜切角保持平行的等距 ── */
.dlg-close, .md-close, .login-modal-close {
  position: absolute; top: 16px; right: 18px; z-index: 6; width: 44px; height: 44px; padding: 0; display: grid; place-items: center;
  border: 0; background: var(--c1); color: var(--c1-ink); cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px));
  transition: background .18s ease, color .18s ease;
}
.dlg-close svg, .md-close svg, .login-modal-close svg { width: 34px; height: 34px; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.dlg-close:hover, .md-close:hover, .login-modal-close:hover { background: var(--c2); color: #fff; box-shadow: 0 0 16px color-mix(in srgb, var(--c2) 75%, transparent), 0 0 2px var(--c2); }
.dlg-close:hover svg, .md-close:hover svg, .login-modal-close:hover svg { transform: rotate(90deg); }
.dlg-close:active, .md-close:active, .login-modal-close:active { filter: brightness(.92); }
.dlg-close:focus-visible, .md-close:focus-visible, .login-modal-close:focus-visible { outline: 0; box-shadow: inset 0 0 0 3px var(--bg); }
/* 電台面板的關閉鈕：樣式與上面的彈窗關閉鈕一致（實心主色、切角、懸停變色轉 90°），但排在標題列裡所以不用絕對定位 */
.radio-close { width: 40px; height: 40px; border: 0; background: var(--c1); color: var(--c1-ink);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); transition: background .18s ease, color .18s ease; }
.radio-close svg { width: 30px; height: 30px; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.radio-close:hover { background: var(--c2); color: #fff; box-shadow: 0 0 16px color-mix(in srgb, var(--c2) 75%, transparent), 0 0 2px var(--c2); }
.radio-close:hover svg { transform: rotate(90deg); }
.radio-close:active { filter: brightness(.92); }
.radio-close:focus-visible { outline: 0; box-shadow: inset 0 0 0 3px var(--bg); }
.article-dialog .fi:focus, .member-dialog .fi:focus { outline: none; }
.article-body > .news-meta, .article-body > h2 { padding-right: 64px; }
.login-modal .eyebrow, .login-modal h2 { padding-right: 64px; }
.member-dialog > .frame, .article-dialog > .frame, .login-modal > .frame { position: relative; }

html { scrollbar-gutter: stable; }
html.has-dialog { overflow: hidden; }
.article-dialog::backdrop, .login-modal::backdrop, .member-dialog::backdrop { background: rgba(0, 4, 8, .86); backdrop-filter: none; }
.article-dialog .fi, .member-dialog .fi { overscroll-behavior: contain; }
html.has-dialog .rain-fx { visibility: hidden; }
html.has-dialog :is(.ticker-track, .rail, .hud, .sec-bar, .live-tag, .lamp, .glitch) { animation-play-state: paused !important; }

/* 留言 */
.comments { display: grid; gap: 14px; margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--line); }
.comments h3 { margin: 0; font: 900 18px/1.4 var(--f-body); }
.comments h3 span { margin-left: 4px; color: var(--c1); font: 600 16px var(--f-mono); }
.c-form { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; }
.c-form .avatar, .c-list .avatar { width: 38px; height: 42px; font-size: 15px; overflow: hidden; }
.c-form .avatar img, .c-list .avatar img { width: 100%; height: 100%; object-fit: cover; }
.c-box textarea { width: 100%; min-height: 78px; padding: 10px 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; line-height: 1.7; resize: vertical; }
.c-box textarea:focus { outline: 0; border-color: var(--c1); }
.c-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.c-foot .btn { margin-left: auto; min-height: 38px; padding-inline: 18px; }
.c-count { color: var(--dim); font: 12px var(--f-mono); }
.c-err { color: var(--crit); font-size: 13px; }
.c-login, .c-closed, .c-empty { margin: 0; color: var(--dim); font-size: 14px; }
.c-login a { color: var(--c1); }
.c-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.c-list li:not(.c-empty) { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px dashed var(--line); }
.c-list li:first-child { border-top: 0; }
.c-top { display: flex; align-items: baseline; gap: 10px; }
.c-top b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-top time { color: var(--dim); font: 12px var(--f-mono); white-space: nowrap; }
.c-del { margin-left: auto; padding: 0; border: 0; background: none; color: var(--dim); font: inherit; font-size: 12px; cursor: pointer; }
.c-del:hover { color: var(--crit); }
.c-main p { margin: 4px 0 0; color: color-mix(in srgb, var(--ink) 90%, var(--dim)); font-size: 15px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.article-body .c-main p { font-size: 15px; }
html.has-dialog .glitch::before, html.has-dialog .glitch::after { animation-play-state: paused !important; }
.news-more-wrap { display: flex; justify-content: center; padding: 0 0 56px; }
.news-more-wrap[hidden], .news-more-wrap:has(button[hidden]) { padding-bottom: 0; }

/* 文章彈窗只留一條捲軸（內層 .fi），用全站的青粉漸層捲軸；高度扣掉標籤頁，彈窗外層不再多出第二條。
   內容貼滿面板，只把捲軸軌道上下縮進避開 .cy 的右上切角與右下斜角；軌道透明、拇指細條，不再有一圈厚邊 */
.article-dialog { overflow: hidden; }
.article-dialog > .frame.cy > .fi { max-height: calc(100vh - 34px - var(--tab)); border: 0; scrollbar-width: auto; scrollbar-color: auto; } /* 設了標準屬性 Chrome 會忽略 ::-webkit-scrollbar */
@supports not selector(::-webkit-scrollbar) { .article-dialog > .frame.cy > .fi { scrollbar-width: thin; scrollbar-color: var(--c1) transparent; } }
.article-dialog > .frame.cy > .fi::-webkit-scrollbar { width: 8px; }
.article-dialog > .frame.cy > .fi::-webkit-scrollbar-track { margin: calc(var(--tn) + 4px) 0 calc(var(--bk) + 10px); border: 0; background: transparent; }
.article-dialog > .frame.cy > .fi::-webkit-scrollbar-thumb { border: 2px solid transparent; border-right-width: 3px; background-clip: padding-box; }


/* ───────── 成員人事檔案（首頁核心團隊彈窗） ─────────
   左：身分卡（一定有）；右：職責與隸屬、協作夥伴從組織圖自動帶出，介紹／專長／聯絡有填才出現 */
.md-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 380px; }
.md-id { position: relative; display: grid; align-content: start; justify-items: center; gap: 6px; padding: 30px 22px 22px; text-align: center;
  border-right: 1px solid var(--line);
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, color-mix(in srgb, var(--c1) 4%, transparent) 3px 4px),
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--c1) 16%, transparent), transparent 70%),
    color-mix(in srgb, var(--bg) 60%, var(--panel)); }
.md-portrait { position: relative; display: grid; place-items: center; width: 150px; height: 168px; margin-bottom: 8px; }
.md-portrait::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--c1) 55%, transparent);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%, 50% 0, 50% 3%, 3% 26.5%, 3% 73.5%, 50% 97%, 97% 73.5%, 97% 26.5%, 50% 3%); }
.md-portrait .avatar { width: 128px; height: 144px; font-size: 48px; }
.md-scan { position: absolute; inset: 12px 11px; pointer-events: none; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--c1) 35%, transparent) 50%, transparent 55%) 0 -170px / 100% 340px no-repeat;
  animation: mdScan 3.2s linear infinite; }
@keyframes mdScan { to { background-position: 0 170px; } }
.md-id h3 { max-width: 100%; margin: 0; overflow-wrap: anywhere; font: 900 26px/1.2 var(--f-body); }
.md-en { margin: 0; color: color-mix(in srgb, var(--ink) 80%, var(--dim)); font: 500 15px/1.3 var(--f-display); letter-spacing: .08em; }
.md-handle { margin: 0; color: var(--dim); font: 12px/1.4 var(--f-mono); overflow-wrap: anywhere; }
.md-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.md-badges li { display: inline-flex; flex: none; align-items: center; gap: 5px; padding: 3px 9px; white-space: nowrap; border: 1px solid color-mix(in srgb, var(--c1) 50%, var(--line)); color: var(--c1); font-size: 12px; }
.md-badges li.is-lead { border-color: var(--warn); color: var(--warn); }
.md-badges li.ok { border-color: var(--ok); color: var(--ok); }
.md-badges svg { width: 14px; height: 14px; }
.md-file { display: grid; gap: 0; width: 100%; margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); text-align: left; }
.md-file div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; }
.md-file dt { color: var(--dim); font: 11px/1.5 var(--f-mono); letter-spacing: .12em; }
.md-file dd { margin: 0; overflow: hidden; color: var(--ink); font: 12px/1.5 var(--f-mono); letter-spacing: .06em; white-space: nowrap; text-overflow: ellipsis; }
.md-file .lamp { margin-right: 6px; }

.md-main { display: grid; align-content: start; gap: 22px; padding: 30px 28px 24px; padding-right: 76px; }
.md-sec h4 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; color: var(--ink); font: 700 15px/1.3 var(--f-body); }
.md-sec h4::before { content: ""; width: 4px; height: 14px; align-self: center; background: var(--c1); box-shadow: 0 0 8px var(--c1); }
.md-sec h4 small { color: var(--dim); font: 10px var(--f-mono); letter-spacing: .18em; }
.md-sec h4::after { content: ""; flex: 1; height: 1px; align-self: center; background: linear-gradient(90deg, var(--line), transparent); }
.md-role { position: relative; display: grid; gap: 3px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--c1) 40%, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--c1) 10%, transparent), transparent 70%); }
.md-role + .md-role { margin-top: 8px; }
.md-role-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.md-role-top b { color: var(--c1); font: 900 19px/1.3 var(--f-body); }
.md-role-top span { padding: 1px 8px; border: 1px solid var(--line); color: var(--dim); font: 11px/1.6 var(--f-mono); letter-spacing: .1em; }
.md-role > small { color: color-mix(in srgb, var(--ink) 75%, var(--dim)); font: 12px/1.4 var(--f-mono); letter-spacing: .06em; }
.md-path { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 6px 0 0; color: var(--dim); font-size: 12px; }
.md-path svg { width: 14px; height: 14px; margin-right: 2px; color: var(--c1); }
.md-path i { color: color-mix(in srgb, var(--c1) 60%, var(--line)); font-style: normal; }
.md-path em { color: var(--ink); font-style: normal; font-weight: 700; }
.md-span { margin: 2px 0 0; color: var(--dim); font-size: 12px; }
.md-span b { color: var(--c1); font-family: var(--f-display); font-size: 14px; }
.md-none { margin: 0; color: var(--dim); }
.md-bio { position: relative; margin: 0; padding: 4px 0 4px 18px; border-left: 2px solid color-mix(in srgb, var(--c1) 55%, var(--line));
  color: color-mix(in srgb, var(--ink) 90%, var(--dim)); font-size: 15px; line-height: 1.8; white-space: pre-line; }
.md-skills li { padding: 5px 12px; background: color-mix(in srgb, var(--c1) 8%, transparent); }
.md-contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.md-link { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.md-link:hover { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 8%, var(--bg)); }
.md-link > svg { width: 22px; height: 22px; flex: none; color: var(--c1); }
.md-link > span { min-width: 0; overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.md-link small { display: block; color: var(--dim); font: 10px/1.4 var(--f-mono); letter-spacing: .12em; }
.md-link.copied small { color: var(--ok); }
.md-link.copied small::after { content: " · 已複製"; }
.md-team { display: grid; gap: 10px; }
.md-team-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; }
.md-team-row > span { padding-top: 6px; color: var(--dim); font-size: 12px; }
.md-team-row > div { display: flex; flex-wrap: wrap; gap: 6px; }
.md-team-row em { align-self: center; color: var(--dim); font: 12px var(--f-mono); font-style: normal; }
.md-mate { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 3px 10px 3px 3px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 13px var(--f-body); cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.md-mate:hover { border-color: var(--c1); color: var(--c1); }
.md-mate .avatar { width: 24px; height: 27px; flex: none; font-size: 10px; }
.md-mate span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.md-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin: 0; padding: 10px 28px 12px 22px; border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--dim); font: 10px/1.6 var(--f-mono); letter-spacing: .16em; }
.md-foot span:last-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-family: var(--f-body); letter-spacing: .04em; }
.md-foot svg { width: 14px; height: 14px; }
@media (max-width: 720px) {
  .md-grid { grid-template-columns: 1fr; }
  .md-id { padding: 26px 18px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .md-portrait { width: 120px; height: 134px; }
  .md-portrait .avatar { width: 102px; height: 115px; font-size: 38px; }
  .md-main { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) { .md-scan { animation: none; background: none; } }
.md-id h3.is-long { font-size: 19px; line-height: 1.3; }

/* 人事檔案切換：收訊開關（雜訊層疊在卡片本體上，形狀跟 2077 外框一樣） */
.member-dialog > .frame .md-noise { position: absolute; inset: var(--tab, 0px) 0 0; z-index: 7; width: 100%; height: calc(100% - var(--tab, 0px)); pointer-events: none;
  clip-path: polygon(0 0, calc(100% - var(--tn, 0px)) 0, 100% var(--tn, 0px), 100% calc(100% - var(--bk, 0px)), calc(100% - var(--bk, 0px)) 100%, 0 100%); }
.member-dialog > .frame .md-noise { image-rendering: pixelated; mix-blend-mode: screen; }
#md-signal { transition: color .2s ease; }
.member-dialog.is-switching #md-signal { color: var(--c1); }
.member-dialog .fi { position: relative; }


/* Discord 狀態燈（形狀照 Discord：實心圓、月亮、減號、空心圈；顏色稍微調柔，避免跟網站的錯誤紅混淆）
   四種都會呼吸發光；離線比較淡、比較慢。月亮的缺口用底色畫（--dc-cut），不用遮罩，光暈才不會被切掉 */
.dc-status { --dc: #80848e; --dc-cut: var(--panel); position: relative; display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--dc);
  animation: dcBreathe 2.4s ease-in-out infinite; }
.dc-status.s-online { --dc: #23a55a; }
.dc-status.s-idle { --dc: #f0b232; background: radial-gradient(circle at 24% 24%, var(--dc-cut) 34%, var(--dc) 35%); }
.dc-status.s-dnd { --dc: #e8555a; }
.dc-status.s-dnd::after { content: ""; position: absolute; left: 22%; right: 22%; top: 50%; height: 22%; border-radius: 2px; background: var(--dc-cut); transform: translateY(-50%); }
.dc-status.s-offline { background: var(--dc-cut); box-shadow: inset 0 0 0 2.5px var(--dc); animation: dcBreatheDim 3.6s ease-in-out infinite; }
@keyframes dcBreathe {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--dc) 55%, transparent); }
  50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--dc) 18%, transparent), 0 0 9px color-mix(in srgb, var(--dc) 75%, transparent); }
}
@keyframes dcBreatheDim {
  0%, 100% { box-shadow: inset 0 0 0 2.5px var(--dc), 0 0 0 0 transparent; opacity: .75; }
  50% { box-shadow: inset 0 0 0 2.5px var(--dc), 0 0 7px color-mix(in srgb, var(--dc) 60%, transparent); opacity: 1; }
}
.person-chip .dc-status { margin: 0 2px; }
.md-file dd .dc-status { --dc-cut: color-mix(in srgb, var(--bg) 60%, var(--panel)); width: 9px; height: 9px; margin-right: 7px; vertical-align: 0; }
/* 人事檔案：徽章放在六角形頭像底部的尖角正中間，外圈用面板底色「挖空」 */
.md-portrait .dc-status { --dc-cut: color-mix(in srgb, var(--bg) 60%, var(--panel)); position: absolute; left: 50%; bottom: -4px; z-index: 2; width: 24px; height: 24px;
  border: 4px solid var(--dc-cut); box-sizing: content-box; transform: translateX(-50%); }
.md-portrait .dc-status[hidden] { display: none; }
.md-portrait .dc-status.s-offline { box-shadow: inset 0 0 0 6px var(--dc); animation-name: dcBreatheDimLg; }
@keyframes dcBreatheDimLg {
  0%, 100% { box-shadow: inset 0 0 0 6px var(--dc), 0 0 0 0 transparent; opacity: .8; }
  50% { box-shadow: inset 0 0 0 6px var(--dc), 0 0 10px color-mix(in srgb, var(--dc) 60%, transparent); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .dc-status { animation: none !important; } }
