/* ============================================================
   叉布 · 作品集
   ------------------------------------------------------------
   形态：滚动驱动的单页作品目录
   技术showcase：手写流场粒子系统（见 studio.js）+ 滚动错位 + 光标跟随

   颜色纪律：单色阶梯 + 一个发光青蓝。
     发光感只在暗底成立，所以底色必须压得很低。
     所有正文级文字对 #08090B 对比度 ≥ 4.5:1。

   性能纪律：动画只碰 transform / opacity；粒子用 GPU 友好的
   fillRect + globalCompositeOperation=lighter，不触发重排。
   ============================================================ */

:root {
  --bg:        #08090B;
  --bg-1:      #101216;
  --ink:       #F2F3F5;
  --ink-2:     #9BA1AB;
  --ink-3:     #7C838D;
  --line:      #1C1F25;
  --line-2:    #2A2F37;

  --accent:      #5B8CFF;   /* 稳定蓝：文字、按钮 */
  --accent-glow: #64E0FF;   /* 发光青：只做光，不做文字 */
  --accent-soft: rgba(91, 140, 255, .14);
  --ok:          #4ADE9B;   /* 在线状态灯：只用于状态指示，不当正文色 */

  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --num:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --pad: clamp(1.25rem, 5vw, 5rem);
  --t:   200ms cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.num { font-family: var(--num); font-variant-numeric: tabular-nums; }

.label {
  font-family: var(--num);
  font-size: .6875rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-3);
}

a { color: inherit; text-decoration: none; }
.shell { padding-inline: var(--pad); }

.display {
  font-weight: 600;
  font-size: clamp(2.25rem, 7vw, 6.5rem);
  line-height: .98;
  letter-spacing: -0.045em;
  margin: 0;
}
.display .dim { color: var(--ink-3); }

.h2 {
  font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.028em;
  margin: 0;
}

/* ══════════ 开机序列 ══════════
   借鉴终端美学（黑底 + 终端绿 + 辉光 + 扫描线），但它是"过渡色"：
   开机用绿色信号，结束时融进页面本身的青蓝。
   绿色是致敬参考作品（Mili - world.execute(me); 的 HTML 可视化），
   所以这里的绿只出现在开机阶段，不进入页面主体配色。 */

.boot {
  position: fixed; inset: 0; z-index: 100;
  background: #05070A;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: clamp(1.25rem, 3vw, 3rem) clamp(1.25rem, 4vw, 4rem);
  font-family: var(--num);
  font-size: clamp(.75rem, 1.35vw, .9375rem);
  line-height: 1.9;
  color: #35FF7A;
  /* 双层辉光：这是"荧光屏"质感的主要来源 */
  text-shadow: 0 0 4px rgba(53, 255, 122, .55), 0 0 14px rgba(53, 255, 122, .28);
  cursor: pointer;
  overflow: hidden;
}

/* 扫描线 + 径向暗角（CRT 三件套之二三） */
.boot::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0 2px,
    rgba(0, 0, 0, .28) 2px 4px);
  pointer-events: none;
}
.boot::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%,
    rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, .82) 100%);
  pointer-events: none;
}

.boot-inner {
  position: relative; z-index: 1;
  max-width: 46rem;
  width: 100%;
  /* 【关键】flex 容器里的块级子元素默认会被拉伸到满高，
     这样父级的 justify-content: center 就失效了（看起来永远顶对齐）。
     margin-block: auto 让它收缩到内容高度并真正居中。 */
  margin-block: auto;
  margin-inline: auto;
  padding-inline: clamp(0px, 2vw, 2rem);
}

.boot-log { margin: 0; font: inherit; white-space: pre-wrap; }
.boot-line { min-height: 1.9em; }

