/* 《墨爻 // MOYAO》赛博水墨样式表 */
:root {
  --ink-void: #07090d;
  --ink-deep: #0c0f15;
  --ink-panel: rgba(250, 246, 236, 0.78);
  --ink-card: rgba(250, 246, 236, 0.84);
  --paper: #1f1c18;
  --paper-soft: #3d3933;
  --ash: #6d675c;
  --ash-dim: #958e80;
  --cinnabar: #c42630;
  --cinnabar-glow: rgba(196, 38, 48, 0.45);
  --cinnabar-soft: rgba(196, 38, 48, 0.12);
  --jade: #2f5d7c;
  --jade-glow: rgba(47, 93, 124, 0.36);
  --jade-soft: rgba(47, 93, 124, 0.1);
  --bronze: #a06c28;
  --bronze-dark: #7d5b20;
  --border-ink: rgba(31, 28, 24, 0.12);
  --border-jade: rgba(47, 93, 124, 0.3);
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "PingFang SC", Georgia, serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--ink-void);
  color: var(--paper);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 赛博水墨动态背景层 */
#ink-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.cyber-grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 82% 14%, rgba(47, 93, 124, 0.08), transparent 40%),
    radial-gradient(circle at 16% 78%, rgba(196, 38, 48, 0.09), transparent 44%),
    linear-gradient(rgba(31, 28, 24, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 28, 24, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}

.scanline-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.14) 0px,
    rgba(0, 0, 0, 0.14) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.25;
}

.app-shell {
  position: relative;
  z-index: 3;
  max-width: 980px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(8px, 1.4dvh, 16px) clamp(10px, 2.4vw, 18px) clamp(12px, 2dvh, 24px);
  display: flex;
  flex-direction: column;
}

/* ===== 顶部赛博干支终端栏（高度自适应） ===== */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 1dvh, 12px) 12px;
  padding: clamp(8px, 1.2dvh, 13px) clamp(10px, 2vw, 16px);
  background: var(--ink-panel);
  border: 1px solid var(--border-ink);
  backdrop-filter: blur(12px);
  position: relative;
  flex-shrink: 0;
}

.topbar::before,
.topbar::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--jade);
  border-style: solid;
  pointer-events: none;
}

.topbar::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.topbar::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-seal {
  width: clamp(30px, 4.4dvh, 36px);
  height: clamp(30px, 4.4dvh, 36px);
  background: var(--cinnabar);
  color: #07090d;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: clamp(17px, 2.5dvh, 21px);
  line-height: 1;
  box-shadow: 0 0 16px var(--cinnabar-glow);
  user-select: none;
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: clamp(15px, 2.2dvh, 18px);
  letter-spacing: 0.16em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-text .mono-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--jade);
  font-weight: 500;
}

.telemetry-line {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.35dvh, 11px);
  color: var(--ash);
  letter-spacing: 0.02em;
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.telemetry-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 8px var(--jade);
  display: inline-block;
  animation: pulseDot 2.2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--border-ink);
  color: var(--paper-soft);
  padding: 7px 13px;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-btn .en {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ash);
}

.nav-btn:hover {
  border-color: var(--border-jade);
  color: var(--paper);
}

.nav-btn.active {
  background: var(--jade-soft);
  border-color: var(--jade);
  color: var(--jade);
  box-shadow: inset 0 0 12px rgba(47, 93, 124, 0.12);
}

.nav-btn.active .en {
  color: var(--jade);
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border-ink);
  color: var(--ash);
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn.on {
  color: var(--jade);
  border-color: var(--border-jade);
}

/* ===== 视图切换 ===== */
.view {
  display: none;
  margin-top: 22px;
  animation: fadeUp 0.32s ease;
}

.view.active {
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 起卦静心提示条 ===== */
.mind-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--ink-panel);
  border: 1px solid var(--border-ink);
  border-left: 3px solid var(--jade);
  color: var(--paper-soft);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px);
}

.prompt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cinnabar);
  box-shadow: 0 0 8px var(--cinnabar-glow);
  flex-shrink: 0;
}

.progress-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 8px 0 6px;
}

.p-dot {
  width: 28px;
  height: 5px;
  background: rgba(31, 28, 24, 0.12);
  transition: all 0.25s ease;
}

.p-dot.filled {
  background: var(--jade);
  box-shadow: 0 0 8px var(--jade-glow);
}

.p-dot.moving {
  background: var(--cinnabar);
  box-shadow: 0 0 10px var(--cinnabar-glow);
}

.p-dot.next {
  background: rgba(47, 93, 124, 0.35);
}

.compass-wrap.done {
  cursor: default;
}

.hex-explain {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ash);
  line-height: 1.5;
}

/* 占卜核心双栏布局 */
.ritual-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 18px;
  align-items: stretch;
}

.ritual-stage,
.yao-column {
  background: var(--ink-panel);
  border: 1px solid var(--border-ink);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.ritual-stage {
  padding: 24px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 460px;
}

.stage-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ash);
  letter-spacing: 0.08em;
}

.stage-step-badge {
  color: var(--jade);
  border: 1px solid var(--border-jade);
  padding: 3px 9px;
  background: var(--jade-soft);
}

/* 八卦罗盘 + 铜钱区 */
.compass-wrap {
  position: relative;
  width: 286px;
  height: 286px;
  margin: 14px 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
}

.compass-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ring-outer {
  transform-origin: 150px 150px;
  animation: slowSpin 48s linear infinite;
}

.ring-inner {
  transform-origin: 150px 150px;
  animation: slowSpinRev 32s linear infinite;
}

.compass-wrap.casting .ring-outer {
  animation-duration: 2.4s;
}

.compass-wrap.casting .ring-inner {
  animation-duration: 1.6s;
}

@keyframes slowSpin {
  to { transform: rotate(360deg); }
}

@keyframes slowSpinRev {
  to { transform: rotate(-360deg); }
}

/* 水墨能量波纹 */
.ink-ripple {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid var(--jade);
  opacity: 0;
  pointer-events: none;
}

.ink-ripple.fire {
  animation: rippleBurst 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ink-ripple.moving {
  border-color: var(--cinnabar);
  box-shadow: 0 0 24px var(--cinnabar-glow);
}

@keyframes rippleBurst {
  0% { transform: scale(0.5); opacity: 0.85; }
  100% { transform: scale(2.15); opacity: 0; }
}

/* 三枚古铜钱 3D 容器 */
.coins-cluster {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  perspective: 900px;
}

.coin-slot {
  width: 72px;
  height: 72px;
  position: relative;
}

/* 落盘阴影：随钱腾空缩小变淡 */
.coin-shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -9%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 70%);
  opacity: 0.6;
  pointer-events: none;
}

/* hop 负责抛物线位移与远近缩放，body 负责翻转，两层分开各走各的缓动 */
.coin-hop {
  position: absolute;
  inset: 0;
  perspective: 520px;
  will-change: transform;
}

.coin-body {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

/* 钱缘：数层铜片叠出厚度，侧立时可见一道铜边 */
.coin-edge {
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: linear-gradient(90deg, #4a320c, #a57a2c 45%, #5a3d10);
  transform: translateZ(var(--z, 0px));
}

.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: grid;
  place-items: center;
}

.coin-face.front {
  transform: translateZ(2.2px);
  background: radial-gradient(circle at 32% 28%, #f0d084 0%, #b58939 52%, #5c4113 100%);
  border: 2px solid #f0d48a;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.55);
}

.coin-face.back {
  transform: rotateX(180deg) translateZ(2.2px);
  background: radial-gradient(circle at 35% 30%, #24383b 0%, #10191d 55%, #070b0d 100%);
  border: 2px solid var(--jade);
  box-shadow: 0 0 14px var(--jade-glow), inset 0 0 12px rgba(47, 93, 124, 0.2);
}

.coin-svg {
  width: 100%;
  height: 100%;
}

/* 投掷状态读数 */
.toss-readout {
  min-height: 44px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.toss-readout .main-line {
  font-size: 16px;
  letter-spacing: 0.12em;
  color: var(--paper);
}

.toss-readout .main-line.moving {
  color: var(--cinnabar);
  text-shadow: 0 0 12px var(--cinnabar-glow);
  animation: microGlitch 0.35s ease;
}

.toss-readout .sub-line {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ash);
}

@keyframes microGlitch {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}

/* 操作按钮组 */
.stage-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.primary-cast-btn {
  width: 100%;
  max-width: 280px;
  padding: 13px 22px;
  background: linear-gradient(135deg, rgba(196, 38, 48, 0.2), rgba(196, 38, 48, 0.06));
  border: 1px solid var(--cinnabar);
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.28em;
  cursor: pointer;
  position: relative;
  transition: all 0.22s ease;
  box-shadow: 0 0 22px rgba(196, 38, 48, 0.2), inset 0 0 18px rgba(196, 38, 48, 0.12);
}

.primary-cast-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(196, 38, 48, 0.32), rgba(196, 38, 48, 0.12));
  box-shadow: 0 0 30px rgba(196, 38, 48, 0.36);
  transform: translateY(-1px);
}

.primary-cast-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.secondary-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border-ink);
  color: var(--ash);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s;
}

