:root {
  --bg: #0e1621;
  --bg-soft: #162232;
  --panel: rgba(15, 24, 36, 0.84);
  --panel-strong: rgba(12, 20, 31, 0.92);
  --panel-border: rgba(240, 234, 223, 0.11);
  --text: #f3efe6;
  --text-soft: #b8c0cc;
  --muted: #8c97a8;
  --accent: #d48d52;
  --accent-strong: #f4b16d;
  --accent-soft: rgba(212, 141, 82, 0.14);
  --line: rgba(255, 255, 255, 0.08);
  --success: #89d4ab;
  --danger: #f8a1a1;
  --shadow: 0 28px 64px rgba(0, 0, 0, 0.28);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --content-width: 1180px;
  --hero-title-size: clamp(1.78rem, 3vw, 2.75rem);
  --section-title-size: clamp(1.28rem, 1.9vw, 1.85rem);
  --card-title-size: 1.08rem;
  --content-title-size: 1.42rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(212, 141, 82, 0.18), transparent 22%),
    radial-gradient(circle at 85% 12%, rgba(53, 93, 139, 0.28), transparent 20%),
    linear-gradient(180deg, #0a1118 0%, #101925 42%, #0b1219 100%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 80%);
}

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

button,
input,
textarea {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(8, 12, 19, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header__inner,
.site-footer__inner,
.page-section,
.page-hero,
.page-layout {
  width: min(var(--content-width), calc(100% - 32px));
  margin: 0 auto;
}

.site-header__inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand__mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(212, 141, 82, 0.24), rgba(255, 255, 255, 0.08)),
    #172232;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--accent-strong);
  font-family: "Consolas", "SFMono-Regular", "Liberation Mono", monospace;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand__text {
  display: grid;
  gap: 2px;
}

.brand__title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand__subtitle {
  color: var(--muted);
  font-size: 0.76rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-soft);
  padding: 10px 14px;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transform: translateY(-1px);
}

.site-nav__locale-switch {
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.site-shell {
  padding-bottom: 96px;
}

.page-hero {
  padding: 48px 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: stretch;
}

.page-hero--single {
  grid-template-columns: minmax(0, 1fr);
}

.hero-card,
.card,
.metric-card,
.table-card,
.content-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 141, 82, 0.22), transparent 70%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(212, 141, 82, 0.12);
  border: 1px solid rgba(212, 141, 82, 0.18);
  color: #f5c08a;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.hero-title,
.section-title,
.content-title {
  margin: 0;
  line-height: 1.08;
}

.hero-title {
  font-size: var(--hero-title-size);
  font-weight: 800;
  margin-top: 16px;
  max-width: none;
  line-height: 1.16;
  text-wrap: pretty;
}

.hero-title strong,
.section-title strong {
  color: var(--accent-strong);
}

.hero-copy,
.section-copy,
.content-copy,
.card-copy {
  color: var(--text-soft);
  line-height: 1.72;
  font-size: 0.98rem;
  max-width: 66ch;
}

.hero-actions,
.inline-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.button--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #181109;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(212, 141, 82, 0.28);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.hero-panel {
  padding: 28px;
  display: grid;
  gap: 14px;
}

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

.hero-grid .metric-card {
  min-height: 120px;
}

.metric-card {
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

.metric-card__label {
  color: var(--muted);
  font-size: 0.82rem;
}

.metric-card__value {
  margin-top: 14px;
  font-size: 1.34rem;
  font-family: "Consolas", "SFMono-Regular", "Liberation Mono", monospace;
  font-weight: 600;
  line-height: 1.25;
}

.page-section {
  padding: 18px 0 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-title {
  font-size: var(--section-title-size);
  font-weight: 800;
  line-height: 1.22;
  max-width: none;
  text-wrap: pretty;
}

.grid-3,
.grid-2,
.grid-auto {
  display: grid;
  gap: 20px;
}

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

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

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

.card,
.content-card,
.table-card {
  padding: 24px;
  min-width: 0;
}

.card h3,
.content-card h3,
.table-card h3 {
  margin: 0 0 10px;
  font-size: var(--card-title-size);
  line-height: 1.3;
}

.card ul,
.content-card ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--text-soft);
  line-height: 1.8;
}

.card li + li,
.content-card li + li {
  margin-top: 8px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  font-size: 0.9rem;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.82fr);
  gap: 24px;
  padding-top: 10px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

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

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.field small {
  color: var(--muted);
  line-height: 1.6;
}

.field-note {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  line-height: 1.72;
  font-size: 0.9rem;
}

.field-note strong {
  color: var(--text);
  font-size: 0.92rem;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  color: var(--text);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 9, 15, 0.35);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(184, 192, 204, 0.56);
}

.field textarea {
  min-height: 144px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(212, 141, 82, 0.54);
  box-shadow: 0 0 0 3px rgba(212, 141, 82, 0.16);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.hint-box,
.status-box,
.result-empty {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  line-height: 1.75;
}

.status-box--error {
  border-color: rgba(248, 161, 161, 0.3);
  background: rgba(248, 161, 161, 0.08);
  color: #ffd1d1;
}

.status-box--success {
  border-color: rgba(137, 212, 171, 0.28);
  background: rgba(137, 212, 171, 0.08);
  color: #d8ffe8;
}

.key-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.key-metric {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.key-metric__label {
  color: var(--muted);
  font-size: 0.82rem;
}

.key-metric__value {
  margin-top: 10px;
  font-family: "Consolas", "SFMono-Regular", "Liberation Mono", monospace;
  font-size: 1.02rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
}

th {
  color: var(--text-soft);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

.mono {
  font-family: "Consolas", "SFMono-Regular", "Liberation Mono", monospace;
}

.site-footer {
  margin-top: 64px;
  padding: 28px 0 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  color: var(--text-soft);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.content-card p,
.content-card li {
  color: var(--text-soft);
  line-height: 1.85;
}

.content-card h2 {
  margin-top: 0;
  font-size: var(--content-title-size);
  line-height: 1.25;
}

.content-card h3 {
  margin-top: 16px;
}

.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.note-list {
  display: grid;
  gap: 12px;
}

.note-item {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.calculator-layout > .stack:first-child {
  gap: 20px;
}

.calculator-layout > .stack:last-child {
  position: sticky;
  top: 96px;
}

.calculator-page .hero-card {
  padding: 22px 24px;
}

.calculator-page .hero-title {
  max-width: none;
  font-size: clamp(1.62rem, 2.35vw, 2.24rem);
}

.calculator-page .hero-copy {
  max-width: 76ch;
  font-size: 0.95rem;
}

.calculator-page .table-card table {
  min-width: 100%;
}

.calculator-page .table-card th,
.calculator-page .table-card td {
  white-space: nowrap;
}

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

  .calculator-layout > .stack:last-child {
    position: static;
    top: auto;
  }
}

@media (max-width: 980px) {
  .page-hero,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .hero-grid,
  .form-grid,
  .key-metrics {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .site-header__inner {
    padding: 14px 0;
    align-items: start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
  }

  .hero-card,
  .hero-panel,
  .card,
  .content-card,
  .table-card {
    padding: 20px;
  }

  .page-hero {
    padding-top: 30px;
  }

  .hero-title {
    font-size: clamp(1.78rem, 8vw, 2.15rem);
    max-width: none;
  }

  .section-title {
    max-width: none;
  }

  .site-shell {
    padding-bottom: 72px;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
