/* ui-v3 · 共用元件 */

/* ── 外框 ─────────────────────────────── */
.app { position: relative; z-index: 1; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.top {
  position: relative; z-index: var(--z-top); flex: 0 0 56px; display: flex; align-items: center; gap: var(--g6);
  padding: 0 var(--g5) 0 var(--g6); border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(6, 7, 10, .96), rgba(6, 7, 10, .9));
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand svg { width: 26px; height: 26px; }
.brand svg path { stroke: var(--sig); }
.brand b { font-weight: 700; font-size: 14.5px; letter-spacing: .08em; white-space: nowrap; }
.brand i { font: 500 9.5px var(--f-mono); font-style: normal; color: var(--dim); letter-spacing: .14em; border: 1px solid var(--line2); padding: 3px 6px; border-radius: var(--r1); white-space: nowrap; }
.brand:hover svg path { animation: wavePulse .9s var(--ease-io); }
.brand svg path:nth-child(2) { animation-delay: .04s; } .brand svg path:nth-child(3) { animation-delay: .08s; } .brand svg path:nth-child(4) { animation-delay: .12s; } .brand svg path:nth-child(5) { animation-delay: .16s; }
@keyframes wavePulse { 40% { transform: scaleY(.4); } }
.brand svg path { transform-origin: center; transform-box: fill-box; }

.nav { position: relative; display: flex; align-self: stretch; }
.nav a { position: relative; display: flex; align-items: center; gap: 9px; padding: 0 15px; color: var(--dim); font-size: 13px; font-weight: 500; transition: color var(--t2) var(--ease); white-space: nowrap; }
.nav a span { font: 500 10px var(--f-mono); letter-spacing: .1em; color: var(--faint); transition: color var(--t2); }
.nav a:hover { color: var(--fg2); }
.nav a.on { color: var(--fg); }
.nav a.on span { color: var(--sig); }
.nav .ind { position: absolute; bottom: -1px; height: 2px; background: var(--sig); box-shadow: 0 0 14px var(--sig), 0 0 2px var(--sig); transition: left var(--t3) var(--spring), width var(--t3) var(--spring); pointer-events: none; }
.nav kbd { font: 500 9px var(--f-mono); color: var(--faint); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-left: 2px; opacity: 0; transition: opacity var(--t2); }
.nav:hover kbd { opacity: 1; }

.ticker { margin-left: auto; display: flex; align-items: center; gap: var(--g5); min-width: 0; }
.tk { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.tk .lbl { font-size: 9.5px; }
.tk .v { font: 700 18px/1 var(--f-num); letter-spacing: .02em; }
.tk .d { font: 500 10.5px var(--f-mono); }
.tk .d.dim { color: var(--dim); }
.ticker.ceil .lbl em { font-style: normal; color: var(--warn); }
.tk.opt { }
.acts { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.acts .sep { width: 1px; height: 20px; background: var(--line2); margin: 0 6px; }
@media (max-width: 1360px) { .tk.opt { display: none; } }
@media (max-width: 1100px) { .brand i, .nav kbd { display: none; } .ticker { gap: var(--g3); } }

.page { position: relative; flex: 1 1 auto; min-height: 0; }

/* ── 按鈕 ─────────────────────────────── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 30px; padding: 0 12px; flex-shrink: 0;
  border: 1px solid var(--line2); background: var(--s2); border-radius: var(--r2); font-size: 12.5px; font-weight: 500; color: var(--fg); white-space: nowrap;
  transition: background var(--t1) var(--ease), border-color var(--t1) var(--ease), color var(--t1), transform var(--t1) var(--ease), box-shadow var(--t2);
  user-select: none;
}
.btn:hover { background: var(--s3); border-color: var(--line3); }
.btn:active { transform: scale(.965); }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; gap: 5px; }
.btn.sm svg { width: 13px; height: 13px; }
.btn.xs { height: 22px; padding: 0 7px; font-size: 11px; gap: 4px; border-radius: var(--r1); }
.btn.xs svg { width: 12px; height: 12px; }
.btn.ico { width: 30px; padding: 0; }
.btn.ico.sm { width: 26px; }
.btn.ico.xs { width: 22px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg2); }
.btn.ghost:hover { background: var(--s3); color: var(--fg); border-color: transparent; }
.btn.pri { background: var(--sig); color: var(--sig-ink); border-color: var(--sig); font-weight: 700; }
.btn.pri:hover { background: var(--sig-2); box-shadow: 0 0 0 4px var(--sig-a), 0 0 24px -4px var(--sig); }
.btn.line { background: transparent; border-color: var(--line2); }
.btn.line:hover { border-color: var(--sig); color: var(--sig); background: var(--sig-a); }
.btn.dash { background: transparent; border-style: dashed; color: var(--dim); }
.btn.dash:hover { color: var(--sig); border-color: var(--sig); background: var(--sig-a); }
.btn.danger:hover { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 50%, transparent); background: var(--danger-a); }
.btn.on { border-color: var(--sig); color: var(--sig); background: var(--sig-a); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn .badge { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--sig); color: var(--sig-ink); font: 700 10px/16px var(--f-mono); text-align: center; }

/* ── 欄位 ─────────────────────────────── */
.fld {
  height: 30px; padding: 0 9px; background: var(--s2); border: 1px solid var(--line2); border-radius: var(--r2);
  font-size: 13px; color: var(--fg); min-width: 0; width: 100%;
  transition: border-color var(--t1), box-shadow var(--t2), background var(--t1);
}
.fld:hover { border-color: var(--line3); }
.fld:focus { border-color: var(--sig); box-shadow: 0 0 0 3px var(--sig-a); background: var(--s1); }
.fld.num { font-family: var(--f-mono); font-size: 12.5px; text-align: right; }
.fld.sm { height: 26px; font-size: 12px; }
textarea.fld { height: auto; padding: 8px 10px; line-height: 1.55; resize: vertical; font-family: var(--f-mono); font-size: 12px; }
.fieldset { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fieldset > .lbl { padding-left: 1px; }

/* 數字欄:左側標籤可左右拖曳調整(像 3D 軟體的 scrub) */
.nf { position: relative; display: flex; align-items: stretch; height: 30px; background: var(--s2); border: 1px solid var(--line2); border-radius: var(--r2); transition: border-color var(--t1), box-shadow var(--t2); min-width: 0; }
.nf:hover { border-color: var(--line3); }
.nf:focus-within { border-color: var(--sig); box-shadow: 0 0 0 3px var(--sig-a); }
.nf input { flex: 1 1 auto; min-width: 0; width: 100%; background: none; border: 0; padding: 0 8px; text-align: right; font: 500 12.5px var(--f-mono); color: var(--fg); }
.nf .u { display: flex; align-items: center; padding-right: 8px; font: 500 11px var(--f-mono); color: var(--dim); }
.nf .scrub { display: flex; align-items: center; padding: 0 8px; font-size: 11.5px; color: var(--dim); cursor: ew-resize; border-right: 1px solid var(--line); user-select: none; white-space: nowrap; transition: color var(--t1), background var(--t1); }
.nf .scrub:hover, .nf.scrubbing .scrub { color: var(--sig); background: var(--sig-a); }
.nf.sm { height: 26px; }
.nf.flash { animation: nfFlash .6s var(--ease); }
@keyframes nfFlash { 0% { box-shadow: 0 0 0 3px var(--sig-a); border-color: var(--sig); } }

/* 下拉觸發鈕 */
.sel {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 10px; width: 100%;
  background: var(--s2); border: 1px solid var(--line2); border-radius: var(--r2); font-size: 13px; text-align: left;
  transition: border-color var(--t1), background var(--t1);
}
.sel:hover { border-color: var(--line3); background: var(--s3); }
.sel[aria-expanded='true'] { border-color: var(--sig); box-shadow: 0 0 0 3px var(--sig-a); }
.sel .v { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel .chev { width: 14px; height: 14px; color: var(--dim); transition: transform var(--t2) var(--ease); flex-shrink: 0; }
.sel[aria-expanded='true'] .chev { transform: rotate(180deg); color: var(--sig); }
.sel.sm { height: 26px; font-size: 12px; }
.sel.mono .v { font-family: var(--f-mono); font-size: 12px; }

/* ── 浮層選單 ─────────────────────────── */
.pop-layer { position: fixed; inset: 0; z-index: var(--z-pop); }
.pop {
  position: fixed; z-index: var(--z-pop); min-width: 160px; max-width: min(420px, 92vw); overflow: auto; padding: 4px;
  background: var(--s2); border-radius: var(--r3); box-shadow: var(--shadow-pop);
  animation: popIn 200ms var(--ease) backwards; transform-origin: var(--ox, 50%) var(--oy, 0);
}
.pop.up { --oy: 100%; }
.pop .it {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 30px; padding: 5px 10px; border-radius: var(--r2);
  font-size: 13px; color: var(--fg2); text-align: left; transition: background var(--t1), color var(--t1);
}
.pop .it:hover, .pop .it.act { background: var(--s4); color: var(--fg); }
.pop .it.on { color: var(--sig); }
.pop .it .ck { width: 14px; height: 14px; flex-shrink: 0; opacity: 0; }
.pop .it.on .ck { opacity: 1; }
.pop .it small { margin-left: auto; color: var(--dim); font: 400 11px var(--f-mono); }
.pop .grp { padding: 8px 10px 4px; }
.pop hr { border: 0; height: 1px; background: var(--line); margin: 4px 2px; }
.pop .it.danger { color: var(--danger); }
.pop .it.danger:hover { background: var(--danger-a); }

/* ── 分段切換(滑動指示塊) ─────────────── */
.seg { position: relative; display: inline-flex; padding: 2px; gap: 0; background: var(--s1); border: 1px solid var(--line2); border-radius: var(--r2); isolation: isolate; }
.seg button { position: relative; z-index: 1; height: 24px; padding: 0 10px; font-size: 12px; font-weight: 500; color: var(--dim); border-radius: var(--r1); white-space: nowrap; transition: color var(--t2) var(--ease); }
.seg button:hover { color: var(--fg2); }
.seg button.on { color: var(--sig-ink); font-weight: 700; }
.seg { contain: layout style; }
.seg .thumb { position: absolute; z-index: 0; left: 0; top: 2px; bottom: 2px; border-radius: var(--r1); background: var(--sig); transition: transform var(--t3) var(--spring), width var(--t3) var(--spring); box-shadow: 0 0 16px -4px var(--sig); }
.seg.sm button { height: 20px; padding: 0 8px; font-size: 11.5px; }
.seg.mono button { font-family: var(--f-mono); font-size: 11.5px; }
.seg.fill { display: flex; }
.seg.fill button { flex: 1 1 0; }

/* ── 開關 ─────────────────────────────── */
.tgl { position: relative; flex-shrink: 0; width: 30px; height: 16px; border-radius: 8px; background: var(--s4); border: 1px solid var(--line2); transition: background var(--t2) var(--ease), border-color var(--t2); }
.tgl::after { content: ''; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--dim); transition: transform var(--t3) var(--spring), background var(--t2); }
.tgl.on { background: var(--sig-a); border-color: var(--sig); }
.tgl.on::after { transform: translateX(14px); background: var(--sig); box-shadow: 0 0 8px var(--sig); }

/* 勾選列 */
.chk { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r2); text-align: left; transition: background var(--t1); }
.chk:hover { background: var(--s3); }
.chk .tgl { margin-top: 2px; }
.chk .t { font-size: 13px; color: var(--fg2); line-height: 1.45; }
.chk.on .t { color: var(--fg); }
.chk .d { display: block; font-size: 11.5px; color: var(--dim); margin-top: 2px; line-height: 1.5; }

/* ── 標籤 / 膠囊 ───────────────────────── */
.tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border: 1px solid var(--line2); border-radius: var(--r1); font: 500 10.5px var(--f-mono); letter-spacing: .06em; color: var(--fg2); white-space: nowrap; }
.tag.el { color: var(--c); border-color: color-mix(in oklab, var(--c) 40%, transparent); background: color-mix(in oklab, var(--c) 8%, transparent); }
.tag.el::before { content: ''; width: 6px; height: 6px; background: var(--c); transform: rotate(45deg); box-shadow: 0 0 8px var(--c); }
.tag.warn { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 40%, transparent); background: var(--warn-a); }
.tag.danger { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 40%, transparent); background: var(--danger-a); }
.tag.sig { color: var(--sig); border-color: color-mix(in oklab, var(--sig) 40%, transparent); background: var(--sig-a); }
.tag.zh { font-family: var(--f-ui); letter-spacing: .02em; font-size: 11px; }