.ghost-btn:hover:not(:disabled) {
  border-color: var(--border-jade);
  color: var(--jade);
}

.ghost-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ===== 右侧：六爻逐层演进槽 ===== */
.yao-column {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.col-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border-ink);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.col-title h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.16em;
  font-weight: 600;
}

.col-title span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ash);
}

.yao-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

.yao-row {
  display: grid;
  grid-template-columns: 44px 1fr 78px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 28, 24, 0.06);
  background: rgba(250, 246, 236, 0.45);
  transition: all 0.3s ease;
}

.yao-row.next-slot {
  border-color: rgba(47, 93, 124, 0.35);
  background: rgba(47, 93, 124, 0.05);
}

.yao-row.filled {
  border-color: rgba(31, 28, 24, 0.14);
}

.yao-row.is-moving {
  border-color: rgba(196, 38, 48, 0.48);
  background: rgba(196, 38, 48, 0.06);
}

.yao-pos-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ash);
}

.yao-row.next-slot .yao-pos-label {
  color: var(--jade);
}

.yao-bar-wrap {
  height: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.yao-placeholder {
  width: 100%;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(31, 28, 24, 0.14) 0 6px,
    transparent 6px 12px
  );
}

.yao-stroke {
  height: 13px;
  flex: 1;
  background: var(--paper);
  position: relative;
  animation: brushReveal 0.42s cubic-bezier(0.2, 0.9, 0.3, 1);
  clip-path: polygon(0% 10%, 99% 0%, 100% 92%, 1% 100%);
}

.yao-row.is-yang .yao-stroke {
  box-shadow: 0 0 12px rgba(47, 93, 124, 0.24);
}

.yao-row.is-yin .yao-stroke {
  background: #1f1c18;
}

.yao-row.is-moving .yao-stroke {
  background: var(--cinnabar);
  box-shadow: 0 0 14px var(--cinnabar-glow);
}

@keyframes brushReveal {
  from { transform: scaleX(0.15); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

.yao-val-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
  color: var(--ash);
  white-space: nowrap;
}

.yao-row.is-moving .yao-val-tag {
  color: var(--cinnabar);
  font-weight: 700;
}

.coin-rule-foot {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ash-dim);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

/* ===== 成卦解盘结果区 ===== */
.result-section {
  margin-top: 22px;
  display: none;
  animation: fadeUp 0.45s ease;
}

.result-section.visible {
  display: block;
}

.result-card {
  background: var(--ink-card);
  border: 1px solid var(--border-ink);
  padding: 24px 22px;
  position: relative;
  backdrop-filter: blur(12px);
}

.result-meta-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ash);
}

.result-question-banner {
  margin-bottom: 18px;
  padding: 11px 14px;
  background: rgba(47, 93, 124, 0.05);
  border-left: 3px solid var(--jade);
  font-size: 15px;
  color: var(--paper);
}

.result-question-banner span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--jade);
  margin-right: 10px;
}

/* 本卦 → 互卦 → 变卦 三栏矩阵 */
.hex-matrix {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr 1.2fr;
  gap: 14px;
  margin-bottom: 22px;
}

.hex-box {
  background: rgba(250, 246, 236, 0.65);
  border: 1px solid var(--border-ink);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.hex-box.primary {
  border-color: rgba(47, 93, 124, 0.35);
}

.hex-box.changed {
  border-color: rgba(196, 38, 48, 0.35);
}

.hex-box-role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ash);
  margin-bottom: 10px;
}

.hex-box.primary .hex-box-role { color: var(--jade); }
.hex-box.changed .hex-box-role { color: var(--cinnabar); }

.hex-visual-pair {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 12px;
}

.mini-hex {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 82px;
}

.mini-hex.small {
  width: 64px;
  gap: 5px;
}

.mini-yao {
  display: flex;
  gap: 8px;
  height: 8px;
  position: relative;
}

.mini-hex.small .mini-yao {
  height: 6px;
  gap: 6px;
}

.mini-yao span {
  flex: 1;
  background: var(--paper);
  display: block;
}

.mini-yao.yin span {
  background: #1f1c18;
}

.mini-yao.moving span {
  background: var(--cinnabar);
  box-shadow: 0 0 8px var(--cinnabar-glow);
}

.mini-yao.changed-line span {
  background: var(--jade);
  box-shadow: 0 0 8px var(--jade-glow);
}

.hex-seal-stamp {
  width: 44px;
  height: 44px;
  background: var(--cinnabar);
  color: #07090d;
  font-size: 24px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 0 16px var(--cinnabar-glow);
}

.hex-seal-stamp.jade {
  background: transparent;
  border: 1.5px solid var(--jade);
  color: var(--jade);
  box-shadow: 0 0 12px rgba(47, 93, 124, 0.2);
}

.hex-seal-stamp.muted {
  background: transparent;
  border: 1px solid var(--ash-dim);
  color: var(--paper-soft);
  box-shadow: none;
  width: 36px;
  height: 36px;
  font-size: 19px;
}

.hex-title-main {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 2px 0;
}

.hex-sub-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ash);
}

/* 朱熹朱批核心栏 */
.zhuxi-box {
  background: var(--cinnabar-soft);
  border: 1px solid rgba(196, 38, 48, 0.48);
  padding: 18px 20px;
  margin-bottom: 22px;
  position: relative;
}

.zhuxi-box::before {
  content: "朱笔断之";
  position: absolute;
  top: -11px;
  right: 16px;
  background: var(--cinnabar);
  color: #07090d;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  letter-spacing: 0.14em;
}

.zhuxi-rule {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cinnabar);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.zhuxi-summary {
  font-size: 13px;
  color: var(--paper-soft);
  margin: 0 0 14px;
  line-height: 1.7;
}

.zhuxi-focus-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zhuxi-focus-item {
  background: rgba(250, 246, 236, 0.65);
  border-left: 3px solid var(--cinnabar);
  padding: 11px 14px;
}

.zhuxi-focus-item.secondary {
  border-left-color: var(--jade);
}

.zhuxi-focus-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--jade);
  margin-bottom: 4px;
}

.zhuxi-focus-text {
  font-size: 18px;
  line-height: 1.75;
  color: var(--paper);
  letter-spacing: 0.05em;
}

/* 原文区块 */
.texts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.text-block {
  background: rgba(250, 246, 236, 0.55);
  border: 1px solid var(--border-ink);
  padding: 16px 18px;
}

.text-block h3 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--jade);
  font-weight: 600;
}

.classical-quote {
  font-size: 17px;
  line-height: 1.8;
  color: var(--paper);
  margin: 0 0 10px;
  letter-spacing: 0.04em;
}

.brief-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--paper-soft);
  margin: 0;
}

/* 六爻全辞 */
.yao-texts-card {
  background: rgba(250, 246, 236, 0.55);
  border: 1px solid var(--border-ink);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.yao-texts-card h3 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--jade);
}

.yao-text-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yao-text-item {
  padding: 9px 12px;
  border-left: 2px solid rgba(31, 28, 24, 0.14);
  font-size: 15px;
  line-height: 1.7;
  color: var(--paper-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.yao-text-item.moving {
  border-left-color: var(--cinnabar);
  background: rgba(196, 38, 48, 0.08);
  color: var(--paper);
  font-weight: 600;
}

.moving-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cinnabar);
  border: 1px solid rgba(196, 38, 48, 0.5);
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* AI 深度解卦占位预览卡片 */
.ai-teaser-card {
  background: linear-gradient(125deg, rgba(47, 93, 124, 0.07), rgba(196, 38, 48, 0.07));
  border: 1px dashed rgba(47, 93, 124, 0.42);
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.ai-teaser-info h4 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pro-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--jade);
  color: #07090d;
  padding: 1px 6px;
  font-weight: 700;
}

.ai-teaser-info p {
  margin: 0;
  font-size: 13px;
  color: var(--ash);
}

