/* ============================================================
   通玄 TONGXUAN · 六爻起卦 liuyao.css
   ============================================================ */

/* ================= 页首 ================= */
.ly-hero {
  position: relative;
  min-height: 46vh;
  padding: calc(var(--nav-h) + 64px) 24px 96px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, #22305a 0%, transparent 60%),
    linear-gradient(180deg, #101a34 0%, var(--ink-900) 60%, var(--ink-950) 100%);
}
.ly-hero-stars { position: absolute; inset: 0; }
.ly-hero-content { position: relative; }
.ly-hero-title {
  margin-top: 20px;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: 0.18em; text-indent: 0.18em;
  background: linear-gradient(168deg, #f4e3b8 8%, var(--gold-400) 40%, var(--gold-600) 95%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 4px 22px rgba(212, 175, 106, 0.22));
}
.ly-hero-sub {
  margin-top: 18px;
  font-size: 14.5px;
  letter-spacing: 0.1em;
  line-height: 2.1;
  color: var(--text-mid);
  max-width: 620px;
}
.ly-hero-edge {
  position: absolute; left: 0; right: 0; bottom: -1px;
  width: 100%; height: 70px;
}
.ly-hero-edge path { fill: var(--paper-100); }

/* ================= 幕布通用 ================= */
.ly-act { padding: 96px 0 110px; }

/* ================= 问卦帖 ================= */
.ly-card {
  max-width: 760px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(150, 114, 58, 0.4);
  box-shadow: 0 24px 60px rgba(60, 48, 22, 0.14);
  background: var(--paper-50);
}
.ly-card-head {
  position: relative;
  text-align: center;
  padding: 34px 28px 30px;
  background:
    radial-gradient(ellipse 120% 100% at 50% -30%, rgba(212, 175, 106, 0.14), transparent 60%),
    linear-gradient(155deg, var(--ink-800), var(--ink-950));
}
.ly-card-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-serif);
  font-size: 12.5px; letter-spacing: 0.4em; text-indent: 0.4em;
  color: var(--gold-500);
}
.ly-card-eyebrow::before, .ly-card-eyebrow::after {
  content: ""; width: 30px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-600));
}
.ly-card-eyebrow::after { transform: scaleX(-1); }
.ly-card-title {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 30px; font-weight: 700;
  letter-spacing: 0.5em; text-indent: 0.5em;
  color: var(--gold-300);
}
.ly-card-guide {
  margin-top: 10px;
  font-size: 13px; letter-spacing: 0.14em;
  color: var(--text-low);
}
.ly-card-body { padding: 36px 44px 40px; }

.ly-field-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 14.5px; font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--paper-ink);
  margin-bottom: 14px;
}
.ly-field-label-2 { margin-top: 30px; }
.ly-card-body textarea {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-size: 15.5px; line-height: 1.9; letter-spacing: 0.03em;
  color: var(--paper-ink);
  background: rgba(255, 253, 246, 0.7);
  border: 1px solid rgba(150, 114, 58, 0.35);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.ly-card-body textarea::placeholder { color: rgba(107, 100, 85, 0.55); }
.ly-card-body textarea:focus {
  border-color: var(--gold-600);
  box-shadow: 0 0 0 3px rgba(212, 175, 106, 0.18);
}
.ly-field-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--cinnabar);
  letter-spacing: 0.06em;
}
.ly-card.shake { animation: lyShake 0.5s var(--ease-out); }
@keyframes lyShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

.ly-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ly-chip {
  padding: 8px 22px;
  font-family: var(--font-serif);
  font-size: 14.5px; letter-spacing: 0.12em; text-indent: 0.12em;
  color: var(--paper-ink-soft);
  border: 1px solid rgba(107, 100, 85, 0.35);
  border-radius: 999px;
  background: transparent;
  transition: all 0.3s var(--ease-out);
}
.ly-chip:hover { border-color: var(--gold-600); color: var(--gold-700); transform: translateY(-2px); }
.ly-chip.active {
  color: #fdf8ea;
  background: linear-gradient(150deg, var(--ink-700), var(--ink-950));
  border-color: var(--gold-600);
  box-shadow: 0 6px 16px rgba(13, 20, 38, 0.28);
}
.ly-card-actions { margin-top: 36px; text-align: center; }

/* ================= 第二幕 · 掷币 ================= */
.ly-stage {
  position: relative;
  padding: 100px 0 120px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(43, 59, 98, 0.45), transparent 62%),
    linear-gradient(180deg, var(--ink-950), var(--ink-900) 55%, var(--ink-950));
}
.ly-stage-stars { position: absolute; inset: 0; }
.ly-stage-inner { position: relative; }
.ly-stage-lock {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 14.5px; letter-spacing: 0.14em;
  color: var(--text-low);
  padding: 10px 0 26px;
}
.ly-stage-question {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 16px; letter-spacing: 0.1em;
  color: var(--gold-300);
  padding: 4px 24px 30px;
}
.ly-stage.locked .ly-stage-grid { opacity: 0.32; filter: saturate(0.6); pointer-events: none; }
.ly-stage-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 40px;
  align-items: stretch;
  transition: opacity 0.6s var(--ease-soft), filter 0.6s;
}