/* 提示符与标记 */
.boot .p   { color: #7CFFB0; opacity: .8; }
.boot .k   { color: #35FF7A; opacity: .85; }
.boot .d   { color: #1E8C4A; letter-spacing: .06em; }
.boot .v   { color: #C6FFDD; }
.boot .n   { color: #1E8C4A; }
.boot .ok  { color: #7CFFB0; }
.boot .pct { color: #C6FFDD; }

/* 光标 */
.boot-cur {
  display: inline-block;
  margin-left: .35em;
  animation: curBlink 1.05s steps(1) infinite;
}
@keyframes curBlink { 50% { opacity: 0; } }

/* 底部进度条 */
.boot-bar {
  position: absolute; left: clamp(1.25rem, 4vw, 4rem);
  right: clamp(1.25rem, 4vw, 4rem); bottom: clamp(1.25rem, 4vw, 3rem);
  height: 1px; background: rgba(53, 255, 122, .18);
  z-index: 1;
}
.boot-bar i {
  display: block; height: 100%; width: 0;
  background: #35FF7A;
  box-shadow: 0 0 8px rgba(53, 255, 122, .8);
  transition: width 200ms linear;
}

/* 跳过提示 */
.boot-skip {
  position: absolute; right: clamp(1.5rem, 6vw, 6rem);
  top: clamp(1.5rem, 5vw, 3rem);
  z-index: 2;
  background: transparent; border: 0;
  color: #1E8C4A;
  font: inherit; font-family: var(--num);
  font-size: .6875rem; letter-spacing: .2em; text-transform: uppercase;
  cursor: pointer; padding: .4rem .2rem;
  transition: color var(--t);
}
.boot-skip:hover { color: #7CFFB0; }

/* 断电式淡出：轻微放大 + 变暗，像关掉一台 CRT */
.boot.is-off {
  animation: crtOff 560ms cubic-bezier(.4, 0, .9, .3) forwards;
  pointer-events: none;
}
@keyframes crtOff {
  0%   { opacity: 1; transform: scale(1); filter: brightness(1); }
  38%  { opacity: 1; transform: scaleY(.006) scaleX(1.02); filter: brightness(3.2); }
  100% { opacity: 0; transform: scale(.96); filter: brightness(0); }
}

/* 页面内容在开机期间先压住，避免"闪一下再开始" */
body:not(.is-ready) .hero-inner,
body:not(.is-ready) .readout,
body:not(.is-ready) .scroll-hint { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .boot { display: none; }
  .boot-cur { animation: none; }
}

/* ── 滚动进度 ─────────────────────────────────────────── */

.progress {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: 2px;
}
.progress i {
  display: block; height: 100%; width: var(--p, 0%);
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
  transition: width 80ms linear;
}

/* ── 光标跟随环 ───────────────────────────────────────── */

.cursor { position: fixed; inset: 0; z-index: 70; pointer-events: none; display: none; }
body.has-cursor .cursor { display: block; }

.cursor-dot,
.cursor-ring {
  position: absolute; top: 0; left: 0;
  border-radius: 50%;
  will-change: transform;
}
.cursor-dot {
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  background: var(--accent-glow);
  box-shadow: 0 0 10px var(--accent-glow);
}
.cursor-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid rgba(100, 224, 255, .5);
  transition: width var(--t), height var(--t), margin var(--t),
              border-color var(--t), background-color var(--t);
}
/* 悬停可点元素时环放大 —— 这一下让"自定义光标"从噱头变成有用的反馈 */
body.cursor-hot .cursor-ring {
  width: 56px; height: 56px; margin: -28px 0 0 -28px;
  border-color: rgba(100, 224, 255, .9);
  background: rgba(100, 224, 255, .08);
}

/* ── 顶栏 ─────────────────────────────────────────────── */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding: 1rem var(--pad);
  display: flex; align-items: center; gap: 1.25rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  opacity: 0; transform: translateY(-8px);
  transition: opacity 600ms ease, transform 600ms ease, border-color 600ms ease;
}
body.is-ready .topbar {
  opacity: 1; transform: none; border-bottom-color: var(--line);
}

.top-logo {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 600; letter-spacing: -.02em; font-size: .9375rem;
}
.logo-mark {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--accent-glow);
  display: grid; place-items: center;
  box-shadow: 0 0 12px rgba(100, 224, 255, .35);
}
.logo-mark::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}

.nav { margin-left: auto; display: flex; gap: .25rem; }
.nav a {
  font-size: .8125rem; color: var(--ink-2);
  padding: .35rem .65rem;
  transition: color var(--t), background-color var(--t);
}
.nav a:hover { color: var(--ink); background: var(--bg-1); }

/* ══════════ 开场 ══════════ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: 6rem var(--pad) 5rem;
  overflow: hidden;
  isolation: isolate;
}

/* 粒子画布铺满整个 hero */
.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: -2;
}

/* 径向压暗：中心压住粒子保证文字可读，边缘保留发光 */
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 62% 58% at 42% 50%,
      rgba(8, 9, 11, .92) 0%, rgba(8, 9, 11, .66) 45%, rgba(8, 9, 11, 0) 78%),
    linear-gradient(180deg, rgba(8,9,11,.55) 0%, transparent 22%, transparent 74%, rgba(8,9,11,.9) 100%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 48rem; z-index: 1; }

/* ══════════ 角色线稿 ══════════
   由 scripts/trace.py 从位图算法描摹出的 SVG（色块边界 + 外轮廓）。
   压暗、慢慢浮动 —— 它是"氛围层"，不能抢文字的注意力。

   定位要点（都是踩过的坑）：
     · 用 top/bottom 同时约束并居中，不用 translateY(-50%)
       —— 后者在窄高比例下会把图推出视口下缘
     · 底部让出 5.5rem：读数条和音效开关在 bottom:2rem，
       不让它们压在图上
     · 窄屏隐藏：小尺寸下这些细节会糊成一团，反而更乱 */

.hero-art {
  position: absolute;
  right: clamp(0rem, 3vw, 4rem);
  top: clamp(4.5rem, 11vh, 7rem);
  bottom: 5.5rem;
  width: clamp(22rem, 34vw, 38rem);
  z-index: 0;
  pointer-events: none;
  display: none;
  align-items: center;
  justify-content: center;
}
@media (min-width: 64rem) { .hero-art { display: flex; } }

/* 线稿区的独立暗底。
   为什么需要它：粒子铺满整个 hero，而线稿是半透明的细线，
   两者叠在同一视觉层会互相干扰 —— 谁都看不清。
   加一块柔和的径向暗底，把这块区域的粒子压下去，线稿才立得住。 */
.hero-art::before {
  content: "";
  position: absolute;
  inset: -6% -10% -6% -10%;
  background: radial-gradient(ellipse at 52% 48%,
    rgba(6, 8, 12, .86) 0%,
    rgba(6, 8, 12, .60) 46%,
    rgba(6, 8, 12, 0) 76%);
  z-index: -1;
  pointer-events: none;
}

.hero-art img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: .82;
  /* 蓝色辉光：与粒子同一色系，让线条在暗底上像在发光 */
  filter:
    drop-shadow(0 0 1.5px rgba(8, 9, 11, .9))
    drop-shadow(0 0 26px rgba(91, 140, 255, .45));
  animation: floaty 11s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(-7px); }
  50%      { transform: translateY(7px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art img { animation: none; }
}

/* 开场：内容依次进入 */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity 800ms cubic-bezier(.22,.61,.36,1),
              transform 800ms cubic-bezier(.22,.61,.36,1);
}
body.is-ready .reveal { opacity: 1; transform: none; }
body.is-ready .reveal[data-d="0"] { transition-delay: 80ms; }
body.is-ready .reveal[data-d="1"] { transition-delay: 220ms; }
body.is-ready .reveal[data-d="2"] { transition-delay: 380ms; }
body.is-ready .reveal[data-d="3"] { transition-delay: 540ms; }

.kicker {
  display: inline-flex; align-items: center; gap: .55rem;
  /* 规格行比原来长，窄屏必须能折行，否则会撑出横向溢出（375px 下实测溢出 79px） */
  flex-wrap: wrap;
  max-width: 100%;
  row-gap: .35rem;
  font-family: var(--num);
  font-size: .6875rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  padding: .3rem .7rem;
  margin: 0 0 1.75rem;
}
.kicker b { color: var(--accent-glow); font-weight: 500; }

/* kicker 的规格行：左边一个 RT 标签，中间斜杠分隔，右边是实测数字。
   数字用 tabular-nums，读起来像仪表读数。 */
.kick-tag {
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: .06rem .34rem;
  border-radius: 2px;
}
.kick-sep { color: var(--line-2); }
.kick-num { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ONLINE 状态：绿灯是站点里唯一用绿色的地方，用来把「在线」和品牌蓝分开。
   只做状态指示，不要扩散到别的元素上。 */
.kick-tag--ok { color: var(--ok); background: rgba(74, 222, 155, .14); }
.pulse.ok { background: var(--ok); animation-name: pulseOk; }
@keyframes pulseOk {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 155, .55); }
  70%  { box-shadow: 0 0 0 8px rgba(74, 222, 155, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 155, 0); }
}

.pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-glow);
  box-shadow: 0 0 0 0 rgba(100, 224, 255, .55);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(100, 224, 255, .55); }
  70%  { box-shadow: 0 0 0 8px rgba(100, 224, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(100, 224, 255, 0); }
}

.hero-title {
  font-size: clamp(2.5rem, 8.5vw, 7rem);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -0.05em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}
/* 发光文字：暗底上的发光靠多层 text-shadow 堆出来 */
.glow {
  color: #EAF6FF;
  text-shadow:
    0 0 18px rgba(100, 224, 255, .45),
    0 0 60px rgba(91, 140, 255, .35);
}

.hero-lead {
  font-size: clamp(.9375rem, 1.5vw, 1.0625rem);
  color: var(--ink-2);
  max-width: 34rem;
  margin: 0 0 2.25rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.25rem;
  font-size: .9375rem; font-weight: 500;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: transform var(--t), background-color var(--t),
              border-color var(--t), box-shadow var(--t);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); color: #06121F;
  box-shadow: 0 0 0 0 var(--accent-soft);
}
.btn-primary:hover { background: #7BA3FF; box-shadow: 0 0 26px -4px rgba(91,140,255,.7); }
.btn-ghost { color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { color: var(--ink); border-color: var(--accent); }

/* 技术读数 + 音效开关 */
.readout {
  position: absolute; left: var(--pad); right: var(--pad); bottom: 2rem;
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  align-items: center;
  font-family: var(--num); font-size: .6875rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
  opacity: 0; transition: opacity 900ms ease 900ms;
}
body.is-ready .readout { opacity: 1; }
.readout .metrics { display: inline-flex; flex-wrap: wrap; gap: 1.5rem; }
.readout .metrics > span { display: inline-flex; align-items: baseline; gap: .45rem; }
.readout i { font-style: normal; color: #626C78; }
.readout b {
  font-weight: 500; color: var(--accent-glow);
  font-variant-numeric: tabular-nums;
  min-width: 2.4em;
}

/* 音效开关：读数区右侧，跟着一起淡入 */
.sound-toggle {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: .5rem;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--ink-3);
  font: inherit;
  font-family: var(--num);
  font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .3rem .65rem;
  cursor: pointer;
  transition: color var(--t), border-color var(--t), background-color var(--t);
}
.sound-toggle:hover { color: var(--ink); border-color: var(--accent); }
.sound-toggle.is-on { color: var(--accent-glow); border-color: rgba(100, 224, 255, .5); }
.sound-toggle b { font-weight: 500; }

/* 三条小波形：音效开启时跳动，关掉就压平 —— 状态一眼可见 */
.sound-toggle .wave { display: inline-flex; align-items: center; gap: 2px; height: 11px; }
.sound-toggle .wave i {
  display: block; width: 2px; height: 3px;
  background: currentColor; border-radius: 1px;
}
.sound-toggle.is-on .wave i { animation: wave 900ms ease-in-out infinite; }
.sound-toggle.is-on .wave i:nth-child(1) { animation-delay: 0ms; }
.sound-toggle.is-on .wave i:nth-child(2) { animation-delay: 160ms; }
.sound-toggle.is-on .wave i:nth-child(3) { animation-delay: 320ms; }
@keyframes wave {
  0%, 100% { height: 3px; }
  50%      { height: 11px; }
}

.scroll-hint {
  position: absolute; right: var(--pad); bottom: 2rem;
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--num); font-size: .6875rem;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3);
  opacity: 0; transition: opacity 900ms ease 1000ms, color var(--t);
}
body.is-ready .scroll-hint { opacity: 1; }
.scroll-hint:hover { color: var(--ink); }
.scroll-hint i {
  display: block; width: 1px; height: 2rem;
  background: linear-gradient(var(--ink-3), transparent);
  animation: hint 2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes hint {
  0%, 100% { transform: scaleY(.3); opacity: .35; }
  50%      { transform: scaleY(1);  opacity: 1; }
}

/* ══════════ 子页面页头 ══════════
   每个版块是独立页面，所以每页开头都有一个大标题 ——
   这是"强排版"在多页面结构下的落点：靠字号区分页面，不靠色块。 */

.page-head {
  padding: clamp(5rem, 14vw, 9rem) 0 clamp(2rem, 5vw, 3.5rem);
}
.page-title {
  font-size: clamp(2.25rem, 8vw, 6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  margin: 1.25rem 0 0;
  max-width: 20ch;
}
.page-lead {
  margin: 1.5rem 0 0;
  max-width: 34rem;
  color: var(--ink-2);
  font-size: clamp(.9375rem, 1.5vw, 1.0625rem);
}
.page-head .hero-actions { margin-top: 2rem; }

/* ══════════ 首页的四个入口 ══════════
   首页不再往下堆内容，只做分发。 */

.hub { padding-block: clamp(2rem, 6vw, 4rem) clamp(4rem, 10vw, 7rem); }
/* 首页入口改成「终端 boot 列表」：
   一行一条、大编号当行首、细线分隔 —— 和站内作品页的 .entry 是同一套语言。 */
.hub .grid { border: 0; background: transparent; gap: 0; }

/* ── 入口行 ─────────────────────────────────────────────── */

.hub .panel {
  position: relative;
  background: transparent;
  border-top: 1px solid var(--line);
  padding: clamp(.8rem, 1.8vw, 1.1rem) .75rem;
  min-height: 0;
  gap: .35rem 1.75rem;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  transition: background-color var(--t) var(--ease);
}
.hub .panel:last-child { border-bottom: 1px solid var(--line); }
.hub .panel:hover { background: var(--accent-soft); }

.hub .panel h3 {
  grid-column: 2;
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  transition: color var(--t) var(--ease), transform 420ms var(--ease);
}
.hub .panel .desc {
  grid-column: 2;
  margin: 0;
  color: var(--ink-2);
  font-size: .9375rem;
  max-width: 34rem;
  transition: color var(--t) var(--ease);
}
.hub .panel .label.num {
  grid-column: 1;
  font-size: 1.375rem;
  letter-spacing: 0;
  color: var(--ink-3);
  transition: color var(--t) var(--ease);
}
.hub .panel .go {
  grid-column: 3; grid-row: 1;
  align-self: baseline;
  margin: 0; padding: 0;
  font-family: var(--num);
  font-size: .6875rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color var(--t) var(--ease);
}

/* 悬停：编号→强调蓝、标题→发光青并右移、描述提亮、标签→强调蓝，
   再加一道从左长到右的渐变线（同 .entry） */
.hub .panel:hover h3 { color: var(--accent-glow); transform: translateX(.6rem); }
.hub .panel:hover .desc { color: var(--ink); }
.hub .panel:hover .label.num,
.hub .panel:hover .go { color: var(--accent); }

.hub .panel::before {
  content: "";
  position: absolute; left: 0; top: -1px;
  height: 1px; width: 0;
  background: linear-gradient(90deg, var(--accent-glow), transparent);
  transition: width 520ms var(--ease);
}
.hub .panel:hover::before { width: 100%; }

@media (min-width: 40rem) {
  .hub .panel { grid-template-columns: auto 1fr auto; }
}

/* ══════════ 加密项目页 /private/ ══════════
   结构：终端提示符 → 口令表单 → 提示文字。
   解锁成功后 private.js 把明文注入 #lockContent，并把 #lock 隐藏。 */

.lock { max-width: 34rem; }

/* 导航里的锁标记：6px 空心方块，不做图形锁免得在 12px 字号里糊成一团 */
.nav-lock {
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: .45em;
  border: 1px solid var(--ink-3);
  vertical-align: .06em;
}
.nav a:hover .nav-lock,
.nav a[aria-current="page"] .nav-lock { border-color: var(--accent); }

/* 屏幕阅读器专用 */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* 终端提示符：首页入口区 + 加密页都用 */
.term-prompt {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .4rem;
  margin: 0 0 1.25rem;
  font-family: var(--num);
  font-size: .8125rem;
  letter-spacing: .02em;
  color: var(--ink-3);
}
.term-user { color: var(--accent); }
.term-path { color: var(--accent-glow); }
.term-cmd  { color: var(--ink); margin-left: .3rem; }

.lock-form {
  display: flex; flex-direction: column; gap: .5rem;
  margin: 0 0 1.25rem;
}
.lock-row { display: flex; gap: .5rem; align-items: stretch; }
.lock-input {
  flex: 1 1 auto; min-width: 0;
  padding: .6rem .8rem;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-size: 1rem; letter-spacing: .18em;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.lock-input::placeholder { color: var(--line-2); letter-spacing: .12em; }
.lock-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-2);
}
.lock-input:disabled { opacity: .55; }

.lock-btn {
  flex: 0 0 auto;
  padding: .6rem 1.25rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: inherit; font-size: .875rem;
  cursor: pointer;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), opacity var(--t) var(--ease);
}
.lock-btn:hover:not(:disabled) { background: var(--accent); color: var(--bg); }
.lock-btn:disabled { opacity: .5; cursor: default; }

