/* Dwell Eon — mobile-first, static, no framework */
:root {
  --ink: #1a1d21;
  --muted: #5c6470;
  --faint: #8a929c;
  --line: #dfe3e8;
  --bg: #ffffff;
  --surface: #f6f8fa;
  --accent: #0f6e56;
  --accent-dark: #084b3c;
  --accent-soft: #e1f5ee;
  --warn-bg: #fae5da;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 18px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip:focus { left: 0; }

/* Header — mobile first */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.header-inner {
  position: relative;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.menu-toggle {
  margin-left: auto; /* 固定在最右，不随导航展开而移动 */
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.site-nav { display: none; }
.site-nav.open {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0 14px;
  /* 脱离 header 的 flex 流，整行下拉；Menu 按钮因此不会移位 */
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 16px rgba(0,0,0,.08);
  z-index: 20;
}
.site-nav a {
  display: block;
  min-height: 44px;
  line-height: 44px;
  padding: 0 6px;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  padding: 14px 0 0;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 6px; color: var(--faint); }

/* Page */
.page { padding: 18px 0 56px; }
h1 {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
}
h2 {
  font-size: 20px;
  line-height: 1.3;
  margin: 28px 0 10px;
  color: var(--ink);
}
/* section 之间用柔和分隔，section 内部的小标题不再加边框 */
section.prose > h2:first-child,
.section-heading {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
h3 { font-size: 16px; margin: 22px 0 8px; }
p { margin: 0 0 14px; }
.lede { font-size: 17px; color: var(--muted); margin-bottom: 22px; max-width: none; }
.prose p, .prose li { max-width: none; }
.prose ul, .sources ul, .related ul { padding-left: 22px; }
.prose li, .sources li, .related li { margin-bottom: 8px; }

/* Calculator — single column on mobile */
.calc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 0 22px;
}
.calc-row { margin-bottom: 14px; }
.calc-row label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.calc-row input,
.calc-row select {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c9d0d8;
  border-radius: 8px;
}
input[type="number"] { appearance: textfield; }
.calc-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14px;
}
.checkbox-row input { min-width: 20px; min-height: 20px; }
.opt-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px 4px;
  margin: 4px 0 16px;
  background: #fff;
}
.opt-group legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 6px;
}
.calc-actions { display: flex; gap: 10px; margin-top: 6px; }
.btn {
  flex: 1;
  min-height: 46px;
  padding: 10px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--surface); color: var(--ink); }

/* Results — every line item visible */
.results {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.results h3 { margin-top: 0; }
.result-net {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.result-net .label { font-size: 13px; color: var(--accent-dark); }
.result-net .value { font-size: 26px; font-weight: 700; color: var(--accent-dark); line-height: 1.2; }
.result-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dotted var(--line);
  font-size: 14px;
}
.result-line span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.result-line.sub { padding-left: 14px; color: var(--muted); font-size: 13px; }
.result-pending {
  background: #fff8e1;
  border: 1px solid #f0d98a;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  color: #6b5200;
}

/* Ad slots — fixed min-height prevents CLS (Core Web Vitals) */
.ad-slot {
  min-height: 100px;
  margin: 20px 0;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--faint);
  font-size: 12px;
}
.ad-slot[data-active="true"] { border: 0; padding: 0; min-height: 100px; }

/* FAQ / sources / related — consistent rhythm between blocks */
#faq, .sources, .related, .disclaimer { margin-top: 32px; }
#faq > h2, .sources > h2, .related > h2 { padding-top: 18px; border-top: 1px solid var(--line); }
.faq-item { margin-bottom: 18px; }
.faq-item h3 { font-size: 15px; margin: 0 0 6px; }
.sources, .related, .disclaimer {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-top: 26px;
}
.disclaimer {
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
}
.updated { font-size: 12px; color: var(--faint); margin: 8px 0 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-size: 14px;
  color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; margin: 12px 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .small { font-size: 12px; color: var(--faint); }

/* Hub / home grids */
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 18px 0; }
.card {
  display: block;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
}
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 4px; font-size: 15px; color: var(--accent); }
.card p { margin: 0; font-size: 13px; color: var(--muted); }
.group-title { font-size: 18px; margin: 30px 0 4px; }

/* Static page (policy) */
.static-page .prose { max-width: none; }
.static-page h2:first-of-type { margin-top: 20px; }

/* Desktop */
@media (min-width: 760px) {
  .wrap { padding: 0 28px; }
  .menu-toggle { display: none; }
  .site-nav, .site-nav.open {
    display: flex !important; flex-direction: row; gap: 22px; padding: 0;
    position: static; background: none; border: 0; box-shadow: none;
  }
  .site-nav a { border: 0; min-height: 56px; line-height: 56px; padding: 0; }
  h1 { font-size: 36px; }
  h2 { font-size: 23px; }
  .calc { padding: 24px; }
  .calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .ad-slot { min-height: 90px; }
}

@media (prefers-reduced-motion: no-preference) {
  a, .btn { transition: color .15s, background-color .15s, border-color .15s; }
}
