:root {
  color-scheme: light;
  --paper: #f4efe6;
  --ink: #1c1915;
  --muted: #5e584e;
  --line: #e2d8c8;
  --card: #fffdf8;
  --accent: #0f6e56;
  --accent-ink: #084437;
  --stamp: #9a3412;
  --shadow: 0 16px 40px rgba(56, 40, 16, 0.06);
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "PMingLiU", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(15, 110, 86, 0.08), transparent 32rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
}
a { color: var(--accent-ink); }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
h1, h2 { font-family: var(--serif); font-weight: 650; line-height: 1.25; letter-spacing: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.15rem); margin: 0.2rem 0 0.6rem; }
h2 { font-size: 1.45rem; margin: 0 0 0.7rem; }

.site-header, .site-footer, .wrap { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.4rem;
}
.brand {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.35rem;
}
.site-header nav { display: flex; gap: 1rem; }
.site-header nav a { text-decoration: none; }
.wrap { padding-bottom: 3rem; }
.crumb, .lede, .field-note, .assume, .cost-line, .follow-note { color: var(--muted); }
.lede { max-width: 46rem; font-size: 1.05rem; }
.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 0.5rem 1.5rem;
  align-items: center;
}
.hero-art {
  width: 220px;
  height: auto;
  justify-self: end;
  border-radius: 18px;
}

.calculator {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 1rem;
  margin: 1.4rem 0;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem 1.2rem;
}
.form-panel { display: grid; gap: 0.75rem; align-content: start; }
label { display: grid; gap: 0.3rem; font-size: 0.92rem; }
input, select {
  width: 100%;
  border: 1px solid #d9cdb8;
  background: #fff;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}
input:focus, select:focus { outline: 2px solid rgba(15, 110, 86, 0.35); border-color: var(--accent); }
.field-note { margin: 0; font-size: 0.85rem; }

.eyebrow { display: flex; align-items: center; gap: 0.45rem; margin: 0; color: var(--muted); }
.stamp {
  display: inline-flex;
  border: 1px solid var(--stamp);
  color: var(--stamp);
  border-radius: 999px;
  padding: 0 0.45rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}
.result-label { margin: 0.7rem 0 0; color: var(--muted); }
.result-value {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--accent-ink);
}
.result-value span { font-size: 1rem; color: var(--muted); }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0 0.4rem;
}
.metrics div {
  background: #f7f3ea;
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
}
.metrics dt { color: var(--muted); font-size: 0.82rem; }
.metrics dd {
  margin: 0.1rem 0 0;
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
  font-weight: 650;
}
.table-wrap { overflow-x: auto; margin-top: 0.8rem; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
caption { text-align: left; font-weight: 650; margin-bottom: 0.35rem; }
th, td { border-bottom: 1px solid var(--line); padding: 0.4rem 0.35rem; text-align: right; }
th:first-child, td:first-child, caption { text-align: left; }
.cost-line, .assume, .bonus-line { font-size: 0.9rem; }
.actions {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.9rem;
}
button {
  border: 0;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  cursor: pointer;
}
button:hover { background: var(--accent-ink); }
.follow-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border: 1px dashed #c4b59a;
  border-radius: 14px;
  padding: 0.7rem 0.8rem;
  background: #fbf7f0;
}
.follow-card img {
  width: 168px;
  height: auto;
  flex: none;
  background: #fff;
  border-radius: 8px;
}
.follow-card p { margin: 0; }
.follow-note { font-size: 0.8rem; }
.months { margin-top: 0; }
.prose { margin: 1rem 0; }
.city-grid, .salary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}
.city-grid a, .salary-list a {
  display: inline-block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}
.city-grid a[aria-current="page"], .salary-list a[aria-current="page"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.site-footer {
  padding: 1rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer p { margin: 0.25rem 0; }

@media (max-width: 800px) {
  .calculator { grid-template-columns: 1fr; }
  .result-panel { order: -1; }
  .metrics { grid-template-columns: 1fr; }
  .site-header { align-items: flex-start; }
  .follow-card { flex-direction: column; }
  .home-intro { grid-template-columns: 1fr; }
  .hero-art { width: 168px; justify-self: start; }
}