.lock-msg {
  margin: 0;
  min-height: 1.2em;
  font-family: var(--num);
  font-size: .75rem; letter-spacing: .1em;
  color: var(--ink-3);
}
.lock-msg[data-kind="err"] { color: #FF8A8A; }

.lock-note {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: .8125rem;
}

/* 解锁后注入的内容：外层间距交给 .catalog，这里只补一点上边距 */
.lock-content { margin-top: .5rem; }

/* ── 编号打字机 ────────────────────────────────────────────
   ⚠️ 选择器的坑（踩过两次，别再动）：
     DOM 层级是  a.panel.rise(.is-in)  >  span.label.num.typing  >  span.ch
       · .is-in 被 initReveal 加在**卡片外层** a.panel.rise 上
       · .typing 在里面的编号元素上
     所以触发必须写 .rise.is-in .typing .ch（卡片带 is-in，往里找 .ch）。
     写成 .typing.is-in .ch 或 .typing.rise.is-in .ch 都不匹配——那两个都要求
     .is-in 和 .typing 落在同一个元素上。 */
.typing .ch { visibility: hidden; }
.rise.is-in .typing .ch {
  visibility: visible;
  transition: visibility 0ms linear;
  transition-delay: calc(var(--i) * 95ms);
}
.typing .caret {
  display: inline-block;
  width: .46em; height: 1em;
  margin-left: .12em;
  background: var(--accent);
  vertical-align: -.14em;
  opacity: 0;
}
.rise.is-in .typing .caret {
  animation: caretBlink 620ms step-end calc(var(--i-last, 0) * 95ms) 8,
             caretOut 240ms linear calc(var(--i-last, 0) * 95ms + 5200ms) forwards;
}
@keyframes caretBlink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@keyframes caretOut { to { opacity: 0; } }

/* ── 扫描线 ────────────────────────────────────────────────
   一条 42% 高的渐变光带从卡片顶部扫一遍再隐去，像终端刷新。
   沿用 .rise/.is-in 触发，只播一次。 */
.hub .panel .scan {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hub .panel .scan > i {
  position: absolute; left: 0; right: 0; top: 0;
  height: 42%;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--accent-soft) 55%,
    rgba(100, 224, 255, .18) 88%,
    transparent 100%);
  transform: translateY(-108%);
}
.hub .panel.is-in .scan > i {
  animation: scanPass 1150ms cubic-bezier(.3, 0, .2, 1) forwards;
}
@keyframes scanPass {
  0%   { transform: translateY(-108%); }
  100% { transform: translateY(340%); }
}