/* —— 掷币台 —— */
.ly-toss-panel {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  padding: 44px 28px 38px;
  border: 1px solid rgba(212, 175, 106, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(17, 26, 48, 0.55);
  backdrop-filter: blur(6px);
}
.ly-coins {
  display: flex; gap: 40px;
  padding: 20px 0 8px;
}
.coin {
  position: relative;
  width: 92px; height: 92px;
  perspective: 500px;
}
.coin.is-idle .coin-inner { animation: coinIdle 4.2s ease-in-out infinite alternate; }
.coin:nth-child(2).is-idle .coin-inner { animation-delay: 1.2s; }
.coin:nth-child(3).is-idle .coin-inner { animation-delay: 2.3s; }
@keyframes coinIdle {
  from { transform: translateY(0) rotateX(0); }
  to   { transform: translateY(-7px) rotateX(10deg); }
}
.coin-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
}
.coin.tossing { animation: coinHop var(--toss-dur, 1.1s) var(--ease-out); }
.coin.tossing .coin-inner {
  transition: transform var(--toss-dur, 1.1s) cubic-bezier(0.32, 0.72, 0.35, 1.02);
}
@keyframes coinHop {
  0%   { transform: translateY(0); }
  38%  { transform: translateY(-56px); }
  72%  { transform: translateY(4px); }
  86%  { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}
.coin-face {
  position: absolute; inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background:
    radial-gradient(circle at 34% 30%, #f0dcae 0%, #d4af6a 42%, #a87f3f 78%, #8a6630 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 244, 214, 0.75),
    inset 0 -3px 6px rgba(90, 62, 22, 0.55),
    0 6px 18px rgba(5, 8, 18, 0.55);
}
.coin-face::before {                 /* 外圈阴线 */
  content: "";
  position: absolute; inset: 7px;
  border-radius: 50%;
  border: 1.5px solid rgba(120, 88, 36, 0.5);
  box-shadow: inset 0 1px 2px rgba(255, 244, 214, 0.4);
}
.coin-back { transform: rotateX(180deg); }
.coin-back::after {                  /* 背面素纹 */
  content: "";
  position: absolute; inset: 24px;
  border-radius: 50%;
  border: 1px solid rgba(120, 88, 36, 0.35);
}
.coin-hole {
  position: absolute; left: 50%; top: 50%;
  width: 24px; height: 24px;
  transform: translate(-50%, -50%);
  background: linear-gradient(160deg, var(--ink-900), var(--ink-700));
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.7),
    0 1px 1px rgba(255, 244, 214, 0.5);
  border-radius: 3px;
}
.coin-char {
  position: absolute;
  font-family: var(--font-serif);
  font-size: 15px; font-weight: 700;
  color: rgba(90, 62, 22, 0.88);
  text-shadow: 0 1px 1px rgba(255, 244, 214, 0.5);
}
.c-top    { top: 8px;  left: 50%; transform: translateX(-50%); }
.c-bottom { bottom: 8px; left: 50%; transform: translateX(-50%); }
.c-left   { left: 10px;  top: 50%; transform: translateY(-50%); }
.c-right  { right: 10px; top: 50%; transform: translateY(-50%); }
.coin-shine {
  position: absolute; inset: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255, 250, 230, 0.85), transparent 60%);
}
.coin.landed .coin-shine { animation: coinShine 0.7s var(--ease-out); }
@keyframes coinShine { 0% { opacity: 0.9; } 100% { opacity: 0; } }
.coin-tag {
  position: absolute; left: 50%; bottom: -30px;
  transform: translateX(-50%);
  font-family: var(--font-serif);
  font-size: 14px; letter-spacing: 0.2em; text-indent: 0.2em;
  color: var(--gold-400);
  opacity: 0;
  transition: opacity 0.4s;
}
.coin.landed .coin-tag { opacity: 1; }

.ly-toss-status {
  margin-top: 44px;
  min-height: 30px;
  font-family: var(--font-serif);
  font-size: 15px; letter-spacing: 0.12em;
  color: var(--text-mid);
  text-align: center;
}
.ly-toss-status b { color: var(--gold-300); font-weight: 600; }
.ly-toss-actions {
  margin-top: 22px;
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
}
.ly-toss-actions .btn[disabled] { opacity: 0.45; pointer-events: none; }

