/* ============================================================
   JENNIFERTRAVELS — 統一設計系統 style.css
   涵蓋：根目錄首頁 / 0315_nantou / 0220_hokkaido
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@400;700&family=Noto+Sans+TC:wght@300;400;500;700;900&family=Noto+Sans+JP:wght@400;700&family=Klee+One:wght@400;600&display=swap');

/* --- 設計 Token (CSS 變數) --- */
:root {
  --ink:           #1c1917;   /* 主文字 stone-900 */
  --paper:         #faf8f4;   /* 背景米白 */
  --warm:          #f5f0e8;   /* 次要暖背景 */
  --accent:        #c2410c;   /* 主強調橘紅 */
  --accent-mid:    #ea580c;   /* 中強調 */
  --accent-light:  #fff7ed;   /* 淡橘背景 */
  --accent-border: #fed7aa;   /* 橘色邊框 */
  --muted:         #78716c;   /* 次要文字 stone-500 */
  --border:        #e7e2d9;   /* 通用邊框 */
  --card-bg:       #ffffff;
}

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

/* --- Base --- */
body {
  background-color: var(--paper);
  font-family: 'Noto Sans TC', sans-serif;
  color: var(--ink);
  padding-bottom: 60px;
}

/* Paper texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.serif { font-family: 'Noto Serif TC', serif; }

/* ============================================================
   HEADER（共用）
   ============================================================ */

/* ── Banner header — 暖沙褐色，比內容深一階 ── */
header,
.site-header,
.header-bg {
  background: #e8e0d3;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid #d4c9b8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* 所有 header 內的文字顏色 */
header h1, header h2,
.site-header h1, .site-header h2,
.header-bg h1, .header-bg h2 {
  color: var(--ink);
}

header p, header span, header a:not(.back-btn),
.site-header p, .site-header span,
.header-bg p, .header-bg span {
  color: var(--muted);
}

/* 飛機裝飾水印 */
header::after,
.site-header::after,
.header-bg::after {
  content: '✈';
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-size: 120px;
  opacity: 0.12;
  line-height: 1;
  pointer-events: none;
  color: var(--accent-border);
}

/* ── 行程內頁 header（跟首頁/列表頁同款：白底）── */
.detail-header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
/* 水印：預設飛機文字；個別頁面可用 --watermark-flag 換成國旗 SVG（emoji 國旗在 Windows 上常常顯示不出來，改用向量圖保證跨平台一致） */
.detail-header::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: -14px;
  width: 120px;
  height: 80px;
  background-image: var(--watermark-flag, none);
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.12;
  pointer-events: none;
  transform: rotate(-4deg);
}
.detail-header:not([style*="watermark-flag"])::after {
  content: '✈';
  width: auto;
  height: auto;
  background: none;
  font-size: 58px;
  line-height: 1;
  color: var(--accent-border);
  transform: none;
}



/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Drill-down cards（旅行記錄 洲別/年份 選擇畫面）— 護照章／登機證造型 */
.drill-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px;
}
.drill-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 14% 20%, var(--drill-accent-bg, var(--warm)) 0%, transparent 55%),
    var(--card-bg);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  opacity: 0;
  animation: fadeUp 0.35s ease forwards;
}
.drill-card::after {
  content: '';
  position: absolute;
  right: -16px;
  top: 50%;
  width: 32px;
  height: 32px;
  background: var(--paper);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: inset 0 0 0 1px var(--border);
}
.drill-card:hover {
  border-color: var(--drill-accent, #fda87a);
  box-shadow: 0 10px 26px rgba(0,0,0,0.09);
  transform: translateY(-3px);
}

/* 郵戳徽章 */
.drill-card-badge {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--drill-accent, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.drill-card-badge-icon { width: 22px; height: 22px; }

/* 撕票線 */
.drill-card-divider {
  align-self: stretch;
  width: 0;
  border-left: 1.5px dashed var(--border);
}

.drill-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.drill-card-eyebrow {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: var(--drill-accent, var(--accent));
  text-transform: uppercase;
  margin-bottom: 3px;
}
.drill-card-label {
  display: block;
  font-family: 'Klee One', 'Noto Serif TC', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.drill-card-count {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.drill-card-arrow {
  position: relative;
  z-index: 1;
  margin-right: 6px;
  color: #c9bfb4;
  flex-shrink: 0;
  transition: transform 0.2s, color 0.2s;
}
.drill-card:hover .drill-card-arrow {
  color: var(--drill-accent, var(--accent));
  transform: translateX(3px);
}

/* ============================================================
   根目錄首頁 — TRIP CARD LIST
   ============================================================ */

#list-planned, #list-completed {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px;
}

.trip-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 10% 12%, var(--drill-accent-bg, var(--warm)) 0%, transparent 55%),
    var(--card-bg);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
}
.trip-card::after {
  content: '';
  position: absolute;
  right: -16px;
  top: 50%;
  width: 32px;
  height: 32px;
  background: var(--paper);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: inset 0 0 0 1px var(--border);
}
.trip-card:hover {
  border-color: var(--drill-accent, #fda87a);
  box-shadow: 0 10px 26px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}
.trip-card:hover .card-title    { color: var(--accent); }
.trip-card:hover .arrow-icon    { transform: translateX(4px); color: var(--accent); }

.trip-card-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--drill-accent, var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.trip-card-badge-icon { width: 20px; height: 20px; }

.trip-card-divider {
  align-self: stretch;
  width: 0;
  border-left: 1.5px dashed var(--border);
}

.trip-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.arrow-icon {
  position: relative;
  z-index: 1;
  margin-right: 6px;
  transition: transform 0.2s, color 0.2s;
  color: #d6cfc6;
}

/* Tag badge */
.trip-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--warm);
}
.trip-tag-planning {
  border-color: #fed7aa;
  color: #c2410c;
  background: #fff7ed;
}

