:root {
  color-scheme: dark;
  --paper: #f5ecf4;
  --muted: #c2b1c6;
  --gold: #ebc58a;
  --line: #523d57;
  --panel: #211729;
  --serif: 'Songti SC', 'Noto Serif CJK SC', SimSun, serif;
  font-family: system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #17101f;
  color: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 75% 1%, #3d2650 0%, #21152d 32%, transparent 65%); }
button, textarea, input { font: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.shell { width: min(1072px, calc(100% - 72px)); margin: auto; padding-bottom: 72px; }
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 76px; border-bottom: 1px solid #62496a80; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .14em; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid #b48d6b; border-radius: 50%; color: var(--gold); font: 25px Georgia, serif; }
.header-label { font-size: 13px; color: var(--muted); letter-spacing: .18em; }
.intro { display: flex; align-items: center; justify-content: space-between; min-height: 246px; padding: 35px 28px 35px 0; }
.intro h1 { margin: 0; font: 700 clamp(32px, 5vw, 60px)/1.2 var(--serif); letter-spacing: -.035em; }
.intro p { max-width: 420px; margin: 17px 0 0; font-size: 15px; line-height: 1.8; color: var(--muted); }
.moon-illustration { position: relative; width: 176px; height: 176px; flex: 0 0 176px; margin-right: 29px; }
.orbit { position: absolute; inset: 0; border: 1px solid #ad806b66; border-radius: 50%; }
.orbit-inner { inset: 15px; border-style: dashed; border-color: #d7ac8473; }
.illustration-moon { position: absolute; inset: 36px; border-radius: 50%; box-shadow: inset 16px -7px 0 #edc58d; transform: rotate(-22deg); filter: drop-shadow(0 0 16px #ecc7865c); }
.illustration-star { position: absolute; color: var(--gold); }
.star-one { top: 37px; right: 39px; font-size: 25px; }
.star-two { right: 23px; bottom: 42px; font-size: 16px; }
.star-three { top: 2px; left: 28px; font-size: 14px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: stretch; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 21px; padding: 26px; background: var(--panel); }
.panel h2 { margin: 0 0 20px; font: 700 22px/1.4 var(--serif); }
.input-wrap { position: relative; }
textarea, input { display: block; width: 100%; color: var(--paper); border: 1px solid var(--line); border-radius: 10px; background: #191221; }
textarea { min-height: 112px; padding: 12px 14px 30px; resize: vertical; line-height: 1.6; }
input { min-height: 44px; padding: 9px 13px; }
textarea::placeholder, input::placeholder { color: #a594ab; }
.count { position: absolute; right: 12px; bottom: 8px; color: var(--muted); font-size: 11px; pointer-events: none; }
.access-label { display: block; margin: 16px 0 7px; font-size: 13px; color: var(--paper); }
button { width: 100%; margin-top: 16px; min-height: 46px; border: 0; border-radius: 10px; background: #ebc58a; color: #281929; font-weight: 700; cursor: pointer; }
button span { padding-right: 4px; }
button:hover:not(:disabled) { background: #ffda9d; }
button:disabled { opacity: .68; cursor: wait; }
.small-print, .spread-note, .error { margin: 14px 0 0; font-size: 12px; line-height: 1.65; color: var(--muted); }
.error { color: #ffb6ba; }
.spread-panel { background: linear-gradient(145deg, #2c1d38, #211729 72%); }
.spread { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.slot { min-width: 0; text-align: center; }
.slot-position { display: block; margin-bottom: 10px; color: #d8c2db; font-size: 12px; letter-spacing: .08em; }
.card { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; height: clamp(138px, 19vw, 204px); border: 1px solid #a77666; border-radius: 12px; background: radial-gradient(ellipse, #53365e 0, #35213e 57%, #25192f 100%); color: var(--gold); }
.card::before, .card::after { content: ''; position: absolute; pointer-events: none; }
.card::before { inset: 6px; border: 1px solid #c38f725c; border-radius: 8px; }
.card::after { inset: 16%; border: 1px solid #c38f7255; border-radius: 50%; }
.card-icon { z-index: 1; font: 42px/1.15 Georgia, 'Segoe UI Symbol', serif; }
.card-name, .card-orientation { position: relative; z-index: 1; }
.card-name { color: var(--paper); font: 700 15px/1.3 var(--serif); }
.card-orientation { color: #f1cc99; font-size: 11px; }
.card.revealed { animation: reveal .35s ease-out; background: radial-gradient(ellipse, #69445e 0, #402742 60%, #2a1a35 100%); }
.card.revealed::after { opacity: .35; }
.card.reversed .card-icon { transform: rotate(180deg); }
.spread-note { text-align: center; min-height: 20px; margin-top: 17px; }
.result-panel { margin-top: 18px; }
.result-panel h2 { margin-bottom: 10px; }
.result-question { color: var(--gold); margin: 0 0 14px; overflow-wrap: anywhere; }
.reading { max-width: 72ch; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.9; }

@keyframes reveal { from { opacity: .45; transform: rotateY(-22deg); } to { opacity: 1; transform: rotateY(0); } }
@media (max-width: 700px) {
  .shell { width: calc(100% - 32px); padding-bottom: 36px; }
  .site-header { min-height: 62px; }
  .intro { min-height: 0; padding: 33px 0; gap: 7px; }
  .intro p { margin-top: 12px; font-size: 14px; }
  .moon-illustration { flex-basis: 78px; width: 78px; height: 78px; margin: 0 3px 0 0; }
  .orbit-inner { inset: 7px; }
  .illustration-moon { inset: 19px; box-shadow: inset 8px -4px 0 #edc58d; }
  .star-one { top: 14px; right: 15px; font-size: 13px; }
  .star-two { bottom: 12px; right: 13px; font-size: 10px; }
  .star-three { top: 0; left: 10px; font-size: 9px; }
  .workspace { grid-template-columns: 1fr; gap: 12px; }
  .panel { padding: 19px; border-radius: 17px; }
  .spread { gap: 8px; }
  .card { height: clamp(132px, 30vw, 185px); }
  .result-panel { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .card.revealed { animation: none; } }
