:root {
  color-scheme: dark;
  --bg: #120822;
  --ink: rgba(255, 249, 255, 0.96);
  --muted: rgba(238, 224, 255, 0.68);
  --soft: rgba(232, 212, 255, 0.44);
  --gold: #f1d58a;
  --rose: #ff78c7;
  --violet: #9b6cff;
  --panel: rgba(25, 13, 43, 0.62);
  --panel-strong: rgba(32, 16, 52, 0.84);
  --line: rgba(255, 233, 180, 0.18);
  --line-cool: rgba(213, 194, 255, 0.18);
  --radius: 24px;
  --shadow: 0 30px 100px rgba(0, 0, 0, 0.42);
  font-family:
    ui-serif, Georgia, "Times New Roman", "Songti SC", "STSong", serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 6%, rgba(255, 120, 199, 0.28), transparent 28rem),
    radial-gradient(circle at 88% 16%, rgba(116, 83, 255, 0.34), transparent 32rem),
    radial-gradient(circle at 50% 100%, rgba(241, 213, 138, 0.12), transparent 36rem),
    linear-gradient(160deg, #0b0717 0%, #180a2c 48%, #090711 100%);
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.aurora {
  position: fixed;
  inset: -20% -12% auto auto;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 117, 199, 0.16), transparent 62%),
    radial-gradient(circle at 30% 40%, rgba(154, 108, 255, 0.2), transparent 38%);
  filter: blur(22px);
  animation: auroraDrift 16s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes auroraDrift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-7%, 5%, 0) scale(1.08);
  }
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.stars span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 240, 204, 0.86);
  box-shadow: 0 0 18px rgba(255, 229, 166, 0.72);
  animation: floatStar 9s ease-in-out infinite alternate;
}

.stars span:nth-child(1) { left: 8%; top: 18%; animation-delay: 0ms; }
.stars span:nth-child(2) { left: 18%; top: 72%; animation-delay: 620ms; }
.stars span:nth-child(3) { left: 28%; top: 30%; animation-delay: 1300ms; }
.stars span:nth-child(4) { left: 38%; top: 84%; animation-delay: 210ms; }
.stars span:nth-child(5) { left: 46%; top: 12%; animation-delay: 970ms; }
.stars span:nth-child(6) { left: 56%; top: 62%; animation-delay: 1580ms; }
.stars span:nth-child(7) { left: 68%; top: 26%; animation-delay: 480ms; }
.stars span:nth-child(8) { left: 76%; top: 78%; animation-delay: 1180ms; }
.stars span:nth-child(9) { left: 84%; top: 40%; animation-delay: 730ms; }
.stars span:nth-child(10) { left: 91%; top: 14%; animation-delay: 1780ms; }
.stars span:nth-child(11) { left: 12%; top: 48%; animation-delay: 2400ms; }
.stars span:nth-child(12) { left: 62%; top: 8%; animation-delay: 2900ms; }

@keyframes floatStar {
  from {
    opacity: 0.38;
    transform: translateY(0) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(-18px) scale(1.18);
  }
}

.topbar,
.app,
.footer {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px 0 10px;
}

.brand,
.nav button,
.back-btn,
.ghost-btn,
.primary-btn,
.spread-card,
.tarot-back,
.template-list button {
  border: 0;
  cursor: pointer;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
}

.brand-moon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(241, 213, 138, 0.34);
  border-radius: 50%;
  color: var(--gold);
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.2), transparent 28%), rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 30px rgba(241, 213, 138, 0.12);
  font-size: 24px;
}

.brand strong,
.brand em {
  display: block;
  text-align: left;
}

.brand strong {
  font-size: 18px;
}

.brand em {
  margin-top: 2px;
  color: var(--soft);
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.08em;
}

.nav {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 233, 180, 0.14);
  border-radius: 999px;
  background: rgba(10, 6, 20, 0.44);
  backdrop-filter: blur(18px);
}

.nav button {
  padding: 9px 15px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}

.nav button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.app {
  padding: 34px 0 46px;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screenIn 520ms ease both;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(310px, 0.38fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  min-height: 430px;
}

.daily-panel,
.hero-copy,
.last-reading,
.tip-card,
.question-card,
.draw-head,
.analysis-panel,
.disclaimer-card,
.case-hero,
.case-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
}

.daily-panel {
  display: grid;
  align-content: space-between;
  gap: 20px;
  padding: 28px;
}

