:root {
  --ink: #161914;
  --ink-soft: #2c322c;
  --muted: #6a7268;
  --line: rgba(22, 25, 20, 0.12);
  --line-strong: rgba(22, 25, 20, 0.22);
  --paper: #eef1ea;
  --paper-deep: #e4e8e0;
  --panel: rgba(250, 252, 247, 0.72);
  --lacquer: #a33a2c;
  --lacquer-deep: #7e2a20;
  --celadon: #2f5d4a;
  --amber: #8a5a12;
  --display: "ZCOOL XiaoWei", "Noto Serif SC", "Songti SC", serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  position: relative;
  font-family: var(--sans);
  color: var(--ink);
  background: #1c211e;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--lacquer);
  outline-offset: 2px;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 12% -8%, rgba(163, 58, 44, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 92% 18%, rgba(47, 93, 74, 0.22), transparent 50%),
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(250, 252, 247, 0.06), transparent 45%),
    linear-gradient(165deg, #232a26 0%, #1c211e 42%, #151916 100%);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: soft-light;
}

#app {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 120px),
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(22, 25, 20, 0.05) calc(100% - 1px)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(47, 93, 74, 0.035) 27px,
      rgba(47, 93, 74, 0.035) 28px
    ),
    var(--paper);
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 0 1px rgba(250, 252, 247, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.35);
}
#app::before {
  content: "";
  height: 2px;
  flex: none;
  background: linear-gradient(90deg, transparent, var(--lacquer) 18%, var(--lacquer-deep) 50%, var(--lacquer) 82%, transparent);
}
#app::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: multiply;
}

#top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 14px 20px 8px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  animation: brand-in 0.7s var(--ease) both;
}
.brand-mini {
  margin-left: auto;
  animation: none;
}
.brand-mini .seal {
  width: 28px;
  height: 28px;
  font-size: 15px;
  animation: none;
}
.brand-mini b {
  font-size: 16px;
  letter-spacing: 0.14em;
}
.brand b {
  display: block;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.18em;
  line-height: 1.15;
}
.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.22em;
}
.seal {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--lacquer);
  color: var(--lacquer);
  font-family: var(--display);
  font-style: normal;
  font-size: 22px;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 30% 25%, rgba(163, 58, 44, 0.12), transparent 55%),
    rgba(163, 58, 44, 0.04);
  box-shadow: inset 0 0 0 3px rgba(163, 58, 44, 0.08);
  animation: stamp 0.85s var(--ease) both;
}
.seal::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(163, 58, 44, 0.28);
  pointer-events: none;
}
.back {
  border: 0;
  background: transparent;
  padding: 8px 0;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--lacquer);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.back span {
  font-size: 16px;
  line-height: 1;
}

#main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 20px 40px;
}
.stage {
  animation: rise 0.55s var(--ease) both;
}

#nav {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: rgba(238, 241, 234, 0.92);
  backdrop-filter: blur(10px);
  padding-bottom: env(safe-area-inset-bottom);
}
#nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12.5%;
  width: 25%;
  height: 2px;
  background: var(--lacquer);
  transform: translateX(-50%);
  transition: left 0.35s var(--ease);
}
#nav[data-tab="cast"]::before { left: 12.5%; }
#nav[data-tab="book"]::before { left: 37.5%; }
#nav[data-tab="bagua"]::before { left: 62.5%; }
#nav[data-tab="log"]::before { left: 87.5%; }
#nav button {
  border: 0;
  background: transparent;
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  touch-action: manipulation;
  transition: color 0.25s ease;
}
#nav button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  transition: transform 0.35s var(--ease);
}
#nav button.on {
  color: var(--lacquer-deep);
  font-weight: 600;
}
#nav button.on svg { transform: translateY(-1px); }

