:root {
  color-scheme: light;
  --ink: #1f2522;
  --muted: #68716b;
  --paper: #f7f1e8;
  --panel: rgba(255, 252, 244, 0.94);
  --line: rgba(47, 65, 58, 0.16);
  --gold: #c09143;
  --deep-gold: #8b642a;
  --jade: #0f6f68;
  --purple: #49305f;
  --fire: #bd5b3a;
  --shadow: 0 22px 60px rgba(35, 31, 22, 0.15);
  font-family:
    Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at 88% 10%, rgba(73, 48, 95, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(247, 241, 232, 0.96), #efe5d8 55%, #fbf8ef),
    var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: min(260px, calc(100vw - 28px));
  padding: 0 18px;
  border-radius: 999px;
  background: #25d366;
  color: #092f18;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(6, 95, 44, 0.28);
}

.hero {
  position: relative;
  min-height: 58vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__image {
  object-fit: cover;
  filter: saturate(0.88) contrast(1.08);
}

.hero__shade {
  background:
    linear-gradient(90deg, rgba(22, 18, 28, 0.8), rgba(31, 28, 24, 0.38) 52%, rgba(22, 18, 28, 0.18)),
    linear-gradient(0deg, rgba(247, 241, 232, 0.98), rgba(247, 241, 232, 0) 34%);
}

.hero__content {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 94px 0 74px;
  color: #fffaf0;
}

.project-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.project-switch a {
  min-width: 92px;
  border: 1px solid rgba(232, 201, 130, 0.72);
  border-radius: 999px;
  padding: 9px 16px;
  color: #fffaf0;
  background: rgba(31, 37, 34, 0.32);
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
}

.project-switch a:hover,
.project-switch a.is-active {
  color: #1f2522;
  background: #e8c982;
}

.eyebrow {
  margin: 0 0 14px;
  color: #e8c982;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(2.55rem, 7.6vw, 6.3rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.intro {
  max-width: 700px;
  margin-bottom: 0;
  color: rgba(255, 250, 240, 0.9);
  font-size: 1.12rem;
  line-height: 1.75;
}

.workspace,
.report-shell,
.legal-section,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 410px) 1fr;
  gap: 22px;
  transform: translateY(-34px);
}

.report-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(320px, 1.08fr);
  gap: 22px;
  padding-bottom: 56px;
}

.name-panel {
  grid-column: 1 / -1;
}

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(14px);
}

.panel__heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.step {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(184, 138, 61, 0.42);
  color: var(--jade);
  font-weight: 900;
  font-size: 0.82rem;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.22rem;
}

.panel__heading p,
.note {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.62;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: #3a443f;
  font-weight: 900;
}

.field input,
.field select {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(47, 65, 58, 0.2);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: rgba(184, 138, 61, 0.78);
  box-shadow: 0 0 0 4px rgba(184, 138, 61, 0.12);
}

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

.primary-button,
.download-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--purple));
  color: #fffaf0;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(73, 48, 95, 0.18);
}

.download-button {
  width: auto;
  min-width: 160px;
  padding: 0 22px;
  border: 1px solid rgba(15, 111, 104, 0.22);
  background: #fffaf0;
  color: var(--jade);
}

.download-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.note {
  margin-top: 14px;
  font-size: 0.92rem;
}

.palace-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(73, 48, 95, 0.14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(232, 201, 130, 0.14)),
    rgba(255, 250, 240, 0.7);
}

.palace {
  min-height: 112px;
  border: 1px solid rgba(47, 65, 58, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.62);
}

.palace.is-core {
  border-color: rgba(184, 138, 61, 0.88);
  background: linear-gradient(145deg, rgba(232, 201, 130, 0.38), rgba(255, 255, 255, 0.76));
}

.palace__name {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--jade);
  font-weight: 900;
}

.palace__star {
  margin-top: 9px;
  color: var(--purple);
  font-size: 1.18rem;
  font-weight: 900;
}

.palace__note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.42;
}

.quick-stats,
.bazi-grid,
.element-board,
.name-grid,
.name-summary,
.name-elements,
.energy-grid,
.download-row {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.quick-stats {
  grid-template-columns: repeat(3, 1fr);
}

.stat,
.pillar,
.element-card,
.advice-card {
  border: 1px solid rgba(47, 65, 58, 0.13);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.56);
}