.daily-panel div {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(213, 194, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.daily-panel span,
.spread-meta i,
.last-meta span,
.position-label,
.case-grid span {
  color: var(--soft);
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.06em;
}

.daily-panel strong {
  color: var(--gold);
  font-size: 20px;
}

.daily-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.62;
}

.hero-copy {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 430px;
  padding: clamp(34px, 7vw, 78px);
  overflow: hidden;
}

.hero-copy::before {
  content: "☾";
  position: absolute;
  right: clamp(20px, 7vw, 90px);
  top: clamp(22px, 5vw, 58px);
  color: rgba(241, 213, 138, 0.1);
  font-size: clamp(100px, 18vw, 220px);
  line-height: 1;
}

.eyebrow {
  margin: 0 0 16px;
  color: rgba(241, 213, 138, 0.84);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin-top: 0;
}

.hero h1 {
  position: relative;
  margin-bottom: 14px;
  color: #fff8ff;
  font-size: clamp(62px, 11vw, 142px);
  line-height: 0.88;
  text-shadow: 0 0 40px rgba(255, 120, 199, 0.18);
}

.subtitle {
  margin: 0;
  color: rgba(255, 247, 232, 0.9);
  font-size: clamp(22px, 3.2vw, 34px);
  line-height: 1.32;
}

.intro,
.question-card p,
.draw-head p,
.result-head p,
.case-hero p,
.case-grid p,
.tip-card p,
.disclaimer-card {
  color: var(--muted);
  line-height: 1.72;
}

.intro {
  max-width: 700px;
  margin: 22px 0 0;
  font-size: 17px;
}

.section-head,
.result-head {
  margin: 40px 0 20px;
  text-align: center;
}

.section-head h2,
.result-head h1,
.case-hero h1,
.question-card h1,
.draw-head h1,
.analysis-panel h2 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
}

.spread-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.spread-card {
  min-height: 280px;
  padding: 24px;
  border: 1px solid rgba(255, 233, 180, 0.15);
  border-radius: 22px;
  color: var(--ink);
  text-align: left;
  background:
    radial-gradient(circle at 20% 0%, rgba(241, 213, 138, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.078), rgba(255, 255, 255, 0.018)),
    rgba(27, 12, 45, 0.76);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.spread-card:hover {
  transform: translateY(-6px);
  border-color: rgba(241, 213, 138, 0.38);
  box-shadow: 0 28px 84px rgba(0, 0, 0, 0.34), 0 0 34px rgba(255, 120, 199, 0.12);
}

.spread-card > span {
  display: inline-flex;
  padding: 7px 11px;
  border: 1px solid rgba(241, 213, 138, 0.18);
  border-radius: 999px;
  color: var(--gold);
  font-size: 12px;
}

.spread-card h3 {
  margin: 28px 0 12px;
  font-size: 28px;
}

.spread-card p {
  color: var(--muted);
  line-height: 1.62;
}

.spread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 14px;
}

.spread-meta i,
.spread-card strong,
.keyword-row i {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(213, 194, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.spread-card strong {
  color: rgba(255, 247, 232, 0.76);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
}

.last-reading,
.tip-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 24px;
}

.last-reading h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.last-reading p,
.tip-card p {
  margin: 0;
}

.last-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tip-card span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--gold);
  background: rgba(241, 213, 138, 0.08);
  box-shadow: 0 0 22px rgba(241, 213, 138, 0.12);
}

.back-btn {
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 233, 180, 0.15);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.question-card,
.draw-head,
.case-hero {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: clamp(26px, 5vw, 52px);
}

.question-card label {
  display: block;
  margin: 28px 0 10px;
  color: rgba(255, 247, 232, 0.82);
}

textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  padding: 18px;
  border: 1px solid rgba(255, 233, 180, 0.18);
  border-radius: 18px;
  outline: none;
  color: var(--ink);
  background: rgba(8, 5, 18, 0.56);
  line-height: 1.65;
}

textarea:focus {
  border-color: rgba(241, 213, 138, 0.46);
  box-shadow: 0 0 0 4px rgba(241, 213, 138, 0.08);
}

.question-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 0 18px;
}

.question-tools span,
.form-error {
  color: var(--soft);
  font-size: 13px;
}

.form-error {
  color: #ffb0ce;
}

.template-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}

.template-list button {
  padding: 13px 15px;
  border: 1px solid rgba(213, 194, 255, 0.13);
  border-radius: 14px;
  color: var(--muted);
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
}

.template-list button:hover {
  color: var(--ink);
  border-color: rgba(241, 213, 138, 0.24);
}

.primary-btn,
.ghost-btn {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.primary-btn {
  border: 1px solid rgba(241, 213, 138, 0.42);
  color: #21120b;
  background: linear-gradient(135deg, #fff2b7, #f1c66d 48%, #ff93d2);
  box-shadow: 0 14px 34px rgba(241, 213, 138, 0.18);
  font-weight: 800;
}

.primary-btn.small {
  min-height: 42px;
}

.ghost-btn {
  border: 1px solid rgba(255, 233, 180, 0.18);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.primary-btn:hover,
.ghost-btn:hover,
.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(241, 213, 138, 0.12);
}

.draw-head {
  text-align: center;
}

#drawQuestion {
  max-width: 760px;
  margin: 16px auto;
}

#drawCountText {
  display: inline-flex;
  padding: 8px 14px;
  border: 1px solid rgba(241, 213, 138, 0.18);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.045);
}

