:root {
  color-scheme: dark;
  --bg: #090b18;
  --panel: rgba(17, 23, 45, 0.8);
  --panel-strong: rgba(23, 32, 61, 0.94);
  --line: rgba(188, 202, 255, 0.2);
  --text: #f4f7ff;
  --muted: #b8c1df;
  --dim: #7f8aae;
  --gold: #f3d07c;
  --fire: #ff6a4a;
  --earth: #8bd07d;
  --air: #78d9ff;
  --water: #8f95ff;
  --focus: #ffd37b;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.42);
  --content-wide: 1180px;
  --ad-rail-width: 160px;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 106, 74, 0.18), transparent 26%),
    radial-gradient(circle at 84% 10%, rgba(120, 217, 255, 0.18), transparent 28%),
    linear-gradient(150deg, #080914 0%, #101832 50%, #070a16 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.58) 0 1px, transparent 1.5px);
  background-position: 0 0, 42px 62px;
  background-size: 92px 92px, 137px 137px;
  opacity: 0.5;
}

body::after {
  background:
    linear-gradient(115deg, transparent 0 41%, rgba(255, 255, 255, 0.08) 42%, transparent 43% 100%),
    linear-gradient(35deg, transparent 0 63%, rgba(120, 217, 255, 0.08) 64%, transparent 65% 100%);
  z-index: -1;
  opacity: 0.34;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-shell {
  width: min(var(--content-wide), calc(100% - 36px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(6, 9, 20, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #151015;
  background: radial-gradient(circle at 32% 28%, #fff7d6 0 12%, #f5d37a 13% 44%, #c68bff 45% 100%);
  box-shadow: 0 0 28px rgba(243, 208, 124, 0.48);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 999px;
  transition: color 160ms ease, background 160ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  align-items: center;
  padding: 56px 0 42px;
}

.page-hero {
  padding: 72px 0 18px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(390px, 1.14fr);
  gap: 36px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 14px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

h1 {
  font-size: clamp(42px, 7vw, 80px);
  line-height: 0.98;
  margin-bottom: 22px;
  letter-spacing: 0;
}

.page-hero h1 {
  max-width: 860px;
}

.hero-copy {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.85;
  max-width: 700px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  color: #111521;
  background: linear-gradient(135deg, #fff0b7, #f3d07c 55%, #f2a65d);
  box-shadow: 0 14px 36px rgba(243, 208, 124, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(243, 208, 124, 0.28);
}

.btn.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  box-shadow: none;
}

.home-orbit {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.08) 0 2px, transparent 2.5px) center / 46px 46px,
    rgba(10, 15, 30, 0.72);
  box-shadow: var(--shadow);
}

.zodiac-dot {
  min-height: 104px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 42%);
  background: rgba(10, 15, 30, 0.78);
  color: var(--text);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent), transparent 78%);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.zodiac-dot:hover,
.zodiac-dot:focus-visible {
  transform: translateY(-3px);
  background: color-mix(in srgb, var(--accent), #10182f 72%);
  border-color: var(--accent);
  outline: none;
}

.zodiac-symbol {
  font-size: 28px;
  line-height: 1;
}

.zodiac-name {
  font-size: 14px;
  font-weight: 800;
}

.zodiac-date {
  font-size: 12px;
  color: var(--muted);
}

section {
  padding: 64px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 26px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
  margin-bottom: 10px;
  letter-spacing: 0;
}

.section-head p {
  color: var(--muted);
  line-height: 1.8;
  max-width: 680px;
  margin-bottom: 0;
}

.section-kicker {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.surface {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: stretch;
}

.match-tool-layout {
  grid-template-columns: minmax(420px, 1.05fr) minmax(0, 0.95fr);
  align-items: start;
}

.tool-panel {
  padding: 22px;
}

.tool-panel h3 {
  font-size: 22px;
  margin-bottom: 10px;
}

.tool-panel p {
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.picker-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pick-slot {
  min-height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--text);
  background: rgba(4, 7, 17, 0.6);
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 6px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.pick-slot span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pick-slot strong {
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.pick-slot.is-active {
  border-color: var(--focus);
  background: rgba(255, 211, 123, 0.11);
  box-shadow: 0 0 0 3px rgba(255, 211, 123, 0.12);
}

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

.match-sign-card {
  min-height: 106px;
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 54%);
  border-radius: 8px;
  color: var(--text);
  background: rgba(10, 15, 30, 0.74);
  padding: 12px 10px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  text-align: center;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.match-sign-card:hover,
.match-sign-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent), #10182f 78%);
  outline: none;
}

.match-sign-card.is-first,
.match-sign-card.is-second {
  border-color: var(--accent);
  box-shadow: 0 0 28px color-mix(in srgb, var(--accent), transparent 74%);
}

.match-symbol {
  color: var(--accent);
  font-size: 27px;
  line-height: 1;
}

.match-sign-card strong {
  font-size: 15px;
  line-height: 1.2;
}

.match-sign-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.match-card-state {
  min-height: 20px;
  border-radius: 999px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111521;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}

.match-sign-card.is-first .match-card-state {
  background: var(--gold);
}

.match-sign-card.is-second .match-card-state {
  background: var(--air);
}

.match-sign-card.is-first.is-second .match-card-state {
  background: linear-gradient(135deg, var(--gold), var(--air));
}

.match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn.compact {
  min-height: 46px;
  padding-inline: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--text);
  background: rgba(4, 7, 17, 0.72);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(255, 211, 123, 0.15);
}

select option {
  color: #151827;
}

.result-panel {
  min-height: 100%;
  padding: 24px;
  display: grid;
  align-content: center;
  overflow: hidden;
}

.result-empty {
  color: var(--muted);
  line-height: 1.8;
}

.result-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 50%);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent), transparent 70%), transparent 34%),
    rgba(10, 15, 31, 0.78);
  padding: 22px;
}