/* 结果操作栏 */
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.jade-btn {
  background: var(--jade-soft);
  border: 1px solid var(--jade);
  color: var(--jade);
  padding: 9px 16px;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}

.jade-btn:hover {
  background: rgba(47, 93, 124, 0.18);
  box-shadow: 0 0 16px rgba(47, 93, 124, 0.25);
}

.cinnabar-btn {
  background: var(--cinnabar-soft);
  border: 1px solid var(--cinnabar);
  color: var(--paper);
  padding: 9px 16px;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}

.cinnabar-btn:hover {
  background: rgba(196, 38, 48, 0.24);
}

/* ===== 64 卦典视图 ===== */
.codex-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.codex-search {
  flex: 1;
  min-width: 200px;
  background: var(--ink-panel);
  border: 1px solid var(--border-ink);
  color: var(--paper);
  padding: 10px 14px;
  font-family: var(--font-serif);
  font-size: 14px;
  outline: none;
}

.codex-search:focus {
  border-color: var(--jade);
}

.trigram-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tri-chip {
  background: var(--ink-panel);
  border: 1px solid var(--border-ink);
  color: var(--ash);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s;
}

.tri-chip.active,
.tri-chip:hover {
  border-color: var(--jade);
  color: var(--jade);
}

.codex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
}

.codex-item {
  background: var(--ink-panel);
  border: 1px solid var(--border-ink);
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.codex-item:hover {
  border-color: var(--jade);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.codex-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ash-dim);
}

