/* 深海塔罗 · DeepSeekChan 篇 —— 样式
 *
 * 两套主题：默认浅色（宣纸），[data-theme="dark"] 切深海夜色。
 * 所有颜色只在下面的令牌里定义，组件区一律 var()，不许写死色值。
 * 去 AI 味口径（impeccable 源码态/渲染态必须 0 条）：
 *   - 不做渐变文字、彩色发光 box-shadow、玻璃拟态 backdrop-filter、装饰性网格背景、走马灯
 *   - 正文最小 12px，正文与背景对比度 ≥ 4.5:1
 *   - 动效只用 transform / opacity，prefers-reduced-motion 全降
 */

/* ======== 字体（自托管；中文按本站实际用字 pyftsubset 裁过，两个文件加起来几百 KB） ======== */
@font-face {
  font-family: 'Neko Serif';
  src: url('/fonts/noto-serif-sc-subset.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Neko Serif';
  src: url('/fonts/noto-serif-sc-subset-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  src: url('/fonts/cormorant-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  src: url('/fonts/cormorant-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ======== 令牌：浅色（默认） ======== */
:root {
  color-scheme: light;

  --bg: #f7f3e9;            /* 宣纸 */
  --bg-soft: #efe9db;       /* 牌桌底 */
  --panel: #fffdf7;
  --panel-2: #f5f0e3;
  --line: #ded4bf;
  --line-strong: #c2b699;
  --ink: #22201c;           /* 墨 */
  --ink-dim: #57523f;
  --ink-faint: #6f6a58;     /* 与 bg 对比 ≈ 5.2:1 */
  --gold: #7d5f28;          /* 浅底必须压深，否则对比不够 */
  --gold-dim: #a98b4c;
  --sea: #2c5872;
  --rose: #96455a;
  --card-bg: #14181f;
  --shadow-card: 0 10px 26px -18px rgba(34, 32, 28, .55);

  --radius: 10px;
  --radius-lg: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --font-cjk: 'Neko Serif', 'Songti SC', 'Noto Serif CJK SC', 'SimSun', serif;
  --font-disp: 'Cormorant', 'Neko Serif', Georgia, serif;
}

/* ======== 令牌：深色（深海夜） ======== */
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b0d14;
  --bg-soft: #10131c;
  --panel: #151925;
  --panel-2: #1b2130;
  --line: #2a3143;
  --line-strong: #3c4459;
  --ink: #ece8df;
  --ink-dim: #b3aebd;
  --ink-faint: #9a95a8;
  --gold: #c9a86a;
  --gold-dim: #8f7a4e;
  --sea: #6d94b4;
  --rose: #c07e92;
  --card-bg: #0e1119;
  --shadow-card: 0 14px 34px -22px rgba(0, 0, 0, .9);
}

/* ======== 基础 ======== */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-cjk);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 64px;      /* 给底部提示条留位置 */
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

button { font-family: inherit; }

img { max-width: 100%; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ======== 顶栏 ======== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand b {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--ink);
}

.brand span {
  font-family: var(--font-disp);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ghost-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: .04em;
  padding: 7px 13px;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s;
}

.ghost-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--panel-2);
}

.ghost-btn svg { width: 15px; height: 15px; display: block; }

/* 主题切换：浅色时显示月亮（点了变深色），深色时显示太阳 */
.theme-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-btn .icon-sun { display: block; }
[data-theme="dark"] .theme-btn .icon-moon { display: none; }

/* ======== 首页标题区 ======== */
.hero {
  padding: 40px 0 26px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-disp);
  font-weight: 600;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.08;
  letter-spacing: .04em;
  color: var(--ink);
}

.hero h1 .cjk {
  font-family: var(--font-cjk);
  font-weight: 700;
  letter-spacing: .2em;
  font-size: .86em;
}

.hero p {
  margin: 0 auto;
  max-width: 56ch;
  font-size: 14px;
  color: var(--ink-dim);
}

.hero .rule {
  width: 54px;
  height: 1px;
  margin: 20px auto 0;
  background: var(--line-strong);
}

/* ======== 牌阵选择（分段控件） ======== */
.spread-bar {
  display: flex;
  justify-content: center;
  margin: 0 0 22px;
}

.spread-list {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  flex-wrap: wrap;
  justify-content: center;
}

