/* 周易筮占 · 古籍宣纸风 */

/* ========== 基础变量 ========== */
:root {
  --paper: #efe4c9;
  --paper-light: #f6edd4;
  --paper-dark: #d9c69c;
  --ink: #2a1f14;
  --ink-soft: #5c4a33;
  --ink-faint: #8a7552;
  --vermilion: #a8321e;       /* 朱砂 */
  --vermilion-dark: #7c1f12;
  --gold: #9c6b2f;            /* 描金 */
  --gold-light: #c89a56;
  --seal-red: #b02a1a;
  --yang-ink: #1a1207;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { background: var(--paper); }

body {
  font-family: "Songti SC", "STSong", "KaiTi SC", "KaiTi", "STKaiti",
               "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  color: var(--ink);
  line-height: 1.8;
  min-height: 100vh;
  position: relative;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ========== 宣纸背景 ========== */
.paper-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--paper);
  background-image:
    /* 浅褐斑点做旧 */
    radial-gradient(circle at 18% 22%, rgba(120, 80, 40, 0.06) 0, transparent 1.2%),
    radial-gradient(circle at 72% 38%, rgba(120, 80, 40, 0.05) 0, transparent 1.5%),
    radial-gradient(circle at 45% 78%, rgba(120, 80, 40, 0.07) 0, transparent 2%),
    radial-gradient(circle at 85% 88%, rgba(120, 80, 40, 0.04) 0, transparent 1.5%),
    radial-gradient(circle at 12% 65%, rgba(120, 80, 40, 0.05) 0, transparent 1.2%),
    /* 纤维纹理 */
    repeating-linear-gradient(92deg,
      rgba(139, 95, 43, 0.025) 0 1px,
      transparent 1px 4px),
    repeating-linear-gradient(178deg,
      rgba(139, 95, 43, 0.02) 0 1px,
      transparent 1px 5px),
    /* 四角微暗 */
    radial-gradient(ellipse at 50% 50%,
      transparent 40%,
      rgba(120, 80, 40, 0.08) 100%);
}

/* ========== 页眉 ========== */
.site-header {
  padding: 48px 20px 28px;
  position: relative;
}
.site-header::after {
  content: "";
  display: block;
  max-width: 880px;
  margin: 28px auto 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--gold-light) 15%,
    var(--gold) 50%,
    var(--gold-light) 85%,
    transparent);
  box-shadow: 0 1px 0 rgba(156, 107, 47, 0.15);
}
.header-inner {
  max-width: 880px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.vert-motto {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
  font-size: 0.82rem;
  line-height: 1.6;
  align-self: start;
  padding-top: 10px;
}
.vert-motto.left { justify-self: end; }
.vert-motto.right { justify-self: start; }

.title-block {
  text-align: center;
  position: relative;
  padding: 0 10px;
}
.seal {
  position: absolute;
  top: -10px;
  right: -4px;
  width: 44px;
  height: 44px;
  background: var(--seal-red);
  color: #f8eed8;
  font-family: "STKaiti", "KaiTi", serif;
  font-weight: 700;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 0 2px #8a1e10,
    inset 0 0 0 4px var(--seal-red),
    0 1px 2px rgba(0, 0, 0, 0.15);
  transform: rotate(-6deg);
  border-radius: 3px;
  letter-spacing: 0;
}
.site-header h1 {
  margin: 0;
  font-size: 2.6rem;
  color: var(--vermilion);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(255, 245, 220, 0.5);
  font-family: "STKaiti", "KaiTi SC", "KaiTi", serif;
}
.subtitle {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  letter-spacing: 0.35em;
}

/* ========== 容器 ========== */
.container {
  max-width: 880px;
  margin: 24px auto;
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ========== 面板（古籍书页风） ========== */
.panel {
  background:
    linear-gradient(180deg, rgba(255, 250, 230, 0.6), rgba(246, 237, 212, 0.4)),
    var(--paper-light);
  border: 1px solid var(--gold);
  padding: 32px 34px 28px;
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 220, 0.5),
    inset 0 0 0 6px rgba(156, 107, 47, 0.08),
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 8px 20px rgba(100, 70, 30, 0.08);
}
/* 描金四角 */
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  border: 1.5px solid var(--gold);
  pointer-events: none;
}
.panel::before {
  top: 8px; left: 8px;
  border-right: none; border-bottom: none;
}
.panel::after {
  bottom: 8px; right: 8px;
  border-left: none; border-top: none;
}