.deck-area {
  margin: 34px auto 0;
  padding: 24px 0;
  perspective: 1200px;
}

.deck {
  display: grid;
  grid-template-columns: repeat(7, minmax(82px, 1fr));
  gap: 16px;
}

.tarot-back {
  position: relative;
  min-height: 176px;
  border: 1px solid rgba(241, 213, 138, 0.24);
  border-radius: 18px;
  color: var(--gold);
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.12), transparent 22%),
    linear-gradient(150deg, #33164f, #16082e 48%, #3b1d65);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transform-style: preserve-3d;
  animation: shuffleIn 900ms cubic-bezier(0.2, 0.85, 0.2, 1.1) both;
  animation-delay: var(--delay);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

@keyframes shuffleIn {
  from {
    opacity: 0;
    transform: translate3d(-34px, -40px, 0) rotateZ(-8deg) rotateY(65deg);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateZ(0) rotateY(0);
  }
}

.tarot-back:hover {
  transform: translateY(-10px) rotateZ(-1.5deg);
  border-color: rgba(241, 213, 138, 0.52);
  box-shadow: 0 28px 82px rgba(0, 0, 0, 0.36), 0 0 34px rgba(255, 120, 199, 0.16);
}

.tarot-back.is-selected {
  transform: translateY(-14px) rotateY(180deg);
  border-color: rgba(255, 245, 210, 0.72);
  box-shadow: 0 0 38px rgba(241, 213, 138, 0.22), 0 30px 90px rgba(0, 0, 0, 0.34);
}

.back-border {
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(241, 213, 138, 0.42);
  border-radius: 13px;
}

.back-symbol {
  display: block;
  margin-top: 42px;
  font-size: 44px;
}

.tarot-back strong,
.tarot-back i {
  display: block;
  margin-top: 10px;
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  letter-spacing: 0.22em;
}

.tarot-back i {
  color: rgba(255, 240, 210, 0.48);
  font-style: normal;
  letter-spacing: 0.08em;
}

.reveal-btn {
  display: block;
  margin: 22px auto 0;
}

.result-toolbar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.drawn-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.reading-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 233, 180, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.024)),
    rgba(25, 13, 43, 0.68);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: revealUp 640ms ease both;
  animation-delay: var(--delay);
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(20px) rotateX(12deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

.card-art {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 250px;
  border: 1px solid rgba(255, 244, 212, 0.24);
  border-radius: 18px;
  background: var(--card-gradient);
  color: white;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 20px 42px rgba(0, 0, 0, 0.24);
}

.card-art.is-reversed {
  transform: rotate(180deg);
}

.card-art span {
  font-size: 70px;
  line-height: 1;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.32);
}

.card-art strong,
.card-art em {
  display: block;
}

.card-art strong {
  margin-top: 28px;
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
}

.card-art em {
  margin-top: 8px;
  font-style: normal;
  font-size: 22px;
  font-weight: 700;
}

.reading-copy h3 {
  margin: 10px 0 12px;
  font-size: 28px;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.keyword-row i {
  min-height: 26px;
  color: rgba(255, 247, 232, 0.82);
  font-size: 12px;
  font-style: normal;
}

.reading-copy p {
  color: var(--muted);
  line-height: 1.72;
}

details {
  margin-top: 18px;
  border-top: 1px solid rgba(255, 233, 180, 0.12);
  padding-top: 14px;
}

summary {
  color: var(--gold);
  cursor: pointer;
}

dl {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

dt {
  color: var(--soft);
  font-size: 12px;
}

dd {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.62;
}

.analysis-panel,
.disclaimer-card {
  margin-top: 22px;
  padding: clamp(24px, 4vw, 38px);
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.analysis-grid article {
  padding: 16px;
  border: 1px solid rgba(213, 194, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.analysis-grid span {
  color: var(--soft);
  font-size: 12px;
}

.analysis-grid strong {
  display: block;
  margin-top: 8px;
  color: rgba(255, 247, 232, 0.88);
  line-height: 1.45;
}

.insight-block {
  color: var(--muted);
  line-height: 1.72;
}

.insight-block h3 {
  margin: 24px 0 8px;
  color: var(--ink);
  font-size: 22px;
}

.insight-block ol {
  padding-left: 20px;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.case-grid article {
  padding: 24px;
}

.case-grid h2 {
  margin-bottom: 10px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 36px;
  color: var(--soft);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
}

@media (max-width: 980px) {
  .topbar,
  .app,
  .footer {
    width: min(100% - 28px, 720px);
  }

  .topbar,
  .footer,
  .last-reading,
  .result-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hero,
  .spread-grid,
  .case-grid,
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .deck {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reading-card {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .daily-panel,
  .question-card,
  .draw-head,
  .analysis-panel,
  .case-hero {
    padding: 22px;
  }

  .hero h1 {
    font-size: clamp(58px, 18vw, 96px);
  }
}
