/* 搭搭公車網站共用樣式
   色票對齊 App：文字對比 ≥ 4.5:1，邊框 ≥ 3:1
   不引用外部字型或追蹤腳本 */

:root,
html[data-theme="light"] {
  --bg: #EEF4F1;
  --bg-hero: #D8EFE3;
  --card: #FFFFFF;
  --text: #14201E;
  --muted: #3D4A47;
  --accent: #0B4A44;
  --link: #0B4A44;
  --btn: #0C5C55;
  --btn-text: #FFFFFF;
  --border: #6B7572;
  --mint: #BFE6CB;
  --draft-bg: #DCEEE4;
  --draft-text: #14201E;
  --todo-bg: #FFF3C4;
  --todo-text: #3A2A00;
  --th: #E3EEE8;
  --header-bg: #EEF4F1;
  --footer-bg: #E3EEE8;
  --placeholder-bg: #D4EBDC;
  --placeholder-text: #0B4A44;
  --soon-bg: #B85A00;
  --soon-text: #FFFFFF;
  --shadow: 0 1px 2px #00000014;
  --focus: #0C5C55;
  --max: 1120px;
  --legal-max: 800px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1211;
    --bg-hero: #10211C;
    --card: #1C2422;
    --text: #F4F7F6;
    --muted: #C5CECB;
    --accent: #4AD4C8;
    --link: #4AD4C8;
    --btn: #4AD4C8;
    --btn-text: #0B4A44;
    --border: #8A9390;
    --mint: #1A3A32;
    --draft-bg: #1A2E28;
    --draft-text: #F4F7F6;
    --todo-bg: #524100;
    --todo-text: #FFF3C4;
    --th: #24302C;
    --header-bg: #0E1211;
    --footer-bg: #141C1A;
    --placeholder-bg: #16302A;
    --placeholder-text: #F4F7F6;
    --soon-bg: #B85A00;
    --soon-text: #FFFFFF;
    --shadow: none;
    --focus: #4AD4C8;
    color-scheme: dark;
  }
}

html[data-theme="dark"] {
  --bg: #0E1211;
  --bg-hero: #10211C;
  --card: #1C2422;
  --text: #F4F7F6;
  --muted: #C5CECB;
  --accent: #4AD4C8;
  --link: #4AD4C8;
  --btn: #4AD4C8;
  --btn-text: #0B4A44;
  --border: #8A9390;
  --mint: #1A3A32;
  --draft-bg: #1A2E28;
  --draft-text: #F4F7F6;
  --todo-bg: #524100;
  --todo-text: #FFF3C4;
  --th: #24302C;
  --header-bg: #0E1211;
  --footer-bg: #141C1A;
  --placeholder-bg: #16302A;
  --placeholder-text: #F4F7F6;
  --soon-bg: #B85A00;
  --soon-text: #FFFFFF;
  --shadow: none;
  --focus: #4AD4C8;
  color-scheme: dark;
}

html[data-theme="light"] { color-scheme: light; }

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

html {
  color-scheme: light dark;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans CJK TC", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: 0;
  z-index: 40;
  background: var(--btn);
  color: var(--btn-text);
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transform: translateY(-200%);
}
.skip:focus, .skip:focus-visible {
  top: 12px;
  transform: none;
  outline: 3px solid var(--focus);
}

.top-draft {
  background: var(--draft-bg);
  color: var(--draft-text);
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  padding: 10px 16px;
  line-height: 1.5;
}

.sticky-stack {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.header-inner, .subnav-inner, .wrap, .footer-inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  min-height: 44px;
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 22.5%;
  border: 1px solid var(--border);
  background: #BFE6CB;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  border: 1px solid transparent;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--card);
  border-color: var(--border);
}

.subnav {
  background: var(--header-bg);
  border-top: 1px solid var(--border);
}
.subnav-inner {
  display: flex;
  gap: 6px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.subnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--card);
}
.subnav a:hover { color: var(--text); }
.subnav a:is(:target-within) { color: var(--text); }

main { padding-bottom: 56px; }

.hero {
  background: var(--bg-hero);
  border-bottom: 1px solid var(--border);
  padding: 36px 0 40px;
  text-align: center;
}
.hero-inner { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.hero .appicon {
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border-radius: 22.5%;
  border: 1px solid var(--border);
  background: #BFE6CB;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: 2rem;
  line-height: 1.25;
  font-weight: 800;
}
.hero .lede {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin: 0 auto 12px;
  max-width: 420px;
}
.hero-note {
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  max-width: 40rem;
}

.btn, .btn-secondary, .btn-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 12px 22px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  line-height: 1.3;
  border: 2px solid transparent;
  font-family: inherit;
  cursor: default;
}
.btn {
  background: var(--btn);
  color: var(--btn-text);
  border-color: var(--btn);
}
.btn-secondary {
  background: var(--card);
  color: var(--accent);
  border-color: var(--border);
}
.btn-placeholder {
  background: var(--btn);
  color: var(--btn-text);
  border-color: var(--btn);
}
.btn-placeholder .tag,
.badge {
  display: inline-block;
  background: var(--soon-bg);
  color: var(--soon-text);
  font-size: 13px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0;
  white-space: nowrap;
}
.btn-secondary .tag {
  background: var(--soon-bg);
  color: var(--soon-text);
}