/* —— 卦架 —— */
.ly-rack-panel {
  padding: 34px 34px 30px;
  border: 1px solid rgba(212, 175, 106, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(17, 26, 48, 0.55);
  backdrop-filter: blur(6px);
}
.ly-rack-cap {
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--gold-400);
  margin-bottom: 20px;
}
.ly-rack-cap span { font-size: 12.5px; color: var(--text-low); letter-spacing: 0.1em; }
.ly-rack {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column-reverse;   /* 初爻在下 */
  gap: 15px;
}
.ly-slot {
  display: grid;
  grid-template-columns: 44px 1fr 26px 74px;
  align-items: center; gap: 12px;
}
.ly-slot-name {
  font-family: var(--font-serif);
  font-size: 13px; letter-spacing: 0.14em;
  color: var(--text-low);
}
.ly-slot-line { display: flex; gap: 10px; height: 14px; }
.ly-slot-ph {
  flex: 1;
  border-radius: 3px;
  border: 1px dashed rgba(212, 175, 106, 0.25);
}
.ly-line-yang, .ly-line-yin {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #a8813f, var(--gold-400) 50%, #a8813f);
  box-shadow: 0 0 10px rgba(212, 175, 106, 0.35), inset 0 1px 0 rgba(255, 246, 220, 0.5);
}
.ly-line-yang { flex: 1; }
.ly-line-yin { flex: 1; }
.ly-slot.filled .ly-slot-line { animation: slotFlash 0.8s var(--ease-out); }
@keyframes slotFlash {
  0%   { filter: brightness(2.2) drop-shadow(0 0 14px rgba(240, 220, 174, 0.9)); }
  100% { filter: none; }
}
.ly-slot-mark {
  font-size: 15px;
  text-align: center;
  color: var(--cinnabar);
  font-weight: 700;
}
.ly-slot-mark.moving { animation: markPulse 1.8s ease-in-out infinite; color: #e0705f; }
@keyframes markPulse {
  0%, 100% { text-shadow: 0 0 4px rgba(224, 112, 95, 0.4); opacity: 0.85; }
  50%      { text-shadow: 0 0 14px rgba(224, 112, 95, 0.95); opacity: 1; }
}
.ly-slot-num {
  font-size: 12px; letter-spacing: 0.08em;
  color: var(--text-low);
  text-align: right;
  white-space: nowrap;
}
.ly-slot-num b { color: var(--gold-400); font-weight: 600; }

/* ================= 第三幕 · 卦象 ================= */
.ly-gua-wrap {
  display: flex; align-items: stretch; justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}
.ly-gua {
  flex: 0 1 380px;
  text-align: center;
  padding: 36px 34px 32px;
  background: rgba(250, 247, 239, 0.8);
  border: 1px solid rgba(150, 114, 58, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 40px rgba(60, 48, 22, 0.12);
}
.ly-gua-bian { background: rgba(250, 247, 239, 0.55); }
.ly-gua-label {
  font-family: var(--font-serif);
  font-size: 13.5px; letter-spacing: 0.4em; text-indent: 0.4em;
  color: var(--paper-ink-soft);
}
.ly-gua-label .badge { margin-left: 6px; vertical-align: 1px; }
.ly-gua-name {
  margin-top: 16px;
  font-size: clamp(38px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: 0.1em; text-indent: 0.1em;
  line-height: 1.3;
  background: linear-gradient(170deg, #8f6f35, #b8914b 50%, #d4af6a);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.ly-gua-tri {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: 15px; letter-spacing: 0.14em;
  color: var(--paper-ink-soft);
}
.ly-gua-lines {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: 132px;
  margin: 22px auto 0;
}
.ly-gua-lines .row { display: flex; gap: 8px; height: 10px; position: relative; }
.ly-gua-lines .row i {
  flex: 1; border-radius: 2px;
  background: linear-gradient(90deg, #8a6630, var(--gold-600));
}
.ly-gua-lines .row em {
  position: absolute; right: -24px; top: 50%;
  transform: translateY(-50%);
  font-style: normal; font-size: 13px; font-weight: 700;
  color: var(--cinnabar);
}
.ly-gua-text {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed rgba(150, 114, 58, 0.4);
  font-family: var(--font-serif);
  font-size: 15.5px; line-height: 2.15; letter-spacing: 0.05em;
  color: #3b382f;
  text-align: left;
}
.ly-gua-text .book { color: var(--cinnabar); }
.ly-gua-arrow {
  align-self: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--gold-700);
  font-family: var(--font-serif);
}
.ly-gua-arrow b { font-size: 18px; letter-spacing: 0.2em; font-weight: 600; }
.ly-gua-arrow i { font-style: normal; font-size: 22px; }
.ly-demo-note {
  margin-top: 30px;
  text-align: center;
  font-size: 13px; letter-spacing: 0.08em;
  color: var(--paper-ink-soft);
}

.ly-again { margin-top: 46px; text-align: center; }

/* ================= 响应式 ================= */
@media (max-width: 960px) {
  .ly-stage-grid { grid-template-columns: 1fr; }
  .ly-rack-panel { max-width: 560px; margin: 0 auto; width: 100%; }
}
@media (max-width: 900px) {
  .ly-gua-wrap { flex-direction: column; align-items: center; }
  .ly-gua { flex-basis: auto; width: min(420px, 100%); }
  .ly-gua-arrow { transform: rotate(90deg); padding: 4px 0; }
}
@media (max-width: 720px) {
  .ly-card-body { padding: 28px 22px 32px; }
  .ly-coins { gap: 20px; }
  .coin { width: 74px; height: 74px; }
  .coin-char { font-size: 12px; }
  .coin-hole { width: 19px; height: 19px; }
  .ly-slot { grid-template-columns: 40px 1fr 20px 64px; gap: 8px; }
  .ly-gua { padding: 28px 22px 26px; }
  .ly-act { padding: 72px 0 84px; }
}