.codex-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.codex-xiang-mini {
  font-size: 11px;
  color: var(--ash);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 卦录视图 ===== */
.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-item {
  background: var(--ink-panel);
  border: 1px solid var(--border-ink);
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.log-item:hover {
  border-color: var(--jade);
}

.log-empty {
  background: var(--ink-panel);
  border: 1px dashed var(--border-ink);
  padding: 46px 20px;
  text-align: center;
  color: var(--ash);
  font-size: 14px;
}

/* ===== 弹窗 (卦签 / 卦典详情 / AI 预览) ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(40, 34, 26, 0.45);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
}

.modal-backdrop.open {
  display: grid;
}

.modal-box {
  background: #faf6ec;
  border: 1px solid var(--border-jade);
  max-width: 660px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-ink);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.14em;
}

.modal-close {
  background: transparent;
  border: 1px solid var(--border-ink);
  color: var(--ash);
  padding: 4px 10px;
  font-family: var(--font-mono);
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
}

.poster-img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  display: block;
  border: 1px solid var(--border-ink);
  margin-bottom: 14px;
}

.prompt-preview {
  background: #07090d;
  border: 1px solid var(--border-ink);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--paper-soft);
  white-space: pre-wrap;
  max-height: 45vh;
  overflow-y: auto;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1f1c18;
  border: 1px solid var(--jade);
  color: var(--jade);
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 80;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 一屏三境单页流样式 ===== */
.stage-screen {
  display: none;
}

.stage-screen.active {
  display: flex;
  flex-direction: column;
  animation: stageEnter 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-section.stage-screen.active {
  display: block;
  margin-top: 0;
}

@keyframes stageEnter {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 第一境：居中单屏摇卦面板 */
.ritual-panel {
  max-width: 580px;
  margin: 0 auto;
  padding: 20px 22px 24px;
  background: var(--ink-panel);
  border: 1px solid var(--border-ink);
  backdrop-filter: blur(12px);
  align-items: center;
  position: relative;
  overflow: hidden;
}

.ritual-panel::before,
.ritual-panel::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--jade);
  border-style: solid;
  pointer-events: none;
}

.ritual-panel::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.ritual-panel::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

/* 紧凑 6 爻进度槽（横排展示 初→上 每爻阴阳条） */
.live-yao-strip {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 12px 0 14px;
}

.strip-slot {
  background: rgba(250, 246, 236, 0.55);
  border: 1px solid rgba(31, 28, 24, 0.08);
  padding: 8px 6px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
}

.strip-slot.next {
  border-color: rgba(47, 93, 124, 0.45);
  background: rgba(47, 93, 124, 0.06);
}

.strip-slot.filled {
  border-color: rgba(31, 28, 24, 0.2);
}

.strip-slot.moving {
  border-color: rgba(196, 38, 48, 0.55);
  background: rgba(196, 38, 48, 0.08);
}

.strip-pos {
  font-size: 11px;
  color: var(--ash);
}

.strip-slot.next .strip-pos {
  color: var(--jade);
}

.strip-bar {
  width: 100%;
  max-width: 48px;
  height: 7px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.strip-bar .s-empty {
  width: 100%;
  height: 2px;
  background: rgba(31, 28, 24, 0.14);
}

.strip-bar .s-line {
  flex: 1;
  height: 7px;
  background: var(--paper);
  animation: brushReveal 0.35s ease;
}

.strip-slot.yin .strip-bar .s-line {
  background: #1f1c18;
}

.strip-slot.moving .strip-bar .s-line {
  background: var(--cinnabar);
  box-shadow: 0 0 10px var(--cinnabar-glow);
}

.strip-val {
  font-size: 11px;
  color: var(--ash-dim);
  min-height: 15px;
}

.strip-slot.filled .strip-val {
  color: var(--paper-soft);
}

.strip-slot.moving .strip-val {
  color: var(--cinnabar);
}

/* ===== 第二境：居中六爻卦象祭坛（可点击触发一化三） ===== */
.monument-panel {
  max-width: 600px;
  margin: 0 auto;
  min-height: 520px;
  padding: 28px 22px 26px;
  background: var(--ink-panel);
  border: 1px solid var(--border-ink);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.monument-kicker {
  font-size: 13px;
  letter-spacing: 0.24em;
  color: var(--jade);
  padding: 5px 14px;
  border: 1px solid var(--border-jade);
  background: var(--jade-soft);
}

.hex-monument-btn {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 30px 28px;
  margin: 18px 0;
  background: radial-gradient(circle at 50% 50%, rgba(47, 93, 124, 0.08), rgba(250, 246, 236, 0.72) 72%);
  border: 1px solid rgba(47, 93, 124, 0.34);
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 36px rgba(47, 93, 124, 0.1), inset 0 0 28px rgba(47, 93, 124, 0.06);
}

.hex-monument-btn:hover {
  transform: translateY(-3px) scale(1.015);
  border-color: var(--jade);
  box-shadow: 0 0 48px rgba(47, 93, 124, 0.24), inset 0 0 32px rgba(196, 38, 48, 0.08);
}

.hex-monument-btn:active {
  transform: scale(0.985);
}

.monument-core {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.monument-row {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: yaoRiseIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes yaoRiseIn {
  from { opacity: 0; transform: translateY(10px) scaleX(0.7); }
  to { opacity: 1; transform: translateY(0) scaleX(1); }
}

.monument-pos {
  font-size: 11px;
  color: var(--ash);
  text-align: left;
}

.monument-tag {
  font-size: 11px;
  color: var(--ash);
  text-align: right;
}

.monument-row.moving .monument-tag {
  color: var(--cinnabar);
}

.monument-bars {
  height: 18px;
  display: flex;
  gap: 20px;
  align-items: center;
}

.monument-stroke {
  flex: 1;
  height: 16px;
  background: var(--paper);
  clip-path: polygon(0% 8%, 99% 0%, 100% 92%, 1% 100%);
  box-shadow: 0 0 14px rgba(47, 93, 124, 0.24);
}

.monument-row.yin .monument-stroke {
  background: #3d3933;
  box-shadow: none;
}

.monument-row.moving .monument-stroke {
  background: var(--cinnabar);
  box-shadow: 0 0 18px var(--cinnabar-glow);
  animation: movingBreathe 2s ease-in-out infinite;
}

@keyframes movingBreathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

/* 点击卦象瞬间的一化三虚影扩散 */
.monument-burst {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  border: 2px solid var(--jade);
  box-shadow: 0 0 36px var(--jade-glow), inset 0 0 24px var(--cinnabar-glow);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

.monument-burst.fire {
  animation: monumentBurst 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes monumentBurst {
  0% { transform: scale(0.4); opacity: 0.95; }
  100% { transform: scale(3.8); opacity: 0; }
}

.monument-ghost {
  position: absolute;
  inset: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.hex-monument-btn.splitting .monument-core {
  animation: corePulseOut 0.45s ease forwards;
}

.hex-monument-btn.splitting .ghost-left {
  animation: ghostSplitLeft 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hex-monument-btn.splitting .ghost-right {
  animation: ghostSplitRight 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes corePulseOut {
  0% { transform: scale(1); opacity: 1; }
  45% { transform: scale(1.06); filter: drop-shadow(0 0 20px var(--jade)); opacity: 1; }
  100% { transform: scale(0.86); opacity: 0; }
}

@keyframes ghostSplitLeft {
  0% { transform: translateX(0) scale(1); opacity: 0.65; }
  100% { transform: translateX(-140px) scale(0.82); opacity: 0; }
}

@keyframes ghostSplitRight {
  0% { transform: translateX(0) scale(1); opacity: 0.65; }
  100% { transform: translateX(140px) scale(0.82); opacity: 0; }
}

.monument-cue-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  background: linear-gradient(135deg, rgba(47, 93, 124, 0.14), rgba(196, 38, 48, 0.1));
  border: 1px solid var(--jade);
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 0 20px rgba(47, 93, 124, 0.18);
  animation: cueFloat 2.4s ease-in-out infinite;
}

.monument-cue-btn:hover {
  background: linear-gradient(135deg, rgba(47, 93, 124, 0.24), rgba(196, 38, 48, 0.18));
  box-shadow: 0 0 28px rgba(47, 93, 124, 0.34);
}

.cue-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cinnabar);
  box-shadow: 0 0 12px var(--cinnabar-glow);
}

@keyframes cueFloat {
  0%, 100% { opacity: 0.95; transform: translateY(0); }
  50% { opacity: 0.55; transform: translateY(-2px); }
}

.monument-foot {
  margin-top: 14px;
}

/* ===== 一卦一屏专屏样式（本卦 / 互卦 / 之卦 独占一屏） ===== */
.single-hex-section.stage-screen.active {
  display: block;
}

.hex-page-card {
  max-width: 680px;
  margin: 0 auto;
  background: var(--ink-card);
  border: 1px solid var(--border-ink);
  padding: 22px 26px 28px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.hex-page-card::before,
.hex-page-card::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--jade);
  border-style: solid;
  pointer-events: none;
}

.hex-page-card::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.hex-page-card::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

/* 顶部四步导航（本卦 · 互卦 · 之卦 · 朱批） */
.step-nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-ink);
}

.step-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.crumb-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ash-dim);
  padding: 4px 10px;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}

.crumb-btn:hover {
  color: var(--paper-soft);
}

.crumb-btn.active {
  color: var(--jade);
  border-color: var(--border-jade);
  background: var(--jade-soft);
}

.crumb-btn.verdict-crumb.active {
  color: var(--cinnabar);
  border-color: rgba(196, 38, 48, 0.5);
  background: var(--cinnabar-soft);
}

.crumb-sep {
  color: var(--ash-dim);
  font-size: 11px;
}

/* ===== 纯视觉几何组合动画舞台（每卦专属入场演出） ===== */
.morph-stage {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 18px 0 12px;
}

.morph-whisper {
  font-size: 14px;
  letter-spacing: 0.24em;
  color: var(--jade);
  min-height: 22px;
  transition: opacity 0.3s ease;
}

/* 1. 本卦组合舞台：上三爻 + 下三爻 磁吸合拢（放慢节奏，留足视线看清） */
.asm-primary-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 38px;
  transition: gap 1.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.asm-primary-stage.merged {
  gap: 11px;
}

.asm-tri-group {
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform 1.15s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease;
}

.asm-tri-group.upper {
  transform: translateY(-28px);
}

.asm-tri-group.lower {
  transform: translateY(28px);
}

.asm-primary-stage.merged .asm-tri-group.upper,
.asm-primary-stage.merged .asm-tri-group.lower {
  transform: translateY(0);
}

.asm-tri-bars {
  width: 176px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.asm-tri-label {
  width: 78px;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--jade);
  border-left: 2px solid rgba(47, 93, 124, 0.4);
  padding-left: 10px;
  transition: opacity 0.45s ease;
}

.asm-bar {
  height: 14px;
  display: flex;
  gap: 18px;
  align-items: center;
}

.asm-bar span {
  flex: 1;
  height: 14px;
  background: var(--paper);
  clip-path: polygon(0% 8%, 99% 0%, 100% 92%, 1% 100%);
  box-shadow: 0 0 12px rgba(47, 93, 124, 0.24);
}

.asm-bar.yin span {
  background: #1f1c18;
  box-shadow: none;
}

.asm-bar.moving span {
  background: var(--cinnabar);
  box-shadow: 0 0 15px var(--cinnabar-glow);
}

/* 2. 互卦几何拆分舞台：6 爻 → 去首尾 → 4 爻分出左右两组三爻 → 上下叠合为新 6 爻 */
.asm-nuclear-stage {
  position: relative;
  width: 340px;
  height: 224px;
  max-width: 100%;
}

.nuc-bar {
  position: absolute;
  left: 50%;
  width: 164px;
  height: 14px;
  margin-left: -82px;
  display: flex;
  gap: 16px;
  transition: transform 1.05s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.85s ease,
              filter 0.7s ease;
}

.nuc-bar span {
  flex: 1;
  height: 14px;
  background: var(--paper);
  clip-path: polygon(0% 8%, 99% 0%, 100% 92%, 1% 100%);
  transition: background 0.45s ease, box-shadow 0.45s ease;
}

.nuc-bar.yin span {
  background: #1f1c18;
}

.nuc-bar.moving span {
  background: var(--cinnabar);
}

/* 初始 6 槽位置（row 0=最顶第6爻, row 5=最底第1爻） */
.nuc-bar[data-slot="0"] { transform: translate(0, 12px); }
.nuc-bar[data-slot="1"] { transform: translate(0, 48px); }
.nuc-bar[data-slot="2"] { transform: translate(0, 84px); }
.nuc-bar[data-slot="3"] { transform: translate(0, 120px); }
.nuc-bar[data-slot="4"] { transform: translate(0, 156px); }
.nuc-bar[data-slot="5"] { transform: translate(0, 192px); }

/* 副拷贝（用于分化出右组 3-4-5 与左组 2-3-4），默认藏在原位且透明 */
.nuc-bar.clone-bar {
  opacity: 0;
  pointer-events: none;
}

/* 阶段 1：首尾消隐，中间 4 爻鎏金 */
.asm-nuclear-stage.phase-trim .nuc-bar.outer-top {
  opacity: 0;
  transform: translate(0, -24px) scaleX(0.5);
}

.asm-nuclear-stage.phase-trim .nuc-bar.outer-bot {
  opacity: 0;
  transform: translate(0, 228px) scaleX(0.5);
}

.asm-nuclear-stage.phase-trim .nuc-bar.mid-bar span {
  background: var(--bronze);
  box-shadow: 0 0 18px rgba(160, 108, 40, 0.6);
}

/* 阶段 2：4 爻当场分化为 左组(下卦 2-3-4) 与 右组(上卦 3-4-5) */
.asm-nuclear-stage.phase-split .nuc-bar.outer-top,
.asm-nuclear-stage.phase-split .nuc-bar.outer-bot {
  opacity: 0;
}

.asm-nuclear-stage.phase-split .nuc-bar.clone-bar {
  opacity: 1;
}

.asm-nuclear-stage.phase-split .nuc-bar.grp-lower span {
  background: var(--jade);
  box-shadow: 0 0 16px var(--jade-glow);
}

.asm-nuclear-stage.phase-split .nuc-bar.grp-upper span {
  background: var(--bronze);
  box-shadow: 0 0 16px rgba(160, 108, 40, 0.65);
}

/* 左组（下卦：四、三、二爻）向左平移并居中对齐成三爻 */
.asm-nuclear-stage.phase-split .nuc-bar.grp-lower[data-target="3"] { transform: translate(-86px, 68px) scaleX(0.76); }
.asm-nuclear-stage.phase-split .nuc-bar.grp-lower[data-target="4"] { transform: translate(-86px, 104px) scaleX(0.76); }
.asm-nuclear-stage.phase-split .nuc-bar.grp-lower[data-target="5"] { transform: translate(-86px, 140px) scaleX(0.76); }

/* 右组（上卦：五、四、三爻）向右平移并居中对齐成三爻 */
.asm-nuclear-stage.phase-split .nuc-bar.grp-upper[data-target="0"] { transform: translate(86px, 68px) scaleX(0.76); }
.asm-nuclear-stage.phase-split .nuc-bar.grp-upper[data-target="1"] { transform: translate(86px, 104px) scaleX(0.76); }
.asm-nuclear-stage.phase-split .nuc-bar.grp-upper[data-target="2"] { transform: translate(86px, 140px) scaleX(0.76); }

/* 阶段 3：右组飞到上方(0-1-2)，左组落到下方(3-4-5)，合成全新六爻！ */
.asm-nuclear-stage.phase-stack .nuc-bar.outer-top,
.asm-nuclear-stage.phase-stack .nuc-bar.outer-bot {
  opacity: 0;
}

.asm-nuclear-stage.phase-stack .nuc-bar.clone-bar {
  opacity: 1;
}

.asm-nuclear-stage.phase-stack .nuc-bar[data-target="0"] { transform: translate(0, 12px) scaleX(1); }
.asm-nuclear-stage.phase-stack .nuc-bar[data-target="1"] { transform: translate(0, 48px) scaleX(1); }
.asm-nuclear-stage.phase-stack .nuc-bar[data-target="2"] { transform: translate(0, 84px) scaleX(1); }
.asm-nuclear-stage.phase-stack .nuc-bar[data-target="3"] { transform: translate(0, 120px) scaleX(1); }
.asm-nuclear-stage.phase-stack .nuc-bar[data-target="4"] { transform: translate(0, 156px) scaleX(1); }
.asm-nuclear-stage.phase-stack .nuc-bar[data-target="5"] { transform: translate(0, 192px) scaleX(1); }

.asm-nuclear-stage.phase-stack .nuc-bar.grp-upper span,
.asm-nuclear-stage.phase-stack .nuc-bar.grp-lower span {
  background: var(--bronze);
  box-shadow: 0 0 18px rgba(160, 108, 40, 0.55);
}

.nuc-split-tag {
  position: absolute;
  bottom: 14px;
  font-size: 12px;
  letter-spacing: 0.14em;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.nuc-split-tag.left {
  left: 34px;
  color: var(--jade);
}

.nuc-split-tag.right {
  right: 34px;
  color: var(--bronze);
}

.asm-nuclear-stage.phase-split .nuc-split-tag {
  opacity: 1;
}

/* 3. 之卦几何变换舞台：实线被光刃劈成两段 / 断线向中间焊合成整条 */
.asm-changed-stage {
  width: 210px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chg-bar {
  position: relative;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chg-half {
  width: 50%;
  height: 15px;
  background: var(--paper);
  transition: transform 1.02s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.75s ease,
              box-shadow 0.75s ease;
}

/* 初始态：阳爻两半紧贴(0px 缝)，阴爻两半拉开(各退 10px 露出中间断口) */
.chg-bar.init-yang .chg-half.l { transform: translateX(0); }
.chg-bar.init-yang .chg-half.r { transform: translateX(0); }

.chg-bar.init-yin .chg-half.l { transform: translateX(-11px); background: #1f1c18; }
.chg-bar.init-yin .chg-half.r { transform: translateX(11px); background: #1f1c18; }

.chg-bar.is-moving .chg-half {
  background: var(--cinnabar);
  box-shadow: 0 0 16px var(--cinnabar-glow);
}

/* 触发变卦瞬间：老阳劈开 / 老阴焊合！ */
.chg-bar.is-moving.morphed.init-yang .chg-half.l {
  transform: translateX(-11px);
  background: var(--jade);
  box-shadow: 0 0 18px var(--jade-glow);
}

.chg-bar.is-moving.morphed.init-yang .chg-half.r {
  transform: translateX(11px);
  background: var(--jade);
  box-shadow: 0 0 18px var(--jade-glow);
}

.chg-bar.is-moving.morphed.init-yin .chg-half.l {
  transform: translateX(0);
  background: var(--jade);
  box-shadow: 0 0 18px var(--jade-glow);
}

.chg-bar.is-moving.morphed.init-yin .chg-half.r {
  transform: translateX(0);
  background: var(--jade);
  box-shadow: 0 0 18px var(--jade-glow);
}

/* 中心切割 / 焊合光刃闪光 */
.chg-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 30px;
  margin: -15px 0 0 -2px;
  background: #c42630;
  box-shadow: 0 0 16px var(--jade), 0 0 28px var(--cinnabar);
  opacity: 0;
  pointer-events: none;
}

.chg-bar.is-moving.morphed .chg-spark {
  animation: sparkSlice 0.95s ease forwards;
}

@keyframes sparkSlice {
  0% { opacity: 0; transform: scaleY(0.2); }
  30% { opacity: 1; transform: scaleY(1.25); }
  100% { opacity: 0; transform: scaleY(0.1); }
}

/* 静卦脉冲光环 */
.asm-changed-stage.static-pulse .chg-bar .chg-half {
  box-shadow: 0 0 16px rgba(47, 93, 124, 0.35);
}

/* 单卦展示主体（独占一屏，居中舒展） */
.solo-hex-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: soloReveal 0.55s cubic-bezier(0.2, 0.9, 0.25, 1);
}

@keyframes soloReveal {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.solo-role-pill {
  font-size: 12px;
  letter-spacing: 0.2em;
  padding: 4px 14px;
  border: 1px solid var(--border-jade);
  color: var(--jade);
  background: var(--jade-soft);
  margin-bottom: 22px;
}

.solo-role-pill.nuclear {
  border-color: rgba(160, 108, 40, 0.45);
  color: var(--bronze);
  background: rgba(160, 108, 40, 0.08);
}

.solo-role-pill.changed {
  border-color: rgba(196, 38, 48, 0.48);
  color: var(--cinnabar);
  background: var(--cinnabar-soft);
}

.solo-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.solo-hex-bars {
  width: 158px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.solo-yao {
  height: 13px;
  display: flex;
  gap: 16px;
}

.solo-yao span {
  flex: 1;
  background: var(--paper);
  clip-path: polygon(0% 8%, 99% 0%, 100% 92%, 1% 100%);
  box-shadow: 0 0 12px rgba(47, 93, 124, 0.2);
}

.solo-yao.yin span {
  background: #1f1c18;
  box-shadow: none;
}

.solo-yao.moving span {
  background: var(--cinnabar);
  box-shadow: 0 0 16px var(--cinnabar-glow);
}

.solo-yao.changed-line span {
  background: var(--jade);
  box-shadow: 0 0 16px var(--jade-glow);
}

.solo-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.solo-seal-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.solo-seal {
  width: 52px;
  height: 52px;
  background: var(--cinnabar);
  color: #07090d;
  font-size: 28px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 0 22px var(--cinnabar-glow);
  animation: sealDrop 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.solo-seal.nuclear {
  background: transparent;
  border: 2px solid var(--bronze);
  color: var(--bronze);
  box-shadow: 0 0 18px rgba(160, 108, 40, 0.25);
}

.solo-seal.changed {
  background: transparent;
  border: 2px solid var(--jade);
  color: var(--jade);
  box-shadow: 0 0 18px var(--jade-glow);
}

@keyframes sealDrop {
  from { transform: scale(1.45) rotate(-8deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.solo-title {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--paper);
}

.solo-meta {
  font-size: 13px;
  color: var(--ash);
  letter-spacing: 0.08em;
}

/* 正下方专属《周易》卦辞卡 */
.solo-scripture-box {
  width: 100%;
  margin-top: 12px;
  padding: 20px 22px;
  background: rgba(250, 246, 236, 0.65);
  border: 1px solid var(--border-ink);
  border-top: 2px solid rgba(47, 93, 124, 0.38);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.solo-scripture-box.nuclear {
  border-top-color: rgba(160, 108, 40, 0.48);
}

.solo-scripture-box.changed {
  border-top-color: rgba(196, 38, 48, 0.48);
}

.solo-scripture-head {
  font-size: 12px;
  color: var(--jade);
  letter-spacing: 0.16em;
}

.solo-scripture-box.nuclear .solo-scripture-head { color: var(--bronze); }
.solo-scripture-box.changed .solo-scripture-head { color: var(--cinnabar); }

.solo-gua {
  margin: 0;
  font-size: 20px;
  line-height: 1.85;
  color: var(--paper);
  letter-spacing: 0.05em;
}

.solo-xiang {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--bronze);
  padding-top: 10px;
  border-top: 1px dashed rgba(31, 28, 24, 0.1);
}

.solo-brief {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--paper-soft);
}

/* 底部翻页操作栏 */
.solo-footer-nav {
  width: 100%;
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.next-stage-btn {
  padding: 12px 26px;
  background: linear-gradient(135deg, rgba(47, 93, 124, 0.2), rgba(47, 93, 124, 0.06));
  border: 1px solid var(--jade);
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 0.18em;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(47, 93, 124, 0.2);
  transition: all 0.22s ease;
}

.next-stage-btn:hover {
  background: linear-gradient(135deg, rgba(47, 93, 124, 0.32), rgba(47, 93, 124, 0.12));
  box-shadow: 0 0 32px rgba(47, 93, 124, 0.36);
  transform: translateY(-1px);
}

.next-stage-btn.cinnabar {
  background: linear-gradient(135deg, rgba(196, 38, 48, 0.28), rgba(196, 38, 48, 0.1));
  border-color: var(--cinnabar);
  box-shadow: 0 0 26px rgba(196, 38, 48, 0.28);
}

.next-stage-btn.cinnabar:hover {
  background: linear-gradient(135deg, rgba(196, 38, 48, 0.42), rgba(196, 38, 48, 0.16));
  box-shadow: 0 0 36px rgba(196, 38, 48, 0.42);
}

/* ===== 最后一屏：三卦脉络条 + 朱批总断 ===== */
.verdict-flow-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: rgba(250, 246, 236, 0.65);
  border: 1px solid var(--border-ink);
  font-size: 15px;
}

.flow-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.flow-chip small {
  font-size: 11px;
  color: var(--ash);
}

.flow-chip strong {
  color: var(--paper);
  letter-spacing: 0.08em;
}

.flow-arrow {
  color: var(--jade);
  font-family: var(--font-mono);
}

/* ===== 响应式视口自适应（全设备一屏完整呈现） ===== */
#view-cast.active {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: clamp(8px, 1.4dvh, 16px);
}

.ritual-panel {
  width: 100%;
  max-width: 560px;
  padding: clamp(12px, 2dvh, 20px) clamp(12px, 3vw, 22px) clamp(14px, 2.2dvh, 22px);
}

.compass-wrap {
  width: clamp(184px, min(58vw, 31dvh), 274px);
  height: clamp(184px, min(58vw, 31dvh), 274px);
  margin: clamp(4px, 1dvh, 12px) 0;
}

.coins-cluster {
  gap: clamp(8px, 2.4vw, 14px);
}

.coin-slot {
  width: clamp(48px, min(15vw, 8.2dvh), 70px);
  height: clamp(48px, min(15vw, 8.2dvh), 70px);
}

.toss-readout {
  min-height: clamp(34px, 5dvh, 42px);
}

.toss-readout .main-line {
  font-size: clamp(14px, 2.1dvh, 16px);
}

.live-yao-strip {
  margin: clamp(6px, 1.2dvh, 12px) 0 clamp(8px, 1.4dvh, 14px);
  gap: clamp(4px, 1.2vw, 8px);
}

.strip-slot {
  padding: clamp(5px, 0.9dvh, 8px) 3px;
  gap: clamp(4px, 0.7dvh, 6px);
}

.primary-cast-btn {
  padding: clamp(10px, 1.5dvh, 13px) 20px;
  font-size: clamp(15px, 2.2dvh, 17px);
}

/* 第二境：六爻逐一消融 → 太极旋开 → 现卦字 → 随机刀光一刀两断 */
.monument-panel {
  width: 100%;
  max-width: 560px;
  min-height: auto;
  padding: clamp(14px, 2.2dvh, 24px) clamp(14px, 3vw, 24px);
  gap: clamp(10px, 1.6dvh, 16px);
}

.monument-panel.slash-shake {
  animation: slashImpactShake 0.26s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes slashImpactShake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 4px); }
  45% { transform: translate(6px, -5px); }
  70% { transform: translate(-3px, 2px); }
  100% { transform: translate(0, 0); }
}

.monument-top,
.monument-cue-btn {
  position: relative;
  z-index: 9;
}

.altar-arena {
  position: relative;
  width: clamp(276px, min(84vw, 46dvh), 360px);
  height: clamp(276px, min(84vw, 46dvh), 360px);
  display: grid;
  place-items: center;
}

/* 1. 初始六爻按钮：点击后一根一根化光消散 */
.altar-arena .hex-monument-btn {
  position: relative;
  z-index: 5;
  width: 88%;
  max-width: 310px;
  padding: clamp(16px, 2.6dvh, 24px) clamp(16px, 3vw, 22px);
  background: radial-gradient(circle at 50% 50%, rgba(47, 93, 124, 0.07) 0%, rgba(250, 246, 236, 0.65) 75%);
  border: 1px solid rgba(47, 93, 124, 0.3);
  box-shadow: 0 0 28px rgba(47, 93, 124, 0.08);
  transition: opacity 0.4s ease, border-color 0.3s ease;
}

.altar-arena .hex-monument-btn.faded-frame {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.altar-arena .monument-core {
  width: 100%;
  gap: clamp(9px, 1.5dvh, 14px);
}

/* 单根爻化光消散动画 */
.monument-row.vanishing {
  animation: yaoDissolveAway 0.48s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes yaoDissolveAway {
  0% {
    opacity: 1;
    transform: scaleX(1) scaleY(1);
    filter: brightness(1);
  }
  35% {
    opacity: 1;
    transform: scaleX(1.08) scaleY(1.3);
    filter: brightness(2.2) drop-shadow(0 0 14px var(--jade));
  }
  100% {
    opacity: 0;
    transform: scaleX(0.08) scaleY(0.3);
    filter: blur(5px) brightness(2);
  }
}

/* 2. 太极阴阳鱼旋转并向两侧旋开舞台 */
.taiji-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transform: scale(0.25) rotate(-180deg);
  transition: opacity 0.55s ease, transform 1.05s cubic-bezier(0.22, 1, 0.36, 1);
}

.taiji-stage.appear {
  opacity: 1;
  transform: scale(1) rotate(360deg);
}

.taiji-stage.opened {
  opacity: 0.22;
  transform: scale(1.16) rotate(405deg);
}

.taiji-stage.slashed-hide {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.taiji-svg {
  width: clamp(176px, min(52vw, 30dvh), 228px);
  height: clamp(176px, min(52vw, 30dvh), 228px);
  overflow: visible;
}

.taiji-half {
  transition: transform 0.88s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.85s ease;
}

/* 太极两仪向两侧旋开露出中心的卦字 */
.taiji-stage.opened .yang-fish {
  transform: translate(54px, -26px) rotate(22deg) scale(0.92);
}

.taiji-stage.opened .yin-fish {
  transform: translate(-54px, 26px) rotate(22deg) scale(0.92);
}

/* 3. 卦象核心大字（完整态 + 被随机斜刀一刀两断的上下/左右两半） */
.slash-glyph-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}

.glyph-whole,
.glyph-half {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(86px, min(24vw, 15dvh), 132px);
  font-weight: 900;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--paper);
  text-shadow: 0 0 26px var(--cinnabar), 0 0 56px rgba(196, 38, 48, 0.65);
  user-select: none;
}

.glyph-whole.two-char,
.glyph-half.two-char {
  font-size: clamp(66px, min(19vw, 12dvh), 102px);
}

.glyph-whole {
  opacity: 0;
  transform: scale(0.45);
  filter: blur(6px);
  transition: opacity 0.6s ease, transform 0.68s cubic-bezier(0.22, 1, 0.36, 1), filter 0.55s ease;
}

.glyph-whole.revealed {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.glyph-whole.hidden {
  opacity: 0;
  transition: none;
}

.glyph-half {
  opacity: 0;
  transform: translate(0px, 0px);
}

.glyph-half.severed {
  opacity: 1;
  color: #ffffff;
  text-shadow: 0 0 22px var(--jade), 0 0 46px var(--cinnabar);
  transition: transform 0.92s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.88s ease 0.18s;
  transform: translate(var(--tx, 0px), var(--ty, 0px));
}

.glyph-half.severed.fade-out {
  opacity: 0;
}

/* 4. 60fps 动态刀光弧线 Canvas */
.blade-canvas {
  position: absolute;
  inset: -16%;
  width: 132%;
  height: 132%;
  pointer-events: none;
  z-index: 10;
}

@keyframes sparkFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1.3); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); }
}

.hex-monument-btn {
  padding: clamp(16px, 2.8dvh, 28px) clamp(16px, 4vw, 28px);
  margin: 0;
}

.monument-core,
.monument-ghost {
  gap: clamp(9px, 1.6dvh, 15px);
}

.monument-ghost {
  inset: clamp(16px, 2.8dvh, 28px) clamp(16px, 4vw, 28px);
}

.monument-bars {
  height: clamp(13px, 2dvh, 18px);
}

.monument-stroke {
  height: clamp(11px, 1.8dvh, 16px);
}

.monument-cue-btn {
  padding: clamp(9px, 1.4dvh, 12px) clamp(16px, 3.5vw, 22px);
  font-size: clamp(13.5px, 2dvh, 15px);
}

.monument-foot {
  margin-top: 0;
}

/* 第 3/4/5 屏：单卦专屏随视口自适应 */
.hex-page-card {
  width: 100%;
  max-width: 680px;
  padding: clamp(12px, 2dvh, 22px) clamp(12px, 3vw, 24px) clamp(14px, 2.2dvh, 24px);
}

.nav-btn.is-restart {
  border-color: rgba(196, 38, 48, 0.55);
  color: var(--paper);
  background: rgba(196, 38, 48, 0.12);
  box-shadow: inset 0 0 10px rgba(196, 38, 48, 0.12);
}

.nav-btn.is-restart:hover {
  border-color: var(--cinnabar);
  background: rgba(196, 38, 48, 0.22);
}

.step-nav-bar {
  justify-content: center;
}

.morph-stage {
  min-height: clamp(220px, 38dvh, 330px);
  gap: clamp(14px, 2.2dvh, 22px);
  padding: clamp(8px, 1.4dvh, 18px) 0;
}

.solo-role-pill {
  margin-bottom: clamp(10px, 1.8dvh, 20px);
  padding: 3px 12px;
  font-size: clamp(11px, 1.5dvh, 12px);
}

.solo-hero {
  flex-wrap: nowrap;
  gap: clamp(14px, 4vw, 28px);
  margin-bottom: clamp(10px, 1.6dvh, 18px);
  width: 100%;
}

.solo-hex-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.solo-hex-bars {
  width: clamp(102px, min(30vw, 19dvh), 160px);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.8dvh, 7px);
}

.solo-yao-btn {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  padding: 3px 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: clamp(9px, 2vw, 15px);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.solo-yao-btn:hover {
  background: rgba(47, 93, 124, 0.08);
  border-color: rgba(47, 93, 124, 0.35);
}

.solo-yao-btn.selected {
  background: rgba(47, 93, 124, 0.12);
  border-color: var(--jade);
  box-shadow: 0 0 12px rgba(47, 93, 124, 0.2);
}

.solo-yao-btn.moving.selected {
  background: rgba(196, 38, 48, 0.14);
  border-color: var(--cinnabar);
  box-shadow: 0 0 12px rgba(196, 38, 48, 0.25);
}

.solo-yao-btn span {
  flex: 1;
  height: clamp(8px, 1.35dvh, 12px);
  background: var(--paper);
  clip-path: polygon(0% 8%, 99% 0%, 100% 92%, 1% 100%);
  box-shadow: 0 0 10px rgba(47, 93, 124, 0.2);
  display: block;
}

.solo-yao-btn.yin span {
  background: #1f1c18;
  box-shadow: none;
}

.solo-yao-btn.moving span {
  background: var(--cinnabar);
  box-shadow: 0 0 14px var(--cinnabar-glow);
}

.solo-yao-btn.changed-line span {
  background: var(--jade);
  box-shadow: 0 0 14px var(--jade-glow);
}

.solo-tap-hint {
  font-size: 10.5px;
  color: var(--ash-dim);
  letter-spacing: 0.08em;
}

.solo-yao-spotlight {
  margin-top: 2px;
  padding: clamp(8px, 1.2dvh, 11px) 12px;
  background: rgba(47, 93, 124, 0.06);
  border-left: 3px solid var(--jade);
  font-size: clamp(13px, 1.85dvh, 15px);
  line-height: 1.65;
  color: var(--paper);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.solo-yao-spotlight.is-moving {
  background: rgba(196, 38, 48, 0.09);
  border-left-color: var(--cinnabar);
}

.solo-yao-spotlight .spot-tag {
  font-size: 11px;
  color: var(--jade);
  margin-right: 8px;
  letter-spacing: 0.08em;
}

.solo-yao-spotlight.is-moving .spot-tag {
  color: var(--cinnabar);
}

.solo-yao-spotlight.empty {
  background: rgba(31, 28, 24, 0.03);
  border-left-color: var(--ash-dim);
  color: var(--ash);
  font-size: 12px;
}

.solo-identity {
  align-items: flex-start;
  text-align: left;
  min-width: 0;
}

.solo-seal-row {
  gap: clamp(8px, 2vw, 14px);
}

.solo-seal {
  width: auto;
  min-width: clamp(36px, min(10vw, 6dvh), 50px);
  height: clamp(36px, min(10vw, 6dvh), 50px);
  padding: 0 10px;
  font-size: clamp(20px, min(5.6vw, 3.4dvh), 28px);
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.solo-seal.two-char {
  padding: 0 clamp(8px, 2.2vw, 14px);
  font-size: clamp(16px, min(4.4vw, 2.6dvh), 22px);
  letter-spacing: 0.08em;
}

.solo-seal-row {
  flex-wrap: wrap;
}

.solo-title {
  font-size: clamp(21px, min(6vw, 3.8dvh), 34px);
  letter-spacing: 0.12em;
}

.solo-meta {
  font-size: clamp(11.5px, 1.6dvh, 13px);
}

/* ===== 一体式雕版排盘：上总纲（卦辞）+ 下六爻图文同行（无框内滚动条） ===== */
.gua-overview-card {
  width: 100%;
  padding: clamp(11px, 1.7dvh, 16px) clamp(12px, 2.6vw, 18px);
  background: rgba(250, 246, 236, 0.68);
  border: 1px solid var(--border-ink);
  border-top: 2px solid var(--jade);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2dvh, 12px);
}

.gua-overview-card.nuclear {
  border-top-color: var(--bronze);
}

.gua-overview-card.changed {
  border-top-color: var(--cinnabar);
}

.gua-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.gua-head-left {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.2vw, 14px);
  min-width: 0;
}

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

.gua-title-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.gua-main-name {
  margin: 0;
  font-size: clamp(20px, min(5.6vw, 3.3dvh), 28px);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--paper);
  line-height: 1.15;
}

.gua-sub-meta {
  font-size: clamp(11px, 1.5dvh, 12.5px);
  color: var(--ash);
  letter-spacing: 0.06em;
}

.gua-role-badge {
  font-size: 11px;
  letter-spacing: 0.14em;
  padding: 3px 10px;
  border: 1px solid var(--border-jade);
  color: var(--jade);
  background: var(--jade-soft);
  white-space: nowrap;
}

.gua-role-badge.nuclear {
  border-color: rgba(160, 108, 40, 0.45);
  color: var(--bronze);
  background: rgba(160, 108, 40, 0.08);
}

.gua-role-badge.changed {
  border-color: rgba(196, 38, 48, 0.48);
  color: var(--cinnabar);
  background: var(--cinnabar-soft);
}

.gua-dictum-block {
  padding-top: clamp(7px, 1.1dvh, 10px);
  border-top: 1px solid rgba(31, 28, 24, 0.09);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.7dvh, 6px);
  text-align: left;
}

.gua-dictum-main {
  margin: 0;
  font-size: clamp(14.5px, 2.05dvh, 17.5px);
  line-height: 1.55;
  color: var(--paper);
  letter-spacing: 0.04em;
}

.gua-dictum-tag {
  display: inline-block;
  font-size: 10.5px;
  padding: 1px 6px;
  margin-right: 7px;
  border: 1px solid rgba(47, 93, 124, 0.35);
  color: var(--jade);
  vertical-align: 1px;
  letter-spacing: 0.08em;
}

.gua-overview-card.nuclear .gua-dictum-tag {
  border-color: rgba(160, 108, 40, 0.4);
  color: var(--bronze);
}

.gua-overview-card.changed .gua-dictum-tag {
  border-color: rgba(196, 38, 48, 0.42);
  color: var(--cinnabar);
}

.gua-dictum-xiang {
  margin: 0;
  font-size: clamp(12px, 1.65dvh, 13.5px);
  line-height: 1.5;
  color: var(--bronze);
}

.gua-dictum-brief {
  margin: 0;
  font-size: clamp(12px, 1.65dvh, 13.5px);
  line-height: 1.52;
  color: var(--paper-soft);
}

/* 下半部：六爻一体式排盘（左列拼成完整六爻卦象，右列一一对应爻辞） */
.integrated-yao-board {
  width: 100%;
  margin-top: clamp(8px, 1.3dvh, 14px);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.65dvh, 6px);
}

.iy-row {
  width: 100%;
  display: grid;
  grid-template-columns: clamp(58px, 16vw, 86px) 38px 1fr;
  align-items: center;
  gap: clamp(8px, 2vw, 14px);
  padding: clamp(6px, 0.95dvh, 9px) clamp(8px, 2vw, 12px);
  background: rgba(250, 246, 236, 0.46);
  border: 1px solid rgba(31, 28, 24, 0.07);
  text-align: left;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.iy-row:hover {
  background: rgba(47, 93, 124, 0.06);
  border-color: rgba(47, 93, 124, 0.28);
}

.iy-row.active-pluck {
  border-color: var(--jade);
  background: rgba(47, 93, 124, 0.11);
}

.iy-row.is-moving {
  background: rgba(196, 38, 48, 0.09);
  border-color: rgba(196, 38, 48, 0.42);
}

.iy-row.is-moving.active-pluck {
  background: rgba(196, 38, 48, 0.17);
  border-color: var(--cinnabar);
}

.iy-bar {
  width: 100%;
  height: clamp(8px, 1.25dvh, 11px);
  display: flex;
  align-items: center;
  gap: clamp(8px, 2.2vw, 13px);
}

.iy-bar span {
  flex: 1;
  height: 100%;
  display: block;
  background: var(--paper);
  clip-path: polygon(0% 8%, 99% 0%, 100% 92%, 1% 100%);
  box-shadow: 0 0 9px rgba(47, 93, 124, 0.2);
}

.iy-row.yin .iy-bar span {
  background: #1f1c18;
  box-shadow: none;
}

.iy-row.is-moving .iy-bar span {
  background: var(--cinnabar);
  box-shadow: 0 0 14px var(--cinnabar-glow);
}

.iy-row.is-changed .iy-bar span {
  background: var(--jade);
  box-shadow: 0 0 12px var(--jade-glow);
}

.iy-pos {
  font-size: clamp(11.5px, 1.6dvh, 13px);
  font-weight: 600;
  color: var(--jade);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.gua-overview-card.nuclear ~ .integrated-yao-board .iy-pos {
  color: var(--bronze);
}

.iy-row.is-moving .iy-pos {
  color: var(--cinnabar);
}

.iy-words {
  font-size: clamp(12.5px, 1.8dvh, 14.5px);
  line-height: 1.45;
  color: var(--paper-soft);
}

.iy-row.is-moving .iy-words,
.iy-row:hover .iy-words,
.iy-row.active-pluck .iy-words {
  color: var(--paper);
}

.solo-gua {
  font-size: clamp(15.5px, 2.2dvh, 20px);
  line-height: 1.65;
}

.solo-xiang {
  font-size: clamp(13px, 1.8dvh, 15px);
  line-height: 1.55;
  padding-top: clamp(6px, 1dvh, 10px);
}

.solo-brief {
  font-size: clamp(12.5px, 1.75dvh, 14px);
  line-height: 1.62;
}

.solo-footer-nav {
  margin-top: clamp(12px, 2dvh, 22px);
}

.next-stage-btn {
  padding: clamp(9px, 1.4dvh, 12px) clamp(16px, 3.6vw, 26px);
  font-size: clamp(14px, 2dvh, 16px);
}

/* 第 6 屏（最后一屏 · 朱批总断）一屏自适应 + 六爻抽屉 */
#stage-verdict .result-card {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(12px, 2dvh, 22px) clamp(12px, 3vw, 22px);
}

.verdict-flow-bar {
  padding: clamp(8px, 1.2dvh, 12px) 12px;
  margin-bottom: clamp(10px, 1.6dvh, 16px);
  font-size: clamp(13px, 1.8dvh, 15px);
  gap: 8px;
}

#stage-verdict .zhuxi-box {
  padding: clamp(12px, 1.8dvh, 18px) clamp(12px, 2.5vw, 18px);
  margin-bottom: clamp(10px, 1.6dvh, 16px);
}

#stage-verdict .zhuxi-summary {
  margin-bottom: clamp(8px, 1.2dvh, 12px);
  font-size: clamp(12px, 1.65dvh, 13px);
}

