/* 北海道旅遊手冊 — 三種風格 + 響應式 */
:root {
  /* 森林綠 + 木質暖色 - 預設 */
  --green-900: oklch(0.28 0.05 145);
  --green-700: oklch(0.42 0.08 145);
  --green-500: oklch(0.55 0.10 145);
  --green-100: oklch(0.93 0.03 145);
  --wood-700: oklch(0.45 0.07 60);
  --wood-500: oklch(0.62 0.08 60);
  --wood-300: oklch(0.82 0.05 70);
  --wood-100: oklch(0.94 0.02 75);
  --paper: oklch(0.97 0.008 80);
  --ink: oklch(0.20 0.01 80);
  --ink-soft: oklch(0.42 0.01 80);
  --ink-muted: oklch(0.58 0.01 80);
  --line: oklch(0.88 0.01 80);
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --fg-muted: var(--ink-muted);
  --accent: var(--green-700);
  --accent-soft: var(--green-100);
  --warm: var(--wood-500);

  --font-base: 16px;
  --font-display: "Noto Serif TC", "Shippori Mincho", "Songti TC", serif;
  --font-body: "Noto Sans TC", "Hiragino Sans", "PingFang TC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", ui-monospace, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px oklch(0 0 0 / 0.04), 0 4px 16px oklch(0 0 0 / 0.04);
}

/* === STYLE: 日系雜誌 (default) === */
[data-style="zasshi"] {
  --bg: oklch(0.97 0.008 80);
  --fg: oklch(0.18 0.01 80);
  --font-headline: var(--font-display);
  --headline-weight: 600;
  --card-bg: #fff;
  --texture: none;
}

/* === STYLE: 現代簡約 === */
[data-style="minimal"] {
  --bg: #fff;
  --fg: oklch(0.18 0 0);
  --fg-soft: oklch(0.42 0 0);
  --fg-muted: oklch(0.62 0 0);
  --line: oklch(0.92 0 0);
  --paper: #fff;
  --accent: oklch(0.42 0.08 145);
  --accent-soft: oklch(0.96 0.015 145);
  --font-headline: var(--font-body);
  --headline-weight: 700;
  --card-bg: #fff;
  --radius: 10px;
  --texture: none;
}