/* 注意：.corners 的角标在横排布局里会和分隔线打架，这个布局不再使用它。
   类名保留在别处（如果将来有竖卡再用）。 */

/* ══════════ 空状态提示 ══════════ */

.empty {
  margin: 0;
  padding: 2rem 0;
  color: var(--ink-3);
  font-size: .9375rem;
  border-top: 1px solid var(--line);
}

/* ══════════ 联系页 ══════════ */

.contact-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
  padding-bottom: clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.contact-block .mail {
  font-size: clamp(1.25rem, 4vw, 2.5rem);
  letter-spacing: -0.03em;
  color: var(--accent);
  border-bottom: 1px solid rgba(91, 140, 255, .4);
  padding-bottom: .1em;
  transition: color var(--t), border-color var(--t), text-shadow var(--t);
}
.contact-block .mail:hover {
  color: var(--accent-glow);
  border-bottom-color: var(--accent-glow);
  text-shadow: 0 0 24px rgba(100, 224, 255, .5);
}
.copy-hint {
  font-family: var(--num);
  font-size: .6875rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3);
  transition: color var(--t);
}
.contact-note {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: clamp(1.5rem, 4vw, 2.25rem) 0;
  border-bottom: 1px solid var(--line);
}
.contact-note p { margin: 0; color: var(--ink-2); max-width: 34rem; }

/* ══════════ 作品目录 ══════════ */

.catalog { padding-block: clamp(3rem, 8vw, 7rem); }
.catalog { scroll-margin-top: 4rem; }

/* ══════════ 网格与面板 ══════════
   1px 间隙 + 父级底色 = 细线分隔，整块像一块仪表盘而不是浮起的卡片。 */