.spread {
  appearance: none;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-dim);
  padding: 9px 20px 10px;
  cursor: pointer;
  text-align: center;
  transition: background-color .2s, color .2s;
}

.spread:hover { color: var(--ink); }

.spread[aria-pressed="true"] {
  background: var(--panel-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--gold-dim);
}

.spread b {
  display: block;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .06em;
}

.spread small {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: var(--ink-faint);
}

/* ======== 牌桌 ======== */
.stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  padding: clamp(30px, 3.4vw, 46px) clamp(16px, 3vw, 40px) clamp(24px, 2.6vw, 34px);
  min-height: clamp(320px, 40vh, 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  overflow: hidden;
}

.stage-note {
  font-size: 15px;
  color: var(--ink-faint);
  text-align: center;
  max-width: 40ch;
  margin: 0;
}

/* 牌堆 */
.deck {
  position: relative;
  width: clamp(96px, 11vw, 132px);
  aspect-ratio: 3 / 4;
  flex: none;
}

/* 抽完牌后牌堆淡出并且不再占位 —— 只做 opacity 的话它会继续撑高牌桌，
   卡片就被顶到下半部，看起来「上太空、下太挤」。 */
.deck.is-gone {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.deck-card {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card-bg) url("/img/cards/22_牌背-480.webp") center/cover no-repeat;
  transition: transform .28s var(--ease);
  box-shadow: var(--shadow-card);
}

.deck-card:nth-child(1) { transform: translate(0, 0); }
.deck-card:nth-child(2) { transform: translate(-3px, -4px); }
.deck-card:nth-child(3) { transform: translate(-6px, -8px); }

.deck.is-shuffling .deck-card:nth-child(1) { transform: translate(-18px, 3px) rotate(-4deg); }
.deck.is-shuffling .deck-card:nth-child(2) { transform: translate(16px, -7px) rotate(5deg); }
.deck.is-shuffling .deck-card:nth-child(3) { transform: translate(-7px, -12px) rotate(-2deg); }

/* ======== 牌位与牌 ======== */
.slots {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(14px, 2.6vw, 34px);
  width: 100%;
  flex-wrap: wrap;
}

.slot {
  position: relative;
  width: clamp(180px, 22vw, 330px);
  perspective: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* 单张：一张牌就是整张桌子 */
.slots--single .slot { width: clamp(260px, 34vw, 500px); }

/* 三张：并排铺开 */
.slots--three .slot { width: clamp(190px, 25vw, 380px); }

.slot-card {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  transform-style: preserve-3d;
  transition: transform .8s var(--ease);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.slot.revealed .slot-card { transform: rotateY(180deg); }

.face {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  backface-visibility: hidden;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--card-bg);
}

.face--back {
  background-image: url("/img/cards/22_牌背-480.webp");
  background-size: cover;
  background-position: center;
}

.face--front {
  transform: rotateY(180deg);
  background: var(--card-bg);
}

.face--front img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slot.reversed .face--front img { transform: rotate(180deg); }

.slot.is-dealing { animation: deal-in .5s var(--ease) both; }

@keyframes deal-in {
  from { opacity: 0; transform: translateY(-28px) scale(.94); }
  to { opacity: 1; transform: none; }
}

.slot.is-active .face { border-color: var(--gold-dim); }

.slot-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  line-height: 1.5;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink-dim);
  border: 1px solid var(--line);
  transform: rotate(180deg);
}

.slot-label {
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--ink-faint);
}

.slot.is-active .slot-label { color: var(--gold); }

/* 凯尔特十字：十张，宁可横向滚也不缩成邮票 */
.slots.slots--celtic {
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: clamp(8px, 1.1vw, 14px) clamp(16px, 2vw, 26px);
  justify-content: center;
  align-items: center;
  min-width: 880px;
  width: max-content;
  margin: 0 auto;
}