h1, h2, p { margin: 0; }
h1 {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.25;
}
h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.kicker {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: none;
}
.muted { color: var(--muted); }
.classic {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.85;
}
.footer-note {
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.cast-lead,
.page-lead {
  position: relative;
  margin: 4px 0 24px;
  padding: 8px 0 22px;
  border-bottom: 1px solid var(--line);
}
.page-lead.compact {
  margin-bottom: 16px;
  padding-bottom: 16px;
}
.cast-lead::before,
.page-lead::before {
  content: "梅";
  position: absolute;
  right: -4px;
  top: -10px;
  font-family: var(--display);
  font-size: 84px;
  line-height: 1;
  color: rgba(163, 58, 44, 0.07);
  pointer-events: none;
  letter-spacing: 0;
}
.page-lead::before { content: "易"; }
.lead-title,
.cast-lead .lead-title {
  font-family: var(--display);
  font-size: 34px;
  letter-spacing: 0.2em;
  line-height: 1.2;
}
.cast-lead .lead-copy {
  margin-top: 14px;
  max-width: 22em;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
  letter-spacing: 0.04em;
}

.num-board,
.time-board {
  position: relative;
  margin: 0 0 24px;
  padding: 22px 16px 18px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.18)),
    rgba(47, 93, 74, 0.04);
  border: 1px solid var(--line);
}
.num-board::before,
.time-board::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(22, 25, 20, 0.05);
  pointer-events: none;
}
.num-board-label {
  margin-bottom: 16px;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--muted);
  text-align: center;
}
.num-board .fields { gap: 14px; }
.num-board .field { margin-bottom: 0; }
.num-board .field span {
  text-align: center;
  letter-spacing: 0.28em;
  margin-bottom: 10px;
}
.num-board input {
  text-align: center;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.08em;
  padding: 14px 12px 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid transparent;
  border-bottom: 1px solid var(--line-strong);
}
.num-board input:focus {
  border-color: rgba(163, 58, 44, 0.22);
  border-bottom-color: var(--lacquer);
}
.num-board .preview {
  margin: 18px 0 0;
  text-align: center;
}
.time-board .btn { position: relative; z-index: 1; }
.time-hint {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 4px 0 22px;
  border-bottom: 1px solid var(--line);
}
.seg button {
  position: relative;
  border: 0;
  background: transparent;
  height: 48px;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.seg button.on {
  color: var(--ink);
  font-weight: 600;
}
.seg button.on::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -1px;
  height: 2px;
  background: var(--lacquer);
}

.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.field { margin-bottom: 20px; min-width: 0; }
.field span, .search span {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}
input, select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 13px 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
input[type="search"] {
  padding-left: 14px;
  padding-right: 14px;
}
input:focus, select:focus {
  background: rgba(255, 255, 255, 0.85);
  border-bottom-color: var(--lacquer);
  outline: none;
}
.preview {
  min-height: 1.4em;
  margin: 4px 0 18px;
  color: var(--celadon);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.04em;
  line-height: 1.6;
}
.form-error {
  min-height: 1.2em;
  margin: 12px 0 0;
  color: var(--lacquer);
  font-size: 13px;
}
.btn {
  width: 100%;
  height: 52px;
  border-radius: 0;
  border: 1px solid transparent;
  touch-action: manipulation;
  letter-spacing: 0.28em;
  transition: transform 0.2s var(--ease), background 0.2s ease, color 0.2s ease;
}
.btn.primary {
  background: var(--lacquer-deep);
  color: #f7f3ee;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  letter-spacing: 0.16em;
}
.btn + .btn { margin-top: 12px; }
.row-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}
.row-actions .btn { margin: 0; }
@media (hover: hover) {
  .btn.primary:hover { background: var(--lacquer); }
  .btn.ghost:hover { border-color: var(--lacquer); color: var(--lacquer-deep); }
  .btn:active { transform: translateY(1px); }
}