/* 面板标题 */
.panel-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -4px 0 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gold-light);
  position: relative;
}
.panel-title::after {
  content: "";
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: var(--gold-light);
  opacity: 0.4;
}
.panel-title .ord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: var(--vermilion);
  color: #f6edd4;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(246, 237, 212, 0.3);
  border-radius: 2px;
}
.panel-title .name {
  font-size: 1.3rem;
  color: var(--vermilion-dark);
  letter-spacing: 0.3em;
  font-weight: 700;
  font-family: "STKaiti", "KaiTi", serif;
}

/* 小节标题 */
.panel h3 {
  margin: 22px 0 12px;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: 0.25em;
  font-weight: 700;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: "STKaiti", "KaiTi", serif;
}
.cn-dash {
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--gold);
  opacity: 0.6;
}

/* ========== 表单字段 ========== */
.field {
  margin-bottom: 18px;
}
.field > label {
  display: block;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
  letter-spacing: 0.2em;
  font-weight: 600;
}

textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--paper-dark);
  background: rgba(255, 250, 230, 0.7);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  outline: none;
  transition: all .2s;
  border-radius: 2px;
}
textarea:focus, input:focus, select:focus {
  border-color: var(--gold);
  background: rgba(255, 250, 230, 0.95);
  box-shadow: 0 0 0 2px rgba(156, 107, 47, 0.12);
}
textarea { resize: vertical; min-height: 60px; }

/* 起卦方式三联卡片 */
.method-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tab {
  padding: 14px 6px;
  border: 1px solid var(--paper-dark);
  background: rgba(255, 250, 230, 0.6);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  transition: all .25s;
  border-radius: 2px;
  position: relative;
}
.tab .tab-title {
  font-size: 1.1rem;
  letter-spacing: 0.3em;
  font-weight: 700;
  font-family: "STKaiti", "KaiTi", serif;
  padding-left: 0.3em;
}
.tab .tab-sub {
  font-size: 0.78rem;
  color: var(--ink-faint);
  letter-spacing: 0.2em;
  margin-top: 4px;
  padding-left: 0.2em;
}
.tab:hover {
  border-color: var(--gold-light);
  background: rgba(255, 245, 215, 0.85);
}
.tab.active {
  background: var(--vermilion);
  color: #f6edd4;
  border-color: var(--vermilion);
  box-shadow: inset 0 0 0 2px rgba(246, 237, 212, 0.25);
}
.tab.active .tab-sub { color: rgba(246, 237, 212, 0.75); }

.num-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hint {
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: var(--ink-faint);
  font-style: italic;
  letter-spacing: 0.05em;
}

/* ========== 按钮 ========== */
.action-row {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}
button.primary {
  padding: 14px 52px;
  border-radius: 2px;
  font-family: "STKaiti", "KaiTi", serif;
  cursor: pointer;
  border: 1px solid var(--vermilion-dark);
  background:
    linear-gradient(180deg, #b63d28, var(--vermilion) 60%, var(--vermilion-dark));
  color: #f6edd4;
  transition: all .2s;
  box-shadow:
    inset 0 0 0 2px rgba(246, 237, 212, 0.18),
    0 2px 0 var(--vermilion-dark),
    0 4px 12px rgba(124, 31, 18, 0.2);
  text-align: center;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
button.primary .btn-main {
  font-size: 1.25rem;
  letter-spacing: 0.5em;
  font-weight: 700;
  padding-left: 0.5em;
}
button.primary .btn-sub {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  opacity: 0.82;
  padding-left: 0.2em;
}
button.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 2px rgba(246, 237, 212, 0.25),
    0 3px 0 var(--vermilion-dark),
    0 8px 18px rgba(124, 31, 18, 0.28);
}
button.primary:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 0 0 2px rgba(246, 237, 212, 0.15),
    0 1px 0 var(--vermilion-dark);
}
button.primary:disabled { opacity: 0.65; cursor: wait; }

button.secondary {
  padding: 8px 22px;
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.92rem;
  letter-spacing: 0.25em;
  cursor: pointer;
  border: 1px solid var(--gold);
  color: var(--vermilion-dark);
  background: rgba(255, 250, 230, 0.7);
  transition: all .2s;
}
button.secondary:hover {
  background: var(--vermilion);
  color: #f6edd4;
  border-color: var(--vermilion);
}

