/* 報站通 TransitCast 官網共用樣式。
   純 CSS、不載入任何外部字型或腳本；深淺色依系統 prefers-color-scheme 切換。
   色票取自 App 導覽頁（紙色 #FAF7F0／墨色 #1A334A／品牌藍 #0074FF）與圖示的 LED 琥珀色。 */

:root {
  color-scheme: light dark;

  --paper: #faf7f0;
  --surface: #ffffff;
  --surface-2: #f1ede3;
  --ink: #1a334a;
  --ink-2: #4a5b6b;
  --line: rgba(26, 51, 74, 0.14);
  --accent: #0a60d0;
  --accent-brand: #0074ff;
  --accent-soft: rgba(0, 116, 255, 0.1);
  --on-accent: #ffffff;
  --led: #ffae1a;
  --led-glow: rgba(255, 174, 26, 0.55);
  --led-panel: #0b0e12;
  --led-bezel: #262b33;
  --good: #1d7a45;
  --frame: #1c232c;
  --shadow: 0 1px 2px rgba(16, 32, 48, 0.06), 0 10px 30px rgba(16, 32, 48, 0.08);
  --shot-placeholder: url("screenshot-placeholder-light.svg");

  --radius: 20px;
  --radius-sm: 12px;
  --maxw: 1080px;
  --gutter: 16px;

  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC",
    "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "PingFang TC",
    "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1a26;
    --surface: #16222f;
    --surface-2: #1c2a39;
    --ink: #eef3f8;
    --ink-2: #aab7c4;
    --line: rgba(238, 243, 248, 0.14);
    --accent: #6ab0ff;
    --accent-brand: #3d97ff;
    --accent-soft: rgba(61, 151, 255, 0.16);
    --on-accent: #0b1622;
    --good: #5fd08f;
    --frame: #05080c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
    --shot-placeholder: url("screenshot-placeholder-dark.svg");
  }
}

@media (min-width: 720px) {
  :root { --gutter: 28px; }
}

*,
*::before,
*::after { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.25;
  letter-spacing: 0;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.1rem, 7vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.2rem); font-weight: 750; }
h3 { font-size: 1.12rem; font-weight: 700; }

p { margin: 0 0 1em; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.narrow { max-width: calc(760px + 2 * var(--gutter)); }

/* ---------- 頁首 ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  position: sticky;
  top: 0;
  z-index: 5;
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}
/* 手機上頁首會折成兩行，不固定以免吃掉閱讀空間 */
@media (max-width: 599px) {
  .site-header { position: static; }
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  min-height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 750;
  line-height: 1.1;
}
.brand img { width: 34px; height: 34px; border-radius: 22.5%; }
.brand small {
  display: block;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  color: var(--ink-2);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.94rem;
  text-decoration: none;
}
.site-nav a:hover { background: var(--accent-soft); }
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }

/* ---------- 共用元件 ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9em;
}

.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 36em; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary[aria-disabled="true"] { cursor: default; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn svg { width: 20px; height: 20px; flex: none; }

.section { padding: clamp(56px, 9vw, 104px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 40em; margin-bottom: 36px; }
.section-head p { color: var(--ink-2); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.note {
  font-size: 0.9rem;
  color: var(--ink-2);
}

/* ---------- 首頁主視覺 ---------- */

.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(48px, 8vw, 88px); }
.hero .wrap {
  display: grid;
  gap: 40px;
  align-items: center;
}
@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: 1.1fr 0.9fr; gap: 56px; }
}
.hero h1 { margin-bottom: 0.45em; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 16px; }
.hero .fineprint { font-size: 0.88rem; color: var(--ink-2); margin: 0; }

.hero-visual {
  display: grid;
  gap: 18px;
  justify-items: center;
  min-width: 0;
}
.hero-icon {
  width: clamp(112px, 26vw, 168px);
  height: auto;
  border-radius: 22.5%;
  box-shadow: 0 18px 40px rgba(0, 72, 160, 0.28);
}

/* LED 跑馬燈：文字＋圓點遮罩模擬點陣燈泡 */
.led {
  position: relative;
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--led-panel);
  border: 6px solid var(--led-bezel);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.8), var(--shadow);
  padding: 12px 0 10px;
}
.led::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 1.15px, var(--led-panel) 1.75px) 0 0 / 4px 4px;
}
.led-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  color: var(--led);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 6vw, 2.15rem);
  line-height: 1.25;
  text-shadow: 0 0 10px var(--led-glow);
  animation: led-scroll 16s linear infinite;
}
.led-track span { padding-right: 2.5em; }
@keyframes led-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .led-track { animation: none; padding-left: 16px; }
}

.trip {
  width: 100%;
  max-width: 460px;
  padding: 16px 18px;
}
.trip-stops {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 650;
  font-size: 0.95rem;
}
.trip-bar {
  position: relative;
  height: 8px;
  margin: 10px 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.trip-bar span {
  position: absolute;
  inset: 0 38% 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-brand), #34c759);
}
.trip-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 0.85rem; color: var(--ink-2); }

/* ---------- 功能卡片 ---------- */

