:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --text: #1c2421;
  --muted: #5b6763;
  --accent: #0f8a6b;
  --accent-soft: #d9f1ea;
  --border: #e1e7e4;
  --warn-bg: #fff4d6;
  --warn-text: #6b4e00;
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101513;
    --surface: #1a211e;
    --text: #e8eeeb;
    --muted: #9aa8a3;
    --accent: #4fd1a8;
    --accent-soft: #1f3a32;
    --border: #2a3430;
    --warn-bg: #3a3014;
    --warn-text: #f3d98a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

.site-header,
main,
.site-footer,
.banner {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.site-header { padding-top: 28px; padding-bottom: 8px; }
.kicker { margin: 0; color: var(--accent); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.04em; }
h1 { margin: 4px 0 0; font-size: 1.6rem; line-height: 1.3; }

main { display: grid; gap: 16px; padding-top: 12px; padding-bottom: 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

h2 { margin: 0 0 8px; font-size: 1.35rem; line-height: 1.35; }
h3 { margin: 0 0 12px; font-size: 1.1rem; }
p { margin: 0 0 8px; }
.body { color: var(--muted); }
.number { margin-top: 12px; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

.state { text-align: center; padding-top: 32px; padding-bottom: 32px; }

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
}

.style-card { text-align: center; }
.eyebrow { color: var(--muted); font-size: 0.95rem; }
.style-icon { display: block; margin: 8px auto 12px; width: 96px; height: 96px; }
.style-name { font-size: 1.8rem; color: var(--accent); }
.style-feature { font-weight: 600; }
.style-message { color: var(--muted); text-align: left; }

.params { margin: 0; display: grid; gap: 10px; }
.param { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.param:last-child { border-bottom: none; padding-bottom: 0; }
.param dt { color: var(--muted); flex-shrink: 0; }
.param dd { margin: 0; text-align: right; min-width: 0; }
.value { font-weight: 700; font-variant-numeric: tabular-nums; }
.unit { color: var(--muted); font-size: 0.9rem; }
.detail { display: block; color: var(--muted); font-size: 0.85rem; }

.privacy { font-size: 0.85rem; color: var(--muted); }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.fields label { display: grid; gap: 4px; font-size: 0.9rem; color: var(--muted); min-width: 0; }

select,
.button {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
  min-width: 0;
}

.button { margin-top: 16px; background: var(--accent); color: #fff; border: none; font-weight: 600; cursor: pointer; }

.mobility-result:empty { display: none; }
.mobility-result { margin-top: 8px; }
.headline { font-size: 1.4rem; font-weight: 700; color: var(--accent); margin-bottom: 4px; }

.bar { height: 14px; border-radius: 7px; background: var(--accent-soft); overflow: hidden; margin: 12px 0 8px; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 7px; }
.speed { color: var(--muted); font-size: 0.9rem; }
.footnote { margin-top: 12px; font-size: 0.8rem; color: var(--muted); }

.banner {
  margin-top: 8px;
  background: var(--warn-bg);
  color: var(--warn-text);
  border-radius: 10px;
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 0.9rem;
}

.banner[hidden] { display: none; }

.site-footer { padding-bottom: 32px; }
.site-footer p { color: var(--muted); font-size: 0.8rem; text-align: center; }
