:root {
  color-scheme: light;
  --ink: #24322a;
  --muted: #546358;
  --paper: #fffefb;
  --line: #dfe5dc;
  --green: #275348;
  --tile: #e4eee2;
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  line-height: 1.55;
  background: #f5f6f0;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); text-underline-offset: .2em; }
a:focus-visible { outline: 3px solid #9c4d30; outline-offset: 3px; }
h1, h2 { margin: 0; line-height: 1.24; }
.shell { max-width: 48rem; margin-inline: auto; padding: clamp(1rem, 5vw, 3.1rem); }
.calendar { max-width: 34rem; margin-inline: auto; }
.calendar-head {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: clamp(10.5rem, 36vw, 14rem);
  margin: 0 0 .85rem;
  padding: 1rem clamp(1rem, 5vw, 1.8rem);
  border-radius: 1rem;
  overflow: hidden;
  color: #fff;
  background: #172c39;
  background-image: linear-gradient(90deg, #142c34f5, #142a35d2 41%, #1023352b 83%), var(--cover-image, url("./taipei.jpg"));
  background-size: cover;
  background-position: center, 57% center;
}
.calendar-head h1 { font-size: clamp(1.85rem, 7vw, 2.7rem); letter-spacing: -.035em; margin-top: .18rem; }
.cover-date { font-size: .9rem; font-weight: 700; color: #e3efcc; margin: 0; }
.photo-credit { margin: .65rem 0 0; font-size: .81rem; color: #f0f2e8; }
.photo-credit a { color: inherit; }
.photo-credit a:focus-visible { outline-color: #e3efcc; }
.calendar-list, .timeline { list-style: none; padding: 0; margin: 0; }
.calendar-list { display: grid; gap: .55rem; }
.date-row {
  display: grid;
  grid-template-columns: 3.3rem minmax(0, 1fr);
  align-items: center;
  gap: .85rem;
  min-height: 4.35rem;
  padding: .38rem .74rem .38rem .42rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}
.date-row:hover { background: #f4f8ee; border-color: #8aa496; }
.date-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3.48rem;
  padding: .27rem;
  border-radius: .62rem;
  background: var(--tile);
  color: var(--green);
  line-height: 1.1;
}
.date-tile span, .weekday { font-size: .875rem; }
.date-tile strong { margin-top: .13rem; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.date-copy { display: grid; gap: .12rem; line-height: 1.3; }
.weekday { color: var(--muted); }
.date-copy strong { font-size: 1.06rem; }
.detail-head { margin: .45rem 0 1.15rem; }
.detail-head h1 { font-size: clamp(1.7rem, 6vw, 2.65rem); }
.eyebrow { margin: 0 0 .35rem; color: var(--green); font-weight: 700; }
.detail-note { color: var(--muted); margin: .38rem 0 0; }
.back a, .detail-nav a, .source-links a { display: inline-flex; align-items: center; min-height: 44px; }
.back a { font-weight: 700; }
.timeline, .guide article { background: var(--paper); border: 1px solid var(--line); border-radius: .9rem; }
.timeline { padding-inline: clamp(.85rem, 3.5vw, 1.5rem); }
.event { display: grid; grid-template-columns: 7.75rem minmax(0, 1fr); gap: .8rem; padding-block: 1rem; }
.event + .event { border-top: 1px solid var(--line); }
.event .time { color: var(--green); font-size: .92rem; font-weight: 800; }
.event h2, .guide h2 { font-size: 1.08rem; }
.event p, .guide p { margin: .35rem 0 0; color: var(--muted); }
.links, .source-links, .detail-nav { display: flex; flex-wrap: wrap; gap: .4rem .72rem; }
.links { margin-top: .62rem; }
.map-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .35rem .62rem;
  border: 1px solid #d3e1d0;
  border-radius: .55rem;
  background: #ebf2e9;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
}
.map-link:hover { text-decoration: underline; }
.source-links { margin-top: .35rem; font-size: .9rem; }
.detail-nav { margin-top: .4rem; padding-top: .45rem; border-top: 1px solid var(--line); font-weight: 700; }
.guide { display: grid; gap: .55rem; margin-bottom: .9rem; }
.guide article { padding: .95rem; }
.guide .map-link { margin-top: .5rem; }
.offline .view { display: none; }
.offline .view:target { display: block; }
.offline .view:target ~ .calendar { display: none; }
@media (max-width: 39rem) {
  .event { grid-template-columns: 1fr; gap: .25rem; }
}
@media print {
  :root, .timeline, .guide article, .date-row { background: white; color: black; }
  .event { break-inside: avoid; }
}

.route-map { margin: 0; min-width: 0; }
.route-overview { margin: 0 0 1rem; padding: .88rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--paper); }
.route-overview figcaption { font-size: 1.1rem; font-weight: 800; margin-bottom: .6rem; }
.map-surface { position: relative; overflow: hidden; aspect-ratio: 2 / 1; min-height: 155px; isolation: isolate; border-radius: .7rem; background-color: #e7eee5; background-image: linear-gradient(90deg, #dde7dc 1px, transparent 1px),linear-gradient(#dde7dc 1px, transparent 1px); background-size: 24px 24px; }
.map-tiles, .map-surface canvas { position: absolute; inset: 0; }
.map-tiles img { position: absolute; display: block; width: 256px; height: 256px; }
.map-surface canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.map-surface > a { position: absolute; right: 0; bottom: 0; padding: .12rem .3rem; background: #ffffffe8; font-size: .76rem; }
.map-stops { display: flex; flex-wrap: wrap; list-style: none; padding: 0; gap: .35rem .55rem; margin: .55rem 0 .24rem; }
.map-stops li { border-radius: .35rem; background: var(--tile); padding: .13rem .45rem; font-size: .9rem; font-weight: 700; }
.map-note { font-size: .88rem; color: var(--muted); margin: .35rem 0; }
.route-disclosure { margin-top: .45rem; }
.route-disclosure summary { min-height: 44px; padding: .63rem 0; color: var(--green); font-weight: 800; cursor: pointer; }
.route-picker { display: grid; gap: .3rem; margin-bottom: .55rem; color: var(--muted); font-size: .9rem; }
.route-picker select { min-height: 44px; width: 100%; padding: .4rem; border: 1px solid #a0ad9f; border-radius: .45rem; background: var(--paper); color: var(--ink); font: inherit; font-size: 1rem; }
.map-navigation { margin-top: .2rem; }

.food-guide { margin: 0 0 1rem; padding: 0 .88rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--paper); }
.food-guide summary { min-height: 44px; padding: .7rem 0; color: var(--green); font-weight: 800; cursor: pointer; }
.food-guide summary:focus-visible { outline: 3px solid #9c4d30; outline-offset: 3px; }
.food-hint, .food-area header p, .food-spots p { color: var(--muted); margin: 0; }
.food-hint, .food-area header p, .food-sources { font-size: .9rem; }
.food-area { padding: .85rem 0; border-top: 1px solid var(--line); margin-top: .45rem; }
.food-area header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .45rem 1rem; }
.food-area h2 { font-size: 1.13rem; margin: .15rem 0 0; }
.food-spots { margin: .65rem 0 0; padding: 0; list-style: none; }
.food-spots li { padding: .65rem 0 .15rem; }
.food-spots li + li { border-top: 1px solid var(--line); }
.food-spots p { margin: .2rem 0 0; }
.food-place, .food-sources a { display: inline-flex; align-items: center; min-height: 44px; }
.food-sources { display: flex; flex-wrap: wrap; gap: 0 .9rem; }
