/* HouseScan — shared styles (look: "Flyover Glass on Stone": cool stone ground, white glass, ink type, emerald accent, signal red) */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400..800&family=Geist+Mono:wght@400..600&family=Noto+Sans+SC:wght@400;500;700&display=swap");

:root {
  color-scheme: light;
  --bg: #eceff1;
  --bg-2: #e2e6e9;
  --surface: #ffffff;
  --surface-2: #f7f9fa;
  --surface-3: #eef1f3;
  --line: rgba(12, 16, 19, 0.08);
  --line-2: rgba(12, 16, 19, 0.14);
  --text: #0c1013;
  --text-2: #38434c;
  --text-3: #5b6772;
  --accent: #047857;
  --accent-strong: #065f46;
  --accent-soft: rgba(4, 120, 87, 0.09);
  --accent-softer: rgba(4, 120, 87, 0.05);
  --on-accent: #ffffff;
  --ink: #0c1013;
  --ink-hover: #1e262c;
  --on-ink: #ffffff;
  --mint: #3df5b8;
  --signal: #f2384a;
  --glow-1: rgba(61, 245, 184, 0.26);
  --glow-2: rgba(4, 120, 87, 0.12);
  --neutral-line: #a3adb5;
  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.68));
  --glass-line: rgba(255, 255, 255, 0.8);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 1px 2px rgba(16, 24, 32, 0.06), 0 24px 56px -18px rgba(16, 24, 32, 0.34), 0 8px 18px -10px rgba(16, 24, 32, 0.14);

  --bad: #c81e33;      --bad-bg: #fde9ec;
  --watch: #9a5800;    --watch-bg: #fbf1e1;
  --ok: #4b5560;       --ok-bg: #eef1f3;
  --good: #047857;     --good-bg: #e2f5ec;

  --shadow-sm: 0 1px 2px rgba(16, 24, 32, 0.05), 0 1px 1px rgba(16, 24, 32, 0.03);
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.04), 0 4px 12px -2px rgba(16, 24, 32, 0.06), 0 18px 40px -16px rgba(16, 24, 32, 0.16);
  --shadow-lg: 0 2px 4px rgba(16, 24, 32, 0.04), 0 12px 28px -6px rgba(16, 24, 32, 0.10), 0 34px 70px -26px rgba(14, 22, 30, 0.30);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --gutter: 16px;
  --maxw: 1120px;
  --font: "Geist", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "Geist Mono", "Noto Sans SC", ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1114;
    --bg-2: #12171b;
    --surface: #161c21;
    --surface-2: #1b2228;
    --surface-3: #222a31;
    --line: rgba(255, 255, 255, 0.08);
    --line-2: rgba(255, 255, 255, 0.14);
    --text: #e9edf0;
    --text-2: #b7c0c7;
    --text-3: #8f9aa3;
    --accent: #3ddc9f;
    --accent-strong: #6ee7b7;
    --accent-soft: rgba(61, 220, 159, 0.12);
    --accent-softer: rgba(61, 220, 159, 0.06);
    --on-accent: #04221a;
    --ink: #e9edf0;
    --ink-hover: #ffffff;
    --on-ink: #0c1013;
    --mint: #3df5b8;
    --signal: #ff5a68;
    --glow-1: rgba(61, 245, 184, 0.12);
    --glow-2: rgba(4, 120, 87, 0.20);
    --neutral-line: #6f7a83;
    --glass: linear-gradient(180deg, rgba(28, 35, 41, 0.78), rgba(22, 28, 33, 0.66));
    --glass-line: rgba(255, 255, 255, 0.10);
    --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 24px 56px -18px rgba(0, 0, 0, 0.6), 0 8px 18px -10px rgba(0, 0, 0, 0.4);
    --bad: #ff7b86;     --bad-bg: rgba(255, 123, 134, 0.12);
    --watch: #f0b45a;   --watch-bg: rgba(240, 180, 90, 0.11);
    --ok: #b7c0c7;      --ok-bg: rgba(255, 255, 255, 0.06);
    --good: #5ee0a8;    --good-bg: rgba(94, 224, 168, 0.11);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.35), 0 20px 48px -16px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1114;
  --bg-2: #12171b;
  --surface: #161c21;
  --surface-2: #1b2228;
  --surface-3: #222a31;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #e9edf0;
  --text-2: #b7c0c7;
  --text-3: #8f9aa3;
  --accent: #3ddc9f;
  --accent-strong: #6ee7b7;
  --accent-soft: rgba(61, 220, 159, 0.12);
  --accent-softer: rgba(61, 220, 159, 0.06);
  --on-accent: #04221a;
  --ink: #e9edf0;
  --ink-hover: #ffffff;
  --on-ink: #0c1013;
  --mint: #3df5b8;
  --signal: #ff5a68;
  --glow-1: rgba(61, 245, 184, 0.12);
  --glow-2: rgba(4, 120, 87, 0.20);
  --neutral-line: #6f7a83;
  --glass: linear-gradient(180deg, rgba(28, 35, 41, 0.78), rgba(22, 28, 33, 0.66));
  --glass-line: rgba(255, 255, 255, 0.10);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 24px 56px -18px rgba(0, 0, 0, 0.6), 0 8px 18px -10px rgba(0, 0, 0, 0.4);
  --bad: #ff7b86;     --bad-bg: rgba(255, 123, 134, 0.12);
  --watch: #f0b45a;   --watch-bg: rgba(240, 180, 90, 0.11);
  --ok: #b7c0c7;      --ok-bg: rgba(255, 255, 255, 0.06);
  --good: #5ee0a8;    --good-bg: rgba(94, 224, 168, 0.11);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.35), 0 20px 48px -16px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; letter-spacing: -0.015em; font-weight: 650; }
