:root {
  --bg: #f4efe4;
  --bg-deep: #dfd1b5;
  --surface: rgba(255, 250, 241, 0.82);
  --surface-strong: rgba(255, 250, 241, 0.95);
  --surface-dark: rgba(35, 24, 15, 0.9);
  --stroke: rgba(80, 57, 24, 0.12);
  --text: #23180f;
  --muted: #6b5d4c;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --accent-strong: #c46b18;
  --positive: #0f766e;
  --negative: #b42318;
  --shadow: 0 24px 80px rgba(62, 44, 19, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(196, 107, 24, 0.18), transparent 32%),
    radial-gradient(circle at 85% 12%, rgba(15, 118, 110, 0.14), transparent 22%),
    linear-gradient(160deg, #f8f3e8 0%, #eee5d5 45%, #e7dbc6 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.55;
}

body::before {
  width: 22rem;
  height: 22rem;
  right: -8rem;
  top: 14rem;
  background: rgba(15, 118, 110, 0.15);
}

body::after {
  width: 18rem;
  height: 18rem;
  left: -6rem;
  bottom: 4rem;
  background: rgba(196, 107, 24, 0.14);
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 28px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(255, 250, 241, 0.82), rgba(247, 239, 224, 0.62));
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -3rem;
  top: -4rem;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.16), transparent 68%);
  pointer-events: none;
}

.hero-copy,
.hero-panel {
  position: relative;
  z-index: 1;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-logo {
  width: 94px;
  height: 94px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  box-shadow: 0 20px 40px rgba(35, 24, 15, 0.12);
}

.hero-brand-copy {
  min-width: 0;
}

.eyebrow,
.card-kicker {
  margin: 0 0 10px;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.hero h1,
.card h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.25rem);
  line-height: 1.08;
}

.hero-text {
  max-width: 44rem;
  margin: 18px 0 0;
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--muted);
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-highlights span {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(80, 57, 24, 0.08);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: nowrap;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-pills a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(80, 57, 24, 0.08);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.hero-pills a:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 118, 110, 0.25);
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: stretch;
}

.panel-metric {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(35, 24, 15, 0.92), rgba(72, 46, 22, 0.84));
  color: #f6efe6;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-metric-primary {
  grid-column: 1 / -1;
  min-height: 138px;
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.24), transparent 28%),
    linear-gradient(155deg, rgba(35, 24, 15, 0.98), rgba(15, 118, 110, 0.92));
}

.panel-metric span {
  color: rgba(246, 239, 230, 0.72);
  font-size: 0.92rem;
}

.panel-metric strong {
  font-size: 1.25rem;
  line-height: 1.4;
}

.panel-metric small {
  margin-top: 14px;
  color: rgba(246, 239, 230, 0.76);
  font-size: 0.88rem;
  line-height: 1.6;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
  align-items: start;
}

.card {
  padding: 28px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 118, 110, 0.14);
  box-shadow: 0 28px 80px rgba(62, 44, 19, 0.16);
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.card-head p:last-child,
.card-head div p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.calculator-form {
  display: grid;
  gap: 16px;
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
  border-radius: 28px;
  background:
    linear-gradient(155deg, rgba(255, 250, 241, 0.88), rgba(248, 242, 230, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.44);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.feature-item {
  min-width: 0;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(80, 57, 24, 0.08);
}

.feature-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.feature-item strong {
  display: block;
  font-size: 1.04rem;
  line-height: 1.55;
}

.feature-item p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.field-group {
  display: grid;
  gap: 10px;
}

.field-group.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-group.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field-group.five-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

label {
  font-size: 0.94rem;
  color: var(--text);
}

input {
  font: inherit;
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input:focus {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
  transform: translateY(-1px);
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.result-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: var(--surface-strong);
  border: 1px solid rgba(80, 57, 24, 0.08);
}

.result-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -24px auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(15, 118, 110, 0.07);
}

.result-card.warn::after {
  background: rgba(180, 35, 24, 0.08);
}

.result-label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.result-value {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.15rem, 2vw, 1.72rem);
  font-weight: 700;
  line-height: 1.2;
}

.result-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

.neutral {
  color: var(--text);
}

.allocation-card,
.wide-card {
  grid-column: 1 / -1;
}

.allocation-meta {
  margin-top: 18px;
}

.allocation-meta span {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(80, 57, 24, 0.08);
  color: var(--muted);
}

.quote-assist {
  min-height: 22px;
}

.quote-pill {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.45;
  border: 1px solid rgba(80, 57, 24, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.quote-pill strong {
  color: var(--text);
}

.quote-pill-loading {
  color: var(--accent);
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.18);
}

.quote-pill-success {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.16);
}

.quote-pill-error {
  color: var(--negative);
  background: rgba(180, 35, 24, 0.08);
  border-color: rgba(180, 35, 24, 0.18);
}

.quote-ratio {
  font-weight: 700;
}

.valuation-summary {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
}

.valuation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.valuation-meta span {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(80, 57, 24, 0.08);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.allocation-breakdown {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
}

.allocation-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 160px;
  align-items: center;
  gap: 14px;
}

.allocation-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(80, 57, 24, 0.08);
}