/* === STYLE: 復古旅遊手帳 === */
[data-style="techo"] {
  --bg: oklch(0.92 0.04 78);
  --fg: oklch(0.25 0.04 60);
  --fg-soft: oklch(0.40 0.04 60);
  --fg-muted: oklch(0.55 0.03 60);
  --line: oklch(0.78 0.05 60);
  --accent: oklch(0.42 0.08 145);
  --accent-soft: oklch(0.86 0.05 80);
  --warm: oklch(0.50 0.10 50);
  --card-bg: oklch(0.96 0.025 80);
  --font-headline: "Caveat", "Klee One", var(--font-display);
  --headline-weight: 700;
  --radius: 6px;
  --texture: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.4 0 0 0 0 0.25 0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* === FONT SIZE === */
[data-fontsize="small"]  { --font-base: 14px; }
[data-fontsize="normal"] { --font-base: 16px; }
[data-fontsize="large"]  { --font-base: 18px; }
[data-fontsize="xl"]     { --font-base: 21px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { font-size: var(--font-base); }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image: var(--texture);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 80px;
}

/* === HEADER === */
.app-header {
  padding: 1.25rem 1.25rem 1rem;
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-header h1 {
  font-family: var(--font-headline, var(--font-display));
  font-weight: var(--headline-weight, 600);
  font-size: 1.35rem;
  margin: 0;
  letter-spacing: 0.01em;
}
.app-header .meta {
  font-size: 0.78rem; color: var(--fg-muted);
  display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.15rem;
}
.app-header .meta .jp { font-feature-settings: "palt"; }
.app-header .controls {
  position: absolute; top: 1rem; right: 1rem;
  display: flex; gap: 0.4rem;
}
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg, #fff);
  color: var(--fg-soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* === DAY TABS (top scroll) === */
.day-tabs {
  display: flex; gap: 0.4rem;
  overflow-x: auto;
  padding: 0.85rem 1.25rem 0.25rem;
  scrollbar-width: none;
  position: sticky; top: 76px; z-index: 20;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
}
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  flex: 0 0 auto;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-bg, #fff);
  color: var(--fg-soft);
  font-size: 0.82rem;
  white-space: nowrap;
  display: flex; align-items: center; gap: 0.4rem;
  transition: all 0.15s;
}
.day-tab .badge {
  font-size: 0.65rem; padding: 1px 6px;
  background: var(--accent); color: #fff;
  border-radius: 999px;
}
.day-tab.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.day-tab.is-today  { box-shadow: 0 0 0 2px var(--accent-soft); }

/* === MAIN AREA === */
.app-main {
  padding: 1rem 1.25rem;
}

/* === DAY HEADER === */
.day-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.85rem; flex-wrap: wrap;
}
.day-header h2 {
  font-family: var(--font-headline, var(--font-display));
  font-weight: var(--headline-weight, 600);
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0; line-height: 1.2;
}
.day-header .jp {
  color: var(--fg-muted); font-size: 0.85em; font-weight: 400;
  display: block; margin-top: 0.15rem;
}
.day-header .stat {
  font-size: 0.78rem; color: var(--fg-muted);
  display: flex; gap: 0.85rem;
}
.day-header .summary {
  flex: 1 1 100%;
  font-size: 0.95rem; color: var(--fg-soft);
  margin-top: 0.4rem; max-width: 60ch;
}

/* === TIMELINE === */
.timeline {
  list-style: none; padding: 0; margin: 0;
  position: relative;
}
.timeline::before {
  content: ""; position: absolute;
  left: 64px; top: 8px; bottom: 8px;
  width: 1px; background: var(--line);
}
[data-style="techo"] .timeline::before {
  background: repeating-linear-gradient(to bottom, var(--wood-500) 0 4px, transparent 4px 8px);
}
.tl-item {
  display: grid;
  grid-template-columns: 56px 16px 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.tl-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-soft);
  padding-top: 0.85rem;
  text-align: right;
}
.tl-dot {
  width: 14px; height: 14px;
  margin-top: 0.95rem;
  border-radius: 50%;
  background: var(--card-bg, #fff);
  border: 2px solid var(--accent);
  position: relative; z-index: 1;
  justify-self: center;
}
.tl-dot[data-kind="hotel"]  { background: var(--accent); }
.tl-dot[data-kind="food"]   { border-color: var(--warm); }
.tl-dot[data-kind="flight"] { border-color: oklch(0.60 0.10 250); }
.tl-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.tl-card:hover { transform: translateY(-1px); box-shadow: 0 2px 4px oklch(0 0 0 / 0.06), 0 8px 24px oklch(0 0 0 / 0.06); }
.tl-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.tl-item.is-past .tl-card { opacity: 0.5; }
.tl-item.is-past .tl-time { opacity: 0.5; }
.tl-item.is-now .tl-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-soft); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.now-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}
[data-style="techo"] .tl-card {
  border-style: dashed;
  transform: rotate(-0.3deg);
}
[data-style="techo"] .tl-card:nth-child(even) { transform: rotate(0.3deg); }

