/* Urban flow demo — shared tokens and layout. Every page links this file and uses the .top nav block. */
:root {
  --bg: #0d1117;
  --panel: #151b23;
  --panel-2: #1c2430;
  --line: #2a3441;
  --fg: #e6edf3;
  --muted: #9aa7b4;
  --faint: #6b7785;
  --acc: #4cc2ff;      /* brand / links */
  --real: #3ecf8e;     /* 真實跑通 */
  --sim: #f0b429;      /* 模擬示意 */
  --idea: #a78bfa;     /* 構想 */
  --alert: #ff6b6b;
  /* categorical, fixed order: car, motorcycle, person, bus/truck, bicycle */
  --c1: #4cc2ff; --c2: #f0b429; --c3: #3ecf8e; --c4: #ff7aa2; --c5: #a78bfa;
  --radius: 10px;
  --font: "PingFang TC", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.65 var(--font); }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }

.top { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 20px; background: rgba(13,17,23,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .brand { font-weight: 700; letter-spacing: .02em; color: var(--fg); }
.top .brand small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { color: var(--muted); padding: 4px 10px; border-radius: 6px; font-size: 14px; }
.top nav a:hover, .top nav a.on { color: var(--fg); background: var(--panel-2); text-decoration: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
h1 { font-size: 30px; line-height: 1.3; margin: 0 0 8px; }
h2 { font-size: 21px; margin: 36px 0 12px; }
h3 { font-size: 16px; margin: 0 0 6px; }
p.lead { color: var(--muted); font-size: 16px; max-width: 760px; margin: 0 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 9px; border-radius: 99px;
  border: 1px solid currentColor; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.real { color: var(--real); } .badge.sim { color: var(--sim); } .badge.idea { color: var(--idea); }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
a.card { display: block; color: var(--fg); transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--acc); text-decoration: none; transform: translateY(-2px); }
.card p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 18px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

button, .btn { background: var(--panel-2); color: var(--fg); border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
button:hover, .btn:hover { border-color: var(--acc); }
button.on { border-color: var(--acc); color: var(--acc); }

.note { border-left: 3px solid var(--sim); background: var(--panel); padding: 10px 14px; border-radius: 0 8px 8px 0;
  color: var(--muted); font-size: 14px; margin: 14px 0; }
.note.real { border-color: var(--real); }
footer { color: var(--faint); font-size: 12px; border-top: 1px solid var(--line); padding: 18px 20px; text-align: center; }

@media (max-width: 640px) {
  .wrap { padding: 20px 16px 48px; }
  h1 { font-size: 24px; }
  .top { padding: 8px 16px; gap: 8px; }
}