#stage-verdict .zhuxi-focus-text {
  font-size: clamp(15px, 2.15dvh, 18px);
  line-height: 1.6;
}

/* 可折叠六爻全辞抽屉 */
.yao-accordion {
  background: rgba(250, 246, 236, 0.55);
  border: 1px solid var(--border-ink);
  margin-bottom: clamp(10px, 1.6dvh, 16px);
}

.yao-accordion summary {
  padding: clamp(9px, 1.3dvh, 12px) 14px;
  font-size: clamp(12.5px, 1.75dvh, 13.5px);
  color: var(--jade);
  letter-spacing: 0.1em;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.yao-accordion summary::-webkit-details-marker {
  display: none;
}

.yao-accordion summary::after {
  content: "展开 ▾";
  font-size: 11px;
  color: var(--ash);
}

.yao-accordion[open] summary::after {
  content: "收起 ▴";
  color: var(--jade);
}

.yao-accordion .yao-text-list {
  padding: 0 12px 12px;
}

#stage-verdict .ai-teaser-card {
  padding: clamp(10px, 1.5dvh, 14px) clamp(12px, 2.4vw, 16px);
  margin-bottom: clamp(10px, 1.6dvh, 16px);
  gap: 10px;
}

#stage-verdict .ai-teaser-info h4 {
  font-size: clamp(13.5px, 1.9dvh, 15px);
}