.result-card::before {
  content: attr(data-symbol);
  position: absolute;
  right: -2px;
  bottom: -42px;
  font-size: 154px;
  color: color-mix(in srgb, var(--accent), transparent 84%);
  line-height: 1;
}

.result-card > * {
  position: relative;
}

.result-card h3 {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 10px;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 13px;
  font-weight: 700;
}

.result-card p {
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 16px;
  max-width: 720px;
}

.traits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.trait-box {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  padding: 14px;
}

.trait-box strong {
  display: block;
  margin-bottom: 8px;
}

.trait-box span {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.feature-grid,
.element-grid,
.zodiac-grid,
.love-grid,
.story-grid {
  display: grid;
  gap: 16px;
}

.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.feature-card,
.element-card,
.sign-card,
.love-card,
.story-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 20px;
}

.feature-card {
  min-height: 230px;
  display: grid;
  align-content: start;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.feature-card:hover,
.feature-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(243, 208, 124, 0.7);
  background: rgba(23, 32, 61, 0.92);
  outline: none;
}

.feature-card span {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #151015;
  background: var(--gold);
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 18px;
}

.feature-card h3,
.element-card h3,
.love-card h3,
.story-card h3 {
  font-size: 23px;
  margin-bottom: 10px;
}

.feature-card p,
.element-card p,
.love-card p,
.story-card p,
.sign-card p {
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 0;
}

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

.element-card {
  min-height: 390px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.element-card::after {
  content: "";
  position: absolute;
  inset: auto 10px -54px auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent), transparent 78%);
}

.element-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.element-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent), transparent 78%);
  color: var(--accent);
  font-weight: 900;
  font-size: 22px;
}

.element-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}

.element-list li::before {
  content: "✦";
  color: var(--accent);
  margin-right: 8px;
}

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

.sign-card {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent), transparent 75%), transparent 36%),
    var(--panel);
}

.sign-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.sign-card h3 {
  font-size: 24px;
  margin-bottom: 4px;
}

