:root {
  color-scheme: dark;
  --bg: #080a11;
  --panel: #10141f;
  --panel-soft: #151a27;
  --ivory: #f4eedf;
  --ivory-soft: rgba(244, 238, 223, 0.66);
  --gold: #d8b66d;
  --gold-bright: #f0d38e;
  --line: rgba(230, 202, 143, 0.16);
  --line-soft: rgba(255, 255, 255, 0.08);
  --danger: #df877d;
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ivory);
  background:
    radial-gradient(circle at 50% -20%, #1f263a 0, transparent 42%),
    linear-gradient(180deg, #090b13 0%, #07090e 100%);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.34;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 18%, rgba(255,255,255,.8) 0 1px, transparent 1.5px),
    radial-gradient(circle at 22% 74%, rgba(255,255,255,.5) 0 1px, transparent 1.5px),
    radial-gradient(circle at 38% 32%, rgba(255,255,255,.55) 0 1px, transparent 1.5px),
    radial-gradient(circle at 61% 13%, rgba(255,255,255,.7) 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 58%, rgba(255,255,255,.45) 0 1px, transparent 1.5px),
    radial-gradient(circle at 92% 28%, rgba(255,255,255,.7) 0 1px, transparent 1.5px);
  background-size: 290px 310px;
}

button,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 100;
  padding: 10px 15px;
  border-radius: 10px;
  color: #17130b;
  background: var(--gold-bright);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.12;
}

.orb--one {
  top: 8%;
  left: -280px;
  background: #7b5bd6;
}

.orb--two {
  top: 24%;
  right: -320px;
  background: #c89d54;
}

.orb--three {
  bottom: -300px;
  left: 38%;
  background: #426f9a;
}

.page-shell,
.site-header {
  width: min(1260px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  text-decoration: none;
}

.brand-seal {
  display: grid;
  width: 49px;
  height: 49px;
  place-items: center;
  border: 1px solid rgba(216, 182, 109, 0.34);
  border-radius: 50%;
  color: var(--gold-bright);
  background: rgba(216, 182, 109, 0.06);
}

.brand-seal svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy strong {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.16em;
}

.brand-copy small {
  color: rgba(216, 182, 109, 0.6);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.site-nav {
  display: flex;
  gap: 30px;
  color: var(--ivory-soft);
  font-size: 13px;
}

.site-nav a {
  position: relative;
  text-decoration: none;
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 180ms ease;
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(500px, 1.1fr);
  min-height: calc(100vh - 104px);
  gap: clamp(50px, 7vw, 100px);
  align-items: center;
  padding: 44px 0 100px;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.hero-copy h1 {
  margin: 25px 0 25px;
  font-family: var(--font-serif);
  font-size: clamp(52px, 6vw, 82px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.05em;
}

.hero-copy h1 em {
  color: var(--gold-bright);
  font-style: normal;
}

.hero-lead {
  max-width: 520px;
  margin: 0;
  color: var(--ivory-soft);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 2;
}

.hero-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 190px));
  gap: 16px;
  margin-top: 42px;
}

.hero-notes > div {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.hero-notes > div > span {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 12px;
}

.hero-notes p {
  display: grid;
  gap: 3px;
  margin: 0;
}

.hero-notes strong {
  font-size: 13px;
}

.hero-notes small {
  color: rgba(244, 238, 223, 0.42);
  font-size: 11px;
}

.hero-footnote {
  max-width: 460px;
  margin: 35px 0 0;
  color: rgba(244, 238, 223, 0.36);
  font-size: 11px;
  line-height: 1.8;
}

.hero-footnote span {
  margin-right: 7px;
  color: var(--gold);
}

.oracle-card {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  padding: 34px clamp(30px, 4vw, 58px) 48px;
  border: 1px solid rgba(216, 182, 109, 0.23);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 45%),
    rgba(16, 20, 31, 0.92);
  box-shadow: 0 38px 100px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.oracle-card::before,
.oracle-card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border-color: rgba(216, 182, 109, 0.2);
  pointer-events: none;
}

.oracle-card::before {
  top: 14px;
  left: 14px;
  border-top: 1px solid;
  border-left: 1px solid;
  border-radius: 24px 0 0;
}

.oracle-card::after {
  right: 14px;
  bottom: 14px;
  border-right: 1px solid;
  border-bottom: 1px solid;
  border-radius: 0 0 24px;
}

.card-stars {
  position: absolute;
  top: 42px;
  right: 58px;
  width: 90px;
  height: 90px;
  opacity: 0.38;
  background:
    radial-gradient(circle at 50% 10%, var(--gold) 0 1px, transparent 2px),
    radial-gradient(circle at 83% 50%, var(--gold) 0 1px, transparent 2px),
    radial-gradient(circle at 24% 70%, var(--gold) 0 1px, transparent 2px);
}

.card-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  color: rgba(216, 182, 109, 0.55);
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.2em;
}