#stage-verdict .ai-teaser-info p {
  font-size: clamp(12px, 1.6dvh, 13px);
}

#stage-verdict .jade-btn,
#stage-verdict .cinnabar-btn {
  padding: clamp(7px, 1.1dvh, 9px) clamp(12px, 2.6vw, 16px);
  font-size: clamp(13px, 1.8dvh, 14px);
}

@media (max-width: 640px) {
  .topbar {
    gap: 6px 8px;
  }
  .nav-controls {
    width: 100%;
    justify-content: space-between;
  }
  .nav-btn {
    flex: 1;
    justify-content: center;
    padding: 5px 6px;
    font-size: 12px;
  }
  .icon-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .crumb-btn {
    padding: 3px 7px;
    font-size: 12px;
  }
  .ghost-btn {
    padding: 5px 9px;
    font-size: 11px;
  }
  .asm-nuclear-stage {
    transform: scale(0.86);
    transform-origin: center center;
  }
  .texts-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 序境：卜筮之礼 ===== */
.intro-panel {
  gap: clamp(8px, 1.4dvh, 14px);
  padding-top: clamp(18px, 3dvh, 30px);
  padding-bottom: clamp(18px, 3dvh, 28px);
}

.intro-kicker {
  font-size: 12px;
  letter-spacing: 0.5em;
  padding-left: 0.5em;
  color: var(--jade);
  opacity: 0.85;
}

.intro-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(24px, 4.2dvh, 34px);
  letter-spacing: 0.22em;
  color: var(--paper);
  text-shadow: 0 0 18px rgba(31, 28, 24, 0.18);
}

