:root {
  --sb-ink: #08070b;
  --sb-panel: rgba(20, 16, 20, 0.88);
  --sb-panel-strong: rgba(27, 20, 22, 0.96);
  --sb-line: rgba(216, 176, 104, 0.18);
  --sb-gold: #d8b068;
  --sb-gold-soft: #f0d59a;
  --sb-red: #a52a31;
  --sb-red-deep: #6f141c;
  --sb-text: #f3ede2;
  --sb-muted: #a79d90;
}

body {
  background:
    radial-gradient(circle at 50% -10%, rgba(125, 35, 42, 0.22), transparent 34rem),
    radial-gradient(circle at 100% 55%, rgba(190, 145, 72, 0.08), transparent 32rem),
    var(--sb-ink);
  color: var(--sb-text);
}

.cosmic-bg {
  background:
    linear-gradient(rgba(216, 176, 104, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 176, 104, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 84%);
}

.grid-overlay { display: none; }

.shengbei-shell {
  width: min(1060px, calc(100% - 32px));
  padding: 110px 0 80px;
}

.shengbei-hero {
  position: relative;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  min-height: 220px;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--sb-line);
  border-radius: 20px 20px 4px 20px;
  background:
    radial-gradient(circle at 9% 50%, rgba(165, 42, 49, 0.26), transparent 24rem),
    linear-gradient(120deg, rgba(216, 176, 104, 0.055), transparent 44%),
    rgba(18, 14, 18, 0.9);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  text-align: left;
}

.shengbei-hero::after {
  content: "筊";
  position: absolute;
  right: 4%;
  bottom: -42%;
  color: rgba(216, 176, 104, 0.035);
  font: 900 clamp(180px, 28vw, 330px)/1 serif;
  pointer-events: none;
}

.shengbei-seal {
  width: 76px;
  height: 76px;
  margin: 0;
  border: 1px solid rgba(240, 213, 154, 0.35);
  border-radius: 50% 50% 8px 50%;
  color: var(--sb-gold-soft);
  background: linear-gradient(145deg, var(--sb-red), var(--sb-red-deep));
  box-shadow: 0 14px 42px rgba(111, 20, 28, 0.34), inset 0 0 0 5px rgba(255, 255, 255, 0.035);
}

.shengbei-hero-copy { position: relative; z-index: 1; }
.shengbei-hero .section-kicker { margin: 0 0 10px; color: var(--sb-gold); }
.shengbei-hero h1 {
  color: var(--sb-text);
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(44px, 7vw, 72px);
  letter-spacing: 0.08em;
}
.shengbei-hero p { width: auto; margin: 12px 0 0; color: var(--sb-muted); }

.ritual-note {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding-left: 22px;
  border-left: 1px solid var(--sb-line);
  color: var(--sb-gold-soft);
  font-size: 13px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}
.ritual-note span::before { content: "◆"; margin-right: 9px; color: var(--sb-red); font-size: 8px; }

.shengbei-stage {
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 18px;
  margin-top: 18px;
}

.shengbei-card {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--sb-line);
  border-radius: 4px 18px 18px 18px;
  background: var(--sb-panel);
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}
.shengbei-card + .shengbei-card { border-radius: 18px 4px 18px 18px; }
.shengbei-card h2 { color: var(--sb-gold); font-family: "Songti SC", "STSong", serif; letter-spacing: 0.12em; }

