:root {
  --bg: #13151b;
  --bg-elevated: #1a1d26;
  --surface: #1f2430;
  --surface-raised: #262c3a;
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(232, 168, 124, 0.28);
  --text: #eceae6;
  --text-soft: #c5c2ba;
  --muted: #848994;
  --warm: #e8a87c;
  --warm-light: #f5d4b8;
  --warm-dim: rgba(232, 168, 124, 0.16);
  --cool: #7eb8da;
  --cool-light: #b8d8ef;
  --cool-dim: rgba(126, 184, 218, 0.14);
  --green: #8fd4a8;
  --green-dim: rgba(95, 180, 130, 0.14);
  --gold: #e8c98a;
  --shadow-panel: 0 20px 44px rgba(0, 0, 0, 0.32), 0 0 0 1px var(--border);
  --radius: 16px;
  --radius-sm: 10px;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --nav-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 55% 40% at 10% 0%, var(--warm-dim), transparent 58%),
    radial-gradient(ellipse 45% 35% at 90% 5%, var(--cool-dim), transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(95, 180, 130, 0.06), transparent);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  backdrop-filter: blur(16px) saturate(140%);
  background: rgba(19, 21, 27, 0.78);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.nav-logo {
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.brand-accent {
  color: var(--warm);
}

.brand-name {
  color: var(--green);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.92rem;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.is-active {
  color: var(--warm-light);
  background: var(--warm-dim);
}

.nav-link-featured {
  color: var(--cool-light);
  border: 1px solid rgba(126, 184, 218, 0.28);
  background: rgba(126, 184, 218, 0.08);
}

.nav-link-featured:hover {
  color: #fff;
  background: rgba(126, 184, 218, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(126, 184, 218, 0.15);
}

.nav-link-featured.is-active {
  color: #fff;
  background: rgba(126, 184, 218, 0.22);
  border-color: rgba(126, 184, 218, 0.42);
  box-shadow: 0 4px 16px rgba(126, 184, 218, 0.12);
}

.nav-link-green {
  color: #8fd4a8;
  border-color: rgba(95, 180, 130, 0.32);
  background: rgba(95, 180, 130, 0.1);
}

.nav-link-green:hover {
  color: #fff;
  background: rgba(95, 180, 130, 0.2);
  box-shadow: 0 6px 20px rgba(95, 180, 130, 0.15);
}

.nav-link-green.is-active {
  color: #fff;
  background: rgba(95, 180, 130, 0.22);
  border-color: rgba(95, 180, 130, 0.42);
  box-shadow: 0 4px 16px rgba(95, 180, 130, 0.12);
}

.nav-link-gold {
  color: var(--gold);
  border-color: rgba(232, 201, 138, 0.32);
  background: rgba(232, 201, 138, 0.1);
}

.nav-link-gold:hover {
  color: #fff;
  background: rgba(232, 201, 138, 0.2);
  box-shadow: 0 6px 20px rgba(232, 201, 138, 0.15);
}

.nav-link-gold.is-active {
  color: #fff;
  background: rgba(232, 201, 138, 0.22);
  border-color: rgba(232, 201, 138, 0.42);
  box-shadow: 0 4px 16px rgba(232, 201, 138, 0.12);
}

.nav-link-icon {
  font-size: 0.95rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text-soft);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.page-head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.page-badge {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(95, 180, 130, 0.28);
  background: var(--green-dim);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
}

.page-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 800;
}

.page-desc {
  max-width: 32rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.92rem;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel {
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--surface), var(--bg-elevated));
  box-shadow: var(--shadow-panel);
}

.panel-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

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

.field-hint {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.input {
  width: 100%;
  padding: 0.62rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.62rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

.custom-select-trigger:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
}

.custom-select.is-open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--warm-dim);
}

.custom-select-value {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-chevron {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--warm);
  transition: transform 0.2s ease;
}

.custom-select.is-open .custom-select-chevron {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-accent);
  background: linear-gradient(165deg, var(--surface-raised), var(--surface));
  box-shadow: var(--shadow-panel);
  max-height: 220px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s;
  scrollbar-width: thin;
  scrollbar-color: var(--warm-dim) transparent;
}

.custom-select-menu::-webkit-scrollbar {
  width: 6px;
}

.custom-select-menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--warm-dim);
}

.custom-select.is-open .custom-select-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.custom-select-option {
  padding: 0.52rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.custom-select-option:hover,
.custom-select-option.is-focused {
  background: rgba(126, 184, 218, 0.12);
  color: var(--cool-light);
}

.custom-select-option.is-selected {
  background: var(--warm-dim);
  color: var(--warm-light);
  font-weight: 600;
}

.custom-select-option.is-selected.is-focused {
  background: rgba(232, 168, 124, 0.24);
  color: var(--warm-light);
}

.input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--warm-dim);
}

.input-lg {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--warm-light);
}

.range {
  width: 100%;
  accent-color: var(--warm);
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
}

.disclaimer {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.5;
}

.panel-result {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background:
    linear-gradient(145deg, rgba(95, 180, 130, 0.08), rgba(232, 168, 124, 0.06)),
    linear-gradient(160deg, var(--surface), var(--bg-elevated));
}

.result-hero {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.result-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.result-amount {
  margin: 0.15rem 0;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--green), var(--warm-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.result-card {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}

.result-card-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.result-card-value {
  font-size: 1.05rem;
  font-weight: 700;
}

.accent-warm {
  color: var(--warm-light);
}

.accent-cool {
  color: var(--cool-light);
}

.annual-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(95, 180, 130, 0.22);
  background: var(--green-dim);
  font-size: 0.88rem;
  color: var(--text-soft);
}

.annual-bar strong {
  font-size: 1.1rem;
  color: var(--green);
}

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

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.88rem;
}

.breakdown-table col.col-label {
  width: auto;
}

.breakdown-table col.col-amount {
  width: 7.5rem;
}

.breakdown-table th,
.breakdown-table td {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.breakdown-table th:first-child,
.breakdown-table td:first-child {
  text-align: left;
  padding-right: 1rem;
}

.breakdown-table th:last-child,
.breakdown-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-left: 1rem;
}

.breakdown-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
}

.breakdown-table .row-primary td:last-child {
  color: var(--warm-light);
  font-weight: 700;
}

.breakdown-table .row-deduct td:last-child {
  color: var(--muted);
}

.breakdown-table .row-tax td:last-child {
  color: #e09a90;
}

.breakdown-table .row-result td {
  font-weight: 700;
}

.breakdown-table .row-result td:last-child {
  color: var(--green);
  font-size: 1rem;
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.site-footer-link {
  font-size: 0.75rem;
  color: var(--warm-light);
}

.site-footer-tagline {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 0.75rem 1.25rem;
    background: rgba(19, 21, 27, 0.96);
    border-bottom: 1px solid var(--border);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s;
  }

  .nav-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-link {
    justify-content: center;
    padding: 0.75rem 1rem;
  }

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