.grid { display: grid; gap: 1px; background: var(--line); border: var(--rule); }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 40rem) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 56rem) {
  .grid-3, .grid-2 { grid-template-columns: repeat(3, 1fr); }
}

.panel {
  display: flex; flex-direction: column; gap: .6rem;
  padding: 1.5rem;
  background: var(--bg);
  position: relative;
  transition: background-color var(--t) var(--ease);
}
a.panel:hover { background: var(--bg-1); }
.panel-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: .25rem;
}
.panel h3 { display: flex; align-items: baseline; gap: .6rem; }
.panel .desc { color: var(--ink-2); font-size: .9375rem; }

/* 悬停时从左扫到右的细线 */
.panel::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  height: 1px; width: 0;
  background: var(--accent);
  transition: width var(--t-slow) var(--ease);
}
a.panel:hover::after { width: 100%; }

.panel .go {
  margin-top: auto; padding-top: 1rem;
  font-size: .8125rem; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: .35rem;
  transition: color var(--t) var(--ease);
}
a.panel:hover .go { color: var(--accent); }
a.panel:hover .go .arrow { transform: translateX(3px); }
.go .arrow { transition: transform var(--t) var(--ease); }

/* ── 标签 ─────────────────────────────────────────────── */

.tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag {
  font-size: .625rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .2rem .45rem;
  border: 1px solid var(--line-2);
  color: var(--ink-3);
}
.tag[data-kind="live"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.tag[data-kind="wip"]  { color: var(--ink-2); border-color: var(--line-2); }
.tag[data-kind="plan"] { color: var(--ink-3); }

/* ── 密集列表（备用样式） ─────────────────────────────── */

.rows { border-top: var(--rule); }
.row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: .5rem 1.25rem; align-items: baseline;
  padding: 1.1rem .25rem;
  border-bottom: var(--rule);
  color: inherit; position: relative;
  transition: background-color var(--t) var(--ease), padding-left var(--t) var(--ease);
}
a.row:hover { background: var(--bg-1); padding-left: .75rem; color: inherit; }
.row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 1px; background: var(--accent);
  transform: scaleY(0); transform-origin: top;
  transition: transform var(--t) var(--ease);
}
a.row:hover::before { transform: scaleY(1); }
.row .idx {
  font-family: var(--font-num); font-size: .6875rem;
  color: var(--ink-3); letter-spacing: .1em;
  transition: color var(--t) var(--ease);
}
a.row:hover .idx { color: var(--accent); }
.row .title { font-weight: 500; }
.row .sub { display: block; font-size: .875rem; color: var(--ink-3); font-weight: 400; margin-top: .2rem; }
.row .meta { font-family: var(--font-num); font-size: .75rem; color: var(--ink-3); white-space: nowrap; }

/* ── 长文排版（正文页/文章页用） ─────────────────────── */

.prose { max-width: 44rem; }
.prose > * + * { margin-top: 1.25rem; }
.prose h2 { margin-top: 3rem; padding-top: 1.5rem; border-top: var(--rule); }
.prose h3 { margin-top: 2.25rem; }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: .45rem; }
.prose code {
  font-family: var(--font-num); font-size: .875em;
  background: var(--bg-2); border: 1px solid var(--line);
  padding: .1rem .35rem; color: var(--ink);
}
.prose blockquote {
  margin: 1.75rem 0; padding: .25rem 0 .25rem 1.25rem;
  border-left: 1px solid var(--accent-line); color: var(--ink-2);
}
.prose hr { border: 0; border-top: var(--rule); margin: 3rem 0; }

/* 嵌入运行的应用（节拍教练等） */
.app-frame {
  width: 100%; height: min(80vh, 48rem);
  border: var(--rule); background: var(--bg-1); display: block;
}

.sec-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
  padding-bottom: 1.25rem;
}
@media (min-width: 48rem) {
  .sec-head { grid-template-columns: 1fr auto; align-items: end; }
  .sec-head .label { grid-column: 1 / -1; }
}
.sec-head p { margin: 0; color: var(--ink-2); max-width: 34rem; font-size: .9375rem; }

.entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .35rem 1.5rem;
  align-items: start;
  padding-block: clamp(1.5rem, 3.5vw, 2.75rem);
  border-top: 1px solid var(--line);
  position: relative;
  /* 滚动错位：JS 写 --shift（-1..1），这里决定错开多少 */
  transform: translate3d(0, calc(var(--shift, 0) * var(--amt, 0px)), 0);
  transition: transform 120ms linear;
}
.entry:last-child { border-bottom: 1px solid var(--line); }