.question-label { color: var(--sb-text); font-size: 15px; font-weight: 700; }
.shengbei-form textarea {
  min-height: 118px;
  padding: 16px;
  border: 1px solid rgba(216, 176, 104, 0.18);
  border-radius: 12px;
  outline: none;
  color: var(--sb-text);
  background: rgba(6, 6, 10, 0.55);
  font: inherit;
  line-height: 1.7;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.shengbei-form textarea::placeholder { color: #706a65; }
.shengbei-form textarea:focus {
  border-color: rgba(216, 176, 104, 0.54);
  background: rgba(10, 8, 12, 0.8);
  box-shadow: 0 0 0 3px rgba(216, 176, 104, 0.07);
}
.question-meta { display: flex; justify-content: space-between; color: #746e68; font-size: 12px; }

.shengbei-button {
  min-height: 54px;
  border-radius: 12px 12px 3px 12px;
  color: #fff8ea;
  background: linear-gradient(135deg, #b2383f, #7a1820);
  box-shadow: 0 16px 34px rgba(111, 20, 28, 0.3), inset 0 1px rgba(255, 255, 255, 0.12);
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.shengbei-button:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 20px 40px rgba(111, 20, 28, 0.38); }
.quota-line { color: #817a72; line-height: 1.6; }

.cup-stage { min-height: 310px; margin-top: 4px; }
.cup-ground { background: radial-gradient(ellipse, rgba(0, 0, 0, 0.62), transparent 70%); }
.cup-glow { background: radial-gradient(circle, rgba(216, 176, 104, 0.2), rgba(165, 42, 49, 0.13) 38%, transparent 72%); }

.result-panel { align-content: start; }
.result-box {
  min-height: 300px;
  border: 1px dashed rgba(216, 176, 104, 0.2);
  border-radius: 12px;
  color: var(--sb-muted);
  background: rgba(6, 6, 10, 0.38);
}
.result-box[data-state="sheng"] { border-style: solid; border-color: rgba(216, 176, 104, 0.42); background: linear-gradient(145deg, rgba(216, 176, 104, 0.09), rgba(6, 6, 10, 0.5)); }
.result-box[data-state="xiao"] { border-style: solid; border-color: rgba(106, 139, 174, 0.35); }
.result-box[data-state="nu"] { border-style: solid; border-color: rgba(165, 42, 49, 0.48); background: rgba(111, 20, 28, 0.08); }
.result-box h2 { color: var(--sb-gold-soft); font-family: "Songti SC", "STSong", serif; }
.result-box strong { color: var(--sb-text); }
.result-actions button,
.result-actions a { border-color: var(--sb-line); color: var(--sb-gold); background: rgba(216, 176, 104, 0.055); }
.result-actions button:first-child { color: #fff8ea; background: linear-gradient(135deg, #a52a31, #70151c); }

.footer { border-color: rgba(216, 176, 104, 0.08); }

@media (max-width: 820px) {
  .navbar { padding: 14px 18px; }
  .nav-links { display: none; }
  .shengbei-shell { padding-top: 86px; }
  .shengbei-hero { grid-template-columns: auto 1fr; min-height: 0; }
  .ritual-note { grid-column: 1 / -1; grid-template-columns: repeat(3, auto); justify-content: start; padding: 14px 0 0; border: 0; border-top: 1px solid var(--sb-line); }
  .shengbei-stage { grid-template-columns: 1fr; }
  .result-box { min-height: 190px; }
}

@media (max-width: 560px) {
  .logo-text { font-size: 18px; }
  .shengbei-shell { width: min(100% - 20px, 520px); padding-top: 78px; }
  .shengbei-hero { gap: 15px; padding: 22px 18px; border-radius: 14px 14px 3px 14px; }
  .shengbei-seal { width: 54px; height: 54px; font-size: 24px; }
  .shengbei-hero h1 { font-size: 39px; }
  .shengbei-hero p { margin-top: 8px; font-size: 13px; line-height: 1.65; }
  .ritual-note { gap: 13px; font-size: 11px; letter-spacing: .06em; }
  .ritual-note span::before { margin-right: 5px; }
  .shengbei-card { padding: 18px 15px; }
  .cup-stage { min-height: 270px; transform: scale(.92); margin: -4px -12px -12px; }
  .question-meta { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .logo-icon, .cup-stage.is-throwing .cup-glow, .cup-pair.throwing .cup { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
