:root {
  --ink: #1c1914;
  --ink-soft: #4a4338;
  --paper: #f3ecdf;
  --card: #fffaf2;
  --line: #e2d6c3;
  --teal: #0e6b66;
  --teal-deep: #0a4542;
  --vermilion: #d24b24;
  --amber: #c4880a;
  --green: #1d7a45;
  --red: #c5362b;
  --shadow: 0 12px 30px rgba(48, 32, 12, 0.08);
  --font: "PingFang HK", "PingFang TC", "Noto Sans CJK TC", "Heiti TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: var(--ink);
  color: #f6efe4;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: 0.04em; font-weight: 700; }
.tag { margin: 0; color: #d9cbb6; font-size: 13px; }
.mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--vermilion);
  color: white;
  font-weight: 700;
  border-radius: 14px 4px 14px 4px;
}
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; }
button, input {
  font-family: inherit;
  font-size: 15px;
}
button {
  border: 0;
  cursor: pointer;
}
.ghost, .solid, .go {
  border-radius: 999px;
  padding: 8px 14px;
}
.ghost { background: transparent; color: #f6efe4; border: 1px solid #6d6458; }
.ghost:hover, .solid:hover, .go:hover { filter: brightness(1.08); }
.solid { background: var(--vermilion); color: white; }
.go { background: var(--teal); color: white; width: 100%; padding: 12px 14px; font-weight: 700; }
.go:disabled { opacity: 0.55; cursor: wait; }

.app {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  height: calc(100dvh - 64px);
}
aside {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--paper);
}
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 10px;
}
.tabs button {
  background: transparent;
  color: var(--ink-soft);
  border-radius: 10px;
  padding: 8px 4px;
}
.tabs button.on {
  background: var(--ink);
  color: #f6efe4;
}
#panel {
  overflow: auto;
  padding: 0 14px 12px;
  flex: 1;
}
.field { display: block; margin-bottom: 10px; position: relative; }
.field span, .block-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--ink);
}
input[type="search"]:focus { outline: 2px solid var(--teal); border-color: transparent; }
.suggest {
  position: absolute;
  z-index: 20;
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow: auto;
}
.suggest button, .row, .option, .service {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}
.suggest button:last-child, .row:last-child { border-bottom: 0; }
.row:hover, .option:hover, .service:hover, .suggest button:hover { background: #f7f0e4; }
.option.on { background: #efe4d2; }
.muted { color: var(--ink-soft); font-size: 13px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin: 10px 0;
}
.option { border: 1px solid var(--line); border-radius: 16px; margin: 8px 0; background: var(--card); }
.kicker {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.mins { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--teal-deep); }
.fare { color: var(--vermilion); font-weight: 700; }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  background: #e7f4ef;
  color: var(--green);
}
.badge.est { background: #f3ead6; color: #7a5b16; }
.steps { margin: 8px 0 0; padding-left: 18px; }
.steps li { margin: 3px 0; }
.note { font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.status { min-height: 1.2em; margin: 0 14px 6px; color: var(--vermilion); font-size: 13px; }
.fine {
  margin: 0;
  padding: 8px 14px 12px;
  font-size: 11px;
  line-height: 1.45;
  color: #7b7266;
}
.news, .journey {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
.c1 { background: var(--red); }
.c2 { background: var(--amber); }
.c3 { background: var(--green); }
.stage { position: relative; height: 100%; min-height: 320px; }
#map {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #d5e2ea;
}
.map-tools {
  position: absolute;
  z-index: 500;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 250, 242, 0.94);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
}
.map-tools label { font-size: 13px; display: flex; gap: 6px; align-items: center; }
.pin span {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50% 50% 50% 4px;
  color: white;
  font-weight: 700;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.cam-pop { max-width: 280px; }
.cam-pop img { width: 260px; height: auto; display: block; border-radius: 8px; }
.cam-pop p { margin: 6px 0 0; font-size: 13px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 48dvh 1fr; height: auto; min-height: calc(100dvh - 64px); }
  .stage { order: -1; height: 48dvh; min-height: 220px; }
  aside { min-height: 52dvh; }
  .top { align-items: flex-start; }
}
