/* ===== 基礎 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* 對應全站共用配色 css/czech-theme.css（黑底劇院風・紅黑白） */
  --bg: var(--cz-bg);
  --bg2: var(--cz-bg-2);
  --panel: var(--cz-surface);
  --panel2: var(--cz-surface-2);
  --line: var(--cz-line);
  --line2: var(--cz-line-2);
  --text: var(--cz-text);
  --text2: var(--cz-text-2);
  --muted: var(--cz-muted);
  --accent: var(--cz-red);            /* 實心紅：主要按鈕／作用中狀態（上面放白字） */
  --accent-text: var(--cz-red-text);  /* 黑底上的紅字、連結 */
  --accent-soft: var(--cz-red-soft);  /* 淡紅底：提示框、選取列 */
  --accent-line: var(--cz-red-line);  /* hover／選取時的紅色細框 */
  --accent2: var(--cz-text-2);        /* 次要強調（原琥珀色標題，改暖白灰） */
  --topbar-h: 60px;
}
html, body { height: 100%; }
body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  overflow: hidden;
}

/* ===== 頂列 ===== */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  position: relative;   /* 手機版下拉選單以頂列為定位基準 */
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 0; }
.logo { font-size: 28px; }
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.topbar p { font-size: 12px; color: var(--muted); }
.topnav { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
/* 次要按鈕：透明底＋細框；hover 換深一階底＋紅細框 */
.nav-btn {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex-shrink: 0;
  background: transparent; color: var(--text); border: 1px solid var(--line2);
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; line-height: 1.3;
  text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.nav-btn:hover { background: var(--panel2); color: var(--text); border-color: var(--accent-line); }
.nav-btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
/* 主要按鈕：實心捷克紅＋白字 */
.nav-btn.play { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.nav-btn.play:hover { background: var(--cz-red-hover); border-color: var(--cz-red-hover); color: #fff; }
.nav-btn.play:active { background: var(--cz-red-press); }

/* ---- 頂列下拉選單（<details class="nav-menu">） ---- */
.nav-menu { position: relative; flex-shrink: 0; }
.nav-menu > summary { list-style: none; user-select: none; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::marker { content: ""; }
.nav-menu .caret { font-size: 10px; opacity: .75; margin-left: 2px; transition: transform .15s; }
.nav-menu[open] > summary { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
.nav-menu[open] > summary .caret { transform: rotate(180deg); }
.nav-menu-list {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 1500;
  min-width: 220px; padding: 6px 0;
  background: var(--panel); border: 1px solid var(--line2); border-radius: var(--cz-radius);
  box-shadow: var(--cz-shadow);
  display: flex; flex-direction: column;
}
.nav-menu-list .nav-btn {
  display: flex; width: 100%; min-height: 44px; padding: 0 16px; gap: 8px;
  background: transparent; border: 0; border-radius: 0; text-align: left; font-size: 14px;
  color: var(--text);
}
.nav-menu-list .nav-btn:hover, .nav-menu-list .nav-btn:focus-visible {
  background: var(--panel2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); outline: none;
}
/* 桌機中等寬度：收斂頂列，避免按鈕擠出畫面 */
@media (min-width: 861px) and (max-width: 1280px) {
  #trip-sub { display: none; }
  .topnav { gap: 6px; }
  .topnav > .nav-btn, .nav-menu > summary { padding: 7px 10px; font-size: 12.5px; }
}
@media (min-width: 861px) and (max-width: 1120px) {
  .topbar h1 { display: none; }   /* 只留國旗 logo，把空間讓給按鈕 */
}

/* ===== 主布局 ===== */
.layout { display: flex; height: calc(100% - var(--topbar-h)); position: relative; }

/* ===== 側邊欄 ===== */
.sidebar {
  width: 340px; flex-shrink: 0; background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto; padding: 16px;
}
.side-section { margin-bottom: 18px; }
.side-label {
  display: block; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.day-dropdown {
  width: 100%; padding: 10px; border-radius: 8px;
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  font-size: 14px; cursor: pointer;
}
.day-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.day-theme { font-size: 26px; }
.day-title { font-size: 16px; font-weight: 700; }
.day-meta { font-size: 12px; color: var(--muted); }
.day-note {
  font-size: 13px; line-height: 1.6; color: var(--text2);
  background: var(--panel2); padding: 10px; border-radius: 8px;
  border-left: 3px solid var(--accent-line);
}

/* ===== 餐廳安排 ===== */
.day-meals { margin-top: 10px; }
.meals-title { font-size: 12px; color: var(--accent2); font-weight: 700; margin-bottom: 6px; }
.meal-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; margin-bottom: 5px; cursor: pointer; font-size: 13px; }
.meal-row:hover { border-color: var(--accent-line); }
.meal-row.plain { cursor: default; }
.meal-label { font-size: 11px; color: var(--muted); background: var(--bg); padding: 2px 7px; border-radius: 6px; flex: 0 0 auto; }
.meal-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.meal-name { font-weight: 600; }
/* 強制換行：讓分類小標籤一律落在名稱下一行（與「更換」同列），各列位置一致 */
.meal-break { flex-basis: 100%; width: 100%; height: 0; }
.meal-special { width: 100%; font-size: 11px; color: var(--muted); padding-left: 2px; line-height: 1.4; }
.meal-clickable { cursor: pointer; }
/* 🔀 並列自選：同一餐時段的第二張圖卡，縮排＋虛線框，視覺上緊貼在主餐下方 */
.meal-row.meal-alt { margin-left: 14px; margin-top: -3px; border-style: dashed; position: relative; }
.meal-row.meal-alt::before { content: "或"; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  font-size: 10px; font-weight: 700; color: var(--accent2); }
.meal-row.meal-alt .meal-label { color: var(--accent2); }
/* 時刻表裡的並列自選列 */
.sch-row.sch-alt { border-left-style: dashed; opacity: .92; }
.sch-row.sch-alt .sch-time { opacity: .6; }
/* 🔀 並列參考行程區塊（同一天的另一種走法） */
.poi-list.altplan .poi-item { border-style: dashed; }
#altplan-note { margin: 2px 0 8px; line-height: 1.5; white-space: pre-line; }
.meal-clickable:hover { color: var(--accent-text); }
.meal-picker { width: 100%; margin-top: 6px; display: flex; flex-direction: column; gap: 4px;
  max-height: 240px; overflow-y: auto; }
.meal-picker .hotel-opt { cursor: pointer; }
.d-links { display: flex; flex-wrap: wrap; gap: 6px; }
.d-links a { font-size: 12px; padding: 5px 10px; border-radius: 8px; background: transparent;
  border: 1px solid var(--line2); color: var(--accent-text); text-decoration: none; transition: .12s; }
.d-links a:hover { background: var(--panel2); color: var(--text); border-color: var(--accent-line); }
.d-links a.book { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.d-links a.book:hover { background: var(--cz-red-hover); border-color: var(--cz-red-hover); color: #fff; }
.d-code { background: var(--cz-ok-soft); border: 1px solid rgba(92,194,138,.45); color: var(--cz-ok); font-size: 14px;
  padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
.d-code b { color: var(--text); font-size: 16px; letter-spacing: 1px; }
.d-toilet { background: var(--cz-ok-soft); border: 1px solid rgba(92,194,138,.45); color: var(--cz-ok); font-size: 13px;
  padding: 7px 11px; border-radius: 8px; margin-bottom: 12px; }
.toilet-badge { display: inline-block; background: var(--cz-ok-soft); color: var(--cz-ok); font-size: 10px;
  padding: 1px 6px; border-radius: 6px; margin-left: 4px; white-space: nowrap; }
/* ⭐ 自選標籤：使用者親自指定且確定的飯店/餐廳/表演 */
.userpick-badge { display: inline-block; background: var(--accent); color: #fff; font-size: 10px;
  font-weight: 700; padding: 1px 6px; border-radius: 6px; white-space: nowrap; border: 1px solid var(--accent); }
.d-facts dd a { color: var(--accent-text); }
/* 🧺 洗衣／烘衣標記 */
.laundry-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; margin-left: 4px; white-space: nowrap; border: 1px solid transparent; }
.laundry-badge.l-in { background: var(--cz-ok-soft); color: var(--cz-ok); border-color: rgba(92,194,138,.45); }
.laundry-badge.l-service, .laundry-badge.l-nearby { background: var(--panel); color: var(--text2); border-color: var(--line2); }
.laundry-badge.l-none { background: transparent; color: var(--muted); border-color: var(--line); }
.laundry-plan { margin-top: 6px; font-size: 12px; line-height: 1.6; color: var(--text2); background: var(--cz-ok-soft); border: 1px solid rgba(92,194,138,.35); border-radius: 8px; padding: 6px 9px; }
.laundry-note { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.sch-laundry { background: var(--cz-ok-soft); border-left-color: var(--cz-ok); }
.sch-laundry .sch-name { font-size: 12.5px; color: var(--text2); cursor: default; }
.d-block.special h4 { color: var(--accent-text); }
.d-block.special { background: var(--accent-soft); border-left: 3px solid var(--accent-line); padding: 8px 10px; border-radius: 6px; }

/* ===== 景點列表 ===== */
.poi-list { list-style: none; display: flex; flex-direction: column; gap: 6px; min-height: 10px; }
.poi-list.flex { opacity: .95; }
.poi-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; cursor: grab; font-size: 14px;
  transition: .12s;
}
.poi-item:hover { border-color: var(--accent-line); transform: translateX(2px); }
.poi-item .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
/* 卡片兩行對換：第一行＝分類標籤(＋距離)，第二行＝地點名稱（column-reverse 讓 .pcat 在上、名稱在下） */
.poi-item .pname { flex: 1; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 3px; }
.poi-item .pcat { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cat-tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; line-height: 1.7; white-space: nowrap; }
.pdist { color: var(--muted); font-size: 11px; }

/* ===== 本日住宿 ===== */
.hotel-item { cursor: default; }
.hotel-pname { cursor: pointer; }
.hotel-change-btn { margin-left: auto; flex-shrink: 0; background: transparent; color: var(--accent-text);
  border: 1px solid var(--line2); border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.hotel-change-btn:hover { background: var(--panel); color: var(--text); border-color: var(--accent-line); }
.hotel-picker { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.hotel-opt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px;
  background: var(--panel2); border: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.hotel-opt:hover { border-color: var(--accent-line); }
.hotel-opt.active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.hotel-opt .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.poi-item.ghost { opacity: .4; }
.poi-item .grip { color: var(--muted); cursor: grab; }
.hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.flex-head { list-style:none; font-size:12px; color:var(--accent2); font-weight:700; margin:8px 0 2px; padding-top:4px; border-top:1px dashed var(--line); }
.flex-head:first-child { border-top:none; padding-top:0; }
.flex-item { cursor: grab; }
.sched-badge { display:inline-block; background:var(--cz-ok-soft); color:var(--cz-ok); font-size:10px; padding:1px 5px; border-radius:6px; margin-left:4px; }
.d-en .sched { display:inline-block; background:var(--cz-ok-soft); color:var(--cz-ok); font-size:11px; padding:1px 7px; border-radius:8px; margin-left:6px; }

/* 景點分類顏色點（與 app.js 對應） */

/* ===== 地圖 ===== */
.map-wrap { flex: 1; position: relative; }
#map { width: 100%; height: 100%; background: var(--bg); }
.route-legend {
  position: absolute; bottom: 14px; left: 14px; z-index: 500;
  background: rgba(20,16,18,.92); border: 1px solid var(--line2);
  border-radius: 10px; padding: 10px 12px; font-size: 12px; max-width: 280px;
  color: var(--text); backdrop-filter: blur(4px);
}
.route-legend b { color: var(--text); }
.route-legend .seg { color: var(--muted); margin-top: 3px; }
.legend-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; gap: 8px; }
.legend-head:hover b { color: var(--accent-text); }
.legend-caret { color: var(--muted); font-size: 14px; flex-shrink: 0; }
.route-legend.collapsed .legend-details { display: none; }

/* Leaflet 數字標記 */
.num-marker {
  background: var(--accent); color: #fff; font-weight: 700;
  border-radius: 50%; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); font-size: 13px;
}
/* 正在檢視的景點：捷克紅脈動標記（目前狀態） */
.hl-marker { position: relative; width: 44px; height: 44px; }
.hl-pulse { position: absolute; inset: 0; border-radius: 50%; background: rgba(200,16,46,.5); animation: hlpulse 1.4s ease-out infinite; }
.hl-pulse.d2 { animation-delay: .7s; }
.hl-dot { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent); border: 3px solid #fff;
  box-shadow: 0 0 14px 5px rgba(255,107,117,.85); display: flex; align-items: center; justify-content: center;
  font-size: 15px; z-index: 2; }
@keyframes hlpulse { 0% { transform: scale(.5); opacity: .95; } 100% { transform: scale(2.4); opacity: 0; } }
.leaflet-popup-content { font-family: inherit; }
/* Leaflet 彈出框／提示／縮放鈕：改黑底暖白字 */
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); box-shadow: var(--cz-shadow); }
.leaflet-popup-content-wrapper { border: 1px solid var(--line2); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--accent-text); }
.leaflet-tooltip { background: var(--panel); color: var(--text); border: 1px solid var(--line2); box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.leaflet-tooltip-top:before { border-top-color: var(--line2); }
.leaflet-tooltip-bottom:before { border-bottom-color: var(--line2); }
.leaflet-tooltip-left:before { border-left-color: var(--line2); }
.leaflet-tooltip-right:before { border-right-color: var(--line2); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--panel); color: var(--text); border-bottom-color: var(--line); }
.leaflet-bar a:hover { background: var(--panel2); }
.leaflet-bar { border-color: var(--line2) !important; }
.popup-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.popup-cat { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.popup-more { color: var(--accent-text); cursor: pointer; font-size: 12px; text-decoration: underline; }
.popup-more:hover { color: var(--text); }

/* ===== 詳情面板 ===== */
.detail {
  position: absolute; top: 0; right: 0; height: 100%; width: 420px; max-width: 90vw;
  background: var(--panel); border-left: 1px solid var(--line);
  z-index: 1000; overflow-y: auto; padding: 20px;
  transition: transform .25s ease; box-shadow: -8px 0 30px rgba(0,0,0,.4);
}
.detail.closed { transform: translateX(105%); }
/* 詳情面板背景遮罩（手機點擊左側空白可關閉） */
.detail-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 999; transition: opacity .25s; }
.detail-backdrop.closed { opacity: 0; pointer-events: none; }
@media (min-width: 861px) { .detail-backdrop { display: none; } }  /* 桌機不需遮罩 */
.detail-close {
  position: absolute; top: 12px; right: 12px;
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer; font-size: 16px; z-index: 2;
}
.detail-close:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.d-cat { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 20px; color: #fff; margin-bottom: 8px; }
.d-name { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.d-en { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.d-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; margin-bottom: 16px; }
.d-facts dt { color: var(--muted); white-space: nowrap; }
.d-facts dd { color: var(--text2); }
.d-block { margin-bottom: 14px; }
.d-block h4 { font-size: 14px; margin-bottom: 5px; color: var(--text); display: flex; gap: 6px; align-items: center; }
.d-block p { font-size: 13px; line-height: 1.7; color: var(--text2); }

/* 詳情面板頂部 CC 圖片 */
.detail-img-wrap {
  margin: -20px -20px 16px; height: 220px;
  overflow: hidden; position: relative; background: var(--panel2);
}
.detail-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-img-wrap .img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; font-size: 60px;
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel2) 100%);
}
.detail-img-wrap .img-loading {
  width: 100%; height: 100%;
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel2) 50%, var(--panel) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
.detail-img-credit {
  position: absolute; bottom: 6px; right: 8px; font-size: 10px;
  color: rgba(255,255,255,.65); background: rgba(0,0,0,.5); padding: 2px 6px; border-radius: 3px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== 彈窗 ===== */
.modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal.closed { display: none; }
.modal-card {
  background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--cz-shadow);
  max-width: 720px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 26px; position: relative;
}
.modal-card h2 { font-size: 22px; margin-bottom: 14px; }
.modal-card h3 { font-size: 16px; margin: 18px 0 8px; color: var(--text); }
.modal-card p { font-size: 14px; line-height: 1.7; color: var(--text2); margin-bottom: 8px; }
.modal-card table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.modal-card th, .modal-card td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.modal-card th { background: var(--panel2); color: var(--accent2); }
.flight-card {
  background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--accent-line);
  border-radius: 10px; padding: 14px; margin: 10px 0;
}
.flight-card .fno { font-weight: 800; color: var(--text); font-size: 16px; }
.tip-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tip-row .ti { font-size: 24px; }
.tip-row .tt { font-weight: 700; margin-bottom: 2px; }
.tip-row .td { font-size: 13px; color: var(--text2); line-height: 1.6; }
.warn {
  background: var(--cz-warn-soft); border: 1px solid rgba(240,176,74,.4); border-left: 3px solid var(--cz-warn); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; color: var(--text); margin: 10px 0;
}

/* ===== 登入/分享 ===== */
.share-status {
  display: inline-block; font-size: 12px; color: var(--muted); line-height: 1.4;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 260px; flex: 0 1 auto;
}
.share-now { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; font-size: 14px; }
.share-link { margin-top: 8px; font-size: 13px; color: var(--muted); }
.share-link input { width: 100%; margin-top: 4px; padding: 7px; border-radius: 6px; background: var(--bg); color: var(--accent-text); border: 1px solid var(--line2); font-size: 12px; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.share-row input { flex: 1; min-width: 160px; padding: 9px 11px; border-radius: 8px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-size: 14px; }
.share-row select { flex: 0 0 auto; padding: 9px 11px; border-radius: 8px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.profile-row input[type="date"] { flex: 0 0 160px; }
.profile-hint { color: var(--cz-warn); font-size: 12px; margin: 2px 0 6px; }
.sbtn { background: transparent; color: var(--text); border: 1px solid var(--line2); padding: 9px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: background .15s, border-color .15s; }
.sbtn:hover { background: var(--panel2); border-color: var(--accent-line); }
.sbtn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.sbtn.primary:hover { background: var(--cz-red-hover); border-color: var(--cz-red-hover); }
.share-msg { margin-top: 12px; font-size: 13px; color: var(--text2); line-height: 1.6; min-height: 18px; }
#btn-cloud-save { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); font-weight: 700; }
#btn-cloud-save:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== 播放模式 ===== */
.play-card {
  position: absolute; top: 18px; right: 18px; z-index: 600; width: 360px; max-width: 80vw;
  background: rgba(27,22,24,.94); border: 1px solid var(--line2); border-radius: 14px;
  padding: 18px 20px; backdrop-filter: blur(8px); box-shadow: 0 10px 40px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .4s ease; pointer-events: none; display: none;
}
body.playing .play-card { display: block; }
body.playing #route-legend { display: none; }
.pc-step { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pc-cat { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.pc-name { font-size: 22px; font-weight: 800; margin-bottom: 2px; }
.pc-en { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.pc-intro { font-size: 13px; line-height: 1.7; color: var(--text2); }
.pc-fact { font-size: 12px; color: var(--accent2); margin-top: 8px; }

.play-bar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 700;
  background: rgba(20,16,18,.96); border-top: 1px solid var(--line2); padding: 10px 14px;
}
.play-bar.closed { display: none; }
.pb-controls { display: flex; align-items: center; gap: 8px; }
.pb-controls button {
  background: transparent; color: var(--text); border: 1px solid var(--line2);
  width: 40px; height: 36px; border-radius: 8px; cursor: pointer; font-size: 15px;
  transition: background .15s, border-color .15s;
}
.pb-controls button:hover { background: var(--panel2); color: var(--text); border-color: var(--accent-line); }
#pp-toggle { background: var(--accent); color: #fff; border-color: var(--accent); }
#pp-toggle:hover { background: var(--cz-red-hover); border-color: var(--cz-red-hover); }
.pb-title { font-weight: 700; margin-left: 6px; flex: 0 0 auto; }
#pp-exit { width: auto; padding: 0 12px; margin-left: auto; }
.play-list { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
.pl-item {
  flex: 0 0 auto; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; color: var(--muted);
}
.pl-item.active { background: var(--accent); color: #fff; font-weight: 700; border-color: var(--accent); }
.pl-item:hover { border-color: var(--accent-line); color: var(--text); }
body.playing .sidebar, body.playing .detail { filter: brightness(.6); }
.flight-dot { font-size: 20px; filter: drop-shadow(0 0 6px rgba(255,107,117,.9)); transition: transform .2s; }
#pp-music { background: transparent; }

/* ===== 播放覆蓋面板（身歷其境） ===== */
.play-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(0.93);
  z-index: 680;
  width: 440px; max-width: calc(100% - 32px);
  max-height: calc(100% - 170px);
  background: rgba(27,22,24,.97);
  border: 1px solid var(--line2);
  border-radius: 18px;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 72px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.04);
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity .45s cubic-bezier(.16,1,.3,1), transform .45s cubic-bezier(.16,1,.3,1);
  display: flex; flex-direction: column;
}
.play-overlay.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.play-overlay.closed { display: none; }
.po-close {
  position: absolute; top: 10px; right: 10px; z-index: 10;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; border: none; cursor: pointer;
  font-size: 13px; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.po-close:hover { background: var(--accent); }
.po-img-wrap {
  width: 100%; height: 210px; flex-shrink: 0;
  background: var(--bg); overflow: hidden; position: relative;
}
.po-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.po-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 72px; opacity: .35;
  background: linear-gradient(135deg, var(--panel), var(--bg));
}
.img-credit {
  position: absolute; bottom: 4px; right: 6px;
  font-size: 9px; color: rgba(255,255,255,.4);
  background: rgba(0,0,0,.45); padding: 2px 5px; border-radius: 3px;
}
.po-body { padding: 15px 20px 18px; overflow-y: auto; flex: 1; }
.po-step { font-size: 11px; color: var(--muted); margin-bottom: 5px; letter-spacing: .5px; }
.po-cat { font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.po-name { font-size: 22px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 2px; line-height: 1.2; }
.po-en { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.po-intro { font-size: 13px; line-height: 1.7; color: var(--text2); }
.po-fact { font-size: 12px; color: var(--accent2); margin-top: 8px; }

/* ===== 捲軸 ===== */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== RWD ===== */
@media (max-width: 860px) {
  html, body { overflow-x: hidden; }
  body { overflow-y: auto; }
  .layout { flex-direction: column; height: auto; }
  /* 手機：區塊順序 → 選擇日期 → 本日景點 → 雨備 → 餐廳 → 住宿 → 跳轉 → 地圖 → 彈性池 */
  .sidebar { display: contents; }
  .side-section { width: 100%; padding: 0 14px; margin-bottom: 16px; }
  .s-day  { order: 1; margin-top: 14px; }
  .s-info { order: 2; }
  .s-itin { order: 3; }
  .s-altplan { order: 4; }
  .s-rain { order: 5; }
  .s-meals { order: 6; }
  .s-hotel { order: 7; }
  .s-jump { order: 8; }
  .map-wrap { order: 9; height: 60vh; }
  .s-flex { order: 10; margin-bottom: 28px; }
  /* 手機：詳情面板固定於畫面（不隨頁面捲動跑掉），左側留空白可點擊關閉 */
  .detail { position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: 86vw; max-width: 86vw; z-index: 1000; }
  .topbar { flex-direction: column; height: auto; gap: 8px; padding: 10px; }
  .topbar h1 { font-size: 15px; }
  /* 手機：頂列按鈕可換行；下拉選單改為頂列全寬、緊接在該選單按鈕下方 */
  .topnav { flex-wrap: wrap; justify-content: center; width: 100%; gap: 6px; }
  .topnav > .nav-btn, .nav-menu > summary { padding: 7px 10px; font-size: 13px; }
  .nav-menu { position: static; }
  .nav-menu-list { top: auto; left: 10px; right: 10px; min-width: 0; margin-top: 6px; }
  .share-status { max-width: 100%; }
  /* 播放模式：地圖全螢幕，隱藏頂列與側欄 */
  body.playing { overflow: hidden; }
  body.playing .topbar { display: none; }
  body.playing .sidebar { display: none !important; filter: none !important; }
  body.playing .map-wrap {
    position: fixed !important;
    inset: 0 !important;
    height: 100dvh !important;
    z-index: 800;
  }
  body.playing .play-bar { z-index: 900; }
  body.playing .play-card { display: none !important; }
  body.playing .play-overlay { max-height: calc(100dvh - 155px); }
  body.playing .play-bar { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  /* 備用清單：手機顯示「＋」按鈕代替拖曳 */
  .flex-add-btn { display: inline-flex; align-items: center; justify-content: center;
    margin-left: auto; min-width: 28px; height: 28px; padding: 0 6px;
    background: var(--accent); color: #fff; border: none; border-radius: 6px;
    font-size: 18px; line-height: 1; cursor: pointer; flex-shrink: 0; }
  .flex-add-btn:active { background: var(--cz-red-press); }
}
@media (min-width: 861px) {
  .flex-add-btn { display: none; }
}

/* ===== 每日行程時刻表視圖 ===== */
.nav-btn.active, .nav-btn.active:hover { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.schedule-view {
  position: fixed; top: var(--topbar-h); left: 0; right: 0; bottom: 0;
  z-index: 850; background: var(--bg); overflow-y: auto; display: flex; flex-direction: column;
}
.schedule-view.closed { display: none; }
body.playing .schedule-view { display: none; }
/* 行程表視圖蓋住地圖時，隱藏會戳出來的 Leaflet 縮放鈕與版權標（z-index 1000 > 850） */
body.schedule-mode .leaflet-control-container { display: none; }
body.schedule-mode .route-legend { display: none; }
.sch-topbar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 14px 20px; background: var(--bg2);
  border-bottom: 1px solid var(--line);
}
.sch-head h2 { font-size: 18px; }
.sch-sub { font-size: 12px; color: var(--muted); margin-top: 4px; max-width: 760px; line-height: 1.6; }
.sch-topbar .nav-btn { flex-shrink: 0; }
.sch-body-wrap {
  width: 100%; max-width: 1720px; margin: 0 auto; padding: 18px 20px 28px;
  display: flex; flex-direction: column; gap: 26px;
}
/* 週檢視：一週一列，週一到週日七欄橫排 */
.sch-week-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.sch-week-head h3 { font-size: 16px; }
.sch-week-head span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sch-week-scroll { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.sch-week-grid { --sch-col-min: 158px; --sch-col-max: 280px; --sch-off-w: 54px; --sch-gap: 8px; display: grid; gap: var(--sch-gap); align-items: start; }
.sch-col { scroll-snap-align: start; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sch-col-label { display: flex; align-items: baseline; gap: 6px; padding: 0 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sch-col-label b { font-size: 13px; color: var(--text); letter-spacing: .5px; }
.sch-col-label.sch-weekend b { color: var(--accent2); font-style: italic; }
.sch-col-off .sch-col-label { flex-direction: column; gap: 0; align-items: center; }
.sch-day-off {
  border-style: dashed; border-top-width: 1px; background: transparent; opacity: .55;
  min-height: 96px; padding: 8px 2px !important; display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; letter-spacing: 4px; font-size: 12px; color: var(--muted);
}
.sch-week .sch-day { padding: 10px 10px 9px; border-radius: 10px; }
.sch-week .sch-day-head { gap: 7px; margin-bottom: 9px; align-items: flex-start; }
.sch-week .sch-day-theme { font-size: 18px; }
.sch-week .sch-day-date { font-size: 11px; }
.sch-week .sch-day-title { font-size: 13px; line-height: 1.35; }
.sch-week .sch-day-map { padding: 3px 6px; }
.sch-week .sch-rows { gap: 4px; }
.sch-week .sch-row { flex-direction: column; gap: 2px; padding: 6px 8px; }
.sch-week .sch-time { width: auto; font-size: 11.5px; }
.sch-week .sch-name { font-size: 13px; line-height: 1.4; }
.sch-week .sch-kind { font-size: 11px; }
.sch-week .sch-move { flex-direction: row; gap: 6px; padding: 1px 8px; }
.sch-week .sch-move .sch-time { width: auto; }
.sch-week .sch-move-txt { font-size: 11px; }
.sch-week .sch-chip { font-size: 11.5px; padding: 2px 8px; }
.sch-week .sch-note p { font-size: 12px; }
.sch-day {
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--day-color, var(--accent));
  border-radius: 12px; padding: 14px 16px 12px;
}
.sch-day-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sch-day-theme { font-size: 24px; line-height: 1; }
.sch-day-titles { flex: 1; min-width: 0; }
.sch-day-date { font-size: 12px; color: var(--muted); }
.sch-day-title { font-size: 15px; font-weight: 700; }
.sch-day-map {
  flex-shrink: 0; background: transparent; color: var(--text2); border: 1px solid var(--line2);
  border-radius: 7px; padding: 4px 8px; font-size: 11px; cursor: pointer; transition: .15s;
}
.sch-day-map:hover { background: var(--panel2); color: var(--text); border-color: var(--accent-line); }
.sch-rows { display: flex; flex-direction: column; gap: 5px; }
.sch-row {
  display: flex; gap: 10px; align-items: baseline;
  background: var(--panel2); border-left: 3px solid var(--line); border-radius: 6px;
  padding: 7px 10px;
}
.sch-time {
  flex-shrink: 0; width: 96px; font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; letter-spacing: .3px;
}
.sch-time i { color: var(--muted); opacity: .7; font-style: normal; margin: 0 2px; }
.sch-kindtime { color: var(--text2); }
.sch-softtime { color: var(--accent2); font-size: 11.5px; }
.sch-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.sch-kind { font-size: 12px; color: var(--text2); font-weight: 700; flex-basis: 100%; }
.sch-name { font-size: 14px; color: var(--text); cursor: pointer; }
.sch-row .sch-name[onclick]:hover { color: var(--accent-text); text-decoration: underline; }
.sch-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sch-move { background: transparent; border-left-color: transparent; padding: 2px 10px; }
.sch-move-txt { font-size: 11.5px; color: var(--muted); }
.sch-move .sch-time { width: 96px; text-align: left; }
.sch-treats .sch-chips { gap: 6px; }
.sch-chip {
  display: inline-block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 9px; font-size: 12px; color: var(--text2); cursor: pointer;
}
.sch-chip:hover { border-color: var(--accent-line); color: var(--accent-text); }
.sch-hotel { background: var(--bg2); }
.sch-fixed { background: var(--accent-soft); }
.sch-fixedtag { display: inline-block; background: var(--accent); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 999px; }
.sch-note { margin-top: 10px; }
.sch-note summary { cursor: pointer; font-size: 12px; color: var(--muted); user-select: none; }
.sch-note summary:hover { color: var(--accent-text); }
.sch-note p { font-size: 12.5px; line-height: 1.7; color: var(--text2); margin-top: 6px; }
@media (max-width: 860px) {
  .sch-topbar { flex-direction: column; }
  .sch-body-wrap { padding: 14px; gap: 20px; }
  .sch-week-grid { --sch-col-min: 78vw; --sch-col-max: 78vw; --sch-off-w: 46px; }
  .sch-time { width: 84px; }
}