.pill { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 22px; padding: 0 8px 0 4px; border-radius: var(--rp); background: var(--s3); border: 1px solid var(--line); font-size: 11.5px; color: var(--fg2); white-space: nowrap; }
.pill img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; background: var(--s5); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--dim)); margin-left: 4px; }
.pill .rem { font: 500 10px var(--f-mono); color: var(--dim); }
.pill .t { overflow: hidden; text-overflow: ellipsis; }
.pill.new { border-color: color-mix(in oklab, var(--up) 60%, transparent); color: var(--fg); box-shadow: 0 0 0 1px color-mix(in oklab, var(--up) 20%, transparent) inset; }
.pill.changed { border-color: color-mix(in oklab, var(--glacio) 60%, transparent); color: var(--fg); }
.pill.gone { opacity: .5; text-decoration: line-through; }
.pill.inactive { border-style: dashed; opacity: .65; }
.pill.gear { background: var(--s2); }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }

/* ── 卡片與區段 ───────────────────────── */
.card { position: relative; background: rgba(10, 12, 16, .82); border: 1px solid var(--line); border-radius: var(--r2); }
.card.pad { padding: var(--g4); }
/* 角落刻度:技術感的裝飾,只放在重點卡 */
.ticks::before, .ticks::after { content: ''; position: absolute; width: 7px; height: 7px; pointer-events: none; border-color: var(--line3); border-style: solid; }
.ticks::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.ticks::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.sh { display: flex; align-items: center; gap: var(--g3); min-height: 22px; }
.sh::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--line); order: 5; }
.sh .lbl { order: 1; }
.sh .x { order: 9; display: flex; align-items: center; gap: 6px; }
.sh .meta { order: 6; font-size: 11.5px; color: var(--dim); }
.sh.tight::after { display: none; }