.entry .title {
  display: block;
  font-weight: 600;
  font-size: clamp(1.75rem, 5.2vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.038em;
  transition: color var(--t), transform 420ms cubic-bezier(.22,.61,.36,1);
}
.entry:hover .title { color: var(--accent-glow); transform: translateX(.6rem); }

.entry .sub {
  display: block; margin-top: .5rem;
  color: var(--ink-2); font-size: .9375rem; max-width: 38rem;
  transition: color var(--t);
}
.entry:hover .sub { color: var(--ink); }

.entry .meta {
  display: flex; flex-direction: column; gap: .3rem; align-items: flex-end;
  text-align: right;
}
.entry .meta .k {
  font-family: var(--num); font-size: .6875rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
}
.entry .meta .k.live { color: var(--accent-glow); }

/* 编号用更大幅度错位 —— 这就是"层间速度差" */
.entry .big-num {
  font-family: var(--num);
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  color: var(--ink-3);
  transform: translate3d(0, calc(var(--shift, 0) * var(--amt-num, 0px)), 0);
  transition: transform 120ms linear, color var(--t);
}
.entry:hover .big-num { color: var(--accent); }

/* 悬停时长出的强调线 */
.entry::before {
  content: ""; position: absolute; left: 0; top: -1px;
  height: 1px; width: 0;
  background: linear-gradient(90deg, var(--accent-glow), transparent);
  transition: width 520ms cubic-bezier(.22,.61,.36,1);
}
.entry:hover::before { width: 100%; }

/* ══════════ 联系 ══════════ */

.outro {
  padding-block: clamp(5rem, 12vw, 11rem);
  border-top: 1px solid var(--line);
  position: relative;
}
.outro a.mail {
  display: inline-block; margin-top: 1.75rem;
  font-size: clamp(1.125rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--accent);
  border-bottom: 1px solid rgba(91, 140, 255, .4);
  padding-bottom: .12em;
  transition: color var(--t), border-color var(--t), text-shadow var(--t);
}
.outro a.mail:hover {
  color: var(--accent-glow);
  border-bottom-color: var(--accent-glow);
  text-shadow: 0 0 24px rgba(100, 224, 255, .5);
}

/* ── 页脚 ─────────────────────────────────────────────── */

.foot {
  padding: 2rem var(--pad) 3rem;
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: .75rem;
}
.foot a { color: var(--ink-3); }
.foot a:hover { color: var(--ink-2); }
.foot .legal { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
/* 页脚次级导航：和版权、备案并排，字号与颜色都压到最低，不抢页脚 */
.foot .foot-nav { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }

/* ── 滚动进场 ─────────────────────────────────────────── */

.rise {
  opacity: 0; transform: translateY(20px);
  transition: opacity 800ms cubic-bezier(.22,.61,.36,1),
              transform 800ms cubic-bezier(.22,.61,.36,1);
}
.rise.is-in { opacity: 1; transform: none; }

/* ── 动效偏好 ─────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal, .rise, .readout, .scroll-hint { opacity: 1 !important; transform: none !important; }
  .entry, .entry .big-num { transform: none !important; }
  /* 打字机 / 光标 / 扫描线：全部直接终态 */
  .typing .ch { visibility: visible !important; }
  .typing .caret { display: none; }
  .hub .panel .scan > i { display: none; }
  .pulse { animation: none; }
  .scroll-hint i { animation: none; }
}

/* ── 窄屏 ─────────────────────────────────────────────── */

@media (max-width: 40rem) {
  .entry { grid-template-columns: auto 1fr; }
  .entry .meta {
    grid-column: 2; flex-direction: row; flex-wrap: wrap;
    gap: .9rem; align-items: flex-start; text-align: left;
  }
  .readout { gap: 1rem; }
  .scroll-hint { display: none; }
}

/* ══════════ 导航子菜单 ══════════
   「游戏」下面挂了「塔罗」。悬停或键盘聚焦时展开。 */

.nav-group { position: relative; display: inline-flex; }
.nav-caret {
  display: inline-block; width: 5px; height: 5px; margin-left: .4em;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: .6;
}
.nav-sub {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 8rem;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  padding: .3rem;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility var(--t);
  z-index: 40;
}
.nav-group:hover .nav-sub,
.nav-group:focus-within .nav-sub {
  opacity: 1; visibility: visible; transform: none;
}
.nav-sub a { padding: .38rem .6rem; font-size: .8125rem; }

/* ══════════ 塔罗牌 ══════════ */

.spread-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.spread-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.spread-btn {
  font: inherit; font-family: var(--font-num);
  font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
  background: transparent;
  border: 1px solid var(--line-2);
  padding: .35rem .7rem;
  cursor: pointer;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease),
              background-color var(--t) var(--ease);
}
.spread-btn:hover { color: var(--text); border-color: var(--accent); }
.spread-btn.is-on {
  color: var(--accent-glow);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.spread-hint {
  margin: 0 0 0 auto;
  font-family: var(--font-num); font-size: .6875rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}

/* 牌桌：卡片绝对定位，坐标由 tarot.js 按牌阵写入 --x / --y。
   高度用 aspect-ratio，不要用百分比：
   父元素是 auto 高度时百分比高度无法解析，牌桌会塌成 0（实测踩过）。
   aspect-ratio 由宽度决定高度，一定能解析。 */
.tarot-board {
  position: relative;
  width: 100%;
  margin: clamp(1.5rem, 4vw, 3rem) auto;
  aspect-ratio: 4 / 3;
}
/* 位置分布越靠下的牌阵，牌桌越高（数值越小 = 越高） */
.tarot-board[data-count="1"]  { aspect-ratio: 16 / 7; }
.tarot-board[data-count="3"]  { aspect-ratio: 16 / 7; }
.tarot-board[data-count="4"]  { aspect-ratio: 4 / 3; }
.tarot-board[data-count="5"]  { aspect-ratio: 7 / 5; }
.tarot-board[data-count="7"]  { aspect-ratio: 5 / 4; }
.tarot-board[data-count="10"] { aspect-ratio: 5 / 4; }

.tcard {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--cw, 12rem);
  /* 5:8 是标准扑克牌比例 */
  aspect-ratio: 5 / 8;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  perspective: 1200px;
}