.sign-card .date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sign-card .symbol {
  color: var(--accent);
  font-size: 38px;
  line-height: 1;
  text-shadow: 0 0 24px color-mix(in srgb, var(--accent), transparent 34%);
}

details {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 800;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  float: right;
  color: var(--muted);
}

details[open] summary::after {
  content: "-";
}

.detail-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin: 12px 0 0;
}

.match-bars {
  display: grid;
  gap: 15px;
  margin: 18px 0;
}

.score-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.bar span {
  display: block;
  height: 100%;
  width: var(--score);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--air), var(--gold), var(--fire));
}

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

.love-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent), transparent 78%), transparent 38%),
    var(--panel);
}

.love-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.love-symbol {
  color: var(--accent);
  font-size: 42px;
  line-height: 1;
  text-shadow: 0 0 24px color-mix(in srgb, var(--accent), transparent 36%);
}

.scene {
  color: var(--gold) !important;
  font-weight: 800;
  font-size: 14px;
}

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

.story-card {
  min-height: 244px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 42%),
    var(--panel);
}

.story-tag {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}

.footer {
  padding: 34px 0 46px;
  color: var(--dim);
  text-align: center;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
}

.toast {
  min-height: 28px;
  color: #ffd8a6;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 10px;
}

.side-ad {
  display: none;
}

.share-rail {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 9, 20, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

.share-label {
  display: none;
}

.share-stack {
  display: flex;
  gap: 7px;
}

.share-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
  line-height: 1;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.share-button:hover,
.share-button:focus-visible {
  transform: translateY(-2px);
  color: #111521;
  background: var(--gold);
  border-color: var(--gold);
  outline: none;
}

.share-button svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.share-button .brand-letter {
  font-size: 14px;
  font-weight: 900;
}

.share-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 1540px) {
  :root {
    --content-wide: 1020px;
  }

  .side-ad {
    position: fixed;
    top: 96px;
    bottom: 24px;
    z-index: 8;
    width: var(--ad-rail-width);
    display: block;
    pointer-events: none;
  }

  .side-ad-left {
    left: 24px;
  }

  .side-ad-right {
    right: 24px;
  }

  .side-ad-inner {
    position: sticky;
    top: 96px;
    width: 100%;
    min-height: 600px;
    border: 1px dashed rgba(188, 202, 255, 0.24);
    border-radius: 8px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: rgba(184, 193, 223, 0.68);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
      rgba(6, 9, 20, 0.35);
    text-align: center;
    font-size: 12px;
    letter-spacing: 0;
  }

  .side-ad-inner strong {
    color: rgba(244, 247, 255, 0.74);
    font-size: 18px;
  }

  .share-rail {
    top: 50%;
    bottom: auto;
    right: calc((100vw - var(--content-wide)) / 2 - 62px);
    transform: translateY(-50%);
    flex-direction: column;
    border-radius: 999px;
    padding: 10px 8px;
  }

  .share-rail:hover {
    z-index: 31;
  }

  .share-label {
    display: block;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: var(--dim);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 0;
  }

  .share-stack {
    flex-direction: column;
  }
}

@media (min-width: 1760px) {
  :root {
    --content-wide: 1180px;
  }
}

@media (max-width: 1040px) {
  .hero-grid,
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .home-orbit,
  .feature-grid,
  .element-grid,
  .zodiac-grid,
  .love-grid,
  .story-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 28px, 1180px);
  }

  .nav {
    align-items: start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-links {
    justify-content: start;
  }

  .hero,
  .page-hero {
    padding-top: 34px;
    min-height: auto;
  }

  h1 {
    font-size: 44px;
  }

  .hero-copy {
    font-size: 16px;
  }

  .home-orbit,
  .feature-grid,
  .traits,
  .element-grid,
  .zodiac-grid,
  .love-grid,
  .story-grid {
    grid-template-columns: 1fr;
  }

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

  .section-head {
    display: block;
  }

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

  .score-row {
    grid-template-columns: 48px minmax(0, 1fr) 42px;
  }
}

@media (max-width: 420px) {
  .btn {
    width: 100%;
  }
}
