:root {
  --ink: #0f1b2d;
  --ink-2: #3d4a5c;
  --ink-3: #6b7686;
  --line: #e3e8ef;
  --line-2: #eef1f6;
  --bg: #ffffff;
  --bg-2: #f6f8fb;
  --bg-3: #eff3f8;
  --brand: #0b5fff;
  --brand-d: #0846bd;
  --brand-soft: #e8f0ff;
  --ok: #00795c;
  --ok-soft: #e3f6ef;
  --warn: #a86200;
  --warn-soft: #fff4e0;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 8px 24px rgba(15, 27, 45, .05);
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Noto Sans JP", "Noto Sans SC", "Hiragino Sans", "Microsoft YaHei", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

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

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 62px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--ink); letter-spacing: -.2px; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #00b3a4);
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
.nav-main { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.nav-main a {
  padding: 7px 11px; border-radius: 8px; color: var(--ink-2);
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
}
.nav-main a:hover { background: var(--bg-3); color: var(--ink); text-decoration: none; }
.nav-main a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }

.pickers { display: flex; align-items: center; gap: 8px; }
.picker { position: relative; }
.picker select {
  appearance: none; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 7px 30px 7px 11px; border-radius: 8px; cursor: pointer;
}
.picker::after {
  content: ""; position: absolute; right: 11px; top: 50%; width: 6px; height: 6px;
  border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* ---------- hero ---------- */
.hero { padding: 46px 0 34px; background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-bottom: 1px solid var(--line-2); }
.hero h1 { margin: 0 0 12px; font-size: clamp(28px, 4.2vw, 42px); line-height: 1.18; letter-spacing: -.8px; font-weight: 800; }
.hero .lead { margin: 0; max-width: 720px; font-size: 17px; color: var(--ink-2); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: var(--bg-3); color: var(--ink-2);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

/* 实时数据徽标：品牌色底 + 绿色呼吸点，视觉上区分于「参考区间」 */
.badge-live {
  background: var(--brand-soft); color: var(--brand-d);
  padding: 3px 8px; font-size: 11.5px; font-weight: 700;
  margin-left: 6px; vertical-align: 1px;
}
.badge-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .18);
}
/* 沿用的是上次抓取结果（本次抓取失败）时，弱化为灰点，避免误导 */
.badge-live.is-stale { background: var(--bg-3); color: var(--ink-2); }
.badge-live.is-stale::before { background: #98a2b3; box-shadow: none; }

.crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.crumb a { color: var(--ink-3); }
.crumb span { margin: 0 6px; }

/* ---------- sections ---------- */
main { padding: 34px 0 60px; }
.section + .section { margin-top: 44px; }
.section h2 { font-size: 22px; letter-spacing: -.3px; margin: 0 0 14px; font-weight: 800; }
.section h3 { font-size: 17px; margin: 22px 0 8px; font-weight: 700; }
.section p { color: var(--ink-2); margin: 0 0 12px; }

.card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.card + .card { margin-top: 14px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-h h3 { margin: 0; font-size: 17px; }

/* ---------- grid ---------- */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.tile {
  display: block; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.tile:hover { text-decoration: none; border-color: #c8d6ef; transform: translateY(-2px); }
.tile b { display: block; font-size: 15.5px; color: var(--ink); margin-bottom: 4px; }
.tile span { font-size: 13.5px; color: var(--ink-3); }
.tile .tile-ico { font-size: 20px; margin-bottom: 8px; display: block; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th, table.data td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line-2); }
table.data th {
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-3); font-weight: 700; background: var(--bg-2); white-space: nowrap;
}
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); white-space: nowrap; }
table.data tbody tr:hover { background: #fafcff; }
.rate-hi { color: var(--ok); }
.muted { color: var(--ink-3); font-size: 13px; }

/* ---------- forms / calculator ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 15px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg); color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  padding: 11px 20px; border-radius: var(--radius-s); border: 1px solid transparent;
  background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-d); text-decoration: none; }
.btn-ghost { background: var(--bg); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-3); }
.btn-sm { padding: 7px 13px; font-size: 13.5px; }

.result {
  margin-top: 18px; padding: 18px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--line);
}
.result-main { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.result-main small { font-size: 15px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.result-sub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.result-sub div { font-size: 13px; color: var(--ink-3); }
.result-sub b { display: block; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 2px; }

.conv-row { display: grid; grid-template-columns: 1.4fr auto 1.4fr; gap: 12px; align-items: end; }
.conv-swap { padding-bottom: 10px; }

/* ---------- notices ---------- */
.notice {
  border-radius: var(--radius); padding: 16px 18px; font-size: 13.5px;
  background: var(--warn-soft); border: 1px solid #f2dfba; color: #6b4a10;
}
.notice b { display: block; margin-bottom: 5px; color: #5a3d09; }
.notice-info { background: var(--brand-soft); border-color: #cfe0ff; color: #12417f; }
.notice-info b { color: #0d3569; }

/* ---------- faq ---------- */
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 14px 16px; background: var(--bg);
}
.faq details + details { margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 15px; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-3); font-weight: 400; font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 10px 0 0; font-size: 14.5px; color: var(--ink-2); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 42px 0 28px; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.foot-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 0 0 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 7px; }
.foot-grid a { color: var(--ink-2); }
.foot-about p { color: var(--ink-3); font-size: 13.5px; margin: 10px 0 0; }
.foot-bottom { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .nav-main { display: none; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .conv-row { grid-template-columns: 1fr; }
  .conv-swap { padding: 0; }
  .conv-swap .btn { width: 100%; }
  .result-main { font-size: 27px; }
  .result-sub { grid-template-columns: 1fr 1fr; }
  .hero { padding: 32px 0 24px; }
  .foot-grid { grid-template-columns: 1fr; }
  .site-header .wrap { height: 56px; gap: 10px; }
  .logo span.logo-text { display: none; }
}

.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;
}

/* ---------- 广告位（仅在配置了广告单元 ID 时出现） ---------- */
.ad-slot {
  margin: 28px auto;
  max-width: 100%;
  text-align: center;
  /* 预留高度，避免广告加载完成时页面跳动（CLS） */
  min-height: 0;
}
.ad-slot .ad-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ad-slot ins.adsbygoogle {
  display: block;
  width: 100%;
  min-height: 90px;
  background: transparent;
}
/* 广告未填充时不留白框 */
.ad-slot ins.adsbygoogle[data-ad-status="unfilled"] { min-height: 0; }
@media (max-width: 640px) {
  .ad-slot { margin: 20px auto; }
}