.slots--celtic .slot { width: clamp(136px, 14vw, 190px); }
.slots--celtic .slot[data-index="0"] { grid-area: 2 / 2; }
.slots--celtic .slot[data-index="1"] { grid-area: 2 / 2; z-index: 2; }
.slots--celtic .slot[data-index="2"] { grid-area: 3 / 2; }
.slots--celtic .slot[data-index="3"] { grid-area: 2 / 1; }
.slots--celtic .slot[data-index="4"] { grid-area: 1 / 2; }
.slots--celtic .slot[data-index="5"] { grid-area: 2 / 3; }
.slots--celtic .slot[data-index="6"] { grid-area: 2 / 5; }
.slots--celtic .slot[data-index="7"] { grid-area: 3 / 5; }
.slots--celtic .slot[data-index="8"] { grid-area: 4 / 5; }
.slots--celtic .slot[data-index="9"] { grid-area: 5 / 5; }

/* 横置的那张压住「现状」：先收窄留出可点边缘，再让外层不接指针 */
.slot--crossed { z-index: 2; pointer-events: none; }
.slot--crossed .slot-card { pointer-events: auto; }
.slot--crossed .slot-card { width: 78%; margin: 11% auto; transform: rotate(90deg); }
.slot--crossed.revealed .slot-card { transform: rotate(90deg) rotateY(180deg); }

/* 凯尔特十字时牌桌允许横向滚动 */
.stage.has-celtic { overflow-x: auto; justify-content: flex-start; }

/* ======== 抽牌按钮 ======== */
.draw-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.draw-btn {
  appearance: none;
  border: 1px solid var(--gold-dim);
  background: var(--panel-2);
  color: var(--ink);
  font-size: clamp(15px, 1.4vw, 17px);
  letter-spacing: .14em;
  padding: 13px clamp(26px, 4vw, 44px);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .2s var(--ease);
}

.draw-btn:hover:not(:disabled) { border-color: var(--gold); }
.draw-btn:active:not(:disabled) { transform: translateY(1px); }
.draw-btn:disabled { opacity: .45; cursor: default; }

.hint-line {
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
  margin: 0;
}

/* ======== 牌义（牌桌下方横排，宽屏多列） ======== */
.read-section {
  margin-top: 34px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.read-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.read-head-row h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .22em;
  color: var(--ink-faint);
}

.read-empty {
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.8;
  margin: 0;
}

#read-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
  gap: 14px;
}

.read-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 17px 18px;
}

.read-card.is-current { border-color: var(--gold-dim); }

.read-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.read-name {
  font-size: 19px;
  letter-spacing: .04em;
  color: var(--ink);
}

.read-en {
  font-family: var(--font-disp);
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--ink-faint);
}

.read-pos {
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--gold);
  margin-top: 3px;
}

.read-orient { color: var(--rose); letter-spacing: .04em; }

.read-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 13px;
}

.read-keywords span {
  font-size: 12px;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}

.read-text {
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink);
  margin: 0 0 12px;
}

.read-sea {
  font-size: 12px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  padding-top: 11px;
  margin: 0;
  line-height: 1.7;
}

/* ======== 首页精简说明 ======== */
.howto {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

.howto h2 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .22em;
  color: var(--ink-faint);
}

.howto-lede {
  margin: 0 0 22px;
  font-size: 15px;
  color: var(--ink-dim);
  max-width: 68ch;
}

.howto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.howto-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 17px 18px;
}

.howto-item h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: .04em;
}

.howto-item h3 .num {
  font-family: var(--font-disp);
  font-size: 15px;
  color: var(--gold);
  margin-right: 7px;
  letter-spacing: .06em;
}

.howto-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-dim);
}

.howto-foot {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--ink-faint);
}

/* ======== 关于 ======== */
.about {
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.95;
}

.about b { color: var(--ink-dim); font-weight: 500; }
.about p { margin: 0 0 10px; }
.about p:last-child { margin-bottom: 0; }

/* ======== 底部提示条（静态一句，抽牌时换句淡入，不做无限滚动） ======== */
.notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 10px 0;
  z-index: 5;
}

.notice-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 22px;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: .04em;
  text-align: center;
  transition: opacity .3s ease;
}

.notice-inner.is-fading { opacity: 0; }

/* ======== 页脚 ======== */
.site-foot {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-faint);
}

/* ======== 文档页（/guide/） ======== */
.doc {
  max-width: 860px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.doc h1 {
  font-family: var(--font-cjk);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: .12em;
  margin: 34px 0 10px;
}

.doc .doc-lede {
  font-size: 15px;
  color: var(--ink-dim);
  margin: 0 0 8px;
}

.doc h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 46px 0 6px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.doc h2 .n {
  font-family: var(--font-disp);
  font-weight: 600;
  color: var(--gold);
  margin-right: 10px;
}

.doc h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 26px 0 6px;
  letter-spacing: .04em;
}