.help {
  margin-top: 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.help summary {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.help p + p { margin-top: 12px; }

.card, .judgment, .yao-card, .slab {
  position: relative;
  background: var(--panel);
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 22px 6px;
  margin-top: 18px;
}
.slab {
  padding: 22px 4px;
  background: transparent;
}
.slab-soft {
  background: linear-gradient(90deg, rgba(22, 25, 20, 0.03), transparent 70%);
}
.slab-gap { margin-top: 18px; }
.gloss-inline {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.result-hero {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: center;
  margin: 8px 0 8px;
  padding: 10px 0 22px;
  border-bottom: 1px solid var(--line);
}
.result-fig {
  padding: 16px 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(163, 58, 44, 0.08), transparent 62%),
    rgba(255, 255, 255, 0.42);
  border: 1px solid var(--line);
}
.result-meta .meta-line {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}
.result-meta .meta-move {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.06em;
}
.result-meta .meta-move span {
  display: block;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.judgment {
  padding: 24px 16px 22px;
  border-left: 3px solid var(--muted);
  background:
    linear-gradient(105deg, rgba(47, 93, 74, 0.07), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(250, 252, 247, 0.3));
  animation: judgment-in 0.65s var(--ease) both;
  animation-delay: 0.12s;
}
.judgment[data-tone="ok"] { border-left-color: var(--celadon); }
.judgment[data-tone="warn"] { border-left-color: var(--amber); }
.judgment[data-tone="bad"] {
  border-left-color: var(--lacquer);
  background:
    linear-gradient(105deg, rgba(163, 58, 44, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(250, 252, 247, 0.3));
}
.judgment h2 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.14em;
}
.tone {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 0;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  vertical-align: 5px;
}
.tone.ok { color: var(--celadon); background: rgba(47, 93, 74, 0.08); }
.tone.warn { color: var(--amber); background: rgba(138, 90, 18, 0.08); }
.tone.bad { color: var(--lacquer); background: rgba(163, 58, 44, 0.08); }
.judgment .classic, .phase { margin-top: 14px; font-size: 15px; line-height: 1.8; }
.tiyong {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}
.tiyong .side {
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.55);
  border-top: 1px solid var(--line);
}
.tiyong span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.tiyong strong {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  margin: 8px 0 6px;
  letter-spacing: 0.08em;
}
.tiyong small { color: var(--muted); font-size: 12px; line-height: 1.6; }

.trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.trio button, .hit, .log-item, .rel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
  border-radius: 0;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.trio button { padding: 14px 6px 12px; text-align: center; }
.trio button.on {
  border-color: var(--lacquer);
  background: rgba(163, 58, 44, 0.05);
}
.trio b {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.trio small, .hit small, .log-item small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.04em;
}

.fig {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 92px;
  max-width: 100%;
  margin: 0 auto;
  min-width: 0;
}
.line {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 6px;
  color: var(--ink);
}
.bars {
  flex: 1;
  display: flex;
  gap: 10px;
  height: 6px;
}
.bars i {
  display: block;
  flex: 1;
  min-width: 0;
  background: currentColor;
  border-radius: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
.line em {
  flex: none;
  width: 14px;
  font-style: normal;
  font-size: 10px;
  line-height: 1;
  color: var(--lacquer);
  letter-spacing: 0;
}
.line.move { color: var(--lacquer); }
.fig.draw .line {
  animation: line-draw 0.55s var(--ease) both;
}
.fig.draw .line:nth-child(1) { animation-delay: 0.05s; }
.fig.draw .line:nth-child(2) { animation-delay: 0.12s; }
.fig.draw .line:nth-child(3) { animation-delay: 0.19s; }
.fig.draw .line:nth-child(4) { animation-delay: 0.26s; }
.fig.draw .line:nth-child(5) { animation-delay: 0.33s; }
.fig.draw .line:nth-child(6) { animation-delay: 0.4s; }
.fig.mini, .fig.tri { width: 44px; gap: 3px; }
.fig.mini .line, .fig.mini .bars, .fig.tri .line, .fig.tri .bars { height: 4px; }
.fig.mini .bars, .fig.tri .bars { gap: 4px; }
.fig.tri { width: 52px; gap: 5px; }
.fig.tri .line, .fig.tri .bars { height: 6px; }
.trio .fig { width: 68px; gap: 5px; }
.trio .line, .trio .bars { height: 6px; }
.trio .bars { gap: 5px; }

.steps { margin: 12px 0 0; padding-left: 1.25em; line-height: 1.85; }
.steps li + li { margin-top: 8px; }
.read {
  margin: 18px 0 0;
  padding-left: 1.2em;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.read li + li { margin-top: 6px; }

.question {
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.04em;
  line-height: 1.6;
}
.yao + .yao { border-top: 1px solid var(--line); }
.yao { padding: 18px 0; }
.yao .who {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--lacquer);
  margin-bottom: 8px;
}
.xiao {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.extra {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.gua-head {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 16px;
  align-items: center;
  padding-bottom: 12px;
}
.gloss {
  margin-top: 20px;
  padding: 18px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  line-height: 1.85;
  background: linear-gradient(90deg, rgba(163, 58, 44, 0.06), transparent 70%);
}
.gloss .kicker { display: block; margin-bottom: 10px; }
.block { margin-top: 26px; }
.block h2 {
  font-size: 13px;
  letter-spacing: 0.28em;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--sans);
}
.rels { display: grid; gap: 10px; margin-top: 22px; }
.rel { display: block; width: 100%; padding: 14px 16px; }
.rel b { font-family: var(--serif); letter-spacing: 0.04em; }

.search {
  display: block;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 0 16px;
  background: linear-gradient(var(--paper) 72%, rgba(238, 241, 234, 0));
}
.section-title {
  margin: 20px 0 14px;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.cell {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
  border-radius: 0;
  padding: 12px 4px 10px;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.cell-name {
  display: block;
  margin-top: 9px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.08em;
}
.cell-no {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.hits { display: grid; gap: 10px; }
.hit {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
}
.hit .no {
  font-family: var(--display);
  font-size: 22px;
  text-align: center;
  color: var(--lacquer-deep);
}
.empty {
  padding: 48px 12px;
  text-align: center;
  color: var(--muted);
  line-height: 1.9;
  letter-spacing: 0.06em;
}

.bagua { display: grid; gap: 12px; }
.bagua article {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.35);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.bagua-mark {
  display: grid;
  justify-items: center;
  gap: 10px;
}
.bagua-num {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(163, 58, 44, 0.35);
  color: var(--lacquer-deep);
  font-family: var(--display);
  font-size: 13px;
  line-height: 1;
}
.bagua h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.12em;
}
.bagua p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.lead {
  margin: 12px 0 0;
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: 28em;
}
.cycle {
  margin: 4px 0 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  line-height: 1.9;
  font-size: 14px;
  font-family: var(--serif);
  letter-spacing: 0.02em;
}

.log-item {
  display: block;
  width: 100%;
  padding: 16px;
  margin-bottom: 10px;
}
.log-item b {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.06em;
}
.log-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.drop, .open-log {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 12px;
}
.open-log {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: left;
  color: var(--ink);
}
.open-log small { margin-top: 6px; }
.error { color: var(--lacquer); line-height: 1.7; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes stamp {
  0% {
    opacity: 0;
    transform: scale(1.18) rotate(-8deg);
  }
  60% {
    opacity: 1;
    transform: scale(0.96) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
@keyframes line-draw {
  from {
    opacity: 0;
    transform: scaleX(0.2);
    transform-origin: left center;
  }
  to {
    opacity: 1;
    transform: scaleX(1);
    transform-origin: left center;
  }
}
@keyframes judgment-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) {
  .cell:hover, .hit:hover, .log-item:hover, .rel:hover, .trio button:hover, .bagua article:hover {
    background: rgba(163, 58, 44, 0.06);
    border-color: rgba(163, 58, 44, 0.28);
  }
}
@media (min-width: 900px) {
  body { padding: 28px 0; }
  #app {
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
    overflow: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage, .brand, .seal, .fig.draw .line, .judgment, #nav::before, #nav button svg {
    animation: none !important;
    transition: none !important;
  }
}