/* 可展開區塊:高度用 grid 0fr → 1fr 平滑展開 */
.fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t3) var(--ease); }
.fold > div { overflow: hidden; min-height: 0; }
.fold.open { grid-template-rows: 1fr; }
.disc { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); padding: 4px 0; transition: color var(--t1); }
.disc:hover { color: var(--fg2); }
.disc svg { width: 12px; height: 12px; transition: transform var(--t2) var(--ease); }
.disc.open svg { transform: rotate(90deg); }
.prose { font-size: 12.5px; line-height: 1.75; color: var(--fg2); white-space: pre-line; }

/* 量表 */
.meter { position: relative; height: 3px; background: var(--line); overflow: hidden; border-radius: 2px; }
.meter i { position: absolute; inset: 0; background: var(--c, var(--sig)); transform-origin: left; transform: scaleX(var(--v, 0)); transition: transform var(--t4) var(--ease); box-shadow: 0 0 8px var(--c, var(--sig)); }

/* 頭像 */
.av { position: relative; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: var(--s4); box-shadow: 0 0 0 1px var(--c, var(--line2)); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.sq { border-radius: var(--r2); }
.av .gl { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--dim); }

/* 屬性菱形 */
.dia { display: inline-block; width: 7px; height: 7px; background: var(--c, var(--dim)); transform: rotate(45deg); box-shadow: 0 0 8px var(--c, transparent); flex-shrink: 0; }