.tl-kind {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.7rem;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  margin-right: 0.4rem;
  font-weight: 600;
}
.tl-title {
  font-family: var(--font-headline, var(--font-display));
  font-weight: var(--headline-weight, 600);
  font-size: 1.05rem; margin: 0.1rem 0 0.05rem;
  line-height: 1.3;
}
.tl-title .jp {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
  font-family: var(--font-body);
  margin-top: 1px;
}
.tl-note {
  font-size: 0.88rem; color: var(--fg-soft);
  margin: 0.4rem 0 0;
  line-height: 1.55;
}
.tl-actions {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin-top: 0.65rem;
}
.tl-actions .pill {
  font-size: 0.74rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-soft);
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.tl-actions .pill:hover { color: var(--accent); border-color: var(--accent); }
.tl-actions .pill.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === ROUTE CARD === */
.route-card {
  margin-top: 0.6rem; padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--accent-soft) 70%, transparent);
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.5rem;
  font-size: 0.78rem;
}
.route-line {
  display: flex; align-items: center; gap: 0.3rem;
  font-family: var(--font-mono);
}
.route-line .from, .route-line .to { color: var(--fg); font-weight: 600; }
.route-line .arrow { color: var(--accent); }
.route-stat { color: var(--fg-soft); font-size: 0.72rem; margin-top: 2px; }
.route-go { font-size: 0.7rem; color: var(--accent); white-space: nowrap; }

/* === IMAGES === */
.img-frame {
  margin-top: 0.65rem;
  width: 100%; aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, var(--wood-100), var(--wood-300));
  position: relative;
}
.img-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-frame .placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--wood-700);
  background-image: repeating-linear-gradient(45deg, transparent 0 9px, oklch(0 0 0 / 0.04) 9px 10px);
  text-align: center; padding: 1rem;
}
.tl-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.tl-ref {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: oklch(from var(--accent) l c h / 0.1);
  border: 1px dashed oklch(from var(--accent) l c h / 0.4);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.img-frame.is-clickable { cursor: zoom-in; }
.img-frame.is-clickable img { transition: transform 0.4s ease; }
.img-frame.is-clickable:hover img { transform: scale(1.03); }

/* === GALLERY (multi-image) === */
.gallery { margin-top: 0.65rem; }
.gallery .img-frame {
  margin-top: 0;
  /* portrait 手機防止 hero 把整屏吃光 */
  max-height: min(48vh, 360px);
}
.gallery .img-frame img { max-height: inherit; }
.gallery-thumbs {
  display: grid;
  /* 桌機/平板：4 格；窄欄位時自動降為 3 格保證 ≥56px 點擊區 */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 4px;
}
@media (max-width: 380px) {
  .gallery-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.gallery-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 0;
  padding: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: var(--wood-100);
  outline: 2px solid transparent;
  outline-offset: -2px;
  transition: outline-color 0.15s ease, transform 0.15s ease;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.is-active { outline-color: var(--accent); }
.gallery-thumb:hover:not(.is-active) { transform: translateY(-1px); }
.gallery-more {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: oklch(0 0 0 / 0.55);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.gallery-count {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-muted);
}
.gallery-dot-row { display: inline-flex; gap: 4px; }
.gallery-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--line);
  transition: background 0.15s ease, transform 0.15s ease;
}
.gallery-dot.is-active { background: var(--accent); transform: scale(1.3); }
.gallery-count-text { letter-spacing: 0.04em; }