.tcard-inner {
  all: unset;
  display: block; position: relative;
  width: 100%; height: 100%;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 620ms cubic-bezier(.22, .61, .36, 1);
}
.tcard-inner.is-flipped { transform: rotateY(180deg); }

.tcard-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  /* 关键：两个面是绝对定位的 span，会盖在按钮上把点击截走
     （实测 elementFromPoint 拿到的是 .tcard-back 而不是按钮，
     于是按钮的 click 永远不触发）。让它们不接收指针事件即可。 */
  pointer-events: none;
}

/* 牌背：横向细线，呼应站点的"信息流"语言 */
.tcard-back {
  background-image: repeating-linear-gradient(
    180deg,
    rgba(91, 140, 255, .16) 0 1px,
    transparent 1px 6px);
}
.tcard-back::after {
  content: ""; position: absolute; inset: 8%;
  border: 1px solid var(--line-2);
}
.tcard-back-mark {
  width: 22%; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--accent-line);
  box-shadow: 0 0 22px -6px var(--accent);
}
.tcard-inner:hover .tcard-back { border-color: var(--accent); }

/* 牌面 */
.tcard-front {
  transform: rotateY(180deg);
  flex-direction: column;
  gap: .35rem;
  padding: .45rem;
  background: var(--bg);
  color: var(--accent-glow);   /* SVG 用 currentColor，颜色从这里继承 */
}
.tcard-art {
  flex: 1; width: 100%; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
/* 牌面：几何 SVG 与图片两种形态都要适配。
   图片需要 object-fit: cover —— 生成图的构图通常已经填满画面，
   cover 能避免留白，同时用 5:8 的容器比例约束它。 */
.tcard-art svg { width: 100%; height: 100%; }
.tcard-art img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 2px;
}
/* 逆位：只把【画面】转 180°，卡纸本身保持直立 —— 这才是真实塔罗里逆位的样子 */
.tcard-art.is-rev { transform: rotate(180deg); }

.tcard-meta {
  display: flex; align-items: baseline; gap: .4rem;
  font-family: var(--font-num);
  color: var(--text);
}
.tcard-num { font-size: .625rem; color: var(--ink-3); letter-spacing: .1em; }
.tcard-name { font-size: .8125rem; font-weight: 500; }

.tcard-pos {
  position: absolute; left: 50%; bottom: -1.5rem;
  transform: translateX(-50%);
  font-family: var(--font-num);
  font-size: .625rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ── 解读区 ─────────────────────────────────────────────── */

.tarot-out { margin-top: clamp(2rem, 5vw, 3.5rem); }

.treading-note {
  margin: 0 0 1.5rem;
  font-size: .875rem; color: var(--ink-3);
  padding-left: .9rem;
  border-left: 2px solid var(--line-2);
}
.treading-list { list-style: none; margin: 0; padding: 0; }
.treading {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: .35rem 1.25rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}
.treading:last-child { border-bottom: 1px solid var(--line); }
.treading-pos {
  font-family: var(--font-num);
  font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.treading-card { display: flex; align-items: baseline; gap: .6rem; }
.treading-card b { font-size: 1.0625rem; font-weight: 600; color: var(--text); }
.treading-dir {
  font-style: normal; font-family: var(--font-num);
  font-size: .625rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  padding: .1rem .35rem;
}
.treading-dir.is-rev { color: var(--accent); border-color: var(--accent-line); }
.treading-text {
  grid-column: 2;
  margin: 0; color: var(--ink-2); font-size: .9375rem;
  max-width: 38rem;
}
.treading-foot {
  margin: 1.75rem 0 0;
  font-size: .875rem; color: var(--ink-3);
}
.treading-foot .label { display: block; margin-bottom: .4rem; }
.tf-fallback {
  font-family: var(--font-num); font-size: 2rem; color: var(--ink-3);
}

/* ── 牌桌尺寸：按牌阵位置分布选择不同的卡宽 ─────────────── */

.tarot-board[data-count="1"]  { --cw: clamp(9rem, 20vw, 13rem); --max-y: 50; }
.tarot-board[data-count="3"]  { --cw: clamp(7rem, 15vw, 11rem); --max-y: 50; }
.tarot-board[data-count="4"]  { --cw: clamp(6.5rem, 13vw, 10rem); --max-y: 74; }
.tarot-board[data-count="5"]  { --cw: clamp(6rem, 12vw, 9rem);   --max-y: 80; }
.tarot-board[data-count="7"]  { --cw: clamp(5rem, 10vw, 8rem);   --max-y: 82; }
.tarot-board[data-count="10"] { --cw: clamp(4.25rem, 8vw, 6.5rem); --max-y: 88; }

@media (max-width: 40rem) {
  .tarot-board { --cw: clamp(5rem, 30vw, 7rem); }
  .treading { grid-template-columns: 1fr; }
  .treading-text { grid-column: 1; }
  .spread-hint { margin-left: 0; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .tcard-inner { transition-duration: .01ms; }
}