/* ── 滾動數字 ─────────────────────────── */
.rn { display: inline-flex; align-items: baseline; white-space: nowrap; }
.rn .d { display: inline-block; height: 1.04em; overflow: hidden; vertical-align: top; }
.rn .d > span { display: block; white-space: pre; line-height: 1.04em; text-align: center; transition: transform var(--t4) var(--ease); transition-delay: var(--dl, 0ms); }
.rn .s { display: inline-block; height: 1.04em; line-height: 1.04em; }
.rn-wrap { position: relative; display: inline-flex; }
.rn-wrap.snap .rn .d > span { transition: none; }
.rn-delta { position: absolute; right: 0; top: -2px; transform: translateY(-100%); font: 600 11px var(--f-mono); white-space: nowrap; pointer-events: none; animation: deltaFloat 1.8s var(--ease) forwards; }
@keyframes deltaFloat { 0% { opacity: 0; transform: translateY(-60%); } 12% { opacity: 1; transform: translateY(-100%); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-150%); } }

/* ── 提示泡泡 ─────────────────────────── */
.tip {
  position: fixed; z-index: var(--z-tip); max-width: 300px; padding: 7px 10px; border-radius: var(--r2);
  background: #eef1f6; color: #0a0c10; font-size: 12px; line-height: 1.5; pointer-events: none; white-space: pre-line;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .6); animation: tipIn 160ms var(--ease) backwards;
}
.tip kbd { font: 600 10px var(--f-mono); background: rgba(0, 0, 0, .08); padding: 1px 4px; border-radius: 3px; margin-left: 6px; }
@keyframes tipIn { from { opacity: 0; transform: translateY(3px); } }