.card-header span:last-child {
  text-align: right;
}

.card-symbol {
  color: var(--gold-bright);
  font-size: 14px;
}

.ask-form,
.loading-state,
.answer-state {
  position: relative;
  z-index: 1;
}

.ask-form {
  padding-top: 38px;
}

.form-heading h2 {
  margin: 10px 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(31px, 4vw, 43px);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.form-heading > p:last-child {
  margin: 0 0 28px;
  color: var(--ivory-soft);
  font-size: 13px;
}

.question-field {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(216, 182, 109, 0.2);
  border-radius: var(--radius-md);
  background: rgba(3, 5, 10, 0.38);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.question-field:focus-within {
  border-color: rgba(240, 211, 142, 0.58);
  background: rgba(3, 5, 10, 0.5);
  box-shadow: 0 0 0 4px rgba(216, 182, 109, 0.07);
}

.question-field textarea {
  display: block;
  width: 100%;
  min-height: 126px;
  resize: vertical;
  padding: 22px 22px 10px;
  border: 0;
  outline: 0;
  color: var(--ivory);
  background: transparent;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.75;
}

.question-field textarea::placeholder {
  color: rgba(244, 238, 223, 0.24);
}

.field-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 14px;
  color: rgba(244, 238, 223, 0.31);
  font-size: 10px;
}

.field-footer b {
  color: rgba(244, 238, 223, 0.58);
  font-weight: 600;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
}

.suggestions > span {
  margin-right: 2px;
  color: rgba(244, 238, 223, 0.35);
  font-size: 10px;
}

.suggestions button {
  padding: 8px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: rgba(244, 238, 223, 0.58);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  font-size: 10px;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.suggestions button:hover {
  border-color: rgba(216, 182, 109, 0.36);
  color: var(--gold-bright);
  background: rgba(216, 182, 109, 0.06);
}

.form-error {
  margin: 16px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.submit-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 25px;
  border: 0;
  border-radius: 15px;
  color: #1b160d;
  background: linear-gradient(135deg, #efd18a, #cfa555);
  box-shadow: 0 16px 35px rgba(200, 157, 84, 0.16);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.submit-button:hover:not(:disabled) {
  filter: brightness(1.07);
  box-shadow: 0 20px 42px rgba(200, 157, 84, 0.24);
  transform: translateY(-2px);
}

.submit-button:disabled {
  cursor: wait;
  filter: saturate(0.5);
  opacity: 0.62;
}

.submit-button svg,
.copy-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.loading-state {
  display: grid;
  min-height: 490px;
  place-content: center;
  text-align: center;
}

.book-loader {
  position: relative;
  width: 92px;
  height: 64px;
  margin: 0 auto 30px;
  perspective: 400px;
}

.book-loader::before,
.book-loader::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 46px;
  height: 58px;
  border: 1px solid rgba(216, 182, 109, 0.54);
  background: rgba(216, 182, 109, 0.08);
}

.book-loader::before {
  left: 0;
  border-radius: 8px 2px 2px 8px;
  transform: rotateY(12deg);
  transform-origin: right;
}

.book-loader::after {
  right: 0;
  border-radius: 2px 8px 8px 2px;
  transform: rotateY(-12deg);
  transform-origin: left;
}

.book-loader span {
  position: absolute;
  z-index: 2;
  right: 46px;
  bottom: 2px;
  width: 43px;
  height: 54px;
  border: 1px solid rgba(240, 211, 142, 0.62);
  border-radius: 7px 2px 2px 7px;
  background: #1c2130;
  transform-origin: right;
  animation: turnPage 1.35s infinite ease-in-out;
}

.book-loader span:nth-child(2) { animation-delay: 0.22s; }
.book-loader span:nth-child(3) { animation-delay: 0.44s; }

.loading-state p {
  margin: 0 0 8px;
  color: var(--gold-bright);
  font-family: var(--font-serif);
  font-size: 24px;
}

.loading-state small {
  color: rgba(244, 238, 223, 0.38);
}

.answer-state {
  min-height: 490px;
  padding-top: 42px;
}

.answer-question > span,
.answer-reveal > span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.answer-question p {
  margin: 12px 0 0;
  color: rgba(244, 238, 223, 0.62);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.8;
}

.answer-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 36px 0;
  color: var(--gold);
}

.answer-divider i {
  height: 1px;
  background: var(--line);
}

.answer-reveal {
  position: relative;
  padding: 8px 0 22px;
}

.answer-reveal::before {
  content: "“";
  position: absolute;
  top: 16px;
  right: 0;
  color: rgba(216, 182, 109, 0.11);
  font-family: var(--font-serif);
  font-size: 130px;
  line-height: 1;
}

.answer-reveal blockquote {
  position: relative;
  margin: 24px 0 0;
  color: var(--gold-bright);
  font-family: var(--font-serif);
  font-size: clamp(35px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.035em;
  animation: answerReveal 650ms cubic-bezier(.22,.8,.25,1) both;
}

.answer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 40px;
}

.secondary-button,
.copy-button {
  display: flex;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.secondary-button {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
}

.copy-button {
  border: 1px solid rgba(216, 182, 109, 0.32);
  color: var(--gold-bright);
  background: rgba(216, 182, 109, 0.07);
}

.secondary-button:hover,
.copy-button:hover {
  transform: translateY(-2px);
}

.guide-section,
.history-section {
  padding: 100px 0;
  border-top: 1px solid var(--line-soft);
}

.section-heading,
.history-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 50px;
  margin-bottom: 44px;
}

.section-heading h2,
.history-header h2 {
  margin: 12px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(34px, 4.5vw, 52px);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.section-heading > p,
.history-header > div > p:last-child {
  max-width: 430px;
  margin: 0;
  color: rgba(244, 238, 223, 0.45);
  font-size: 13px;
  line-height: 1.9;
}

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

.guide-grid article {
  min-height: 240px;
  padding: 30px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.guide-grid article:hover {
  border-color: rgba(216, 182, 109, 0.28);
  background: rgba(216, 182, 109, 0.035);
  transform: translateY(-4px);
}

.guide-grid article > span {
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 14px;
}

.guide-grid h3 {
  margin: 38px 0 14px;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 500;
}

.guide-grid p {
  margin: 0;
  color: var(--ivory-soft);
  font-size: 13px;
  line-height: 1.9;
}

.history-section {
  padding-bottom: 80px;
}

.text-button {
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid rgba(216, 182, 109, 0.28);
  color: rgba(244, 238, 223, 0.5);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.text-button:hover {
  color: var(--gold-bright);
}

.empty-history {
  display: grid;
  min-height: 230px;
  place-content: center;
  border: 1px dashed rgba(216, 182, 109, 0.15);
  border-radius: var(--radius-lg);
  color: rgba(244, 238, 223, 0.34);
  text-align: center;
}

.empty-history span {
  color: var(--gold);
  font-size: 30px;
}

.empty-history p {
  margin: 18px 0 5px;
  color: rgba(244, 238, 223, 0.58);
  font-family: var(--font-serif);
  font-size: 20px;
}

.empty-history small {
  font-size: 11px;
}

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

.history-item {
  display: grid;
  min-height: 210px;
  gap: 10px;
  padding: 25px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.history-item:hover {
  border-color: rgba(216, 182, 109, 0.28);
  background: rgba(216, 182, 109, 0.035);
  transform: translateY(-3px);
}

.history-date {
  color: rgba(216, 182, 109, 0.55);
  font-family: Georgia, serif;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.history-question {
  align-self: end;
  color: rgba(244, 238, 223, 0.58);
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
}

.history-answer {
  color: var(--gold-bright);
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.5;
}

.history-item small {
  align-self: end;
  color: rgba(244, 238, 223, 0.3);
  font-size: 10px;
}

.history-item small b {
  margin-left: 4px;
  color: var(--gold);
}

.site-footer {
  display: flex;
  min-height: 130px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line-soft);
  color: rgba(244, 238, 223, 0.34);
  font-size: 11px;
}

.site-footer p {
  margin: 0;
}

.site-footer p:first-child {
  display: grid;
  gap: 4px;
}

.site-footer strong {
  color: rgba(244, 238, 223, 0.68);
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.12em;
}

.site-footer a {
  color: var(--gold);
  text-underline-offset: 3px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  padding: 13px 18px;
  border: 1px solid rgba(216, 182, 109, 0.28);
  border-radius: 13px;
  color: var(--ivory);
  background: rgba(18, 22, 33, 0.92);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  font-size: 12px;
  animation: toastIn 240ms ease both;
}

@keyframes turnPage {
  0% { transform: rotateY(0deg); opacity: 0; }
  12% { opacity: 1; }
  70%, 100% { transform: rotateY(178deg); opacity: 0; }
}

@keyframes answerReveal {
  from { opacity: 0; transform: translateY(18px); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

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

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    max-width: 720px;
    min-height: auto;
    padding-top: 70px;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-lead,
  .hero-footnote {
    margin-inline: auto;
  }

  .hero-notes {
    justify-content: center;
  }

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

@media (max-width: 680px) {
  .page-shell,
  .site-header {
    width: min(100% - 28px, 560px);
  }

  .site-header {
    min-height: 80px;
  }

  .site-nav {
    display: none;
  }

  .hero {
    gap: 44px;
    padding: 46px 0 74px;
  }

  .hero-copy h1 {
    font-size: clamp(43px, 13vw, 62px);
  }

  .hero-lead {
    font-size: 15px;
  }

  .hero-notes {
    grid-template-columns: 1fr 1fr;
  }

  .oracle-card {
    min-height: 590px;
    padding: 28px 20px 32px;
    border-radius: 26px;
  }

  .card-header {
    padding-inline: 6px;
  }

  .ask-form {
    padding-top: 32px;
  }

  .field-footer span:first-child {
    display: none;
  }

  .field-footer {
    justify-content: flex-end;
  }

  .suggestions > span {
    width: 100%;
  }

  .answer-state {
    padding: 36px 6px 0;
  }

  .answer-actions {
    grid-template-columns: 1fr;
  }

  .guide-section,
  .history-section {
    padding: 72px 0;
  }

  .section-heading,
  .history-header {
    display: grid;
    gap: 18px;
    margin-bottom: 30px;
  }

  .guide-grid,
  .history-list {
    grid-template-columns: 1fr;
  }

  .guide-grid article {
    min-height: 200px;
  }

  .site-footer {
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    text-align: center;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