.doc p, .doc li {
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--ink-dim);
}

.doc ul, .doc ol { padding-left: 22px; margin: 10px 0 16px; }
.doc li { margin-bottom: 7px; }
.doc li::marker { color: var(--gold-dim); }

.doc strong { color: var(--ink); font-weight: 700; }

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--ink);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 22px;
  font-size: 13.5px;
}

.doc th, .doc td {
  border-bottom: 1px solid var(--line);
  padding: 10px 10px;
  text-align: left;
  vertical-align: top;
  color: var(--ink-dim);
}

.doc th {
  font-weight: 500;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: .1em;
  border-bottom-color: var(--line-strong);
}

.doc td b { color: var(--ink); font-weight: 700; }

/* 好问题 / 坏问题 对照 */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 18px 0 8px;
}

.compare > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 15px 16px 17px;
}

.compare h4 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: .16em;
  font-weight: 500;
}

.compare .good h4 { color: var(--sea); }
.compare .bad h4 { color: var(--rose); }
.compare p { margin: 0 0 9px; font-size: 13.5px; }
.compare p:last-child { margin-bottom: 0; }

/* 牌阵示意图 */
.spread-figure {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin: 20px 0 10px;
}

.figure-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px 16px 14px;
  text-align: center;
}

.figure-box h4 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: .08em;
}

.figure-slots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 84px;
  margin-bottom: 12px;
}

.figure-slots.cross {
  display: grid;
  grid-template-columns: repeat(5, 26px);
  grid-template-rows: repeat(5, 34px);
  gap: 4px;
  justify-content: center;
  align-items: center;
}

.mini-card {
  width: 26px;
  height: 34px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  font-family: var(--font-disp);
  font-size: 11px;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-card.crossed { transform: rotate(90deg); }

.figure-box small {
  display: block;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.7;
}

/* 演示样例 */
.demo {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 20px 20px 22px;
  margin: 22px 0;
}

.demo-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.demo-head .tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 8px;
}

.demo-head h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.demo-head p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-dim);
}

.demo-cards {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.demo-card {
  width: 118px;
  text-align: center;
}

.demo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--card-bg);
}

.demo-card.rev img { transform: rotate(180deg); }

.demo-card span {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.5;
}

.demo-body { display: flex; flex-direction: column; gap: 12px; }

.demo-step {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 12px;
  align-items: start;
}

.demo-step .pos {
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--gold);
  padding-top: 3px;
}

.demo-step p { margin: 0; font-size: 14px; line-height: 1.9; color: var(--ink-dim); }
.demo-step p b { color: var(--ink); font-weight: 700; }

.demo-sum {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 14px;
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink-dim);
}

.demo-sum b { color: var(--ink); font-weight: 700; }

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px 18px 16px;
  margin: 26px 0 0;
}

.toc h2 {
  border: 0;
  padding: 0;
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .2em;
  font-weight: 500;
  color: var(--ink-faint);
}

.toc ol { margin: 0; padding-left: 20px; }
.toc li { font-size: 13.5px; margin-bottom: 4px; }

/* 牌义速查表 */
.ref-table td:nth-child(1) { width: 112px; }
.ref-table td .orient {
  display: block;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 3px;
}

/* ======== 动效降级 ======== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ======== 窄屏 ======== */
@media (max-width: 900px) {
  .slots.slots--celtic { min-width: 760px; }
}

@media (max-width: 620px) {
  body { font-size: 14px; padding-bottom: 70px; }
  .wrap { padding: 0 14px; }
  .hero { padding: 26px 0 18px; }
  .brand span { display: none; }
  .slots--single .slot { width: min(84vw, 360px); }
  .slots--three .slot { width: min(86vw, 260px); }
  .slots--celtic .slot { width: 116px; }
  .slots.slots--celtic { min-width: 660px; }
  .stage { padding: 22px 12px; min-height: 320px; }
  .demo-step { grid-template-columns: 1fr; gap: 3px; }
  .doc h2 { margin-top: 36px; }
}