.feature-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.feature-grid .card { height: 100%; }
.feature-grid p { margin: 0; color: var(--ink-2); font-size: 0.97rem; }

.icon-badge {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
}
.icon-badge svg { width: 24px; height: 24px; }

/* 支援的交通工具 */
.modes {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.chips li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.9rem;
}

/* 三步驟 */
.steps {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  counter-reset: step;
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: "0" counter(step) " /";
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 10px;
}
.steps p { margin: 0; color: var(--ink-2); }

/* ---------- 截圖牆 ----------
   每張截圖是 CSS 背景：上層為 screenshots/ 內的 PNG，下層為佔位圖。
   PNG 不存在時瀏覽器只會略過上層，不會出現破圖圖示。 */

.shots {
  display: grid;
  gap: 20px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) {
  .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
}
.shots figure { margin: 0; }
.shots figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.5;
}
.shot {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  aspect-ratio: 1320 / 2868;
  border: 5px solid var(--frame);
  border-radius: 13% / 6%;
  background-color: var(--surface-2);
  background-position: center, center;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
  box-shadow: var(--shadow);
}
.shot-01 { background-image: url("screenshots/01-bus-led.png"), var(--shot-placeholder); }
.shot-02 { background-image: url("screenshots/02-live-activity.png"), var(--shot-placeholder); }
.shot-03 { background-image: url("screenshots/03-metro-map.png"), var(--shot-placeholder); }
.shot-04 { background-image: url("screenshots/04-nearby-stops.png"), var(--shot-placeholder); }
.shot-05 { background-image: url("screenshots/05-rail-trips.png"), var(--shot-placeholder); }
.shot-06 { background-image: url("screenshots/06-route-planner.png"), var(--shot-placeholder); }

/* ---------- 報站通 Plus ---------- */

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.compare-wrap { overflow-x: auto; }
.compare caption { text-align: left; font-weight: 700; padding-bottom: 12px; }
.compare th,
.compare td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.compare thead th { font-size: 0.85rem; color: var(--ink-2); font-weight: 650; }
.compare td { white-space: nowrap; }
.compare td.yes { color: var(--good); font-weight: 700; }
.compare td.no { color: var(--ink-2); }
.compare .plus-col { color: var(--accent); }
.compare tbody th { font-weight: 500; }

.plans {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.plans h3 { margin-bottom: 0.3em; }
.plans p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.plans + .note { margin-top: 18px; }
.plans .tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---------- 文件頁（隱私權、條款、支援） ---------- */

.doc-head { padding: clamp(40px, 7vw, 72px) 0 12px; }
.doc-head .lede { margin-bottom: 0.6em; }
.doc-meta { font-size: 0.88rem; color: var(--ink-2); }

.summary-box {
  margin: 28px 0 8px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--line);
}
.summary-box h2 { font-size: 1.1rem; margin-bottom: 0.6em; }
.summary-box ul { margin: 0; padding-left: 1.2em; }

.toc { margin: 28px 0; padding: 18px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.toc h2 { font-size: 1rem; margin-bottom: 0.4em; }
.toc ol { margin: 0; padding-left: 1.4em; columns: 2 16em; column-gap: 32px; }
.toc li { break-inside: avoid; }

.prose { padding-bottom: 64px; }
.prose section { scroll-margin-top: 16px; }
@media (min-width: 600px) {
  .prose section { scroll-margin-top: 84px; }
}
.prose h2 { font-size: clamp(1.25rem, 3.6vw, 1.55rem); margin-top: 2.2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul,
.prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 0.94rem; }
.prose th,
.prose td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
.prose thead th { color: var(--ink-2); font-weight: 650; font-size: 0.86rem; }
.table-wrap { overflow-x: auto; }

.english {
  margin-top: 3em;
  padding: 24px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.english h2 { margin-top: 0; }

.contact-card {
  margin: 1.2em 0;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.contact-card p:last-child { margin-bottom: 0; }
.contact-email { font-weight: 650; word-break: break-all; }

/* 支援頁常見問題（原生 details，免腳本） */
.faq { display: grid; gap: 12px; margin: 0 0 1.5em; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 18px;
}
.faq summary {
  display: flex;
  gap: 10px;
  align-items: baseline;
  cursor: pointer;
  padding: 14px 0;
  font-weight: 650;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  flex: none;
  width: 1em;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}
.faq details[open] summary::before { content: "−"; }
.faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.faq details > :last-child { margin-bottom: 16px; }

/* ---------- 404 ---------- */

.not-found { padding-top: clamp(56px, 12vw, 120px); padding-bottom: clamp(56px, 12vw, 120px); text-align: center; }
.not-found .led { margin: 0 auto 32px; max-width: 420px; }
.not-found .led-track { animation: none; width: auto; justify-content: center; padding: 0 16px; }
.not-found .led-track span { padding-right: 0; }
.not-found .lede { margin-left: auto; margin-right: auto; }
.not-found .cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* ---------- 頁尾 ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 48px;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.site-footer .wrap { display: grid; gap: 16px; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--accent); }
.site-footer p { margin: 0; }