/* Home big blocks */
/* ── 首頁新設計 ── */
.home-header {
  padding: 40px 28px 32px;
  border-bottom: 1px solid var(--border);
}
.home-eyebrow {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 400;
}
.home-title {
  font-family: 'Klee One', 'Noto Serif TC', serif;
  font-size: 2rem;
  font-weight: 600;
  color: #6b3d14;
  line-height: 1.2;
  text-wrap: balance;
  letter-spacing: 0.05em;
}
.home-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.home-stat {
  padding: 28px 12px 24px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.home-stat:last-child { border-right: none; }
.home-stat-num {
  font-family: 'Noto Serif TC', Georgia, serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: #a16207;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.home-stat-label {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 7px;
  font-family: 'Noto Sans TC', sans-serif;
}
.home-menu {
  display: flex;
  flex-direction: column;
}
.home-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 19px 28px;
  border: none;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  background: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background 0.18s, border-left-color 0.18s;
}
.home-menu-item:last-child { border-bottom: none; }
.home-menu-item:hover {
  background: var(--warm);
  border-left-color: var(--accent);
}
.home-menu-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: var(--border);
  border-radius: 9px;
  flex-shrink: 0;
  transition: background 0.18s;
}
.home-menu-item:hover .home-menu-icon {
  background: var(--accent-border);
}
.home-menu-text {
  flex: 1;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--ink);
  font-family: 'Noto Sans TC', sans-serif;
}
.home-menu-arrow {
  color: #c9bfb4;
  transition: transform 0.18s, color 0.18s;
  flex-shrink: 0;
}
.home-menu-item:hover .home-menu-arrow {
  color: var(--accent);
  transform: translateX(4px);
}
.home-tagline {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  font-family: 'Klee One', 'Noto Sans TC', sans-serif;
  font-weight: 400;
  letter-spacing: 0.06em;
}
/* 小字那行是回 jennlife 入口的連結，但它要維持小標的樣子，不是一條藍字。 */
.home-hub {
  color: inherit;
  text-decoration: none;
}
.home-hub:hover { color: var(--accent); }

/* 去美食區的入口，跟在 tagline 底下。 */
.home-switch {
  margin-top: 10px;
  font-size: 12px;
  font-family: 'Klee One', 'Noto Sans TC', sans-serif;
  letter-spacing: 0.04em;
}
.home-switch a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding-bottom: 1px;
}
.home-switch a:hover { border-bottom-color: var(--accent); }

.home-stamp {
  flex-shrink: 0;
  transform: rotate(10deg);
  opacity: 0.6;
  margin-top: 6px;
}

/* ── 子頁面 header（旅行計畫 / 旅行記錄，跟首頁、管理頁同款）── */
.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 24px 22px;
  border-bottom: 1px solid var(--border);
}
.page-eyebrow {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 400;
}
.page-title {
  font-family: 'Klee One', 'Noto Serif TC', serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: #6b3d14;
  letter-spacing: 0.04em;
}

/* Back button */
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.back-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

/* 頁首左上角的兩顆圓鈕：上一頁 + 首頁 */
.nav-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.nav-btns .back-btn { width: 30px; height: 30px; }

/* Section label */
.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* Year divider */
.year-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}
.year-label::before,
.year-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}