/* ── Toast ────────────────────────────── */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  position: relative; overflow: hidden; pointer-events: auto; display: flex; align-items: center; gap: 12px; min-height: 40px; max-width: min(640px, 92vw); padding: 8px 8px 8px 14px;
  background: var(--s3); border: 1px solid var(--line2); border-radius: var(--r3); box-shadow: var(--shadow-pop); font-size: 13px;
  animation: toastIn 380ms var(--spring) backwards;
}
.toast.out { animation: toastOut 200ms var(--ease-in) both; }
.toast .ico { width: 16px; height: 16px; color: var(--sig); flex-shrink: 0; }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--sig); opacity: .6; transform-origin: left; animation: toastBar linear forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ── 彈窗 ─────────────────────────────── */
.modal-layer { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 3vh 3vw; background: rgba(3, 4, 6, .66); backdrop-filter: blur(8px) saturate(.8); animation: fadeIn 260ms var(--ease) backwards; }
.modal-layer.out { animation: fadeOut 120ms var(--ease-in) both; pointer-events: none; }
@keyframes fadeOut { to { opacity: 0; } }
.modal { position: relative; display: flex; flex-direction: column; width: min(1180px, 100%); height: min(820px, 100%); background: var(--s1); border: 1px solid var(--line2); border-radius: var(--r3); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .9); overflow: hidden; animation: modalIn 480ms var(--ease) backwards; }
.modal-layer.out .modal { animation: modalOut 120ms var(--ease-in) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-hd { display: flex; align-items: center; gap: var(--g3); height: 56px; padding: 0 var(--g4) 0 var(--g5); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-hd h2 { font-size: 15px; font-weight: 700; letter-spacing: .04em; }

/* 搜尋框 */
.search { position: relative; display: flex; align-items: center; height: 34px; min-width: 0; background: var(--s2); border: 1px solid var(--line2); border-radius: var(--r2); transition: border-color var(--t1), box-shadow var(--t2); }
.search:focus-within { border-color: var(--sig); box-shadow: 0 0 0 3px var(--sig-a); }
.search svg { width: 15px; height: 15px; margin: 0 4px 0 10px; color: var(--dim); flex-shrink: 0; }
.search input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0 8px; background: none; border: 0; font-size: 13px; }
.search kbd { font: 500 10px var(--f-mono); color: var(--dim); border: 1px solid var(--line2); border-radius: 3px; padding: 1px 5px; margin-right: 8px; }

/* 空狀態 */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: var(--g8) var(--g4); text-align: center; color: var(--dim); font-size: 12.5px; }
.empty svg { width: 30px; height: 30px; color: var(--faint); }
.empty b { color: var(--fg2); font-size: 14px; font-weight: 500; }

/* 警示列 */
.alert { display: flex; gap: 9px; align-items: flex-start; padding: 9px 12px; border-radius: var(--r2); border: 1px solid color-mix(in oklab, var(--warn) 35%, transparent); background: var(--warn-a); color: var(--warn); font-size: 12px; line-height: 1.6; }
.alert svg { width: 14px; height: 14px; margin-top: 2px; flex-shrink: 0; }
.alert.danger { border-color: color-mix(in oklab, var(--danger) 35%, transparent); background: var(--danger-a); color: var(--danger); }

/* 鍵盤提示 */
kbd { font: 500 10px var(--f-mono); }

/* 進場錯落:子元素依 --i 延遲 */
.stagger > * { animation: riseIn 560ms var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms); }