.status {
  margin-top: 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(200, 154, 86, 0.1);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ========== 卦象概览 ========== */
.hex-overview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  padding: 22px 26px;
  background: rgba(255, 250, 230, 0.6);
  border: 1px solid var(--paper-dark);
  border-radius: 2px;
  position: relative;
}
.hex-overview::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(156, 107, 47, 0.15);
  pointer-events: none;
}

.hex-art-wrap {
  padding: 12px 18px;
  background: rgba(239, 228, 201, 0.6);
  border: 1px solid var(--paper-dark);
  border-radius: 2px;
}
.hex-art {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 170px;
}
.hex-art .row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--ink-faint);
  letter-spacing: 0.15em;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .45s ease-out, transform .45s ease-out;
}
.hex-art .row.reveal { opacity: 1; transform: translateX(0); }

.bar {
  position: relative;
  width: 130px;
  height: 14px;
  flex-shrink: 0;
}
.bar.yang::before {
  content: "";
  position: absolute;
  inset: 4px 0;
  background: var(--yang-ink);
  border-radius: 1px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.bar.yin::before, .bar.yin::after {
  content: "";
  position: absolute;
  inset: 4px 0;
  width: 54px;
  background: var(--yang-ink);
  border-radius: 1px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.bar.yin::after { left: auto; right: 0; }

.bar.change::before {
  animation: linePulse 1.2s ease-in-out infinite;
}
.bar.change.yang .mark,
.bar.change.yin .mark {
  position: absolute;
  right: -26px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--vermilion);
  font-weight: 700;
}

@keyframes linePulse {
  0%, 100% { background: var(--yang-ink); }
  50% { background: var(--vermilion); }
}

.hex-meta .hex-name {
  font-size: 2.4rem;
  color: var(--vermilion-dark);
  letter-spacing: 0.3em;
  margin-bottom: 6px;
  font-family: "STKaiti", "KaiTi", serif;
  font-weight: 700;
}
.hex-meta .hex-symbol {
  font-size: 2.8rem;
  line-height: 1;
  color: var(--ink);
  margin-right: 12px;
  vertical-align: -0.15em;
}
.hex-meta .hex-sub {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: 4px;
  letter-spacing: 0.05em;
}
.hex-meta .hex-sub.small {
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* ========== 六爻表 ========== */
.lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
  background: rgba(255, 250, 230, 0.4);
  border: 1px solid var(--paper-dark);
}
.lines-table th, .lines-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px dashed rgba(156, 107, 47, 0.3);
}
.lines-table th {
  background: rgba(200, 154, 86, 0.14);
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 0.15em;
  border-bottom: 1px solid var(--gold-light);
  font-size: 0.88rem;
}
.lines-table tr.changing td {
  background: rgba(168, 50, 30, 0.08);
  color: var(--vermilion-dark);
}
.lines-table tr:last-child td { border-bottom: none; }
.lines-table .sym {
  font-family: "Menlo", "Monaco", monospace;
  letter-spacing: -0.05em;
  color: var(--ink);
}

/* ========== 本卦/变卦信息 ========== */
.hex-info { padding: 4px 0; }
.hex-info p {
  margin: 6px 0;
  line-height: 1.8;
}
.hex-info .label {
  display: inline-block;
  width: 4.5em;
  color: var(--ink-soft);
  letter-spacing: 0.2em;
  font-weight: 600;
}
.hex-info h4 {
  margin: 12px 0 6px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
}

/* ========== 衍生卦卡片 ========== */
.derived-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.derived-card {
  border: 1px solid var(--paper-dark);
  padding: 14px 16px;
  background: rgba(255, 250, 230, 0.5);
  border-radius: 2px;
  position: relative;
}
.derived-card::before {
  content: "";
  position: absolute;
  top: 4px; left: 4px; right: 4px; bottom: 4px;
  border: 1px solid rgba(156, 107, 47, 0.15);
  pointer-events: none;
}
.derived-card .kind {
  color: var(--vermilion-dark);
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  margin-bottom: 6px;
  font-weight: 700;
  font-family: "STKaiti", "KaiTi", serif;
}
.derived-card .name {
  font-size: 1.15rem;
  color: var(--ink);
  font-weight: 700;
  font-family: "STKaiti", "KaiTi", serif;
}
.derived-card .sym {
  font-size: 1.6rem;
  margin-right: 8px;
  vertical-align: -0.1em;
}
.derived-card .judg {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ========== 解卦指引 ========== */
.guide {
  white-space: pre-wrap;
  background: rgba(255, 250, 230, 0.5);
  padding: 14px 18px;
  border: 1px solid var(--paper-dark);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.96rem;
  margin: 0;
  line-height: 1.85;
  color: var(--ink);
}

/* ========== 提示词 ========== */
.prompt-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.copy-status {
  font-size: 0.88rem;
  color: var(--vermilion-dark);
  opacity: 0;
  transition: opacity .25s;
}
.copy-status.show { opacity: 1; }
#promptText {
  font-family: "Menlo", "Monaco", "Consolas", "Courier New", monospace;
  font-size: 0.86rem;
  line-height: 1.65;
  background: rgba(255, 250, 230, 0.55);
  border: 1px solid var(--paper-dark);
  color: var(--ink);
}