/* ============================================================
   南投 0315 — STICKY HEADER + TABS
   ============================================================ */

.sticky-top {
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Day tab bar */
.tabs-bar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
}
.tab-btn {
  flex: 1;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  transition: all 0.15s;
  font-family: 'Noto Sans TC', sans-serif;
}
.tab-btn:hover { background: #fafaf9; color: var(--ink); }
.tab-btn.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}
.tab-date    { font-size: 15px; font-weight: 700; font-family: 'Noto Sans TC', sans-serif; }
.tab-summary { font-size: 11px; margin-top: 2px; line-height: 1.4; color: inherit; font-family: 'Noto Sans TC', sans-serif; }

/* Day summary strip */
.day-summary {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-align: center;
  padding: 10px 16px 18px;
}

/* ============================================================
   南投 0315 — TIMELINE
   ============================================================ */

.timeline-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 16px 0;
}
.timeline {
  position: relative;
}

/* ── 新 timeline 線做法：每個 event-item 自己畫那段線 ── */
.event-item {
  display: flex;
  gap: 16px;
  opacity: 0;
  animation: fadeUp 0.35s ease forwards;
}

/* 左側：線 + dot 的欄位 */
.event-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 32px;
  position: relative;
}

/* 線段：從 dot 下方延伸到 item 底部 */
.event-line {
  width: 2px;
  flex: 1;
  background: #c5b8a8;
  margin-top: 4px;
  min-height: 20px;
}

/* 最後一個 event：時間軸收在 dot 上，不再往下拖一截線（避免像沒結束的斷線） */
.event-item:last-child .event-line {
  display: none;
}

/* Dot */
.event-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--paper);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  color: white;
  z-index: 2;
  flex-shrink: 0;
}

/* 右側：card */
.event-card-wrap {
  flex: 1;
  padding-bottom: 20px;
  min-width: 0;
}


/* Timeline dot (北海道用) — flex item，由 timeline-col 置中 */
.timeline-dot {
  position: relative;   /* 覆蓋 event-dot 的 absolute */
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--paper);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  color: white;
  z-index: 10;
  flex-shrink: 0;
}

/* Event card */
.event-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}
.event-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.event-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.event-time {
  background: var(--paper);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  margin-top: 2px;
}
.event-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}
.event-notes {
  font-size: 13.5px;
  color: #57534e;
  line-height: 1.75;
  white-space: pre-line;
  margin-top: 4px;
}

/* Info block（地址 / 時間 / 導航） */
.info-block {
  margin-top: 14px;
  background: #fafaf9;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
}
.info-row svg { flex-shrink: 0; margin-top: 1px; }
.info-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}
.info-link:hover { text-decoration: underline; color: var(--accent-mid); }
.info-muted { color: var(--muted); }

/* Options block */
.options-block {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.option-card {
  background: #fafaf9;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.option-name  { font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.option-meta  { display: flex; align-items: center; gap: 5px; font-size: 12px; margin-bottom: 2px; }

/* Alert block */
.alert-block {
  margin-top: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #92400e;
  white-space: pre-line;
  line-height: 1.65;
}
.alert-block svg { flex-shrink: 0; margin-top: 1px; }

/* Split-bill block（Splitwise 風格） */
.split-block {
  margin-top: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 12px 14px;
}
.split-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 6px;
}
.split-row {
  font-size: 12.5px;
  color: #3f6212;
  line-height: 1.6;
}
.split-owe {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #bbf7d0;
  font-size: 13px;
  font-weight: 700;
  color: #15803d;
}

/* Paid/unpaid chip（記帳分頁：標記某人是否已付款） */
.paid-chip {
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.paid-chip.is-paid {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

/* 記帳分頁：總支出卡片 + 支出項目卡片 */
.expense-total-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 10% 15%, var(--accent-light) 0%, transparent 55%),
    var(--card-bg);
  margin-bottom: 16px;
}
.expense-total-badge {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.expense-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
  margin-bottom: 10px;
  box-sizing: border-box;
}
.expense-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0eee9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #57534e;
  flex-shrink: 0;
}