p { margin: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.en { letter-spacing: 0; }
.muted { color: var(--text-3); }
[hidden] { display: none !important; }
.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; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 28px; } }
@media (min-width: 1280px) { :root { --gutter: 32px; } }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar:not(.scrolled) { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; min-height: 44px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: #0c1013; display: grid; place-items: center; box-shadow: 0 4px 10px -4px rgba(12, 16, 19, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.brand-mark svg path { stroke: var(--mint); }
.brand-mark svg { width: 18px; height: 18px; }
.brand small { font-weight: 500; color: var(--text-3); font-size: 13px; letter-spacing: .02em; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--text-2); font-size: 15px; padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; border-radius: 12px; white-space: nowrap; }
.nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.count-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.count-badge[hidden] { display: none; }
@media (max-width: 760px) { .brand small { display: none; } }
/* EN / 中文 switch */
.lang-switch { display: inline-flex; align-items: center; margin-left: 6px; padding: 3px; border-radius: 999px; background: var(--surface-3); gap: 2px; }
.lang-switch button { white-space: nowrap; font: inherit; font-size: 13px; font-weight: 600; line-height: 1; min-width: 38px; min-height: 30px; padding: 0 9px; border: 0; border-radius: 999px; background: transparent; color: var(--text-3); cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.brand, .nav { white-space: nowrap; }
.brand { flex: none; }
/* phones: the switch shrinks to one button naming the other language; tighter nav; Method lives in the footer below 400 px */
@media (max-width: 600px) {
  .topbar .wrap { gap: 8px; }
  .brand { gap: 8px; font-size: 16px; }
  .nav { gap: 0; }
  .nav a { padding: 0 6px; font-size: 14px; }
  .lang-switch { margin-left: 4px; padding: 0; background: transparent; }
  .lang-switch button[aria-pressed="true"] { display: none; }
  .lang-switch button { min-width: 40px; min-height: 32px; padding: 0 8px; background: var(--surface-3); color: var(--text-2); }
}
@media (max-width: 400px) { .nav a[href="/method"] { display: none; } }
@media (max-width: 340px) { .brand .brand-name { display: none; } }

/* ---------- cards & sections ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 24px;
}
@media (min-width: 601px) { .card { border-radius: 24px; } }
@media (max-width: 600px) { .card { padding: 20px 18px; border-radius: 18px; } }
.card.flat { box-shadow: var(--shadow-sm); }
.section { margin-top: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(20px, 2.2vw, 24px); font-weight: 750; letter-spacing: -0.02em; }
.section-head p { color: var(--text-3); font-size: 14.5px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--text-3); margin-bottom: 8px; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); flex: none; }
.kicker { font-size: 13.5px; color: var(--text-3); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: transparent; box-shadow: 0 10px 22px -12px rgba(12, 16, 19, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn.primary:hover { background: var(--ink-hover); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2);
  color: var(--text-2); font-size: 14.5px; box-shadow: var(--shadow-sm); white-space: nowrap;
}
.chip:hover { text-decoration: none; color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.chip svg { width: 15px; height: 15px; color: var(--accent); }

/* ---------- search ---------- */
.search { position: relative; width: 100%; }
.search-box {
  display: flex; align-items: center; gap: 4px;
  background: var(--glass), var(--surface); border: 1px solid var(--glass-line); border-radius: 22px;
  box-shadow: var(--shadow-lg); padding: 6px 6px 6px 18px;
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: var(--shadow-lg), 0 0 0 4px var(--accent-soft); }
.search-box > svg { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.search-box input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 17px; height: 52px; padding: 0 8px;
}
.search-box input::placeholder { color: var(--text-3); opacity: .9; }
.search-box .btn { height: 52px; border-radius: 13px; padding: 0 22px; font-size: 16px; }
@media (max-width: 600px) {
  .search-box { padding: 4px 4px 4px 14px; border-radius: 16px; }
  .search-box input { font-size: 16px; height: 50px; padding: 0 6px; }
  .search-box .btn { height: 50px; padding: 0 16px; }
  .search-box .btn .label-long { display: none; }
}
.search.compact .search-box { box-shadow: var(--shadow); }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 6px; margin: 0; list-style: none;
  max-height: min(420px, 60vh); overflow-y: auto;
}
.suggest[hidden] { display: none; }
.suggest li { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border-radius: 11px; cursor: pointer; color: var(--text); }
.suggest li svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.suggest li .addr { font-size: 15.5px; letter-spacing: .01em; overflow-wrap: anywhere; }
.suggest li .addr b { font-weight: 650; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--accent-soft); }
.suggest li[aria-selected="true"] svg { color: var(--accent); }
.suggest .hint { cursor: default; color: var(--text-3); font-size: 14px; min-height: 40px; }
.suggest .hint:hover { background: transparent; }
.search-msg { margin-top: 12px; font-size: 14.5px; color: var(--text-2); display: flex; gap: 10px; align-items: flex-start; }
.search-msg[hidden] { display: none; }
.search-msg.error { color: var(--bad); background: var(--bad-bg); border-radius: 14px; padding: 12px 14px; }
.search-msg svg { width: 18px; height: 18px; flex: none; margin-top: 3px; }
.search-msg .spin { margin-top: 4px; }

