:root {
  color-scheme: light;
  --ink: #263040;
  --muted: #667085;
  --paper: #fffaf0;
  --surface: #ffffff;
  --line: rgba(38, 48, 64, 0.12);
  --sun: #ffcf5a;
  --coral: #ff7b6b;
  --teal: #58bec2;
  --sky: #74b9ff;
  --lavender: #b8a5ff;
  --leaf: #70bf73;
  --day-accent: var(--sun);
  --nav-height: 78px;
  font-family:
    "Microsoft JhengHei",
    "PingFang TC",
    "Noto Sans TC",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #dff5f7;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(116, 185, 255, 0.22), rgba(255, 250, 240, 0.95) 34%),
    #fff8e7;
}

body,
button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: min(390px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 40px rgba(37, 69, 84, 0.16);
}

.hero {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  background: #ffdf88;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(19, 42, 63, 0.08) 0%, rgba(255, 248, 224, 0.12) 48%, rgba(255, 248, 224, 0.96) 100%),
    linear-gradient(90deg, rgba(38, 48, 64, 0.32), rgba(38, 48, 64, 0.02) 58%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 300px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 20px 22px;
}

.eyebrow,
.tiny-label {
  margin: 0;
  color: rgba(38, 48, 64, 0.68);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
}

.hero h1 {
  margin: 8px 0 12px;
  color: #263040;
  font-size: clamp(2.15rem, 10vw, 2.95rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-meta span,
.date-chip,
.net-pill,
.tag-row span {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  font-size: 0.78rem;
  font-weight: 750;
}

.hero-meta span {
  padding: 7px 9px;
  backdrop-filter: blur(10px);
}

.content {
  display: grid;
  gap: 18px;
  padding: 0 16px calc(var(--nav-height) + 24px + env(safe-area-inset-bottom));
}

.status-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  border-block: 1px solid rgba(38, 48, 64, 0.08);
}

.status-band p {
  margin: 4px 0 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
}

.net-pill {
  flex: 0 0 auto;
  padding: 8px 10px;
  background: #e8fff7;
}

.net-pill.is-offline {
  background: #fff1e8;
}

.spotlight {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-block: 1px solid var(--line);
}

.spotlight.is-now {
  border-color: rgba(255, 123, 107, 0.45);
}

.spot-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: var(--day-accent);
  color: #263040;
  font-size: 0.84rem;
  font-weight: 900;
}

.spotlight h2,
.day-header h2,
.section-title h3 {
  margin: 0;
  letter-spacing: 0;
}

.spotlight h2 {
  margin-top: 4px;
  font-size: 1.16rem;
  line-height: 1.25;
}

.spotlight p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.day-header,
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.day-header h2 {
  margin-top: 4px;
  font-size: 1.55rem;
  line-height: 1.16;
}

.date-chip {
  padding: 8px 10px;
  background: #ffffff;
  white-space: nowrap;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.quick-link,
.link-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(38, 48, 64, 0.12);
  border-radius: 8px;
  background: #ffffff;
  color: #263040;
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
}

.quick-link {
  padding: 8px 6px;
  min-width: 0;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 20px rgba(88, 190, 194, 0.1);
}

.section-title {
  margin-bottom: 10px;
}

.section-title h3 {
  font-size: 1.08rem;
}

.section-title span {
  max-width: 54%;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
  text-align: right;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-card {
  position: relative;
  border: 1px solid var(--line);
  border-left: 6px solid var(--day-accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(38, 48, 64, 0.08);
}

.timeline-card.is-now {
  border-left-color: var(--coral);
}

.timeline-card summary {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.timeline-card summary::-webkit-details-marker {
  display: none;
}

.time {
  display: grid;
  min-height: 44px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 207, 90, 0.34);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.summary-main {
  min-width: 0;
}

.summary-main strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.25;
}

.summary-main small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.card-body {
  padding: 0 12px 14px 100px;
}

.card-body ul {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding-left: 1.1rem;
  color: #3b4658;
  font-size: 0.9rem;
  line-height: 1.55;
}

.tag-row,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-row {
  margin-bottom: 10px;
}

.tag-row span {
  padding: 5px 8px;
  background: #f6fbff;
  font-size: 0.74rem;
}

.mini-button {
  min-width: 66px;
  min-height: 36px;
  padding: 7px 10px;
  background: #263040;
  color: #ffffff;
  font-size: 0.8rem;
}

.mini-button.official {
  background: var(--teal);
  color: #102b31;
}

.transport-list,
.backup-list,
.official-links {
  display: grid;
  gap: 10px;
}

.info-card,
.backup-card,
.official-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(38, 48, 64, 0.07);
}

.info-card {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding: 13px;
}

.route-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border: 3px solid var(--day-accent);
  border-radius: 50%;
}

.info-card h4,
.backup-card h4 {
  margin: 0 0 7px;
  font-size: 0.98rem;
  line-height: 1.28;
}

.info-card p,
.backup-card p {
  margin: 0;
  color: #3b4658;
  font-size: 0.9rem;
  line-height: 1.55;
}

.info-card small,
.backup-card small,
.official-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}

.backup-card {
  padding: 13px;
}

.backup-card .mini-button {
  margin-top: 12px;
}

.official-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
}

.official-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--sun), var(--teal));
  color: #263040;
  font-size: 0.88rem;
  font-weight: 950;
}

.official-card strong {
  display: block;
  font-size: 0.95rem;
}

.bottom-nav {
  position: fixed;
  right: auto;
  bottom: 0;
  left: 50%;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: min(100vw, 390px);
  max-width: 100vw;
  min-height: var(--nav-height);
  margin: 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(38, 48, 64, 0.12);
  background: rgba(255, 250, 240, 0.94);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.nav-button {
  display: grid;
  gap: 2px;
  align-content: center;
  min-width: 0;
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #485467;
  cursor: pointer;
}

.nav-button span {
  font-size: 0.74rem;
  font-weight: 900;
}

.nav-button strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  line-height: 1.12;
}

.nav-button[aria-current="page"] {
  border-color: rgba(38, 48, 64, 0.12);
  background: var(--day-accent);
  color: #263040;
  box-shadow: 0 8px 20px rgba(255, 207, 90, 0.25);
}

@media (min-width: 391px) {
  body {
    padding-block: 18px;
  }

  .app-shell {
    min-height: calc(100vh - 36px);
    border-radius: 16px;
  }

  .bottom-nav {
    bottom: 18px;
    border-radius: 0 0 16px 16px;
  }
}

@media (max-width: 360px) {
  .content {
    padding-inline: 12px;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .timeline-card summary {
    grid-template-columns: 68px 1fr;
  }

  .card-body {
    padding-left: 12px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .quick-link,
  .timeline-card,
  .nav-button {
    transition:
      transform 160ms ease,
      box-shadow 160ms ease,
      background 160ms ease;
  }

  .quick-link:active,
  .nav-button:active {
    transform: translateY(1px);
  }
}