.intro-title-dot {
  color: var(--cinnabar);
  letter-spacing: 0;
}

.intro-source {
  margin-top: -4px;
  font-size: 12px;
  color: var(--ash);
  letter-spacing: 0.1em;
}

.intro-rites {
  list-style: none;
  margin: clamp(4px, 1dvh, 10px) 0 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.3dvh, 12px);
}

.intro-rites li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-rites li:nth-child(1) { animation-delay: 0.08s; }
.intro-rites li:nth-child(2) { animation-delay: 0.2s; }
.intro-rites li:nth-child(3) { animation-delay: 0.32s; }
.intro-rites li:nth-child(4) { animation-delay: 0.44s; }

.rite-num {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--cinnabar);
  border: 1px solid rgba(196, 38, 48, 0.55);
  background: var(--cinnabar-soft);
}

.rite-body b {
  display: block;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--paper);
  margin-bottom: 2px;
}

.rite-body p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--paper-soft);
  letter-spacing: 0.04em;
}













.intro-panel .stage-actions {
  margin-top: clamp(6px, 1.4dvh, 12px);
  opacity: 0;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.68s forwards;
}

.intro-panel .primary-cast-btn {
  letter-spacing: 0.2em;
}

.intro-hint {
  font-size: 11px;
  color: var(--ash-dim);
  letter-spacing: 0.08em;
}

@media (max-width: 640px) {
  .intro-title {
    letter-spacing: 0.14em;
  }
  .rite-body p {
    font-size: 13px;
    line-height: 1.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-rites li,
  .intro-panel .stage-actions {
    animation: none;
    opacity: 1;
  }
}