/* 記帳分頁：新增/編輯支出表單 */
.expense-form-card {
  border-style: dashed;
  background: var(--warm);
}
.exp-form-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.exp-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.exp-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--ink);
  font-family: 'Noto Sans TC', sans-serif;
}
.exp-input:focus {
  outline: none;
  border-color: var(--ink);
}
.exp-submit-btn {
  flex: 1;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Noto Sans TC', sans-serif;
  transition: opacity 0.15s;
}
.exp-submit-btn:hover { opacity: 0.85; }
.exp-cancel-btn {
  background: var(--card-bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Noto Sans TC', sans-serif;
}
.person-chip {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.person-chip.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

/* ============================================================
   北海道 0220 — TAB / TIMELINE / MODAL
   ============================================================ */

/* accent 色 */
.accent-color { color: var(--accent) !important; }

/* header-bg (北海道用，套用 header 樣式即可) */
/* .header-bg — merged into header block above */

/* Main tab bar */
.tab-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-weight: 500;
  transition: all 0.18s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  border-radius: 0;
  font-size: 0.875rem;
  font-family: 'Noto Sans TC', sans-serif;
  color: var(--muted);
  background: none;
  border: none;
}
.main-tab:hover {
  color: var(--ink);
  background-color: var(--warm);
}
.main-tab.active {
  border-bottom: 3px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  background-color: transparent;
}
.day-tab { color: var(--muted); }
.day-tab:hover {
  color: var(--ink);
  background-color: var(--warm);
}
.day-tab.active {
  border-bottom: 3px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  background-color: transparent;
}

/* Content area */
.content-area {
  animation: fadeIn 0.4s ease-in-out;
  min-height: 500px;
}

/* Modals */
#location-modal,
#hotel-edit-modal,
#expense-modal,
#itinerary-modal {
  transition: opacity 0.2s ease-in-out;
}
#location-modal.hidden,
#hotel-edit-modal.hidden,
#expense-modal.hidden,
#itinerary-modal.hidden   { opacity: 0; pointer-events: none; }
#location-modal:not(.hidden),
#hotel-edit-modal:not(.hidden),
#expense-modal:not(.hidden),
#itinerary-modal:not(.hidden) { opacity: 1; pointer-events: auto; }

/* Timeline (北海道版，用 class 而非 ::before) */
.timeline-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40px;
  flex-shrink: 0;
}
.timeline-line-solid {
  position: absolute;
  top: 0; bottom: -3rem; left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, var(--accent-border), var(--border) 80%, transparent);
  z-index: 0;
}
.timeline-line-dashed {
  position: absolute;
  top: 0; bottom: -3rem; left: 50%;
  width: 0;
  transform: translateX(-50%);
  border-left: 2px dashed #d6d3d1;
  z-index: 0;
}
.first-item .timeline-line-solid,
.first-item .timeline-line-dashed { top: 1.5rem; }
.last-item .timeline-line-solid,
.last-item .timeline-line-dashed  { bottom: auto; height: 1.5rem; }