/* ── 游標光暈 / 飛入 / 局部轉場 ───────── */
[data-spot] { position: relative; }
[data-spot]::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit; opacity: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), color-mix(in oklab, var(--c, var(--sig)) 14%, transparent), transparent 70%);
  transition: opacity var(--t3) var(--ease);
}
[data-spot]:hover::before { opacity: 1; }
.fly-ghost { position: fixed; z-index: var(--z-toast); pointer-events: none; border-radius: var(--r2); background: color-mix(in oklab, var(--c) 30%, var(--s3)); border: 1px solid var(--c); box-shadow: 0 0 24px -4px var(--c); color: var(--fg); font-size: 12px; display: flex; align-items: center; padding: 0 10px; overflow: hidden; white-space: nowrap; transform-origin: center; }
/* 立繪換人:短的淡入 + 位移,不模糊(模糊很吃效能),也不擋操作 */
@keyframes porIn { from { opacity: 0; transform: translateX(24px); } }
.img-fb { display: grid; place-items: center; width: 100%; height: 100%; color: var(--faint); background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .025) 6px 7px); }
.img-fb svg { width: 40%; height: 40%; max-width: 28px; max-height: 28px; }
/* 出招頁已經有大的走帶列,頂欄只留比較基準 */
.ticker.lite .tk { display: none; }

/* 快捷鍵表 */
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; padding: 20px 24px 28px; overflow-y: auto; }
.keys section { display: flex; flex-direction: column; gap: 2px; }
.keys .lbl { padding-bottom: 6px; }
.key-r { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--fg2); }
.key-k { display: flex; gap: 4px; flex-shrink: 0; }
.key-k kbd { padding: 2px 7px; border: 1px solid var(--line3); border-bottom-width: 2px; border-radius: 4px; background: var(--s3); color: var(--fg); font-size: 11px; white-space: nowrap; }
.modal:has(.keys) { height: auto; }
@media (max-width: 700px) { .keys { grid-template-columns: 1fr; } }

/* 手機:頂欄精簡(只留標誌、導覽、復原與選單),跟著捲動黏在上方 */
@media (max-width: 760px) {
  .top { position: sticky; top: 0; gap: 8px; padding: 0 8px 0 12px; flex-basis: 52px; }
  .brand b, .brand i, .ticker, .acts .sep, .acts [aria-label='快捷鍵'] { display: none; }
  .nav { margin-left: auto; }
  .nav a { padding: 0 9px; gap: 6px; font-size: 13px; }
  .nav a span { display: none; }
  .nav .ind { display: none; }
  .nav a.on { box-shadow: inset 0 -2px 0 var(--sig); }
  .acts { gap: 0; }
  .modal-layer { padding: 0; }
  .modal { width: 100% !important; height: 100% !important; border-radius: 0; }
  .toasts { left: 12px; right: 12px; transform: none; bottom: 12px; }
}
.pill .img-fb { width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%; background: var(--s5); }
.pill .img-fb svg { width: 9px; height: 9px; }
.mv-ico .img-fb, .clip-ico.img-fb { background: none; }
.clip-tx .img-fb { width: 14px; height: 14px; flex-shrink: 0; }

/* 換頁時各欄依序浮現(只在掛上時播一次) */
@keyframes colIn { from { opacity: 0; transform: translateY(8px); } }
.team > .rack, .team > .editor, .team > .ro,
.rot > .tp, .rot > .lib, .rot > .stage, .rot > .insp,
.dat > .dat-cats, .dat > .dat-list, .dat > .dat-doc { animation: colIn 360ms var(--ease) backwards; }
.team > .editor, .rot > .lib, .dat > .dat-list { animation-delay: 30ms; }
.team > .ro, .rot > .stage, .dat > .dat-doc { animation-delay: 60ms; }
.rot > .insp { animation-delay: 90ms; }
.clip-ico, .mv-ico img, .skl-ico img, .pill img { object-fit: contain; }

/* 頂欄獨立排版 */
.top { contain: layout style; }

/* ── 不放遊戲圖片的網站版(WW_SITE.noArt):頭像 = 屬性色底 + 名字第一個字;立繪 = 大號空心字 ── */
.av .img-fb { background: color-mix(in oklab, var(--c, var(--line2)) 18%, var(--s3)); }
.av .gl { color: color-mix(in oklab, var(--c, var(--fg2)) 70%, var(--fg)); font-weight: 600; line-height: 1; }
.img-fb > .gl { font-weight: 700; color: color-mix(in oklab, var(--c, var(--fg2)) 70%, var(--fg)); }
.por-glyph {
  display: block; font: 900 1em/1 var(--f-ui); color: transparent; user-select: none; pointer-events: none;
  -webkit-text-stroke: 1.5px color-mix(in oklab, var(--c, var(--fg)) 70%, transparent);
  background: linear-gradient(165deg, color-mix(in oklab, var(--c, var(--fg)) 34%, transparent), transparent 72%); -webkit-background-clip: text; background-clip: text;
}