/* ---------- status markers ---------- */
.mark {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 8px;
  border-radius: 999px; font-size: 13.5px; font-weight: 650; white-space: nowrap; flex: none;
}
.mark svg { width: 15px; height: 15px; }
.mark.bad { color: var(--bad); background: var(--bad-bg); }
.mark.watch { color: var(--watch); background: var(--watch-bg); }
.mark.ok { color: var(--ok); background: var(--ok-bg); }
.mark.good { color: var(--good); background: var(--good-bg); }
.temp { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px; }
.temp svg { width: 17px; height: 17px; }
.dollar { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 14px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; justify-self: end; }

/* ---------- spinner / steps ---------- */
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 100;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px;
  font-size: 15px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
table.data th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.data td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; }
table.data td.nowrap, table.data .nowrap { white-space: nowrap; }
table.data tr.self td { background: var(--accent-softer); }
table.data tr.self td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- chart ---------- */
.chart { position: relative; width: 100%; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.chart svg { overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .end-label { font-size: 12.5px; font-weight: 650; }
.chart .tip {
  position: absolute; top: 0; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: var(--shadow); padding: 8px 12px; font-size: 13px; line-height: 1.5;
  white-space: nowrap; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .12s; z-index: 2;
}
.chart .tip.show { opacity: 1; }
.chart .tip .y { font-weight: 650; margin-bottom: 2px; }
.chart .tip .row { display: flex; align-items: center; gap: 8px; }
.chart .tip i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--text-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.linkish { background: none; border: 0; padding: 0 4px; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.linkish:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- bars ---------- */
.bar { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }

/* ---------- footer ---------- */
.footer { margin-top: 80px; padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 14px; }
.footer .wrap { display: grid; gap: 10px; }
.footer strong { color: var(--text-2); font-weight: 600; }
.footer .attrib { color: var(--text-2); }
.footer a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 48px 24px; }
.empty h2 { font-size: 21px; margin-bottom: 8px; }
.empty p { color: var(--text-2); max-width: 520px; margin: 0 auto; }
.note { font-size: 13.5px; color: var(--text-3); line-height: 1.6; }
.note.disclaim { margin-top: 12px; }
.note.disclaim a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
