/* =====================================================================
   臺北市預約公車 — 形象網站視覺系統
   深林綠 × 米紙色 × 站牌琥珀；標題襯線、內文黑體；照片主導
   ===================================================================== */
:root {
  --forest-950: #0d2619;
  --forest-900: #123524;
  --forest-800: #1a4630;
  --forest-700: #205a3c;
  --forest-600: #2c6f4b;
  --forest-100: #dfeae1;
  --forest-50:  #eef4ef;
  --amber-500:  #f2c46b;   /* 站牌琥珀：預約班次、重點數字 */
  --amber-800:  #7a4a00;
  --amber-100:  #fbe9c4;
  --amber-50:   #fdf5e4;
  --red-700:    #a8261b;
  --red-50:     #fbeeec;
  --ink:        #1c2620;
  --ink-2:      #47534c;
  --ink-3:      #6c766f;
  --paper:      #f6f3ec;
  --paper-2:    #ede8dc;
  --surface:    #ffffff;
  --line:       #ddd6c6;
  --line-2:     #ebe6da;

  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;

  --r-sm: 6px; --r-md: 12px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(18, 53, 36, .06), 0 10px 30px -14px rgba(18, 53, 36, .25);
  --fs: 18px;
  --tap: 48px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --z-top: 20; --z-tab: 30; --z-toast: 40;
  font-size: var(--fs);
}
:root[data-font="large"]  { --fs: 20px; }
:root[data-font="xlarge"] { --fs: 23px; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.7; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; outline: none; }
main.page { padding: 2.5rem 0 4rem; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6rem; text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 900; letter-spacing: .01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8rem; text-wrap: pretty; }
a { color: var(--forest-700); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, time { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid #1d6fd8; outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 99; border-radius: var(--r-sm); }
.skip:focus { top: 8px; }
.eyebrow { font-size: .82rem; font-weight: 700; letter-spacing: .12em; color: var(--forest-600); margin: 0 0 .9rem; }

/* ============ Top bar ============ */
.topbar { background: var(--forest-900); color: #fff; position: sticky; top: 0; z-index: var(--z-top); transition: background .3s var(--ease), box-shadow .3s; }
.topbar__in { display: flex; align-items: center; gap: 1.25rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; }
.brand__mark { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.12); color: var(--amber-500); display: grid; place-items: center; }
.brand__text { font-family: var(--serif); font-weight: 900; font-size: 18px; line-height: 1.15; display: flex; flex-direction: column; white-space: nowrap; }
.brand__text small { font-family: var(--sans); font-weight: 500; font-size: 10px; letter-spacing: .14em; opacity: .7; text-transform: uppercase; }
.mainnav { display: flex; gap: .25rem; margin-left: auto; }
.mainnav a { position: relative; color: #fff; text-decoration: none; padding: .5rem .85rem; font-size: 16px; font-weight: 500; opacity: .9; }
.mainnav a::after { content: ""; position: absolute; left: .85rem; right: .85rem; bottom: .25rem; height: 2px; background: var(--amber-500); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.mainnav a:hover { opacity: 1; }
.mainnav a:hover::after, .mainnav a[aria-current="page"]::after { transform: scaleX(1); }
.mainnav a[aria-current="page"] { opacity: 1; font-weight: 700; }
.topbar__tools { display: flex; align-items: center; gap: .75rem; }
.fontsize { display: flex; background: rgba(255,255,255,.1); border-radius: 999px; padding: 3px; }
.fontsize button { background: none; border: 0; color: #fff; min-width: 34px; height: 32px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13px; transition: background .2s; }
.fontsize button sup { font-size: .6em; }
.fontsize button:hover { background: rgba(255,255,255,.12); }
.fontsize button[aria-pressed="true"] { background: #fff; color: var(--forest-900); }
.account { color: var(--forest-900); background: var(--amber-500); text-decoration: none; padding: .5rem 1.15rem; border-radius: 999px; font-weight: 700; font-size: 15px; white-space: nowrap; transition: transform .15s, background .2s; }
.account:hover { background: #f6d38f; transform: translateY(-1px); }
.account:active { transform: translateY(1px); }

/* 首頁：頁首透明疊在主視覺上，捲動後轉為實色 */
body.is-home .topbar { position: fixed; inset: 0 0 auto 0; background: linear-gradient(rgba(8,24,16,.55), rgba(8,24,16,0)); }
body.is-home .topbar.is-solid { background: var(--forest-900); box-shadow: 0 6px 20px -12px rgba(0,0,0,.5); }

/* ============ Mobile tab bar ============ */
.tabbar { display: none; }
@media (max-width: 900px) {
  .mainnav { display: none; }
  .brand__text small { display: none; }
  .topbar__tools { margin-left: auto; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: var(--z-tab); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem 0 .5rem; font-size: 12px; color: var(--ink-2); text-decoration: none; min-height: 58px; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
  .tabbar a[aria-current="page"] { color: var(--forest-700); font-weight: 700; }
  body { padding-bottom: 64px; }
}
@media (max-width: 480px) {
  .topbar__in { gap: .6rem; min-height: 64px; }
  .brand__mark { width: 34px; height: 34px; }
  .brand__text { font-size: 15px; }
  .account { padding: .4rem .85rem; font-size: 14px; }
  .fontsize button { min-width: 30px; font-size: 12px; }
}

/* ============ Inner page band ============ */
.band { position: relative; color: #fff; background: var(--forest-900); overflow: hidden; }
.band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,30,20,.85) 0%, rgba(10,30,20,.5) 55%, rgba(10,30,20,.15) 100%); }
.band .wrap { position: relative; z-index: 1; padding: 3.5rem 0 3rem; min-height: 280px; display: flex; flex-direction: column; justify-content: flex-end; }
.band h1 { font-size: 2.4rem; margin: 0 0 .3rem; }
.band p { margin: 0; color: #e4eee6; max-width: 34em; }
.band .eyebrow { color: var(--amber-500); margin-bottom: .5rem; }
@media (max-width: 640px) { .band .wrap { min-height: 200px; padding: 2.5rem 0 2rem; } .band h1 { font-size: 1.75rem; } }

/* ============ Buttons & form ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: var(--tap); padding: .6rem 1.4rem; border-radius: 999px; border: 2px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none; transition: background .2s, transform .15s var(--ease), border-color .2s, box-shadow .2s; font-size: 1rem; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--forest-700); color: #fff; }
.btn--primary:hover { background: var(--forest-800); box-shadow: 0 8px 18px -10px rgba(18,53,36,.6); }
.btn--amber { background: var(--amber-500); color: var(--forest-950); }
.btn--amber:hover { background: #f6d38f; }
.btn--outline { background: transparent; color: var(--forest-700); border-color: var(--forest-700); }
.btn--outline:hover { background: var(--forest-50); }
.btn--light { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn--light:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn--ghost { background: none; color: var(--forest-700); padding-inline: .7rem; }
.btn--ghost:hover { background: var(--forest-50); }
.btn--danger { background: var(--surface); color: var(--red-700); border-color: #e7b6b0; }
.btn--danger:hover { background: var(--red-50); }
.btn--block { width: 100%; }
.btn--lg { min-height: 56px; font-size: 1.08rem; padding-inline: 1.8rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.link-arrow { font-weight: 700; text-decoration: none; display: inline-flex; gap: .35rem; align-items: center; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .25s var(--ease); padding-bottom: 2px; }
.link-arrow:hover { background-size: 100% 2px; }

label { font-weight: 700; display: block; margin-bottom: .35rem; }
.field { margin-bottom: 1.1rem; }
.input, select.input, textarea.input { width: 100%; min-height: var(--tap); padding: .55rem .9rem; border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--forest-600); outline: none; box-shadow: 0 0 0 3px var(--forest-100); }
.input[aria-invalid="true"] { border-color: var(--red-700); }
.field-error { color: var(--red-700); font-size: .88rem; margin-top: .3rem; font-weight: 500; }
.hint { color: var(--ink-3); font-size: .85rem; margin-top: .25rem; }

/* ============ Surfaces ============ */
.panel { background: var(--surface); border-radius: var(--r-lg); padding: 1.4rem; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 1rem; }
.section { margin-top: 2.25rem; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.section__head a { font-weight: 700; text-decoration: none; }
.pagehead { margin-bottom: 1.5rem; }
.pagehead p { color: var(--ink-2); margin: 0; }
.back { display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; font-weight: 700; margin-bottom: .75rem; min-height: 40px; }

/* ============ Tags ============ */
.tag { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; padding: .12rem .55rem; border-radius: 4px; white-space: nowrap; }
.tag--res { background: var(--amber-100); color: var(--amber-800); }
.tag--fixed { background: var(--paper-2); color: var(--ink-2); }
.tag--ok { background: var(--forest-100); color: var(--forest-800); }
.tag--warn { background: var(--red-50); color: var(--red-700); }
.tag--info { background: #e5eefb; color: #1d4f99; }

/* =====================================================================
   首頁（形象）
   ===================================================================== */
.scr { min-height: min(100dvh, 920px); display: flex; align-items: center; padding: 6rem 0; }

/* Hero */
.hero { position: relative; min-height: 100dvh; display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: var(--forest-950); }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,24,16,.35) 0%, rgba(8,24,16,0) 30%, rgba(8,24,16,.2) 55%, rgba(8,24,16,.85) 100%), linear-gradient(90deg, rgba(8,24,16,.55) 0%, rgba(8,24,16,0) 60%); }
.hero .wrap { position: relative; z-index: 1; padding: 0 0 clamp(3rem, 9vh, 6rem); }
.hero .eyebrow { color: var(--amber-500); }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.6rem); line-height: 1.15; margin-bottom: 1.1rem; letter-spacing: .02em; }
.hero__lead { font-size: 1.15rem; color: #e6efe8; max-width: 30em; margin-bottom: 1.8rem; }
.hero__actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero__facts { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-top: 2.8rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,.25); max-width: 760px; }
.hero__facts div { display: flex; flex-direction: column; }
.hero__facts b { font-family: var(--serif); font-size: 1.9rem; font-weight: 900; color: var(--amber-500); line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero__facts span { font-size: .9rem; color: #d7e4da; }
.nexttrip-chip { position: absolute; z-index: 2; right: max(20px, calc((100% - 1200px) / 2)); bottom: clamp(3rem, 9vh, 6rem); background: rgba(255,255,255,.96); color: var(--ink); border-radius: var(--r-lg); padding: 1.1rem 1.3rem; width: 320px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); text-decoration: none; transition: transform .2s var(--ease); }
.nexttrip-chip:hover { transform: translateY(-2px); }
.nexttrip-chip small { color: var(--ink-3); font-weight: 700; letter-spacing: .08em; }
.nexttrip-chip strong { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--forest-800); margin: .15rem 0; }
@media (max-width: 1100px) { .nexttrip-chip { display: none; } }

/* Photo frames with hover zoom */
.ph { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--paper-2); }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
a:hover > .ph img, .ph:hover img { transform: scale(1.03); }

/* Story: split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.split--rev > :first-child { order: 2; }
.split .ph { aspect-ratio: 4 / 5; }
.split h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
.split p.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 30em; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.facts b { display: block; font-family: var(--serif); font-size: 2.2rem; font-weight: 900; color: var(--forest-700); line-height: 1.1; font-variant-numeric: tabular-nums; }
.facts span { font-size: .9rem; color: var(--ink-2); }

/* Steps with photo */
.ride { background: var(--forest-900); color: #fff; }
.ride .eyebrow { color: var(--amber-500); }
.ride h2 { color: #fff; font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
.ride__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.ride .ph { aspect-ratio: 4 / 3; }
.ride__steps { list-style: none; padding: 0; margin: 1.8rem 0 0; counter-reset: s; }
.ride__steps li { counter-increment: s; display: grid; grid-template-columns: 3rem 1fr; gap: .2rem 1rem; padding: 1.1rem 0; border-top: 1px solid rgba(255,255,255,.16); }
.ride__steps li::before { content: counter(s, decimal-leading-zero); grid-row: span 2; font-family: var(--serif); font-weight: 900; font-size: 1.5rem; color: var(--amber-500); line-height: 1.2; }
.ride__steps h3 { margin: 0; font-size: 1.12rem; }
.ride__steps p { margin: 0; color: #cfdcd2; font-size: .95rem; }

/* Routes showcase */
.routes-show .section__head { align-items: end; margin-bottom: 1.8rem; }
.routes-show h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); margin: 0; }
.areas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.area { display: block; text-decoration: none; color: inherit; transition: transform .25s var(--ease); }
.area:hover { transform: translateY(-2px); }
.area .ph { aspect-ratio: 3 / 4; }
.area .ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(8,24,16,.88) 100%); }
.area__body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 1.2rem; color: #fff; }
.area__body h3 { font-family: var(--serif); font-weight: 900; font-size: 1.45rem; margin: 0 0 .2rem; }
.area__body p { margin: 0; font-size: .88rem; color: #dfe9e2; }
.area__routes { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .55rem; }
.area__routes span { background: var(--amber-500); color: var(--forest-950); font-weight: 700; font-size: .78rem; padding: .1rem .5rem; border-radius: 4px; }
@media (max-width: 1000px) { .areas { grid-template-columns: repeat(2, 1fr); } .area .ph { aspect-ratio: 4 / 3; } }
@media (max-width: 560px) { .areas { grid-template-columns: 1fr; } }

/* Full-bleed photo with copy */
.bleed { position: relative; color: #fff; overflow: hidden; background: var(--forest-950); }
.bleed > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bleed::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,24,16,.9) 0%, rgba(8,24,16,.6) 45%, rgba(8,24,16,.05) 80%); }
.bleed .wrap { position: relative; z-index: 1; }
.bleed__copy { max-width: 520px; }
.bleed h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); color: #fff; }
.bleed p { color: #dbe7de; }
.bleed .eyebrow { color: var(--amber-500); }
.propmini { margin: 1.6rem 0 1.8rem; display: grid; gap: .9rem; }
.propmini a { display: block; color: #fff; text-decoration: none; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: var(--r-md); padding: .9rem 1.1rem; transition: background .2s, transform .2s var(--ease); backdrop-filter: blur(4px); }
.propmini a:hover { background: rgba(255,255,255,.15); transform: translateY(-2px); }
.propmini .progress { background: rgba(255,255,255,.2); margin-top: .5rem; }
.propmini .progress > span { background: var(--amber-500); }

/* News + partners */
.newsroom { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.newsroom h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
.newslist { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.newslist a { display: grid; grid-template-columns: 7rem 1fr auto; gap: 1rem; align-items: center; padding: 1.1rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: padding .25s var(--ease), color .2s; }
.newslist a:hover { padding-left: .5rem; color: var(--forest-700); }
.newslist time { color: var(--ink-3); font-size: .88rem; }
.newslist strong { font-weight: 700; }
.partners h3 { font-size: .85rem; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 1rem; }
.partners ul { list-style: none; padding: 0; margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.02rem; line-height: 1.95; color: var(--forest-800); columns: 2; column-gap: 1.5rem; }
@media (max-width: 900px) { .newsroom { grid-template-columns: 1fr; } .newslist a { grid-template-columns: 1fr; gap: .2rem; } .newslist .tag { justify-self: start; } }

/* Closing band */
.closing { background: var(--amber-500); color: var(--forest-950); }
.closing .split { grid-template-columns: .9fr 1.1fr; }
.closing .ph { aspect-ratio: 4 / 3; }
.closing h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
.closing p.lead { color: #3d3420; }
.closing .btn--outline { color: var(--forest-950); border-color: var(--forest-950); }
.closing .btn--outline:hover { background: rgba(0,0,0,.06); }
.closing__actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

@media (max-width: 900px) {
  .scr { min-height: 0; padding: 4rem 0; }
  .split, .ride__grid, .closing .split { grid-template-columns: 1fr; }
  .split--rev > :first-child { order: 0; }
  .split .ph { aspect-ratio: 4 / 3; }
  .bleed::after { background: linear-gradient(180deg, rgba(8,24,16,.45) 0%, rgba(8,24,16,.9) 55%); }
  .bleed.scr { align-items: flex-end; min-height: 90dvh; }
  .hero__facts { gap: 1.5rem; }
  .facts b { font-size: 1.7rem; }
}
@media (max-width: 480px) {
  .hero__actions .btn, .closing__actions .btn { flex: 1 1 100%; }
  .hero__lead { font-size: 1.02rem; }
  .hero__facts b { font-size: 1.5rem; }
  .facts { grid-template-columns: 1fr 1fr 1fr; gap: .6rem; }
  .facts b { font-size: 1.4rem; }
}

/* =====================================================================
   內頁元件（功能頁沿用同一套語彙）
   ===================================================================== */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line-2); }
.row { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; color: inherit; text-decoration: none; min-height: 64px; transition: background .2s; }
a.row:hover { background: var(--forest-50); }
.row__main { flex: 1; min-width: 0; }
.row__title { font-weight: 700; }
.row__sub { color: var(--ink-2); font-size: .9rem; }
.row__end { display: flex; align-items: center; gap: .5rem; flex: none; }
.chev { width: 20px; height: 20px; stroke: var(--ink-3); fill: none; stroke-width: 2; flex: none; transition: transform .2s; }
a:hover .chev { transform: translateX(3px); }
.badge-route { min-width: 4.6rem; padding: .3rem .55rem; border-radius: var(--r-sm); background: var(--forest-700); color: #fff; font-weight: 700; text-align: center; font-size: .92rem; flex: none; }
.badge-route[data-cat="blue"] { background: #1f5fae; }
.badge-route[data-cat="red"] { background: #b3261e; }
.badge-route[data-cat="brown"] { background: #7a4b25; }
.badge-route[data-cat="green"] { background: #2b7a3f; }
.badge-route[data-cat="citizen"] { background: #3c5b8a; }
.badge-route[data-cat="other"] { background: #3d4a42; }
.newsdate { color: var(--ink-3); font-size: .85rem; font-variant-numeric: tabular-nums; flex: none; width: 6.2rem; }

.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin: .9rem 0 1.1rem; }
.chip { min-height: 40px; padding: .3rem .95rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; font-size: .92rem; transition: all .15s; }
.chip:hover { border-color: var(--forest-600); transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--forest-700); border-color: var(--forest-700); color: #fff; }
.chip--res[aria-pressed="true"] { background: var(--amber-500); border-color: var(--amber-500); color: var(--forest-950); }

.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); margin-bottom: 1.4rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button, .tabs a { background: none; border: 0; padding: .7rem 1rem; font-weight: 700; color: var(--ink-2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; text-decoration: none; min-height: var(--tap); }
.tabs [aria-selected="true"] { color: var(--forest-800); border-bottom-color: var(--amber-500); }

.seg { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: .45rem 1rem; border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--ink-2); min-height: 42px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--forest-800); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.searchbox { position: relative; }
.searchbox .input { min-height: 56px; padding-left: 3rem; font-size: 1.05rem; border-radius: 999px; }
.searchbox svg { position: absolute; left: 1.1rem; top: 16px; width: 24px; height: 24px; stroke: var(--ink-3); fill: none; stroke-width: 2; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); color: var(--ink); border-radius: var(--r-md); box-shadow: var(--shadow); z-index: 5; overflow: hidden; }
.suggest a { display: flex; gap: .75rem; align-items: center; padding: .7rem 1rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.suggest a:hover, .suggest a:focus { background: var(--forest-50); }

/* Stepper / booking */
.stepper { display: flex; gap: .3rem; margin: 0 0 1.6rem; padding: 0; list-style: none; }
.stepper li { flex: 1; font-size: .82rem; color: var(--ink-3); font-weight: 700; }
.stepper li::before { content: ""; display: block; height: 6px; border-radius: 3px; background: var(--line); margin-bottom: .45rem; }
.stepper li[data-state="done"]::before, .stepper li[data-state="current"]::before { background: var(--forest-700); }
.stepper li[data-state="current"] { color: var(--forest-800); }
@media (max-width: 560px) { .stepper li span { display: none; } .stepper li[data-state="current"] span { display: inline; } }
.booklayout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.summary { position: sticky; top: 92px; }
.summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .45rem .9rem; font-size: .92rem; }
.summary dt { color: var(--ink-3); }
.summary dd { margin: 0; font-weight: 700; }
.summary dd.none { color: var(--ink-3); font-weight: 400; }
.daystrip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory; }
.day { flex: none; scroll-snap-align: start; width: 72px; padding: .5rem 0; border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-align: center; cursor: pointer; line-height: 1.25; transition: border-color .15s, transform .15s; }
.day:hover { border-color: var(--forest-600); transform: translateY(-1px); }
.day b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.day small { color: var(--ink-3); font-size: .75rem; }
.day[aria-pressed="true"] { border-color: var(--forest-700); background: var(--forest-700); color: #fff; }
.day[aria-pressed="true"] small { color: #d9ecdf; }
.tripgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; margin-top: 1rem; }
.trip { text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: .9rem 1rem; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; display: flex; flex-direction: column; gap: .25rem; }
.trip:hover:not([disabled]) { border-color: var(--forest-600); transform: translateY(-2px); }
.trip[aria-pressed="true"] { border-color: var(--forest-700); background: var(--forest-50); }
.trip[disabled] { cursor: not-allowed; background: var(--paper-2); color: var(--ink-3); }
.trip__time { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.trip__meta { font-size: .85rem; color: var(--ink-2); }

.stoplist { list-style: none; margin: 0; padding: 0; }
.stoplist li { position: relative; padding-left: 2.2rem; }
.stoplist li::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 4px; background: var(--forest-100); }
.stoplist li:first-child::before { top: 50%; }
.stoplist li:last-child::before { bottom: 50%; }
.stoplist li::after { content: ""; position: absolute; left: 7px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--surface); border: 3px solid var(--forest-600); }
.stoplist .stopbtn { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; text-align: left; min-height: 50px; padding: .4rem .75rem; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; }
.stoplist .stopbtn:hover:not([disabled]) { background: var(--forest-50); }
.stoplist .stopbtn[disabled] { color: var(--ink-3); cursor: not-allowed; }
.stoplist li[data-role="board"]::after, .stoplist li[data-role="alight"]::after { background: var(--amber-500); border-color: var(--forest-700); width: 20px; height: 20px; left: 5px; margin-top: -10px; }
.stoplist li[data-role="between"]::before, .stoplist li[data-role="board"]::before, .stoplist li[data-role="alight"]::before { background: var(--forest-600); }
.stoplist li[data-role] .stopbtn { font-weight: 700; }
.stoplist .eta { font-size: .85rem; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stoplist .eta--soon { color: var(--forest-800); font-weight: 700; }
.stoplist .eta--warn { color: var(--red-700); }

.pax { display: inline-flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.pax button { width: var(--tap); height: var(--tap); border-radius: 50%; border: 2px solid var(--forest-700); background: var(--surface); color: var(--forest-700); font-size: 1.4rem; cursor: pointer; transition: transform .15s; }
.pax button:active { transform: scale(.94); }
.pax button[disabled] { opacity: .35; cursor: not-allowed; }
.pax output { font-size: 1.6rem; font-weight: 700; min-width: 2ch; text-align: center; }

.callout { border-radius: var(--r-md); padding: .95rem 1.15rem; display: flex; gap: .75rem; align-items: flex-start; font-size: .94rem; }
.callout p { margin: 0; }
.callout--amber { background: var(--amber-50); border: 1px solid var(--amber-100); }
.callout--red { background: var(--red-50); border: 1px solid #f2c9c4; }
.callout--green { background: var(--forest-50); border: 1px solid var(--forest-100); }
.callout svg { flex: none; width: 22px; height: 22px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; }
.actionsbar { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; }

.ticket { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; max-width: 580px; }
.ticket__head { background: var(--forest-900); color: #fff; padding: 1.4rem 1.5rem; }
.ticket__head h1 { font-size: 1.45rem; margin: 0; }
.ticket__body { padding: 1.3rem 1.5rem; }
.ticket__code { font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 1.2rem; letter-spacing: .08em; font-weight: 700; }
.ticket__route { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 1rem 0; }
.ticket__route dt { color: var(--ink-3); }
.ticket__route dd { margin: 0; font-weight: 700; }

.tripcard { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 1.15rem 1.3rem; display: grid; grid-template-columns: auto 1fr auto; gap: .5rem 1.3rem; align-items: center; }
.tripcard + .tripcard { margin-top: .8rem; }
.tripcard__date { text-align: center; padding-right: 1.3rem; border-right: 1px solid var(--line-2); min-width: 5.5rem; }
.tripcard__date b { display: block; font-family: var(--serif); font-size: 1.7rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tripcard__date small { color: var(--ink-3); font-size: .8rem; }
.tripcard__actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.standing { display: flex; align-items: center; gap: 1rem; }
.meter { display: flex; gap: 4px; }
.meter i { width: 28px; height: 10px; border-radius: 5px; background: var(--line); }
.meter i.on { background: var(--red-700); }

.routehead { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.routehead .badge-route { font-size: 1.2rem; padding: .45rem .8rem; }
.routehead h1 { margin: 0; }
.fav { margin-left: auto; }
.fav[aria-pressed="true"] svg { fill: var(--amber-500); stroke: var(--amber-800); }
.fav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.detailgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; margin-top: 1.4rem; }

.propcard { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .65rem; transition: transform .2s var(--ease); }
.propcard:hover { transform: translateY(-2px); }
.propgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.od { display: grid; grid-template-columns: 14px 1fr; gap: .1rem .6rem; align-items: center; font-weight: 700; }
.od i { width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid var(--forest-700); justify-self: center; }
.od i.end { background: var(--forest-700); }
.od span.line { grid-column: 1; width: 2px; height: 12px; background: var(--forest-100); justify-self: center; }
.progress { height: 10px; border-radius: 5px; background: var(--paper-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--forest-600); border-radius: 5px; transition: width .4s var(--ease); }
.propcard__foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: auto; padding-top: .4rem; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 2rem; margin: 0; padding: 0; }
.rules li { list-style: none; display: flex; gap: .75rem; align-items: flex-start; }
.rules b { flex: none; display: inline-block; min-width: 4.5rem; color: var(--forest-700); font-family: var(--serif); font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.skel { background: linear-gradient(90deg, var(--line-2) 0, #f8f6f0 50%, var(--line-2) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r-md); }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 2.8rem 1rem; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.empty svg { width: 56px; height: 56px; stroke: var(--forest-600); fill: none; stroke-width: 1.5; margin: 0 auto .5rem; }
.empty p { color: var(--ink-2); }
.errorbox { background: var(--red-50); border: 1px solid #f2c9c4; color: var(--red-700); padding: 1rem 1.2rem; border-radius: var(--r-md); }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: .75rem 1.25rem; border-radius: 999px; opacity: 0; pointer-events: none; transition: all .25s; z-index: var(--z-toast); max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dlg { border: 0; border-radius: var(--r-lg); padding: 0; width: min(460px, calc(100% - 32px)); max-height: 85vh; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dlg::backdrop { background: rgba(12, 30, 20, .5); }
.dlg__body { padding: 1.5rem; }
.dlg__actions { display: flex; gap: .75rem; justify-content: flex-end; padding: 0 1.5rem 1.5rem; flex-wrap: wrap; }

/* Login: split with photo */
.loginwrap { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100dvh - 72px); }
.loginwrap .ph { border-radius: 0; }
.loginbox { align-self: center; justify-self: center; width: min(440px, 100% - 40px); padding: 3rem 0; }
.loginbox h1 { font-size: 2.2rem; }
.loginbox .btn { width: 100%; margin-top: .8rem; }
.btn--google { background: #fff; color: #1f1f1f; border-color: var(--line); }
.btn--google:hover { background: #f7f7f7; border-color: #c9c9c9; }
#emailform .btn { margin-top: .2rem; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--ink-3); font-size: .85rem; margin: 1.3rem 0 .25rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 900px) { .loginwrap { grid-template-columns: 1fr; min-height: 0; } .loginwrap .ph { aspect-ratio: 16 / 9; } }

/* ============ Footer ============ */
.footer { background: var(--forest-950); color: #c8d6cc; padding: 3.5rem 0 1.5rem; font-size: .9rem; }
.footer__top { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer__name { font-family: var(--serif); font-weight: 900; font-size: 1.4rem; color: #fff; margin: 0 0 .3rem; }
.footer__nav { display: grid; grid-template-columns: repeat(2, auto); gap: .4rem 2rem; align-content: start; justify-content: start; }
.footer a { color: #fff; text-decoration: none; }
.footer__nav a:hover { text-decoration: underline; }
.footer__label { font-size: .78rem; letter-spacing: .12em; color: var(--amber-500); font-weight: 700; margin: 0 0 .2rem; }
.footer__phone { font-family: var(--serif); font-size: 1.2rem; color: #fff; font-weight: 600; margin: 0 0 .4rem; }
.footer__org { margin: 1.4rem 0 .4rem; }
.footer__credit { font-size: .78rem; color: #8ea597; margin: 0; }
@media (max-width: 900px) { .footer__top { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .booklayout, .detailgrid { grid-template-columns: 1fr; }
  .summary { position: static; order: -1; }
  .rules { grid-template-columns: 1fr; }
  .actionsbar { position: sticky; bottom: 64px; background: var(--paper); padding: .75rem 0; margin-bottom: -.75rem; z-index: 2; }
  .actionsbar .btn { flex: 1; }
  h1 { font-size: 1.6rem; }
}
@media (max-width: 640px) {
  .formgrid { grid-template-columns: 1fr; }
  .tripcard { grid-template-columns: 1fr; }
  .tripcard__date { display: flex; gap: .5rem; align-items: baseline; text-align: left; border-right: 0; padding: 0 0 .5rem; border-bottom: 1px solid var(--line-2); }
  .tripcard__date b { font-size: 1.25rem; display: inline; }
  .tripcard__actions { justify-content: stretch; }
  .tripcard__actions .btn { flex: 1; }
}
@media (max-width: 480px) {
  .summary h3 { display: none; }
  .summary dl { grid-template-columns: auto 1fr auto 1fr; font-size: .85rem; }
}
.booklayout > *, .detailgrid > *, .split > *, .ride__grid > *, .newsroom > * { min-width: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* 登入頁照片：在 grid 中撐滿整格 */
.loginwrap .ph { min-height: 320px; }
.loginwrap .ph img { position: absolute; inset: 0; }
/* 手機首屏：主角小巴在畫面右側，手機改以小巴為中心裁切；字級與數字列收斂成一屏 */
@media (max-width: 600px) {
  .hero__img { object-position: 82% 50%; }
  .hero h1 { font-size: 2.1rem; }
  .hero .wrap { padding-top: 88px; }
  .hero__lead { margin-bottom: 1.2rem; }
  .hero__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1.6rem; padding-top: 1rem; }
  .hero__facts b { font-size: 1.3rem; }
  .hero__facts span { font-size: .75rem; line-height: 1.4; }
  .hero__actions .btn--lg { min-height: 52px; }
}

/* 手機版登入頁：16:9 比例加上最小高度 320 會把照片撐到 569px 寬造成橫向捲動，改固定高度 */
@media (max-width: 900px) { .loginwrap .ph { aspect-ratio: auto; min-height: 200px; width: 100%; } }

/* 即時到站：車子目前停在這一站 */
.stoplist li[data-bus="here"]::after { background: var(--amber-500); border-color: var(--forest-800); }
.stoplist .busat { display: inline-flex; align-items: center; gap: .3rem; margin-left: .5rem; padding: .1rem .5rem; border-radius: 999px; background: var(--amber-100, #fdf0d5); color: var(--forest-900, #12301f); font-size: .78rem; font-weight: 700; vertical-align: middle; }
.stoplist .busat svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

/* 手機版：「車在此站」標籤自成一行不斷字；路線頁班次列的按鈕換到下一行，說明文字不被擠成一字一行 */
.stoplist .busat { white-space: nowrap; }
@media (max-width: 600px) {
  .stoplist .busat { display: flex; width: max-content; margin: .25rem 0 0; }
  .detailgrid .list .row { flex-wrap: wrap; row-gap: .6rem; }
  .detailgrid .list .row .btn { flex: 1 0 100%; }
}

/* ============ LOGO：白色圓框＋正面公車，中文名稱下接英文全名（業主 2026-11-11 指定樣式） ============ */
.brand { gap: .7rem; }
.brand__mark { width: 46px; height: 46px; border-radius: 0; background: none; color: #fff; display: block; flex: none; }
.brand__mark .logo-mark { width: 100%; height: 100%; display: block; }
.brand__text { font-size: 21px; letter-spacing: .06em; line-height: 1.1; }
.brand__text small { font-size: 10.5px; letter-spacing: .04em; text-transform: none; opacity: .88; margin-top: 3px; font-weight: 500; }
.footer__name { display: flex; align-items: center; gap: .7rem; color: #fff; }
.footer__name .brand__text small { display: block; }
@media (max-width: 900px) { .brand__text small { display: block; } }
@media (max-width: 480px) {
  .brand { gap: .5rem; }
  .brand__mark { width: 36px; height: 36px; }
  .brand__text { font-size: 16px; letter-spacing: .04em; }
  .brand__text small { font-size: 8px; letter-spacing: .02em; margin-top: 2px; }
}