.section { padding: 36px 0 8px; }
.section h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  line-height: 1.3;
}
.section .intro {
  margin: 0 0 20px;
  color: var(--muted);
  max-width: 46rem;
}

.cards {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}
.card .num {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 6px;
  font-variant-numeric: tabular-nums;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}
.card p { margin: 0; color: var(--muted); }

.notice, .draft, .page-intro {
  background: var(--draft-bg);
  color: var(--draft-text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 20px;
}
.notice p, .draft p, .page-intro p { margin: 0 0 8px; }
.notice p:last-child, .draft p:last-child, .page-intro p:last-child { margin: 0; }

.steps-preview {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: step;
}
.steps-preview li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 10px;
  align-items: start;
  box-shadow: var(--shadow);
}
.steps-preview li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.steps-preview a { font-weight: 700; text-decoration: none; }
.steps-preview a:hover { text-decoration: underline; }
.steps-preview span { display: block; color: var(--muted); font-size: 15px; }

.page-head {
  padding: 28px 0 8px;
}
.page-head h1 {
  margin: 0 0 8px;
  font-size: 1.85rem;
  line-height: 1.25;
}
.page-head .lede, .note { color: var(--muted); margin: 0 0 16px; }

/* 使用說明：步驟＋手機框占位 */
.manual-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 0 28px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 6.5rem;
}
.manual-step h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}
.manual-copy p { margin: 0 0 10px; }
.manual-copy p:last-child { margin: 0; }

.phone-ph { margin: 0 auto; }
.phone-ph figcaption {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  max-width: 230px;
}
.phone-frame {
  width: 230px;
  aspect-ratio: 390 / 844;
  border: 3px solid var(--border);
  border-radius: 36px;
  background: var(--placeholder-bg);
  color: var(--placeholder-text);
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.phone-island {
  width: 72px;
  height: 14px;
  border-radius: 8px;
  background: var(--border);
  margin: 0 auto 10px;
  flex: 0 0 auto;
}
.phone-screen {
  flex: 1;
  width: 100%;
  border: 1px dashed var(--border);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 16px 12px;
}
.ph-label {
  margin: 0;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.4;
  color: var(--placeholder-text);
}
.ph-step {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--placeholder-text);
}

/* 法律頁 */
.legal-article {
  scroll-margin-top: 7.5rem;
  margin: 8px 0 40px;
}
.legal-article > h2 {
  font-size: 1.6rem;
  margin: 8px 0 8px;
}
.legal-kicker { color: var(--muted); margin: 0 0 16px; }

.legal-article section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px 20px 18px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}
.legal-article h3 {
  font-size: 1.15rem;
  margin: 18px 0 10px;
  line-height: 1.4;
}
.legal-article h3::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 1em;
  border-radius: 3px;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: -0.1em;
}
.legal-article .draft { margin: 0 0 14px; }
.legal-article ul, .legal-article ol { padding-left: 1.4em; }
.legal-article li { margin: 4px 0; }
ol.toc { padding-left: 1.4em; }

.table-wrap {
  overflow-x: auto;
  margin: 10px 0;
  -webkit-overflow-scrolling: touch;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
  margin: 0;
  min-width: 32rem;
  font-variant-numeric: tabular-nums;
}
th, td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--th);
  color: var(--text);
  font-weight: 700;
}

.todo, mark.todo {
  background: var(--todo-bg);
  color: var(--todo-text);
  padding: 0.05em 0.35em;
  border-radius: 4px;
  font-weight: 600;
}
code {
  font-size: 14px;
  font-family: "Noto Sans Mono CJK TC", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  background: var(--th);
  color: var(--text);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.legal-endnote {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 0;
}

footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  padding: 24px 0 32px;
}
.footer-inner { display: grid; gap: 10px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.footer-links a { color: var(--link); font-weight: 600; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
footer p { margin: 0; }

@media (min-width: 720px) {
  body { font-size: 18px; }
  .hero h1 { font-size: 2.5rem; }
  .page-head h1 { font-size: 2.15rem; }
  .hero-actions {
    flex-direction: row;
    max-width: none;
    justify-content: center;
  }
  .btn, .btn-secondary, .btn-placeholder { min-width: 220px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .manual-step {
    display: block;
    max-width: 40rem;
  }
}

@media (min-width: 1080px) {
  .wrap, .header-inner, .subnav-inner, .footer-inner { padding-left: 32px; padding-right: 32px; }
  .legal-wrap { max-width: calc(var(--legal-max) + 64px); margin-left: auto; margin-right: auto; }
}

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

/* 表定時刻免責（小字）＋TDX 標章位置 */
.schedule-disclaimer{font-size:12px;color:var(--muted, #5b6b66);margin:0}
.tdx-logo-slot{display:inline-block;min-width:0;vertical-align:middle}
.tdx-logo-slot:empty{display:none}