/* ========== 页脚 ========== */
.site-footer {
  text-align: center;
  padding: 32px 10px 44px;
  color: var(--ink-faint);
  font-size: 0.88rem;
  letter-spacing: 0.5em;
  padding-left: 0.5em;
}
.footer-line {
  max-width: 300px;
  height: 1px;
  margin: 0 auto 20px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
}

/* ========== 起卦仪式遮罩 ========== */
.ritual-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .6s ease-out;
}
.ritual-overlay[hidden] { display: none !important; }
.ritual-stage[hidden] { display: none !important; }
.ritual-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center,
    rgba(42, 31, 20, 0.88) 0%,
    rgba(20, 14, 8, 0.96) 70%);
  backdrop-filter: blur(4px);
}
.ritual-content {
  position: relative;
  text-align: center;
  color: #f6edd4;
  max-width: 520px;
  padding: 40px 30px;
  width: 90%;
}
.ritual-seal {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  background: var(--seal-red);
  color: #f8eed8;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 0 2px #8a1e10,
    inset 0 0 0 5px var(--seal-red),
    0 2px 10px rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  animation: sealPulse 2.4s ease-in-out infinite;
}
@keyframes sealPulse {
  0%, 100% { box-shadow: inset 0 0 0 2px #8a1e10, inset 0 0 0 5px var(--seal-red), 0 2px 10px rgba(0, 0, 0, 0.4); }
  50% { box-shadow: inset 0 0 0 2px #8a1e10, inset 0 0 0 5px var(--seal-red), 0 2px 24px rgba(168, 50, 30, 0.7); }
}

.ritual-stage {
  margin-top: 60px;
  animation: stageEnter .7s ease-out;
}
@keyframes stageEnter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ritual-title {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 2rem;
  letter-spacing: 0.5em;
  padding-left: 0.5em;
  color: #e8c97a;
  margin-bottom: 22px;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(232, 201, 122, 0.35);
}
.ritual-quote {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.1rem;
  line-height: 2;
  letter-spacing: 0.3em;
  color: rgba(246, 237, 212, 0.8);
  margin-bottom: 24px;
}
.ritual-question {
  font-size: 1rem;
  color: #f8dc9a;
  letter-spacing: 0.1em;
  margin: 16px 0 22px;
  padding: 10px 16px;
  border-top: 1px solid rgba(200, 154, 86, 0.4);
  border-bottom: 1px solid rgba(200, 154, 86, 0.4);
  font-style: italic;
  min-height: 1.6em;
}
.ritual-question:empty { display: none; }
.ritual-countdown {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 5rem;
  font-weight: 700;
  color: #e8c97a;
  line-height: 1;
  margin: 10px 0 12px;
  text-shadow: 0 0 30px rgba(232, 201, 122, 0.5);
  animation: countPop .9s ease-out;
}
@keyframes countPop {
  0% { opacity: 0; transform: scale(1.4); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}
.ritual-hint {
  font-size: 0.92rem;
  color: rgba(246, 237, 212, 0.65);
  letter-spacing: 0.2em;
  margin-top: 14px;
}

/* 摇卦铜钱 */
.ritual-coins {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 30px 0 20px;
  perspective: 600px;
}
.coin {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #e8c97a, #9c6b2f 70%, #6b4518);
  border: 2px solid #6b4518;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    inset 0 0 0 4px rgba(107, 69, 24, 0.5),
    inset 0 0 10px rgba(0, 0, 0, 0.3),
    0 4px 10px rgba(0, 0, 0, 0.4);
  animation: coinFlip 1.2s ease-in-out infinite;
}
.coin::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1.5px solid #5c3a12;
  background: #3a2510;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.5);
}
.coin span {
  display: none;
}
.coin:nth-child(2) { animation-delay: .25s; }
.coin:nth-child(3) { animation-delay: .5s; }

@keyframes coinFlip {
  0%   { transform: rotateY(0deg) translateY(0); }
  25%  { transform: rotateY(180deg) translateY(-18px); }
  50%  { transform: rotateY(360deg) translateY(0); }
  75%  { transform: rotateY(540deg) translateY(-10px); }
  100% { transform: rotateY(720deg) translateY(0); }
}

/* 蓍草 */
.ritual-coins.yarrow {
  gap: 10px;
  align-items: flex-end;
  height: 90px;
}
.stalk {
  width: 5px;
  height: 70px;
  background: linear-gradient(180deg, #e8c97a, #9c6b2f);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(232, 201, 122, 0.4);
  transform-origin: bottom center;
  animation: stalkSway 1.4s ease-in-out infinite;
}
@keyframes stalkSway {
  0%, 100% { transform: rotate(-8deg) translateY(0); opacity: 0.8; }
  50% { transform: rotate(10deg) translateY(-6px); opacity: 1; }
}

/* 数字/八卦字 */
.ritual-coins.numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 320px;
  margin: 30px auto 20px;
}
.numglyph {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #e8c97a;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(232, 201, 122, 0.5);
  background: rgba(42, 31, 20, 0.5);
  border-radius: 2px;
  text-shadow: 0 0 10px rgba(232, 201, 122, 0.5);
  animation: glyphGlow 1.6s ease-in-out infinite;
}
@keyframes glyphGlow {
  0%, 100% { opacity: 0.4; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.05); box-shadow: 0 0 16px rgba(232, 201, 122, 0.4); }
}

/* 揭示阶段 */
.ritual-hex {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin: 20px 0 14px;
}
.ritual-hex .row {
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .55s ease-out, transform .55s ease-out;
}
.ritual-hex .row.reveal { opacity: 1; transform: translateY(0); }
.ritual-hex .bar {
  width: 160px;
  height: 16px;
}
.ritual-hex .bar.yang::before,
.ritual-hex .bar.yin::before,
.ritual-hex .bar.yin::after {
  background: #e8c97a;
  box-shadow: 0 0 8px rgba(232, 201, 122, 0.5);
}
.ritual-hex .bar.change::before {
  animation: changeGlow 1.4s ease-in-out infinite;
}
@keyframes changeGlow {
  0%, 100% { background: #e8c97a; box-shadow: 0 0 8px rgba(232, 201, 122, 0.5); }
  50% { background: #d8452e; box-shadow: 0 0 16px rgba(216, 69, 46, 0.7); }
}
.ritual-hex .label {
  font-size: 0.8rem;
  color: rgba(246, 237, 212, 0.6);
  letter-spacing: 0.15em;
  min-width: 3.5em;
  text-align: left;
}

.ritual-skip {
  margin-top: 24px;
  padding: 6px 16px;
  background: transparent;
  color: rgba(246, 237, 212, 0.55);
  border: 1px solid rgba(246, 237, 212, 0.3);
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  cursor: pointer;
  font-family: inherit;
  border-radius: 2px;
  transition: all .2s;
}
.ritual-skip:hover {
  color: #f6edd4;
  border-color: rgba(246, 237, 212, 0.6);
}

/* ========== 结果进入动画 ========== */
#resultSection, #promptSection {
  animation: panelEnter .8s ease-out;
}
@keyframes panelEnter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 响应式 ========== */
@media (max-width: 720px) {
  .header-inner { grid-template-columns: 1fr; }
  .vert-motto { display: none; }
  .site-header h1 { font-size: 2rem; letter-spacing: 0.3em; }
  .panel { padding: 26px 20px 22px; }
  .hex-overview { grid-template-columns: 1fr; gap: 20px; }
  .num-inputs { grid-template-columns: 1fr; }
  .method-tabs { grid-template-columns: 1fr; }
  .hex-meta .hex-name { font-size: 1.8rem; }
  .ritual-title { font-size: 1.5rem; }
  .ritual-countdown { font-size: 4rem; }
  .coin { width: 54px; height: 54px; }
  .coin::before { inset: 18px; }
}