.stat strong,
.pillar strong,
.element-card strong,
.advice-card strong {
  display: block;
  color: var(--jade);
  font-size: 0.92rem;
}

.stat span,
.pillar span,
.element-card span {
  display: block;
  margin-top: 8px;
  color: var(--purple);
  font-size: 1.32rem;
  font-weight: 900;
}

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

.element-board {
  grid-template-columns: repeat(5, 1fr);
}

.name-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(184, 138, 61, 0.24);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(73, 48, 95, 0.09), rgba(232, 201, 130, 0.24)),
    rgba(255, 255, 255, 0.6);
}

.name-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--deep-gold);
  font-size: 0.8rem;
  font-weight: 900;
}

.name-hero-card h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: clamp(1.7rem, 5vw, 3rem);
  line-height: 1.05;
}

.name-hero-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.name-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  color: #fffaf0;
  background: radial-gradient(circle at 30% 25%, #e8c982, var(--purple) 72%);
  box-shadow: 0 18px 34px rgba(73, 48, 95, 0.18);
}

.name-number span {
  display: block;
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}

.name-number small {
  font-weight: 900;
}

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

.name-tile {
  border: 1px solid rgba(47, 65, 58, 0.14);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.name-tile__role {
  color: var(--jade);
  font-size: 0.82rem;
  font-weight: 900;
}

.name-tile strong {
  display: block;
  margin: 6px 0;
  font-size: 2.15rem;
  line-height: 1;
}

.name-tile small,
.mini-note {
  color: var(--muted);
  line-height: 1.55;
}

.name-summary {
  grid-template-columns: repeat(3, 1fr);
}

.name-summary article {
  border: 1px solid rgba(15, 111, 104, 0.15);
  border-radius: 8px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.56);
}

.name-summary strong {
  display: block;
  margin-bottom: 8px;
  color: var(--jade);
}

.name-summary p {
  margin-bottom: 0;
  color: #3f4a44;
  line-height: 1.68;
}

.name-elements {
  grid-template-columns: repeat(5, 1fr);
}

.name-element {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.name-element i {
  height: 8px;
  border-radius: 999px;
  background: rgba(47, 65, 58, 0.12);
  overflow: hidden;
}

.name-element b {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.mini-note {
  margin: 16px 0 0;
  font-size: 0.9rem;
}

.meter {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(47, 65, 58, 0.12);
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--fire));
}

.report {
  color: #3f4a44;
  font-size: 1.02rem;
  line-height: 1.86;
}

.report h3 {
  margin: 24px 0 8px;
  color: var(--jade);
  font-size: 1.16rem;
}

.report blockquote {
  margin: 18px 0;
  padding: 18px;
  border-left: 5px solid var(--gold);
  background: rgba(232, 201, 130, 0.14);
}

.report ul {
  padding-left: 20px;
}

.destiny-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 16px 0 22px;
  overflow: hidden;
  border: 1px solid rgba(47, 65, 58, 0.16);
  border-radius: 8px;
  background: rgba(47, 65, 58, 0.16);
}

.destiny-table div {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  padding: 13px 14px;
  background: rgba(255, 253, 248, 0.86);
}

.destiny-table b,
.destiny-grid b,
.pillar-table strong,
.luck-table strong {
  color: var(--jade);
  font-weight: 900;
}

.destiny-table span {
  color: #3f4a44;
}

.pillar-table,
.luck-table,
.destiny-grid {
  display: grid;
  gap: 12px;
  margin: 16px 0 22px;
}

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

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

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

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

.pillar-table section,
.luck-table section,
.destiny-grid section {
  border: 1px solid rgba(47, 65, 58, 0.14);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(232, 201, 130, 0.12), rgba(255, 255, 255, 0.58)),
    rgba(255, 253, 248, 0.72);
}

.pillar-table b,
.luck-table b {
  display: block;
  margin: 6px 0;
  color: var(--purple);
  font-size: 1.25rem;
}

.pillar-table span,
.luck-table span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--deep-gold);
  font-weight: 900;
}

.pillar-table small,
.luck-table small {
  display: block;
  color: var(--muted);
  line-height: 1.55;
}

.destiny-grid p,
.destiny-grid ul {
  margin-bottom: 0;
}

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