/* === LIGHTBOX === */
.lightbox {
  position: fixed; inset: 0;
  z-index: 200;
  background: oklch(0.08 0 0 / 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 4vmin;
  animation: lightbox-fade 0.18s ease-out;
  -webkit-tap-highlight-color: transparent;
}
@keyframes lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px oklch(0 0 0 / 0.6);
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: oklch(1 0 0 / 0.1);
  color: #fff;
  border: 1px solid oklch(1 0 0 / 0.18);
  backdrop-filter: blur(6px);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { background: oklch(1 0 0 / 0.2); }
.lightbox-close {
  top: 1rem; right: 1rem;
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  font-size: 1.1rem;
}
.lightbox-nav {
  top: 50%; transform: translateY(-50%);
  width: 3rem; height: 3rem;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  font-family: serif;
}
.lightbox-nav.prev { left: 1rem; }
.lightbox-nav.next { right: 1rem; }
.lightbox-nav:hover { transform: translateY(-50%) scale(1.05); }
.lightbox-count {
  position: absolute;
  bottom: 1.25rem; left: 50%;
  transform: translateX(-50%);
  background: oklch(0 0 0 / 0.5);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  border: 1px solid oklch(1 0 0 / 0.15);
}
@media (max-width: 600px) {
  .lightbox-nav { width: 2.5rem; height: 2.5rem; font-size: 1.6rem; }
  .lightbox-close { top: 0.6rem; right: 0.6rem; }
  .lightbox-nav.prev { left: 0.4rem; }
  .lightbox-nav.next { right: 0.4rem; }
}
/* landscape 手機（高度很矮）：縮減邊距、按鈕貼邊 */
@media (max-height: 500px) and (orientation: landscape) {
  .lightbox { padding: 1.5vmin; }
  .lightbox-count { bottom: 0.5rem; padding: 3px 9px; font-size: 0.7rem; }
  .lightbox-close { top: 0.4rem; right: 0.4rem; width: 2rem; height: 2rem; font-size: 0.95rem; }
  .lightbox-nav { width: 2.2rem; height: 2.2rem; }
}
/* detail panel 容器較窄時，縮圖也降成 3 格（容器查詢） */
.detail-panel { container-type: inline-size; }
@container (max-width: 380px) {
  .detail-panel .gallery-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* === DETAIL PANEL === */
.layout-two > aside {
  /* 手機單欄時隱藏：詳情面板僅作為寬螢幕右欄。時間軸卡片已含完整內容，
     若不隱藏，aside 會堆疊在最後一張卡之下、預設顯示第一個 block，
     看起來像「最後一張卡重複顯示第一張卡」。≥720px 才顯示（見下方 media query）。 */
  display: none;
  align-self: start;
  position: sticky;
  top: 9.25rem; /* app-header (~4.75rem) + day-tabs (~3.5rem) + gap */
}
.detail-panel {
  max-height: calc(100vh - 10.5rem);
  overflow-y: auto;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg, #fff);
}
.detail-panel h3 {
  font-family: var(--font-headline, var(--font-display));
  font-weight: var(--headline-weight, 600);
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}
.detail-panel .jp { color: var(--fg-muted); font-size: 0.85rem; }
.detail-panel .empty {
  color: var(--fg-muted); font-size: 0.9rem; line-height: 1.6;
  padding: 1rem 0;
}

/* === BOTTOM NAV === */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex;
  background: color-mix(in oklab, var(--bg) 96%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 0.4rem 0.4rem max(0.4rem, env(safe-area-inset-bottom));
}
.nav-btn {
  flex: 1;
  background: transparent; border: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 0.45rem 0.25rem;
  color: var(--fg-muted);
  border-radius: 12px;
  font-size: 0.68rem;
}
.nav-btn .icon { font-size: 1.15rem; line-height: 1; }
.nav-btn.is-active { color: var(--accent); background: var(--accent-soft); }

/* === SHEET (modal-ish) === */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: oklch(0 0 0 / 0.4);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadein 0.2s;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  background: var(--bg); width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto;
  border-radius: 18px 18px 0 0;
  padding: 1.25rem 1.25rem max(1.5rem, env(safe-area-inset-bottom));
  animation: slideup 0.25s ease-out;
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle {
  width: 36px; height: 4px; background: var(--line); border-radius: 2px;
  margin: 0 auto 0.85rem;
}
.sheet h2 {
  font-family: var(--font-headline, var(--font-display));
  font-weight: var(--headline-weight, 600);
  margin: 0 0 0.85rem;
  font-size: 1.4rem;
}

/* === EMERGENCY === */
.eg-section {
  margin-bottom: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg, #fff);
  overflow: hidden;
}
.eg-section > h3 {
  margin: 0; padding: 0.85rem 1rem;
  font-family: var(--font-headline, var(--font-display));
  font-weight: var(--headline-weight, 600);
  font-size: 1.05rem;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: baseline; gap: 0.5rem;
}
.eg-section > h3 .jp { font-size: 0.7rem; color: var(--accent); opacity: 0.7; font-weight: 400; font-family: var(--font-body); }
.eg-section .note { padding: 0 1rem; font-size: 0.85rem; color: var(--fg-soft); margin: 0.7rem 0 0; }
.eg-list { list-style: none; padding: 0; margin: 0.5rem 0 0.65rem; }
.eg-item {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 0.65rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--line);
  align-items: center;
}
.eg-item:first-of-type { border-top: 0; }
.eg-icon { font-size: 1.1rem; }
.eg-label { font-weight: 600; font-size: 0.95rem; }
.eg-desc { font-size: 0.78rem; color: var(--fg-muted); margin-top: 1px; }
.eg-tel { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); white-space: nowrap; }
.eg-item.placeholder { background: repeating-linear-gradient(45deg, transparent 0 8px, oklch(0 0 0 / 0.025) 8px 9px); }
.eg-item.placeholder .eg-tel { color: var(--fg-muted); }

