/* 美西之旅 · 全站样式
   主题三态：默认跟随系统；<html data-theme="light|dark"> 由 core.js 按用户选择写入并覆盖系统。
   地区色 --c-<key> 由 core.js 从 data.js 的 regions 生成，这里不定义。 */
:root {
  color-scheme: light;
  --bg: #F3F4F1;
  --surface: #FFFFFF;
  --surface-2: #EAEDE8;
  --surface-3: #DDE2DC;
  --ink: #1C2429;
  --ink-2: #4A555C;
  --ink-3: #7A858B;
  --line: #D6DAD5;
  --line-2: #BFC6BF;
  --accent: #1E6F76;
  --accent-soft: #E1EFF0;
  --accent-ink: #FFFFFF;
  --on-region: #FFFFFF;
  --warn-bg: #FBF1E3;
  --warn-line: #E8C48E;
  --warn-ink: #6E4410;
  /* 「已加进行程」的绿：跟 --accent（青）分开，免得「可点的动作」和「已完成的状态」看起来是一回事 */
  --ok-bg: #E4F0E7;
  --ok-line: #A9CDB6;
  --ok-ink: #2F7A57;
  --danger: #A63A2B;
  --danger-bg: #F8E6E2;
  --shadow: 0 8px 30px rgba(20, 30, 35, .18);
  --shadow-sm: 0 1px 4px rgba(20, 30, 35, .10);
  --radius: 6px;
  --top-h: 96px; /* 顶栏实际高度由 app.js 量出后写入 */
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141A1E; --surface: #1D2529; --surface-2: #263035; --surface-3: #313D44;
    --ink: #E8ECEA; --ink-2: #B3BCC0; --ink-3: #7F8B90; --line: #35424A; --line-2: #48565F;
    --accent: #6FC3C8; --accent-soft: #1E3437; --accent-ink: #0F1A1C; --on-region: #0F171A;
    --warn-bg: #3A2C16; --warn-line: #7A5A2A; --warn-ink: #F3D39A;
    --ok-bg: #1C3327; --ok-line: #2F5741; --ok-ink: #6FBF8D;
    --danger: #E08373; --danger-bg: #3B2521;
    --shadow: 0 8px 30px rgba(0, 0, 0, .5); --shadow-sm: 0 1px 4px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141A1E; --surface: #1D2529; --surface-2: #263035; --surface-3: #313D44;
  --ink: #E8ECEA; --ink-2: #B3BCC0; --ink-3: #7F8B90; --line: #35424A; --line-2: #48565F;
  --accent: #6FC3C8; --accent-soft: #1E3437; --accent-ink: #0F1A1C; --on-region: #0F171A;
  --warn-bg: #3A2C16; --warn-line: #7A5A2A; --warn-ink: #F3D39A;
  --ok-bg: #1C3327; --ok-line: #2F5741; --ok-ink: #6FBF8D;
  --danger: #E08373; --danger-bg: #3B2521;
  --shadow: 0 8px 30px rgba(0, 0, 0, .5); --shadow-sm: 0 1px 4px rgba(0, 0, 0, .4);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--top-h) + 12px); }
/* 只能是 min-height：写成 height:100% 会把 sticky 顶栏的容器压成一屏高，滚过一屏后顶栏就跟着滚走 */
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.55; font-variant-numeric: tabular-nums;
}
h1, h2, h3 { font-family: var(--serif); margin: 0; font-weight: 900; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.muted { color: var(--ink-2); }
.hint { font-size: 13px; color: var(--ink-3); margin: 6px 0 0; }

/* 通用按钮 / 输入框 */
.btn, .tools button, .tools select, .day-head .acts button, .drawer-actions button, .ov-side-bar button {
  padding: 6px 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius); font-size: 13.5px; line-height: 1.3; cursor: pointer;
  transition: border-color .12s, background-color .12s, color .12s;
}
.btn:hover, .tools button:hover, .day-head .acts button:hover, .drawer-actions button:hover, .ov-side-bar button:hover { border-color: var(--accent); color: var(--accent); }
.tools .primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tools .primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.danger { color: var(--danger) !important; }
.danger:hover { border-color: var(--danger) !important; background: var(--danger-bg); }
input[type="text"], input[type="date"], input[type="time"], input[type="search"], select, textarea {
  padding: 5px 8px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 14px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }

/* ---------- 顶栏（标题 + 工具 + 日期导航，整体吸顶） ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 2px solid var(--ink); }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 10px 20px 8px; }
.brand { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.brand h1 { font-size: 24px; line-height: 1.2; }
.brand .sub { font-size: 12.5px; color: var(--ink-2); }
.tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tools .sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.tools select { max-width: 320px; }
.mobile-only { display: none; }

/* ---------- 布局 ---------- */
.app { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
.library {
  border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column;
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h));
}
/* 景点库内部样式见 search.css */

.main { padding: 16px 22px 60px; min-width: 0; }
.trip-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; align-items: baseline; margin-bottom: 12px; }
.trip-summary { font-size: 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.trip-summary b { color: var(--ink); font-size: 16px; }
.trip-summary .stat::before { content: "·"; margin-right: 8px; color: var(--ink-3); }
.trip-summary .stat.warn { color: var(--warn-ink); }
/* 人数：只影响费用估算，所以贴着统计行放 */
.party { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.party input { width: 58px; padding: 3px 6px; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--rc); margin-right: 5px; vertical-align: -1px; }

/* ---------- 逐日 ---------- */
/* minmax(0, 1fr)：网格项的 min-width 默认是 auto（按内容算），本日地图里的时间条给自己设了
   min-width（一天几小时就多少像素），会顺着往上把整列撑到屏幕外。这里明确允许列收窄到 0，
   时间条自己在 .day-tl-wrap 里横向滚动。 */
.days { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.day { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--dc); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
/* 表头一行：第几天 + 地区 | 日期 + 住宿地 | 当天统计 | 操作。窄屏时按块换行。 */
.day-head {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
  padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0;
}
.day-head .n { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.day-head .n b { font-family: var(--serif); font-weight: 900; font-size: 20px; line-height: 1.2; }
.day-region { display: inline-block; font-size: 11px; letter-spacing: .06em; padding: 1px 7px; border-radius: 999px; background: var(--dc); color: var(--on-region); font-weight: 700; }
.day-head .fields { display: flex; gap: 6px 10px; align-items: center; font-size: 14px; min-width: 0; }
.day-head input[type="date"] { padding: 4px 6px; }
/* 住宿地 / 主题：宽度随内容自适应（app.js 量文字宽度；支持 field-sizing 的浏览器直接用它） */
.day-head input[type="text"] { width: 168px; min-width: 168px; max-width: min(100%, 520px); background: transparent; border-color: transparent; padding: 4px 6px; }
@supports (field-sizing: content) { .day-head input[type="text"] { width: auto; field-sizing: content; } }
.day-head input[type="text"]:hover, .day-head input[type="text"]:focus { border-color: var(--line-2); background: var(--surface); }
.day-head input[type="text"]::placeholder { color: var(--ink-3); }
.day-head .wd { font-weight: 700; }
/* 第 2 天起的日期是静态文字（由第 1 天顺延） */
.day-head .date { font-size: 14px; font-weight: 500; }
.day-head .date.empty { color: var(--ink-3); border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 3px 8px; font-weight: 400; }
.day-head .sum { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: baseline; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.day-head .sum span + span::before { content: "·"; margin: 0 7px; color: var(--ink-3); }
.day-head .sum .warn { color: var(--warn-ink); font-weight: 700; }
.day-head .acts { display: flex; gap: 2px; margin-left: auto; }
.day-head .acts button { padding: 4px 8px; font-size: 12.5px; border-color: transparent; background: transparent; color: var(--ink-2); }
.day-head .acts button:hover { border-color: var(--line-2); background: var(--surface); color: var(--accent); }

.items { list-style: none; margin: 0; padding: 8px 10px; display: grid; gap: 6px; min-height: 52px; }
.items:empty::after { content: "把景点拖到这里，或在左侧点「＋」"; color: var(--ink-3); font-size: 13px; padding: 12px; display: block; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.item {
  display: grid; grid-template-columns: 20px 62px 46px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-left: 5px solid var(--rc); border-radius: var(--radius);
  background: var(--bg); padding: 7px 8px 7px 6px; cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.item:hover { border-color: var(--rc); box-shadow: var(--shadow-sm); }
.item .handle { color: var(--ink-3); cursor: grab; font-size: 18px; text-align: center; user-select: none; }
.item .time { display: grid; line-height: 1.2; }
.item .time b { font-weight: 700; color: var(--rc); font-size: 15px; }
.item .time small { color: var(--ink-3); font-size: 11px; }
.item.overlap .time small { color: var(--warn-ink); font-weight: 700; }
.thumb { display: block; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--surface-2); flex: none; position: relative; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb.ph::after { content: ""; position: absolute; inset: 0; background: var(--rc); opacity: .14; }
/* 没有照片：按活动类型显示线条图标（img/fb-*.svg），虚线框，一眼能看出是占位 */
.thumb.generic { border-style: dashed; border-color: var(--line-2); background: var(--surface-2); }
.thumb.generic img { object-fit: contain; padding: 7px; opacity: .8; }
.item .txt { min-width: 0; }
.item .txt .t { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.item .txt b { font-weight: 500; font-size: 15px; }
.item .txt small { color: var(--ink-3); font-size: 12.5px; display: block; }
/* 提醒是整句话，窄屏时必须能折行——nowrap 会把它顶出页面，连带撑宽整个逐日区 */
.item .txt small .w { color: var(--warn-ink); background: var(--warn-bg); padding: 0 5px; border-radius: 3px; margin-left: 4px; display: inline-block; max-width: 100%; }
.item .x { border: 0; background: transparent; color: var(--ink-3); font-size: 16px; padding: 4px 6px; border-radius: var(--radius); }
.item .x:hover { color: var(--danger); background: var(--danger-bg); }
/* 强度标签（1 轻松 / 2 适中 / 3 较累） */
.lv { display: inline-block; font-size: 11px; line-height: 1.5; padding: 0 6px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink-3); white-space: nowrap; font-weight: 500; vertical-align: middle; }
.lv-1 { color: var(--accent); border-color: var(--accent); }
.lv-2 { color: var(--ink-2); border-color: var(--ink-3); }
.lv-3 { color: var(--warn-ink); background: var(--warn-bg); border-color: var(--warn-line); }
.sortable-ghost { opacity: .4; }
.sortable-chosen { box-shadow: var(--shadow); }
.days-foot { margin-top: 14px; }
.days-foot button { padding: 9px 14px; border: 1.5px dashed var(--line-2); background: transparent; border-radius: var(--radius); width: 100%; color: var(--ink-2); }
.days-foot button:hover { border-color: var(--accent); color: var(--accent); }

.notes { margin-top: 36px; max-width: 80ch; }
.notes h2 { font-size: 20px; margin-bottom: 8px; border-left: 5px solid var(--accent); padding-left: 10px; }
.notes ul { padding-left: 20px; margin: 0; }
.notes li { margin: 6px 0; font-size: 14.5px; }

/* ---------- 详情抽屉 ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(480px, 100%); background: var(--surface);
  box-shadow: var(--shadow); z-index: 40; display: flex; flex-direction: column;
}
.drawer-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); position: relative; }
.drawer-head h2 { font-size: 22px; line-height: 1.3; padding-right: 36px; }
.region-tag { display: inline-block; font-size: 12px; letter-spacing: .1em; color: var(--rc); font-weight: 700; margin-bottom: 4px; }
.close { position: absolute; top: 12px; right: 12px; border: 0; background: transparent; font-size: 20px; color: var(--ink-3); padding: 4px 8px; border-radius: var(--radius); }
.close:hover { color: var(--ink); background: var(--surface-2); }
.drawer-body { overflow-y: auto; padding: 14px 18px 30px; display: grid; gap: 14px; align-content: start; }
.warn-box { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); padding: 10px 12px; font-size: 14px; border-radius: var(--radius); }
.desc { margin: 0; font-size: 15px; }
.meta { display: grid; grid-template-columns: 84px 1fr; gap: 6px 10px; margin: 0; font-size: 14px; }
.meta dt { color: var(--ink-3); }
.meta dd { margin: 0; }
.meta dd a.src { font-size: 13px; word-break: break-all; }
.meta dd .est-note { color: var(--ink-3); font-size: 12.5px; margin-left: 6px; }
.dr-img { margin: 0; }
.dr-img img { display: block; width: 100%; height: auto; max-height: 220px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.dr-img figcaption { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.dr-img figcaption a { color: inherit; }
.dr-img.generic img { height: 96px; object-fit: contain; padding: 22px; border-style: dashed; border-color: var(--line-2); opacity: .8; }
.edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; background: var(--surface-2); border-radius: var(--radius); }
.edit label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.edit label.wide { grid-column: 1 / -1; }
.edit label small { color: var(--ink-3); font-size: 12px; line-height: 1.4; }
.edit input, .edit select, .edit textarea { font-size: 15px; width: 100%; }
.edit textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.links { display: grid; gap: 6px; }
.links a { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--accent); text-decoration: none; font-size: 14px; }
.links a:hover { border-color: var(--accent); }
.links a small { display: block; color: var(--ink-3); font-size: 12px; word-break: break-all; }
.map { height: 220px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.nav a { font-size: 14px; }
.drawer-actions { display: flex; gap: 8px; }

/* ---------- 本日地图：表头下方展开的面板（地图 + 时间条），app.js 只在展开时重绘 ---------- */
.day-head .acts button[aria-pressed="true"] { border-color: var(--line-2); background: var(--surface); color: var(--ink); }
.day-map { border-bottom: 1px solid var(--line); background: var(--surface); }
.day-map-canvas { height: 50vh; min-height: 260px; background: var(--surface-2); }
/* 时间条：按时间等比铺开；每项一格，编号与地图圆点一致；有照片的格子右侧透出照片、左侧渐变成底色；车程虚线框，没坐标的点线框，没设开始时间的浅字 */
.day-tl-wrap { overflow-x: auto; padding: 8px 12px 10px; }
.day-tl { position: relative; }
.day-tl .ticks { position: relative; height: 20px; font-size: 10.5px; line-height: 1; color: var(--ink-3); }
.day-tl .tick { position: absolute; top: 0; transform: translateX(-50%); padding-bottom: 8px; }
/* 两端的刻度贴边，免得伸出时间条；小竖线始终指向刻度所在的时间 */
.day-tl .tick.first { transform: none; }
.day-tl .tick.last { transform: translateX(-100%); }
.day-tl .tick::after { content: ""; position: absolute; left: 50%; bottom: 0; height: 7px; border-left: 1px solid var(--line-2); }
.day-tl .tick.first::after { left: 0; }
.day-tl .tick.last::after { left: auto; right: 0; }
.day-tl .lane { position: relative; height: 44px; margin-top: 0; border-top: 1px solid var(--line); }
.day-tl .lane + .lane { margin-top: 4px; }
.day-tl .seg {
  position: absolute; top: 4px; height: 38px; box-sizing: border-box; min-width: 22px;
  border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface); color: var(--ink);
  padding: 4px 7px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; line-height: 1.2; cursor: pointer;
}
.day-tl .seg.has-img {
  background-image: linear-gradient(90deg, var(--surface) 0, var(--surface) 34%, rgba(255, 255, 255, .55) 62%, rgba(255, 255, 255, 0) 100%), var(--img);
  background-size: cover; background-position: center;
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .day-tl .seg.has-img { background-image: linear-gradient(90deg, var(--surface) 0, var(--surface) 34%, color-mix(in srgb, var(--surface) 55%, transparent) 62%, color-mix(in srgb, var(--surface) 0%, transparent) 100%), var(--img); }
}
.day-tl .seg:hover { border-color: var(--ink-2); z-index: 1; }
.day-tl .seg b { font-weight: 700; margin-right: 4px; }
.day-tl .seg small { display: block; color: var(--ink-3); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.day-tl .seg.drive { border-style: dashed; background: transparent; color: var(--ink-2); }
.day-tl .seg.nogeo { border-style: dotted; }
.day-tl .seg.est { color: var(--ink-3); }
.day-tl-empty { margin: 0; padding: 10px 14px; font-size: 13px; color: var(--ink-3); }

/* ---------- 「加到第几天」弹层（app.js 追加到 body；固定尺寸，天数多了内部滚动） ---------- */
.daypick { position: fixed; z-index: 70; width: 236px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.daypick-head { padding: 7px 10px 5px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.daypick-head small { display: block; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daypick-list { max-height: 232px; overflow-y: auto; padding: 4px; }
.daypick-list button {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; width: 100%;
  padding: 5px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); text-align: left; font-size: 13.5px; line-height: 1.4;
}
.daypick-list button:hover, .daypick-list button:focus-visible { background: var(--surface-2); outline: none; }
.daypick-list button span { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daypick-list button i { font-style: normal; color: var(--accent); font-size: 12px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius); z-index: 60; font-size: 14px; box-shadow: var(--shadow); }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, .item:focus-visible, .lib-item:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Leaflet：圆点标记与皮肤（三处地图共用） ---------- */
.leaflet-container { font: inherit; z-index: 0; }
.pin { background: transparent; border: 0; }
.pin-dot {
  display: grid; place-items: center; width: var(--ps, 24px); height: var(--ps, 24px); border-radius: 50%;
  background: var(--pc); color: #fff; font-weight: 700; font-size: 12px; line-height: 1;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); transition: transform .12s;
}
.pin.small .pin-dot { border-width: 2px; }
.pin:hover .pin-dot { transform: scale(1.15); }
/* 已在行程里的圆点：描边 + 右上角一个绿色 ✓ 角标（地图底图始终是浅色，用固定的绿） */
.pin.in-trip .pin-dot { box-shadow: 0 0 0 2.5px var(--accent), 0 1px 4px rgba(0, 0, 0, .4); position: relative; }
.pin.in-trip .pin-dot::after {
  content: "✓"; position: absolute; top: -7px; right: -8px; width: 13px; height: 13px; border-radius: 50%;
  background: #2E9E5B; color: #fff; font-size: 9px; font-weight: 700; line-height: 13px; text-align: center; border: 1.5px solid #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.leaflet-popup-content-wrapper { border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.leaflet-popup-tip { background: var(--surface); box-shadow: none; }
.leaflet-popup-content { margin: 10px 12px; min-width: 180px; font-size: 13px; line-height: 1.45; }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-3); }
.leaflet-bar { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-control-attribution { font-size: 10px; background: var(--surface); color: var(--ink-3); }
.leaflet-control-layers { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: none; font-size: 12px; }
.leaflet-control-layers-expanded { padding: 5px 8px; }
.leaflet-control-layers label { display: block; line-height: 1.6; white-space: nowrap; }
.leaflet-control-layers-selector { margin: 0 2px 0 0; vertical-align: -1px; }
/* 弹窗内的通用块 */
.pop b.head { display: block; font-size: 14px; line-height: 1.35; padding-left: 8px; padding-right: 10px; border-left: 3px solid var(--rc, var(--line)); }
.pop .en { color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.pop .meta-line { color: var(--ink-2); margin-top: 4px; }
.pop .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pop .acts button { padding: 4px 9px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: 13px; line-height: 1.4; }
.pop .acts button:hover { border-color: var(--accent); color: var(--accent); }
.pop .acts button.go { border-color: var(--accent); color: var(--accent); }
.pop .acts button.go:hover { background: var(--accent); color: var(--accent-ink); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .library { position: fixed; top: 0; left: 0; height: 100%; width: min(380px, 92%); z-index: 45; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .library.open { transform: none; }
  .mobile-only { display: inline-block; }
  .top { padding: 8px 12px 6px; }
  .brand .sub { display: none; }
  .tools select { max-width: 200px; }
  .tools .sep { display: none; }
  .main { padding: 12px 10px 60px; }
  .day-head .sum { flex-basis: 100%; white-space: normal; }
  .day-head .acts { margin-left: 0; }
  .item { grid-template-columns: 18px 56px 40px minmax(0, 1fr) auto; gap: 8px; }
  .thumb { width: 40px; height: 40px; }
  .day-map-canvas { height: 45vh; min-height: 220px; }
  .edit { grid-template-columns: 1fr; }
  /* 时间条改成纯文字清单：按时间等比铺开的格子在这个宽度下只剩几像素 */
  .day-tl { display: flex; flex-direction: column; min-width: 0 !important; }
  .day-tl .ticks { display: none; }
  .day-tl .lane { display: contents; }
  .day-tl .seg,
  .day-tl .seg.has-img,
  .day-tl .seg.drive,
  .day-tl .seg.nogeo {
    position: static; order: var(--i); left: auto !important; width: auto !important;
    height: auto; min-width: 0; padding: 9px 2px; border-radius: 0;
    border: 0; border-top: 1px solid var(--line);
    background: none; background-image: none; text-decoration: none; white-space: normal;
  }
  .day-tl .seg small { display: inline; margin-left: 6px; }
  .day-tl .seg:hover { border-color: var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .library, .item, .day-nav a, .pin-dot { transition: none; }
}
/* 打印样式见 print.css（由 print.js 生成 #print-view） */