.advanced-grid section {
  border: 1px solid rgba(47, 65, 58, 0.14);
  border-radius: 8px;
  padding: 15px;
  background:
    linear-gradient(145deg, rgba(73, 48, 95, 0.08), rgba(255, 255, 255, 0.58)),
    rgba(255, 253, 248, 0.74);
}

.advanced-grid b {
  display: block;
  margin-bottom: 8px;
  color: var(--jade);
  font-weight: 900;
}

.advanced-grid p {
  margin: 0;
}

.tai-sui-card {
  margin: 24px 0 4px;
  overflow: hidden;
  border: 1px solid rgba(189, 91, 58, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(189, 91, 58, 0.15), rgba(232, 201, 130, 0.15)),
    rgba(255, 250, 240, 0.96);
  box-shadow: 0 18px 44px rgba(88, 52, 24, 0.12);
}

.tai-sui-card__head {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 16px;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(189, 91, 58, 0.18);
}

.tai-sui-card__head span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--fire);
  color: #fffaf0;
  font-size: 1.25rem;
  font-weight: 900;
}

.tai-sui-card__head h3 {
  margin-bottom: 6px;
  color: var(--fire);
}

.tai-sui-card__head p,
.tai-sui-result p {
  margin-bottom: 0;
}

.tai-sui-result {
  margin: 18px 22px;
  padding: 16px 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.tai-sui-result strong {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 6px 12px;
  color: #fffaf0;
  background: var(--jade);
}

.tai-sui-result.is-alert strong {
  background: var(--fire);
}

.tai-sui-button {
  display: flex;
  justify-content: center;
  margin: 0 22px 22px;
  border-radius: 999px;
  padding: 14px 20px;
  color: #fffaf0;
  background: linear-gradient(135deg, #bd5b3a, #8b642a);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(134, 71, 38, 0.24);
}

.legal-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 8px 0 28px;
}

.legal-section details {
  border: 1px solid rgba(47, 65, 58, 0.16);
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.78);
  box-shadow: 0 12px 34px rgba(35, 31, 22, 0.08);
}

.legal-section summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  color: var(--deep-gold);
  font-size: 1.08rem;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.legal-section summary::-webkit-details-marker {
  display: none;
}

.legal-section summary::after {
  content: "+";
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
}

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

.legal-content {
  padding: 0 20px 20px;
  color: #3f4a44;
  font-size: 0.95rem;
  line-height: 1.8;
}

.legal-content p:last-child {
  margin-bottom: 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer h2 {
  color: var(--ink);
}

.visitor-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 8px 13px;
  border: 1px solid rgba(192, 145, 67, 0.28);
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.72);
  color: var(--deep-gold);
  font-weight: 900;
}

.visitor-counter span {
  color: var(--jade);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--jade);
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 920px) {
  .workspace,
  .report-shell {
    grid-template-columns: 1fr;
  }

  .name-summary,
  .name-elements,
  .destiny-table,
  .destiny-grid,
  .destiny-grid--wide,
  .advanced-grid,
  .legal-section {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 640px) {
  .hero {
    min-height: 64vh;
  }

  .hero__content,
  .workspace,
  .report-shell,
  .legal-section,
  .site-footer {
    width: min(100% - 22px, 1120px);
  }

  .hero__content {
    padding: 74px 0 58px;
  }

  .workspace {
    transform: translateY(-22px);
  }

  .panel {
    padding: 18px;
  }

  .date-grid,
  .quick-stats,
  .bazi-grid,
  .name-grid,
  .element-board,
  .pillar-table,
  .luck-table {
    grid-template-columns: 1fr;
  }

  .destiny-table div {
    grid-template-columns: 1fr;
  }

  .name-hero-card {
    display: block;
  }

  .name-number {
    width: 92px;
    height: 92px;
    margin-top: 16px;
  }

  .palace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 7px;
  }

  .palace {
    min-height: 104px;
    padding: 9px;
  }

  .site-footer {
    display: block;
  }

  .whatsapp-float {
    right: 12px;
    bottom: 12px;
    min-height: 44px;
    padding: 0 14px;
    font-size: 0.88rem;
  }

  .tai-sui-card__head {
    grid-template-columns: 1fr;
  }

  .footer-links {
    margin-top: 18px;
  }
}