/* === PHRASES === */
.phrase-item {
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line);
}
.phrase-item:first-child { border-top: 0; }
.phrase-tw { font-weight: 600; }
.phrase-jp { color: var(--accent); margin-top: 2px; }
.phrase-romaji { font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-muted); margin-top: 1px; }

/* === PACKING === */
.pack-section {
  background: var(--card-bg, #fff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 1rem;
  margin-bottom: 1rem;
}
.pack-section h3 {
  font-family: var(--font-headline, var(--font-display));
  font-weight: var(--headline-weight, 600);
  margin: 0 0 0.6rem; font-size: 1rem;
  display: flex; align-items: center; justify-content: space-between;
}
.pack-progress {
  font-size: 0.72rem; color: var(--fg-muted);
  font-family: var(--font-mono);
  font-weight: 400;
}
.pack-list { list-style: none; padding: 0; margin: 0; }
.pack-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
  user-select: none;
}
.pack-item:last-child { border-bottom: 0; }
.pack-check {
  width: 20px; height: 20px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: transparent;
  transition: all 0.15s;
}
.pack-item.is-done .pack-check {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.pack-item.is-done .pack-label {
  color: var(--fg-muted); text-decoration: line-through;
}
.pack-label { font-size: 0.92rem; }

/* packing: 還原 / 新增 / 刪除 */
.pack-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
}
.pack-head h2 { margin: 0; }
.pack-reset-group { display: inline-flex; gap: 0.4rem; }
.pack-reset {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--fg-soft);
  background: var(--card-bg, #fff);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
}
.pack-reset.is-confirm { color: #fff; background: #c0392b; border-color: #c0392b; }
@media (hover: hover) {
  .pack-reset:hover { color: var(--accent); border-color: var(--accent); }
  .pack-reset.is-confirm:hover { color: #fff; background: #a93226; border-color: #a93226; }
}
/* 列點擊改由 check/label 觸發，刪除鈕獨立 */
.pack-item { cursor: default; }
.pack-check, .pack-label { cursor: pointer; }
.pack-label { flex: 1 1 auto; }
.pack-del {
  flex: 0 0 auto;
  margin-left: auto;
  width: 26px; height: 26px;
  border: 0; background: transparent;
  color: var(--fg-muted);
  font-size: 0.8rem; line-height: 1;
  border-radius: 7px;
  cursor: pointer;
  opacity: 0.55;
  transition: all 0.15s;
}
@media (hover: hover) {
  .pack-del:hover { opacity: 1; color: #c0392b; background: rgba(192,57,43,0.1); }
}
.pack-add { display: flex; gap: 0.5rem; margin-top: 0.7rem; }
.pack-add-input {
  flex: 1 1 auto; min-width: 0;
  font: inherit; font-size: 0.88rem;
  padding: 0.42rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg, #fff);
  color: var(--fg);
}
.pack-add-input::placeholder { color: var(--fg-muted); }
.pack-add-input:focus { outline: none; border-color: var(--accent); }
.pack-add-btn {
  flex: 0 0 auto;
  width: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg, #fff);
  color: var(--accent);
  font-size: 1.15rem; line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
}
@media (hover: hover) {
  .pack-add-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
}

/* === MAP OVERVIEW === */
.map-wrap {
  background: var(--card-bg, #fff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.map-svg { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
.map-legend {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-top: 0.75rem;
  font-size: 0.78rem; color: var(--fg-soft);
}
.map-legend .swatch {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 4px; vertical-align: middle;
}

/* === WEATHER === */
.weather-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
}
.weather-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  text-align: center;
}
.weather-card .day { font-size: 0.78rem; color: var(--fg-muted); }
.weather-card .icon { font-size: 1.6rem; margin: 0.25rem 0; }
.weather-card .temp { font-family: var(--font-mono); font-size: 0.92rem; }
.weather-card .city { font-size: 0.72rem; color: var(--fg-muted); margin-top: 2px; }
.weather-note {
  background: var(--accent-soft); padding: 0.85rem 1rem;
  border-radius: var(--radius); margin-top: 1rem;
  font-size: 0.85rem; color: var(--fg-soft); line-height: 1.6;
}

/* === SETTINGS PANEL === */
.settings-row {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row .label { font-weight: 600; margin-bottom: 0.45rem; }
.settings-row .desc { font-size: 0.78rem; color: var(--fg-muted); margin-bottom: 0.5rem; }
.choice-row {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
}
.choice-btn {
  padding: 0.45rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  color: var(--fg-soft); font-size: 0.85rem;
}
.choice-btn.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === SECTION HEADERS === */
.section-h {
  font-family: var(--font-headline, var(--font-display));
  font-weight: var(--headline-weight, 600);
  font-size: 1.3rem; margin: 0.5rem 0 1rem;
}

/* === RESPONSIVE === */

/* Pixel Fold inner ~768px+ : two-column */
@media (min-width: 720px) {
  .layout-two {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 1.5rem;
    align-items: start;
  }
  .layout-two > aside { display: block; } /* 寬螢幕才顯示右側詳情欄 */
}
@media (min-width: 720px) and (max-width: 1023px) {
  .app-shell { padding-bottom: 0; }
  .bottom-nav {
    position: sticky; bottom: 0;
    border-radius: 0;
    margin-top: 1rem;
  }
}

/* Desktop / tablet large */
@media (min-width: 1024px) {
  .day-tabs { padding-top: 1rem; }
  .layout-two {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 2rem;
  }
}

/* small phone (Pixel Fold outer ~360-480px, Z Flip cover etc.) */
@media (max-width: 380px) {
  .timeline::before { left: 48px; }
  .tl-item { grid-template-columns: 42px 14px 1fr; }
  .tl-time { font-size: 0.78rem; padding-top: 0.85rem; }
  .app-header { padding: 0.85rem 0.85rem 0.7rem; }
  .day-tabs { padding-left: 0.85rem; padding-right: 0.85rem; }
  .app-main { padding: 0.85rem; }
}

/* Pixel 10 Pro Fold 內螢幕 ~820px：兩欄式最佳化 */
@media (min-width: 720px) and (max-width: 900px) {
  .layout-two {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 1.25rem;
  }
  .app-main { padding: 1rem; }
  .layout-two > aside { top: 9rem; }
  .detail-panel { padding: 1rem; }
}
/* Pixel 10 Pro Fold 外螢幕 ~412px：略寬於小手機 */
@media (min-width: 381px) and (max-width: 480px) {
  .timeline::before { left: 56px; }
}
