:root {
  --paper: #fff9f0;
  --paper-strong: #fffdf8;
  --ink: #1e1d1a;
  --muted: #746d62;
  --line: #ddd0bf;
  --red: #b92d2a;
  --red-dark: #7f1f1c;
  --jade: #0f766e;
  --gold: #c88a22;
  --blue: #2f5b8f;
  --shadow: 0 18px 60px rgba(39, 29, 15, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui,
    sans-serif;
  background:
    linear-gradient(120deg, rgba(185, 45, 42, 0.09), transparent 32%),
    linear-gradient(300deg, rgba(15, 118, 110, 0.1), transparent 36%),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(300px, 390px) 1fr;
  gap: 20px;
  align-items: stretch;
}

.tool-panel,
.result-panel {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.tool-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-row,
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-row {
  justify-content: flex-start;
}

.seal {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--red);
  color: var(--red);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--jade);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 40px);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.birth-form,
.quick-lookup {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--paper-strong);
}

.field input:focus,
.field select:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--jade);
}

.field.compact {
  grid-template-columns: 1fr;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  box-shadow: 0 12px 24px rgba(185, 45, 42, 0.2);
}

.secondary-button {
  min-width: 108px;
  padding: 0 16px;
  color: var(--red-dark);
  border: 1px solid rgba(185, 45, 42, 0.28);
  background: rgba(185, 45, 42, 0.08);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.quick-lookup {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.lookup-result {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(15, 118, 110, 0.42);
  border-radius: 6px;
  color: var(--jade);
  font-size: 24px;
  font-weight: 900;
  background: rgba(15, 118, 110, 0.06);
}

.result-panel {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.score-badge {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 2px solid var(--gold);
  color: var(--red-dark);
  background: rgba(200, 138, 34, 0.1);
}

.score-badge span {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.score-badge small {
  color: var(--muted);
  font-weight: 800;
}

.zodiac-stage {
  min-height: 310px;
  display: grid;
  place-items: center;
  position: relative;
}

.zodiac-ring {
  width: min(320px, 70vw);
  aspect-ratio: 1;
  position: relative;
  border: 2px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 42%, rgba(200, 138, 34, 0.12) 43%, transparent 45%),
    conic-gradient(
      from -15deg,
      rgba(185, 45, 42, 0.12),
      rgba(15, 118, 110, 0.12),
      rgba(47, 91, 143, 0.12),
      rgba(200, 138, 34, 0.12),
      rgba(185, 45, 42, 0.12)
    );
}

.zodiac-item {
  --angle: calc(var(--i) * 30deg);
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--paper-strong);
  font-weight: 900;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-132px) rotate(calc(-1 * var(--angle)));
  transition: 180ms ease;
}

.zodiac-item.active {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
  box-shadow: 0 12px 24px rgba(185, 45, 42, 0.24);
}

.zodiac-core {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--paper-strong);
  transform: translate(-50%, -50%);
}

.zodiac-core span {
  color: var(--red-dark);
  font-size: 58px;
  font-weight: 900;
  line-height: 1;
}

.zodiac-core small {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
}

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

.metric,
.reading-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.metric {
  min-height: 82px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  color: var(--blue);
  font-size: 28px;
}

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

.reading-card {
  min-height: 150px;
  padding: 18px;
}

.reading-card p,
.reading-card li {
  color: #3f3a34;
  line-height: 1.75;
}

.reading-card ul {
  margin: 0;
  padding-left: 20px;
}

.tarot-section {
  display: grid;
  gap: 14px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.tarot-card {
  min-height: 286px;
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper-strong);
  background:
    linear-gradient(160deg, rgba(47, 91, 143, 0.88), rgba(30, 29, 26, 0.94)),
    var(--blue);
  box-shadow: 0 14px 32px rgba(31, 33, 34, 0.14);
}

.tarot-card.reversed {
  background:
    linear-gradient(160deg, rgba(127, 31, 28, 0.9), rgba(30, 29, 26, 0.94)),
    var(--red-dark);
}

.tarot-position {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: rgba(255, 253, 248, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.tarot-illustration {
  min-height: 118px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 253, 248, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(200, 138, 34, 0.3), transparent 38%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.1), rgba(255, 253, 248, 0.03));
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  font-weight: 900;
}

.tarot-card.reversed .tarot-illustration span {
  display: inline-block;
  transform: rotate(180deg);
}

.tarot-name {
  margin: 0;
  color: #fffdf8;
  font-size: 22px;
  line-height: 1.2;
}

.tarot-keyword {
  margin: 0;
  color: rgba(255, 253, 248, 0.7);
  font-size: 13px;
  font-weight: 800;
}

.tarot-reading {
  margin: 0;
  color: rgba(255, 253, 248, 0.86);
  line-height: 1.6;
}

.tarot-message {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(200, 138, 34, 0.1));
}

.tarot-message p {
  margin-bottom: 0;
  color: #3f3a34;
  line-height: 1.75;
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 18px 0;
  }

  .tool-panel,
  .result-panel {
    padding: 20px;
  }

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

  .tarot-spread {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .brand-row,
  .result-header,
  .section-heading {
    align-items: flex-start;
  }

  .section-heading {
    flex-direction: column;
  }

  .secondary-button {
    width: 100%;
  }

  .score-badge {
    width: 76px;
    height: 76px;
  }

  .score-badge span {
    font-size: 28px;
  }

  .zodiac-stage {
    min-height: 260px;
  }

  .zodiac-item {
    width: 38px;
    height: 38px;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-108px) rotate(calc(-1 * var(--angle)));
  }

  .zodiac-core {
    width: 110px;
    height: 110px;
  }

  .zodiac-core span {
    font-size: 48px;
  }

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