/* Form inputs */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* Checklist */
.checklist-item { cursor: pointer; transition: all 0.2s; }
.checklist-item:hover { background-color: var(--accent-light); }
.checklist-checkbox { accent-color: var(--accent); width: 1.25rem; height: 1.25rem; }
.checked-text { text-decoration: line-through; color: #9ca3af; opacity: 0.7; }

/* Highlight clickable text */
.highlight-text-clickable {
  font-weight: 700;
  color: var(--accent);
  background-color: var(--accent-light);
  padding: 0 2px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: underline;
}

/* Hide scrollbar */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Day tab — 統一南投風格：日期大字 + 摘要小字 */
.day-tab {
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 14px !important;
  font-family: 'Noto Sans TC', sans-serif;
}
.day-tab .tab-date {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: inherit;
}
.day-tab .tab-summary {
  font-size: 10px;
  margin-top: 2px;
  line-height: 1.3;
  color: inherit;
  opacity: 0.75;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.day-tab.active .tab-summary { opacity: 1; }

/* Text clamp / expand */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-none {
  display: block;
  -webkit-line-clamp: unset;
}
.expand-btn {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: inline-block;
  margin-bottom: 0.75rem;
}
.expand-btn:hover { text-decoration: underline; color: var(--accent-mid); }

/* Section headings inside day-content */
.day-content h3.accent-color,
.day-content h3[class*="accent"] {
  color: var(--accent) !important;
  border-bottom-color: var(--accent-border) !important;
}

/* Checklist label hover (also used in script-generated HTML) */
.group:hover label,
.group:hover .group-hover\:text-orange-700 {
  color: var(--accent) !important;
}

/* ============================================================
   RWD — 手機版優化
   ============================================================ */

/* Tab bar — 手機字小一點，不擠 */
@media (max-width: 640px) {
  .tab-item {
    padding: 10px 10px;
    font-size: 0.8rem;
    gap: 3px;
  }

  .event-item {
    padding-left: 46px;
  }

  /* Timeline dot 在手機上稍小 */
  .event-dot {
    width: 28px;
    height: 28px;
    left: 2px;   /* 16 - 14(半徑) */
  }

  /* Event card 在手機上 padding 小一點 */
  .event-card {
    padding: 14px 14px 12px;
  }

  /* Trip card 手機版 padding */
  .trip-card .card-title {
    font-size: 0.95rem;
  }

  /* Modal 全螢幕感 */
  #location-modal > div,
  #hotel-edit-modal > div,
  #expense-modal > div,
  #itinerary-modal > div {
    max-height: 95vh;
    margin: 0.5rem;
  }

  /* Back btn 字小一點 */
  .back-btn {
    font-size: 12px;
  }

  /* Timeline line — 手機靠更左 */
  .timeline::before {
    left: 16px;
  }
  .timeline {
    padding-left: 0;
  }
}
/* ── 編輯權限：登入元件與編輯按鈕的顯示控制（邏輯見根目錄 trip-edit-login.js）──
   真正的把關是 Firestore rules（只有 EDITOR_EMAIL 寫得進去，在 Google 伺服器上
   執行）。這裡只是把編輯按鈕對訪客藏起來，讓畫面乾淨，不是安全機制。 */

#trip-edit-login {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
  font-size: 12px;
  line-height: 1;
  opacity: .45;
  transition: opacity .18s ease;
}
#trip-edit-login:hover,
#trip-edit-login:focus-within { opacity: 1; }
#trip-edit-login.tel-on {
  opacity: 1;
  border-color: var(--accent-border);
  background: var(--accent-light);
}
#trip-edit-login .tel-text { color: var(--accent); font-weight: 600; }
#trip-edit-login .tel-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex: none;
}
#trip-edit-login .tel-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--muted);
  font-family: inherit;
}
#trip-edit-login .tel-link:hover { color: var(--accent); }
#trip-edit-login .tel-link:disabled { cursor: default; opacity: .6; }
#trip-edit-login.tel-on .tel-link {
  color: var(--muted); font-weight: 500;
  padding-left: 7px; border-left: 1px solid var(--accent-border);
}

/* 未登入就不顯示編輯入口。用 onclick 內容比對，省得去改三支 script.js
   動態產生的每一顆按鈕。 */
body:not(.is-editor) [onclick*="openItineraryModal"],
body:not(.is-editor) [onclick*="openEditHotelModal"],
body:not(.is-editor) [onclick*="openNewHotelModal"],
body:not(.is-editor) [onclick*="deleteAccommodation"],
body:not(.is-editor) [onclick*="toggleHomeEditMode"],
body:not(.is-editor) [onclick*="resetItineraryToDefault"],
/* 記帳（共用元件 expenses.js）會寫入雲端的入口 */
body:not(.is-editor) [onclick*="openAddExpense"],
body:not(.is-editor) [onclick*="startEditExpense"],
body:not(.is-editor) [onclick*="deleteExpenseEntry"],
body:not(.is-editor) [onclick*="openPeopleManager"],
body:not(.is-editor) [onclick*="editCash"],
body:not(.is-editor) [onclick*="openIcCardModal"],
body:not(.is-editor) [data-editor-only] {
  display: none !important;
}


/* 整列/整張卡的 onclick 就是開編輯視窗的函式，不能藏（藏了資料就不見），
   訪客點了在函式裡就 return，這裡只把游標改回一般箭頭 */
body:not(.is-editor) [onclick*="openExpenseModal"],
body:not(.is-editor) [onclick*="openShoppingModal"] { cursor: default; }

/* 有彈窗打開時把左下角的登入膠囊藏起來：它 z-index 很高，會蓋住彈窗底部的
   「刪除」「複製」按鈕和文字。彈窗都是 Tailwind 的 .fixed.inset-0，關著時有 .hidden */
body:has(.fixed.inset-0:not(.hidden)) #trip-edit-login,
body:has(.shop-lightbox.is-open) #trip-edit-login { display: none !important; }

/* 分攤的「已付／NT$xxx」標籤：訪客也要看得到誰付了誰還沒付，
   只是不能點（toggleParticipantPaid 裡會擋），游標和 hover 不要裝成可以點 */
body:not(.is-editor) .paid-chip { cursor: default; pointer-events: none; }

/* 左下角的登入膠囊是固定在畫面上的，頁面捲到最底時會蓋住最後一兩行
   （例如分攤記帳最後一天的日期）。頁面底部多留一段空間，最後一行才捲得到膠囊上面。 */
body:has(#trip-edit-login) { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

@media print { #trip-edit-login { display: none !important; } }