.allocation-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  width: 0;
  transition: width 420ms ease;
}

.allocation-fill.stock {
  background: linear-gradient(90deg, #0f766e, #14b8a6);
}

.allocation-fill.etf {
  background: linear-gradient(90deg, #b45309, #f59e0b);
}

.allocation-fill.bond {
  background: linear-gradient(90deg, #1d4ed8, #60a5fa);
}

.allocation-fill.gold {
  background: linear-gradient(90deg, #ca8a04, #facc15);
}

.allocation-fill.btc {
  background: linear-gradient(90deg, #9333ea, #f97316);
}

.allocation-amount {
  justify-self: end;
  font-weight: 600;
}

.footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: center;
  margin-top: 24px;
  padding: 22px;
  border-radius: 20px;
  background: rgba(255, 250, 241, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: var(--muted);
  line-height: 1.7;
}

.footer-copy p {
  margin: 0;
}

.footer-title {
  margin-bottom: 8px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 1.16rem;
  color: var(--text);
}

.footer-note {
  margin-top: 10px;
}

.footer-qr {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(80, 57, 24, 0.08);
}

.footer-qr img {
  width: 100%;
  max-width: 180px;
  border-radius: 18px;
  display: block;
}

.footer-qr span {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: riseIn 700ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal:nth-child(2) {
  animation-delay: 90ms;
}

.reveal:nth-child(3) {
  animation-delay: 160ms;
}

.reveal:nth-child(4) {
  animation-delay: 220ms;
}

.reveal:nth-child(5) {
  animation-delay: 280ms;
}

@keyframes riseIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .feature-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .allocation-card {
    grid-column: auto;
  }

  .wide-card {
    grid-column: auto;
  }

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

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

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

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 960px);
    padding-top: 20px;
    padding-bottom: 40px;
  }

  .hero,
  .card {
    padding: 20px;
    border-radius: 24px;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero-highlights {
    margin-top: 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .hero-highlights::-webkit-scrollbar,
  .hero-pills::-webkit-scrollbar {
    display: none;
  }

  .hero-brand {
    gap: 14px;
    margin-bottom: 16px;
  }

  .hero-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
  }

  .hero-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-right: -4px;
  }

  .hero-pills a,
  .hero-highlights span {
    flex: 0 0 auto;
  }

  .panel-metric,
  .panel-metric-primary {
    min-height: auto;
  }

  .feature-band,
  .hero-panel,
  .field-group.two-up,
  .field-group.three-up,
  .field-group.five-grid {
    grid-template-columns: 1fr;
  }

  .card-head {
    flex-direction: column;
    gap: 10px;
  }

  input {
    font-size: 16px;
  }

  .quote-pill {
    width: 100%;
  }

  .allocation-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .allocation-amount {
    justify-self: start;
  }

  .footer {
    padding: 20px;
  }

  .footer-qr img {
    max-width: 160px;
  }
}
