/* ============================================================
   行程规划器（拖拽式 · 城市级）—— 清爽风格
   右区两列：左列「每天」 / 右列「选中那天的时间点」
   两列都可以直接接收左侧搜索便签的拖拽
   沿用设计系统 V3 的 token：--primary / --text / --ice / --border / 圆角 / 阴影
   ============================================================ */
.planner {
  /* 行/卡片/面板边框专用色：明显比全局 --border 深，块与块、行与行才分得清 */
  --row-border: #a6c4cd;
  --row-border-hover: #6f9fab;
  /* 吸顶头部（工具栏 + Tab 栏）的高度，JS 会按实际测量更新 */
  --pl-head-h: 96px;
  width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  background: var(--bg); padding-bottom: 0;
}

/* ---------- 吸顶头部：工具条 + Tab 栏作为整体固定，切 Tab 时不动 ---------- */
.pl-head {
  position: sticky; top: 62px; z-index: 950;
  background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(15,62,74,.06);
}

/* ---------- 顶部工具条：压到最矮的一行 ---------- */
.pl-top { background: #fff; }
.pl-top-inner {
  max-width: 1560px; margin: 0 auto; padding: 7px 20px;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin;
}
.pl-title {
  font-family: var(--font-head); font-size: 1rem; font-weight: 700; margin: 0; color: var(--text);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.pl-title i { color: var(--primary-600); font-size: .92rem; }
.pl-input {
  height: 32px; border: 1px solid var(--border); border-radius: 10px; padding: 0 11px;
  font-size: .8rem; color: var(--text); background: #fff; outline: none; min-width: 150px;
}
.pl-input-date { min-width: 132px; }
.pl-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.pl-inline-group { display: inline-flex; align-items: center; gap: 6px; }
.pl-inline-label { font-size: .72rem; color: var(--text-4); white-space: nowrap; }
.pl-stepper {
  display: inline-flex; align-items: center; gap: 2px; height: 32px;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff;
}
.pl-stepper button {
  width: 30px; height: 100%; border: 0; background: transparent; color: var(--text-2);
  font-size: .95rem; cursor: pointer; transition: background .15s;
}
.pl-stepper button:hover { background: var(--ice); color: var(--primary-600); }
.pl-stepper b { min-width: 30px; text-align: center; font-family: var(--font-head); font-size: .86rem; color: var(--text); }
.pl-stats { display: flex; gap: 5px; flex-wrap: nowrap; margin-left: auto; white-space: nowrap; }
.pl-stat {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 9px; border-radius: 999px;
  background: var(--ice); color: var(--text-3); font-size: .68rem; white-space: nowrap;
}
.pl-stat b { font-family: var(--font-head); font-size: .78rem; color: var(--text); }
.pl-actions { display: flex; gap: 6px; }
.pl-autosave {
  font-size: .66rem; color: var(--text-4); display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.pl-autosave.flash { color: var(--primary-600); }
/* 登录态：草稿同步到账号（数据库）；失败时提示只存了本机 */
.pl-autosave.is-cloud { color: var(--primary-700, #0a7d5c); }
.pl-autosave.is-cloud i { color: var(--primary-600); }
.pl-autosave.is-error { color: #b4531b; }
.pl-autosave.is-error i { color: #b4531b; }
.pl-autosave a { color: inherit; }

.pl-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text-2);
  font-size: .76rem; font-weight: 500; cursor: pointer; transition: all .16s; white-space: nowrap;
}
.pl-btn:hover { border-color: var(--primary); color: var(--primary-600); }
.pl-btn-ghost { background: #fff; }
.pl-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.pl-btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.pl-btn-danger { background: var(--rose); border-color: var(--rose); color: #fff; }
.pl-btn-danger:hover { background: #d4386a; border-color: #d4386a; color: #fff; }
.pl-btn-sm { height: 30px; padding: 0 10px; font-size: .74rem; border-radius: 9px; }
.pl-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- 行间「交通行」：上一站 → 这一站怎么走 ----------
   箭头是「时间轴」上的连接点：用和时间列一样的 78px 栅格，箭头居中、右侧虚线接上时间列那条虚线 */
.pl-move {
  display: grid; grid-template-columns: 78px minmax(0, 1fr);
  align-items: stretch; gap: 0 6px;
  padding: 0 8px; margin: 0; min-height: 24px;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(10,168,122,.06), transparent 70%);
}
.pl-move-arrow {
  grid-column: 1; display: flex; align-items: center; justify-content: center;
  min-height: 24px; border-right: 1px dashed var(--row-border);
  color: var(--c, var(--primary)); font-size: .68rem; opacity: .85;
}
.pl-move-body {
  grid-column: 2; display: flex; align-items: center; gap: 6px;
  flex-wrap: nowrap; overflow: hidden; min-width: 0;
}
.pl-move-lab { font-size: .66rem; color: var(--text-4); flex: 0 0 auto; }
.pl-move-mode {
  height: 22px; border: 1px solid var(--border); border-radius: 7px; background: #fff;
  font-size: .68rem; color: var(--text); padding: 0 4px; outline: none; max-width: 82px; flex: 0 0 auto;
}
.pl-move-mode:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.pl-move-durwrap { display: inline-flex; align-items: center; gap: 2px; font-size: .66rem; color: var(--text-4); flex: 0 0 auto; }
.pl-move-durwrap input {
  width: 42px; height: 22px; border: 1px solid var(--border); border-radius: 7px;
  padding: 0 4px; font-size: .68rem; color: var(--text); outline: none; text-align: center;
}
.pl-move-durwrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.pl-move-durwrap input::-webkit-outer-spin-button,
.pl-move-durwrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pl-move-durwrap input[type=number] { -moz-appearance: textfield; }
.pl-move-times { font-size: .68rem; font-weight: 600; color: var(--primary-700, #0a7d5c); font-variant-numeric: tabular-nums; flex: 0 0 auto; }

/* ---------- 正在编辑「一日游线路」的提示条（保存回服务端） ---------- */
.pl-tripbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 20px; background: linear-gradient(135deg, #e5f8f3, #eef9fb);
  border-top: 1px solid var(--primary-100);
}
.pl-tripbar[hidden] { display: none; }
.pl-tripbar-ico {
  width: 26px; height: 26px; border-radius: 9px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-size: .72rem;
}
.pl-tripbar-text { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.pl-tripbar-text b { font-size: .74rem; color: var(--primary-700, #0a7d5c); font-weight: 700; }
.pl-tripbar-text #plTripTitle { font-size: .86rem; font-weight: 600; color: var(--text); }
.pl-tripbar-text em { font-style: normal; font-size: .72rem; color: var(--text-4); }
.pl-tripbar-state { font-size: .72rem; color: var(--primary-600); }
.pl-tripbar-state.dirty { color: var(--amber, #e8850c); font-weight: 600; }

/* ---------- 「同步到页面」弹层 ---------- */
.pl-trippop {
  left: 50%; top: 10%; transform: translateX(-50%); width: 460px; max-width: calc(100vw - 24px);
}
.pl-trippop-body { padding: 12px 14px 14px; max-height: min(74vh, 620px); overflow-y: auto; }
.pl-trippop-lab { display: block; font-size: .72rem; color: var(--text-4); margin: 12px 0 6px; }
.pl-trippop-body > .pl-trippop-lab:first-child { margin-top: 0; }
.pl-trippop-body input[type="text"],
.pl-trippop-body textarea,
.pl-trippop-body select {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font-size: .84rem; color: var(--text); outline: none;
  font-family: inherit; background: #fff;
}
.pl-trippop-body input[type="text"] { height: 36px; }
.pl-trippop-body textarea { resize: vertical; line-height: 1.6; }
.pl-trippop-body input[type="text"]:focus,
.pl-trippop-body textarea:focus,
.pl-trippop-body select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
/* 模块切换：分段按钮 */
.pl-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pl-seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; border-radius: 10px;
  padding: 8px 6px; font-size: .76rem; font-weight: 600; color: var(--text-2); cursor: pointer;
  transition: all .15s;
}
.pl-seg button:hover { border-color: var(--primary-200); color: var(--primary-600); }
.pl-seg button.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pl-seg button.is-on:hover { color: #fff; }
.pl-trippop-row[hidden] { display: none; }
.pl-trippop-check {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  font-size: .76rem; color: var(--text-2); cursor: pointer;
}
.pl-trippop-check input { width: 15px; height: 15px; accent-color: var(--primary); }
.pl-trippop-hint { font-size: .72rem; color: var(--text-4); margin: 8px 0 0; line-height: 1.6; }
.pl-trippop-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- 主体：左侧地图（放大一些，城市名才看得见）/ 右区两列 ---------- */
/* 规划页三列宽度：全文件只有这一处数字来源，改这里全局生效（断点里不再有裸百分比）。
   用户以后只说「地图再宽/再窄一点」，只改 --pl-map-w 一个数。
   --pl-map-w   地图列（52%），右栏自动拿剩下的 48%
   --pl-day-w   右栏里「每天」那一列占右栏内容宽的比例（45%）
   --pl-day-min 「每天」列的最小可用宽度（172px）：比例再小也不会窄到把天号/日期/城市名裁掉
   实算：1600px → 地图 811 / 每天 321 / 点位 380；1440px → 749 / 295 / 348；1200px → 624 / 243 / 285 */
:root {
  --pl-map-w: 48%;
  --pl-day-w: 40%;
  --pl-day-min: 220px;
}
.pl-body {
  max-width: 1560px; margin: 0 auto;
  display: grid;
  grid-template-columns: var(--pl-map-w) minmax(0, 1fr);
  align-items: start;
}
.pl-mapcol {
  /* sticky：左栏地图固定（导航 62px + 吸顶头部高度之下），右边两列自己滚 */
  position: sticky; top: calc(62px + var(--pl-head-h) + 8px);
  height: calc(100vh - var(--pl-head-h) - 86px); min-height: 420px;
  display: flex; flex-direction: column; gap: 9px; padding: 10px 12px 10px 18px;
  border-right: 1px solid var(--border); background: #fff;
}
.pl-mapwrap {
  position: relative; flex: 1 1 auto; min-height: 220px;
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: var(--ice);
  box-shadow: var(--shadow-sm);
}
.pl-map { position: absolute; inset: 0; }
.pl-map-msg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: .8rem; color: var(--text-4); background: linear-gradient(135deg, #eef9fb, #e5f8f3);
  text-align: center; padding: 20px;
}
/* 全览：地图右上角的小图标按钮（高德自己的工具条在右下角） */
.pl-fit {
  position: absolute; right: 10px; top: 10px; z-index: 5;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border-radius: 9px; border: 1px solid var(--border); background: rgba(255,255,255,.95);
  color: var(--text-2); font-size: .74rem; cursor: pointer; box-shadow: var(--shadow-sm);
}
.pl-fit:hover { border-color: var(--primary); color: var(--primary-600); }
.pl-legend {
  position: absolute; left: 10px; bottom: 10px; right: 58px; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 4px 8px; max-height: 74px; overflow: auto;
  background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 12px;
  padding: 7px 9px; font-size: .68rem; color: var(--text-3);
  scrollbar-width: none;
}
.pl-legend::-webkit-scrollbar { display: none; }
.pl-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.pl-legend span { white-space: nowrap; }

/* ---------- 右栏：两列所在区域 ---------- */
.pl-right { padding: 10px 18px 26px; min-width: 0; }

/* ---------- 搜索（暂时下线；样式保留，随时可以恢复） ---------- */
.pl-search { position: relative; z-index: 3; margin-bottom: 10px; }
.pl-search-bar {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 6px 9px 6px 13px;
  box-shadow: var(--shadow-sm); flex-wrap: wrap;
}
.pl-search-bar > i { color: var(--text-4); font-size: .84rem; }
.pl-search-bar input {
  flex: 1 1 200px; min-width: 130px; border: 0; outline: none; height: 30px;
  font-size: .84rem; color: var(--text); background: transparent;
}
.pl-scope { display: inline-flex; gap: 2px; background: var(--ice); border-radius: 10px; padding: 2px; }
.pl-scope button {
  border: 0; background: transparent; border-radius: 8px; padding: 5px 11px;
  font-size: .72rem; color: var(--text-3); cursor: pointer;
}
.pl-scope button.active { background: #fff; color: var(--primary-600); font-weight: 600; box-shadow: var(--shadow-sm); }
.pl-notes-toggle {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text-3);
  font-size: .72rem; cursor: pointer; flex: 0 0 auto;
}
.pl-notes-toggle:hover { border-color: var(--primary); color: var(--primary-600); }
.pl-search-hint { font-size: .72rem; color: var(--text-4); margin: 7px 2px 0; }

/* ---------- 搜索结果（只有搜过才有；从这里拖到第一列 / 第二列，拖到空白才变便签） ---------- */
.pl-results {
  margin-top: 8px; background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.pl-results[hidden] { display: none; }
.pl-res-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-bottom: 1px solid var(--border); background: #fdfefe;
}
.pl-res-head .pl-panel-title { font-size: .78rem; }
.pl-res-head .pl-panel-sub { font-size: .68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-res-head .spacer { margin-left: auto; }
.pl-res-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px;
  padding: 8px; max-height: 156px; overflow-y: auto; scrollbar-width: thin;
}
.pl-res {
  display: flex; align-items: center; gap: 7px; padding: 5px 6px 5px 8px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: grab;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.pl-res:hover { border-color: var(--primary); background: #fbfefe; box-shadow: 0 3px 12px rgba(15,62,74,.10); }
.pl-res.dragging { opacity: .45; }
.pl-res:active { cursor: grabbing; }
.pl-res-ico { width: 22px; height: 22px; border-radius: 7px; background: var(--ice); display: inline-flex; align-items: center; justify-content: center; font-size: .68rem; flex: 0 0 auto; }
.pl-res-main { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.pl-res-main b { font-size: .78rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-res-main small { font-size: .66rem; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-res-kind {
  font-size: .62rem; color: var(--text-4); border: 1px solid var(--border); border-radius: 6px;
  padding: 0 4px; flex: 0 0 auto;
}
.pl-res-note {
  border: 0; background: transparent; color: var(--text-4); cursor: pointer;
  width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto;
}
.pl-res-note:hover { color: var(--primary-600); background: var(--primary-50); }

/* ---------- 两列主从：每天 / 当天时间点 ---------- */
.pl-board-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 9px; padding: 0 2px;
}
.pl-board-hint { font-size: .72rem; color: var(--text-4); display: flex; align-items: center; gap: 6px; }
.pl-board-hint i { color: var(--primary-600); }
.pl-board-nav { margin-left: auto; display: flex; gap: 6px; }
.pl-board-nav button {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; color: var(--text-3); cursor: pointer; transition: all .15s;
}
.pl-board-nav button:hover { border-color: var(--primary); color: var(--primary-600); }

.pl-detail {
  /* 「每天」列：比例 + 最小可用宽度（两个来源都在 :root 的变量里），最小宽度保证内容不被裁 */
  display: grid; grid-template-columns: minmax(var(--pl-day-min), var(--pl-day-w)) minmax(0, 1fr); gap: 12px; align-items: start;
}
.pl-panel {
  display: flex; flex-direction: column; min-width: 0;
  background: #fff; border: 1px solid var(--row-border); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.pl-panel-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; border-bottom: 1px solid var(--border); background: #fdfefe;
  border-radius: 15px 15px 0 0;
}
.pl-panel-title {
  font-family: var(--font-head); font-size: .84rem; font-weight: 600; color: var(--text);
  display: inline-flex; align-items: center; gap: 6px;
}
.pl-panel-title i { color: var(--primary-600); }
.pl-panel-sub { font-size: .7rem; color: var(--text-4); }
.pl-panel-head .spacer { margin-left: auto; }

/* 左列：每天 */
.pl-daylist {
  padding: 9px; display: flex; flex-direction: column;
  max-height: calc(100vh - var(--pl-head-h) - 152px); min-height: 250px; overflow-y: auto;
}
.pl-day {
  position: relative; border: 1px solid var(--row-border); border-radius: 13px; background: #fff;
  box-shadow: 0 1px 3px rgba(15,62,74,.05);
  cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.pl-day:hover { border-color: var(--row-border-hover); background: #fcfefe; }
.pl-day.sel {
  border-color: var(--c, var(--primary));
  background: var(--c-bg, #fbfefe);                      /* 选中：整卡同色淡背景 */
  box-shadow: 0 2px 12px rgba(15,62,74,.10);
}
/* 选中那天的卡片：左侧同色粗条（▶ 小箭头已按用户要求删除，改为只用颜色区分） */
.pl-day.sel::before { width: 4px; }

/* 右边列头的「第几天」徽章：和左边天数卡同色 */
.pl-day-chip {
  display: inline-flex; align-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: .78rem;
  color: #fff; background: var(--c, var(--primary));
  border-radius: 8px; padding: 2px 9px; white-space: nowrap;
}
/* 与选中那天关联：整块面板 + 列头都染成同色淡背景，描边与左侧色条同色 */
.pl-panel.has-sel {
  border-color: var(--c, var(--primary));
  background: var(--c-bg, #f9fdfc);
  box-shadow: 0 2px 14px rgba(15,62,74,.10);
}
.pl-panel.has-sel .pl-panel-head {
  background: var(--c-bg-head, #f2f9f9);
  box-shadow: inset 4px 0 0 var(--c, var(--primary));
}
.pl-day.sel::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  border-radius: 3px; background: var(--c, var(--primary));
}
.pl-day.drop { border-color: var(--primary); background: var(--primary-50); }
.pl-day.drag-col { opacity: .45; }
.pl-day.over-top { box-shadow: 0 -3px 0 var(--primary); }
.pl-day.over-bottom { box-shadow: 0 3px 0 var(--primary); }
/* 天卡片：全文只有这一条基础规则（不再在文件末尾重复声明 display/grid-template）——
   两行 grid，第 1 行 5 列的顺序由文件末尾的 grid-row/grid-column 指定，第 2 行整行放城市 chip */
.pl-day-card { display: grid; grid-template-columns: auto auto minmax(0,1fr) auto auto; align-items: center; column-gap: 8px; row-gap: 4px; padding: 12px 11px 12px 13px; min-height: 62px; cursor: grab; user-select: none; }
.pl-day-card:active { cursor: grabbing; }
.pl-day-card .pl-citychip { cursor: pointer; }
.pl-day-grip { color: var(--border); cursor: grab; padding-top: 2px; }
.pl-day-grip:active { cursor: grabbing; }
.pl-day-no {
  font-family: var(--font-head); font-weight: 700; font-size: .76rem; color: #fff;
  background: var(--c, var(--primary)); border-radius: 7px; padding: 2px 7px; white-space: nowrap;
}
.pl-day-date { font-size: .74rem; color: var(--text-2); font-family: var(--font-head); white-space: nowrap; }
.pl-day-date small { color: var(--text-4); margin-left: 3px; }
/* 城市 chip 行 = 天卡片的第 2 行（自己占满整行宽）：一行放多个，放不下才换行（左→右，再上→下）；
   城市之间没有任何箭头/分隔符；徽章 / ✕ 固定在第 1 行，不受城市数量影响。
   全文只有这一条城市行规则（文件末尾不再重复声明） */
.pl-day-cities {
  grid-row: 2; grid-column: 1 / -1;
  font-size: .72rem; color: var(--text-3);
  display: flex; flex-wrap: wrap; gap: 4px 6px; overflow: visible; height: auto;
  align-items: center; min-width: 0;
}
/* 子选择器放进 #plTracks（天卡片列表）作用域，避免再出现重复的基础规则 */
#plTracks .none { color: var(--text-4); }
#plTracks .arrow, #plTracks .pl-arrow, #plTracks i.fa-arrow-right, #plTracks i.fa-arrow-right-long, #plTracks i.fa-angle-right { display: none !important; }

/* 城市标签：可点（换城市）/ 可删（✕），颜色随位置变化，hover 有明显颜色反馈 */
.pl-citychip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 4px 2px 6px; border-radius: 999px; cursor: pointer;
  min-height: 24px; box-sizing: border-box;   /* 点击区加高，字号不变 */
  /* 老浏览器不支持 color-mix 时用这两个兜底色 */
  background: #f4fafb; border: 1px solid var(--row-border);
  background: color-mix(in srgb, var(--cc) 12%, #fff);
  border-color: color-mix(in srgb, var(--cc) 35%, #fff);
  color: var(--text-2); font-size: .72rem; transition: all .15s;
}
.pl-citychip > i { font-size: .5rem; color: var(--cc); }
.pl-citychip:hover { background: var(--cc); border-color: var(--cc); color: #fff; }
.pl-citychip:hover > i { color: #fff; }
.pl-citychip-x {
  border: 0; background: transparent; color: inherit; opacity: .55; cursor: pointer;
  width: 15px; height: 15px; border-radius: 50%; font-size: .6rem; line-height: 1;
}
.pl-citychip-x:hover { opacity: 1; background: rgba(255,255,255,.35); }
.pl-cityadd {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer; flex: 0 0 auto;
  border: 1px dashed var(--border); background: #fff; color: var(--text-4); font-size: .58rem;
  transition: all .15s;
}
.pl-cityadd:hover { border-color: var(--c, var(--primary)); border-style: solid; color: #fff; background: var(--c, var(--primary)); }

/* 第二列列头最右边：针对这一天的两个操作（在地图展示 / 清空当天） */
.pl-slot-tools { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.pl-day-tool {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 9px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text-3);
  font-size: .7rem; white-space: nowrap; transition: all .15s;
}
.pl-day-tool:hover:not([disabled]) { border-color: var(--primary); color: var(--primary-600); background: var(--primary-50); }
.pl-day-tool[disabled] { opacity: .45; cursor: not-allowed; }
.pl-day-tool.danger:hover { border-color: var(--rose); color: var(--rose); background: #fdeef3; }

/* 城市搜索弹层（fixed，不会被列表滚动裁掉） */
.pl-citypop {
  position: fixed; z-index: 1100; width: 264px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15,62,74,.24); overflow: hidden;
}
.pl-citypop[hidden] { display: none; }
.pl-citypop-bar {
  display: flex; align-items: center; gap: 7px; padding: 7px 8px 7px 12px;
  border-bottom: 1px solid var(--border); background: #fdfefe;
}
.pl-citypop-bar > i { color: var(--text-4); font-size: .76rem; }
.pl-citypop-bar input {
  flex: 1 1 auto; min-width: 0; height: 26px; border: 0; outline: none; background: transparent;
  font-size: .8rem; color: var(--text);
}
.pl-citypop-bar button {
  border: 0; background: transparent; color: var(--text-4); cursor: pointer;
  width: 24px; height: 24px; border-radius: 7px; font-size: .72rem;
}
.pl-citypop-bar button:hover { background: #fdeef3; color: var(--rose); }
.pl-citypop-list { max-height: 236px; overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.pl-cityrow {
  display: flex; align-items: center; gap: 7px; width: 100%; text-align: left;
  border: 1px solid transparent; background: #fff; border-radius: 10px;
  padding: 6px 8px; cursor: pointer; font-size: .78rem; color: var(--text); transition: all .13s;
}
.pl-cityrow > i { font-size: .5rem; color: var(--cc); }
.pl-cityrow .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-cityrow .p { margin-left: auto; font-size: .68rem; color: var(--text-4); white-space: nowrap; flex: 0 0 auto; max-width: 58%; overflow: hidden; text-overflow: ellipsis; }
.pl-cityrow:hover, .pl-cityrow.on {
  background: var(--ice);
  border-color: var(--border);
  background: color-mix(in srgb, var(--cc) 14%, #fff);
  border-color: color-mix(in srgb, var(--cc) 45%, #fff);
}
.pl-cityrow:hover > i { color: var(--cc); }
.pl-citypop-empty { padding: 14px; text-align: center; color: var(--text-4); font-size: .76rem; }

/* 时间选择弹层：小时 00-23 + 分钟 00-59 全部列出（10 列网格，不用翻页） */
.pl-timepop { width: 344px; }
.pl-timepop-title { font-size: .72rem; color: var(--text-3); }
.pl-timepop-head { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--border); }
.pl-timepop-head input {
  flex: 1 1 auto; min-width: 0; height: 30px; border: 1px solid var(--row-border); border-radius: 9px;
  padding: 0 9px; font-size: .84rem; font-family: var(--font-head); font-weight: 600;
  color: var(--text); outline: none; background: #fff; text-align: center;
}
.pl-timepop-head input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.pl-timepop-head button {
  flex: 0 0 auto; height: 30px; padding: 0 12px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--primary); background: var(--primary); color: #fff; font-size: .76rem;
}
.pl-timepop-head button:hover { background: var(--primary-600); border-color: var(--primary-600); }
.pl-timepop-cols { max-height: min(52vh, 330px); overflow-y: auto; scrollbar-width: thin; }
.pl-timepop-sec { padding: 6px 8px 8px; }
.pl-timepop-sec + .pl-timepop-sec { border-top: 1px dashed var(--border); }
.pl-timepop-lab { display: block; font-size: .68rem; color: var(--text-4); margin-bottom: 5px; }
.pl-timepop-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.pl-timepop-grid button {
  height: 26px; border: 1px solid transparent; border-radius: 7px; cursor: pointer;
  background: #f4fafb; color: var(--text-2); font-size: .72rem;
  font-family: var(--font-head); padding: 0;
}
.pl-timepop-grid button:hover { background: var(--ice); border-color: var(--row-border); }
.pl-timepop-grid button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 地点：只读的选择按钮（点开弹层从地图数据里选，保证有经纬度） */
.pl-name-pick {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 36px;
  padding: 0 8px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--text); font-size: .84rem; font-weight: 600;
  text-align: left; cursor: pointer; transition: background .15s, border-color .15s;
}
.pl-name-pick span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-name-pick > i { flex: 0 0 auto; color: var(--text-4); font-size: .68rem; }
.pl-name-pick:hover { background: var(--ice); border-color: var(--row-border); }
.pl-name-pick:hover > i { color: var(--primary-600); }
.pl-name-pick.empty { color: var(--text-4); font-weight: 400; }
.pl-placepop { width: 360px; }
.pl-placepop-hint { padding: 5px 10px; font-size: .68rem; color: var(--text-4); background: #fdfefe; border-bottom: 1px solid var(--border); }
/* 地点搜索弹层（时段行里打地点时弹出来，数据来自地图库，选中即带经纬度） */
.pl-placepop {
  position: fixed; z-index: 1100; width: 348px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15,62,74,.24); overflow: hidden;
}
.pl-placepop[hidden] { display: none; }
.pl-placepop-head {
  display: flex; align-items: center; gap: 7px; padding: 7px 8px 7px 12px;
  border-bottom: 1px solid var(--border); background: #fdfefe;
  font-size: .72rem; color: var(--text-4);
}
.pl-placepop-head > i { color: var(--primary-600); }
.pl-placepop-head button {
  margin-left: auto; border: 0; background: transparent; color: var(--text-4); cursor: pointer;
  width: 24px; height: 24px; border-radius: 7px; font-size: .72rem;
}
.pl-placepop-head button:hover { background: #fdeef3; color: var(--rose); }
.pl-placepop-list { max-height: 260px; overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.pl-day-badge {
  /* 「N 个点位」徽章：天卡片第 1 行第 4 列的常驻元素（.pl-day-card 的直接子元素），
     定位见文件末尾；城市再多也挤不下来、不隐藏 */
  font-size: .68rem; color: var(--text-3); background: var(--ice); border-radius: 999px;
  padding: 1px 7px; white-space: nowrap; align-self: center;
}
/* 天数卡操作区（✕ .pl-day-acts）：第 1 行第 5 列，常驻 + 占位固定，hover 只改 opacity，绝不 display:none */
.pl-day-acts { display: inline-flex; align-items: center; gap: 2px; align-self: center; opacity: .45; }
.pl-day:hover .pl-day-acts { opacity: 1; }
.pl-day-ico {
  border: 0; background: transparent; color: var(--text-4); cursor: pointer;
  width: 22px; height: 22px; border-radius: 7px; font-size: .68rem;
}
.pl-day-ico:hover { color: var(--primary-600); background: var(--primary-50); }
.pl-day-ico.danger:hover { color: var(--rose); background: #fdeef3; }
.pl-day-del {
  border: 0; background: transparent; color: var(--text-4); cursor: pointer;
  width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto;
}
.pl-day-del:hover { color: var(--rose); background: #fdeef3; }

/* 天与天之间：跨城 */
.pl-conn {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; position: relative;
  padding: 7px 6px 7px 22px; font-size: .7rem; color: var(--text-4);
}
.pl-conn::before {
  content: ""; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px;
  background: repeating-linear-gradient(180deg, var(--border) 0 4px, transparent 4px 8px);
}
.pl-conn .pl-conn-arrow { color: var(--primary-600); font-size: .68rem; }
.pl-conn select {
  height: 24px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
  font-size: .68rem; color: var(--text-2); padding: 0 3px; max-width: 96px;
}
.pl-conn .pl-leg-time { color: var(--primary-600); font-weight: 500; }
.pl-conn .pl-leg-km { color: var(--text-4); }

/* ---------------- 只读模式（凭「只能查看」链接进来） ----------------
   藏掉所有会改内容的控件；输入框由 JS 统一 disabled（见 planner.js applyReadOnly）。
   服务端还有一层 canEdit 校验，前端藏控件只是别让人白点。 */
.pl-ro-badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: .72rem; font-weight: 700; color: #9a5b06;
  background: #fff4e0; border: 1px solid #f0d6a4; border-radius: 999px; padding: 4px 10px;
}
body.pl-readonly #plTripSave,
body.pl-readonly #plTripSaveAs,
body.pl-readonly #plDemo,
body.pl-readonly #plReset,
body.pl-readonly #plAiOpen,
body.pl-readonly [data-act="add"],
body.pl-readonly [data-act="addday"],
body.pl-readonly [data-act="clear"],
body.pl-readonly [data-act="delday"],
body.pl-readonly [data-act="reseq"],
body.pl-readonly [data-act="cityadd"],
body.pl-readonly [data-act="timepick"],
body.pl-readonly [data-act="placepick"],
body.pl-readonly [data-citydel],
body.pl-readonly .pl-del,
body.pl-readonly .pl-col-add { display: none !important; }
body.pl-readonly .pl-item { cursor: default; }
/* 点交通行 = 在地图上单独突出这一段（再点一次恢复）：做成可点区域 + 选中态 */
.pl-conn { cursor: pointer; border-radius: 10px; transition: background .15s; }
.pl-conn:hover { background: #f6fbf9; }
.pl-conn.is-focused { background: var(--primary-50, #eafaf4); box-shadow: inset 0 0 0 1px var(--primary-100, #cdf1e4); }
.pl-conn.is-focused .pl-leg-km { color: var(--primary-600); font-weight: 500; }

.pl-col-add {
  margin-top: 4px; height: 44px; border: 1px dashed var(--row-border); border-radius: 13px;
  background: #fcfefe; color: var(--text-4); cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 7px; font-size: .78rem; transition: all .16s;
}
.pl-col-add i { color: var(--primary-300); }
.pl-col-add:hover { border-color: var(--primary); color: var(--primary-600); background: var(--primary-50); }

/* 右列：当天时间点（表格式时间轴，每行一个时段） */
.pl-slots {
  padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 6px;
  min-height: 250px; max-height: calc(100vh - var(--pl-head-h) - 152px); overflow-y: auto;
}
.pl-slots.drop { background: var(--primary-50); }

/* 从地图搜索结果开始拖的时候：两列一起亮起来，提示「这两列都能放」 */
body.pl-drag-result .pl-panel { border-color: var(--primary-200); box-shadow: 0 0 0 3px var(--primary-50); }
body.pl-drag-result .pl-day { border-style: dashed; border-color: var(--primary-200); }
body.pl-drag-result .pl-slots { background: #fbfefe; }
.pl-items { display: flex; flex-direction: column; gap: 3px; }
.pl-empty {
  border: 1px dashed var(--row-border); border-radius: 12px; padding: 26px 14px; text-align: center;
  color: var(--text-4); font-size: .78rem; background: #fcfefe; line-height: 1.6;
}
.pl-empty b { display: block; color: var(--text-3); font-size: .84rem; margin-bottom: 4px; }

/* 时段列表末尾：手动添加 / 清空当天（清空放在右边，按你说的） */
.pl-slot-foot { display: flex; gap: 6px; margin-top: 5px; }
.pl-slot-add {
  flex: 1 1 auto; height: 34px;
  border: 1px dashed var(--row-border); border-radius: 11px; background: #fcfefe;
  color: var(--text-4); font-size: .76rem; cursor: pointer; transition: all .16s;
}
.pl-slot-add i { color: var(--primary-300); margin-right: 4px; }
.pl-slot-add:hover { border-color: var(--primary); color: var(--primary-600); background: var(--primary-50); }

.pl-item {
  /* 点位/详情列只占右栏的 55%，所以要窄得多，点位行折成三行放控件（DOM 不动，只改网格）：
       第一行：时间道（跨前两行，竖着像时间轴）| geo 点 | 名称（横跨名称+时长两列）| 删除
       第二行：时间道 | geo 点 | 分类 | 时长 | 拖动
       第三行：备注（占前 3 列）| 这一点花多少钱（占后 2 列 = 时长+拖动，宽 109px，放得下「费用/Cost」）
     最小宽 = 52 + 10 + 30 + 81 + 22 = 195，加 4 个列间距 6×4 = 24 → 219px
     （点位列在任何宽度下都 ≥ 219，不会横向滚动；放不下的控件已经折到第二行，不会被裁）
     注意：费用框以前没有 grid-area，被浏览器 auto 放到**隐式第 4 行**（只有时间栏那 52px 宽），
     占位文字「Cost」被裁成「Cos」，每个点位还白高 36px —— 现在它有了自己的格子。 */
  display: grid;
  grid-template-columns: 52px 10px minmax(30px,1fr) 81px 22px;
  grid-template-areas:
    "time geo  name name del"
    "time geo  cat  dur  grip"
    "note note note cost cost";
  align-items: center; gap: 4px 6px; padding: 5px 8px; border-radius: 11px; min-height: 44px;
  border: 1px solid var(--row-border); background: #fff;
  box-shadow: 0 1px 3px rgba(15,62,74,.06);
  transition: border-color .15s, box-shadow .15s;
  cursor: grab; user-select: none;
}
.pl-item .pl-time { grid-area: time; }
.pl-item .pl-geo { grid-area: geo; }
.pl-item .pl-namewrap { grid-area: name; }
.pl-item .pl-catwrap { grid-area: cat; }
.pl-item .pl-durwrap { grid-area: dur; }
.pl-item .pl-grip { grid-area: grip; }
.pl-item .pl-del { grid-area: del; }
.pl-item .pl-note-in { grid-area: note; }
.pl-item .pl-costwrap { grid-area: cost; justify-content: flex-end; }
/* 金额右对齐、等宽数字：和上面的时长排在一列，一眼能读出数 */
.pl-item .pl-costwrap input { text-align: right; font-variant-numeric: tabular-nums; }
/* 行与行之间的箭头：对齐左侧时间道的中心，和左列跨城箭头同风格 */
.pl-slot-conn { position: relative; height: 17px; }
.pl-slot-conn::before {
  content: ""; position: absolute; left: 34px; top: -2px; bottom: -2px; width: 2px;
  background: repeating-linear-gradient(180deg, var(--row-border) 0 4px, transparent 4px 8px);
}
.pl-slot-conn > i {
  position: absolute; left: 29px; top: 2px; font-size: .56rem; color: var(--c, var(--primary-600));
  background: #fff; padding: 1px 1px; border-radius: 3px;
}
.pl-item:active { cursor: grabbing; }
.pl-item input, .pl-item select { cursor: text; user-select: text; }
.pl-item select, .pl-item button { cursor: pointer; }
/* 有没有经纬度：有=薄荷实心点，没有=灰点（配合「在地图展示」） */
.pl-geo { display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; color: var(--border); }
.pl-geo.on { color: var(--primary-600); }
/* 地点输入框 + 里面的搜索按钮 */
.pl-namewrap { position: relative; display: block; min-width: 0; }
.pl-namewrap .pl-name { padding-right: 28px; }
.pl-name-search {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border: 0; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--text-4); font-size: .68rem;
}
.pl-name-search:hover { background: var(--primary-50); color: var(--primary-600); }
.pl-item:hover { border-color: var(--row-border-hover); background: #fbfefe; box-shadow: 0 3px 10px rgba(15,62,74,.10); }
.pl-item.dragging { opacity: .45; }
.pl-item.over { border-color: var(--primary); box-shadow: 0 -3px 0 var(--primary) inset; }
.pl-grip { color: var(--border); cursor: grab; text-align: center; }
.pl-grip:active { cursor: grabbing; }
.pl-item input, .pl-item select {
  height: 36px; border: 1px solid transparent; border-radius: 9px; background: transparent;
  font-size: .82rem; color: var(--text); padding: 0 7px; outline: none; width: 100%; min-width: 0;
}
.pl-item input:hover, .pl-item select:hover { background: var(--ice); }
.pl-item input:focus, .pl-item select:focus { background: #fff; border-color: var(--primary); }
/* 时间道：占满整行高度、居中，右侧一条淡淡的分隔线，读起来像时间轴；点它弹出时间选择器 */
.pl-item .pl-time {
  align-self: stretch; height: auto; min-height: 42px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-right: 1px dashed var(--row-border); border-radius: 9px 0 0 9px;
  font-family: var(--font-head); font-size: .92rem; font-weight: 600; color: var(--text);
  cursor: pointer; transition: background .15s, color .15s;
}
.pl-item .pl-time:hover { background: var(--primary-50); color: var(--primary-600); }
.pl-item .pl-name { font-weight: 600; font-size: .84rem; }
/* 备注：在时间道右侧的第二行（右下），不越过时间道 */
.pl-item .pl-note-in {
  width: 100%; height: 30px; margin-top: 2px;
  background: var(--ice); border-radius: 8px; padding: 0 9px;
  color: var(--text-3); font-size: .76rem;
}
.pl-item .pl-note-in::placeholder { color: var(--text-4); }
.pl-item .pl-note-in:hover { background: #e6f3f6; }
.pl-item .pl-note-in:focus { background: #fff; border-color: var(--primary); }
.pl-catwrap {
  display: inline-flex; align-items: center; gap: 3px; background: var(--ice);
  border-radius: 999px; padding: 1px 7px; min-width: 0;
}
.pl-catwrap i { font-size: .68rem; flex: 0 0 auto; }
.pl-catwrap select { width: auto; height: 26px; font-size: .74rem; padding: 0 2px; flex: 1 1 auto; }
.pl-durwrap { display: inline-flex; align-items: center; gap: 3px; font-size: .7rem; color: var(--text-4); white-space: nowrap; }
.pl-durwrap input { width: 56px; text-align: right; font-size: .76rem; }
/* 干掉 number 输入框的上下小箭头 —— 它占宽度，会把「120」挤成「12(」 */
.pl-durwrap input::-webkit-outer-spin-button,
.pl-durwrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pl-durwrap input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.pl-item .pl-del {
  border: 0; background: transparent; color: var(--text-4); cursor: pointer; font-size: .78rem;
  border-radius: 8px; width: 26px; height: 26px;
}
.pl-item .pl-grip { color: var(--border); cursor: grab; text-align: center; }
.pl-item:hover .pl-grip { color: var(--text-4); }
.pl-item .pl-del:hover { color: var(--rose); background: #fdeef3; }

/* ---------- 漂浮便签层 ---------- */
.pl-board {
  position: fixed; left: 0; right: 0; top: 60px; bottom: 0;
  pointer-events: none; z-index: 900;
}
.pl-board.off { display: none; }
.pl-note {
  position: absolute; width: 214px; pointer-events: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 10px 26px rgba(15,62,74,.16); overflow: hidden;
  transition: box-shadow .16s, transform .16s;
}
.pl-note::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--primary)); }
.pl-note:hover { box-shadow: 0 14px 34px rgba(15,62,74,.22); }
.pl-note.moving { transform: scale(1.02); box-shadow: 0 18px 40px rgba(15,62,74,.28); }
.pl-note-head {
  display: flex; align-items: center; gap: 7px; padding: 8px 9px 7px 13px; cursor: move;
  border-bottom: 1px dashed var(--border); background: #fdfefe;
}
.pl-note-head i.ico { color: var(--c, var(--primary)); font-size: .78rem; }
.pl-note-head .kind { font-size: .62rem; color: var(--text-4); border: 1px solid var(--border); border-radius: 6px; padding: 0 4px; }
.pl-note-head .x {
  margin-left: auto; border: 0; background: transparent; color: var(--text-4); cursor: pointer;
  width: 22px; height: 22px; border-radius: 7px; font-size: .74rem;
}
.pl-note-head .x:hover { background: #fdeef3; color: var(--rose); }
.pl-note-body { padding: 8px 10px 9px 13px; cursor: grab; }
.pl-note-body:active { cursor: grabbing; }
.pl-note-name { font-size: .84rem; font-weight: 600; color: var(--text); font-family: var(--font-head); line-height: 1.3; }
.pl-note-sub { font-size: .7rem; color: var(--text-4); margin-top: 2px; }
.pl-note-foot { display: flex; align-items: center; gap: 6px; padding: 0 10px 9px 13px; }
.pl-note-add {
  border: 1px solid var(--border); background: #fff; color: var(--text-2); border-radius: 9px;
  font-size: .72rem; height: 28px; padding: 0 9px; cursor: pointer;
}
.pl-note-add:hover { border-color: var(--primary); color: var(--primary-600); }
.pl-note-hint { font-size: .66rem; color: var(--text-4); }
.pl-note.done .pl-note-hint { color: var(--primary-600); }
.pl-note-thumb { width: 100%; height: 60px; object-fit: cover; display: block; background: var(--ice); }

/* ---------- Tab 切换：在吸顶头部里面，不再自己 sticky ---------- */
.pl-tabbar {
  display: flex; align-items: center; gap: 6px;
  max-width: 1560px; margin: 0 auto; padding: 6px 18px;
  background: #fff; border-top: 1px solid var(--border);
}
.pl-tab {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 15px;
  border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text-3);
  font-size: .79rem; cursor: pointer; transition: all .16s;
}
.pl-tab:hover { border-color: var(--primary); color: var(--primary-600); }
.pl-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.pl-synced {
  margin-left: auto; font-size: .72rem; color: var(--primary-600); display: inline-flex;
  align-items: center; gap: 5px; opacity: 0; transition: opacity .25s;
}
.pl-synced.on { opacity: 1; }

.pl-views { max-width: 1560px; margin: 0 auto; padding: 12px 18px 34px; }
/* 每个生成视图单独给高度：隐藏的视图不占位，所以编辑页不会多出一块空白 */
.pl-view { min-height: calc(100vh - var(--pl-head-h) - 120px); }
.pl-doc {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.pl-doc-word .dc-doc, .pl-doc-pdf .dc-doc { padding: 22px 24px; }
.pl-doc-pdf { background: var(--ice); }
.pl-doc-image { background: var(--ice); display: flex; justify-content: center; padding: 14px; }
.pl-doc-image canvas { max-width: 100%; height: auto; border-radius: 10px; box-shadow: var(--shadow); background: #fff; }
.pl-view-foot {
  display: flex; align-items: center; gap: 12px; justify-content: flex-end; flex-wrap: wrap;
  margin-top: 12px;
}
/* 顶部工具条：左边那句说明，右边三个导出按钮（导出视图专用） */
.pl-view-foot-top {
  justify-content: space-between; margin: 0 0 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 9px 12px; box-shadow: var(--shadow-sm);
}
.pl-view-btns { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.pl-view-tip { font-size: .74rem; color: var(--text-4); }

/* ---------- 弹层 ---------- */
.pl-modal {
  position: fixed; inset: 0; z-index: 1200; background: rgba(15,62,74,.42);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.pl-modal[hidden] { display: none; }
.pl-modal-card {
  background: #fff; border-radius: 18px; padding: 20px 22px 18px; max-width: 400px; width: 100%;
  box-shadow: 0 24px 60px rgba(15,62,74,.3);
}
.pl-modal-card h3 { font-family: var(--font-head); font-size: 1.02rem; margin: 0 0 8px; color: var(--text); }
.pl-modal-card p { font-size: .82rem; color: var(--text-3); line-height: 1.6; margin: 0 0 16px; }
.pl-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* 当天地图弹窗：独立地图，不动左栏那张 */
.pl-daymap-modal { z-index: 1300; }
.pl-daymap-card {
  display: flex; flex-direction: column;
  width: min(880px, 94vw); height: min(640px, 86vh);
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15,62,74,.32);
}
.pl-daymap-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--row-border); background: #fdfefe;
}
.pl-daymap-head > i { color: var(--primary-600); }
.pl-daymap-head b { font-family: var(--font-head); font-size: .86rem; color: var(--text); }
.pl-daymap-head button {
  margin-left: auto; border: 0; background: transparent; color: var(--text-4); cursor: pointer;
  width: 28px; height: 28px; border-radius: 8px; font-size: .8rem;
}
.pl-daymap-head button:hover { background: #fdeef3; color: var(--rose); }
.pl-daymap-body { flex: 1 1 auto; min-height: 0; padding: 10px; background: var(--ice); }
.pl-daymap-body > div { width: 100%; height: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--row-border); }

/* ---------- 地图上的 Day 圆点（带慢呼吸环） ---------- */
.pl-dot {
  position: relative; width: 15px; height: 15px; border-radius: 50%;
  background: var(--c, #0aa87a); border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(15,62,74,.4); cursor: pointer;
}
.pl-dot b {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 9px; font-weight: 700; color: #fff; line-height: 1;
}
.pl-dot.nonum b { display: none; }
/* 城市编号圆点：直径 22px（含 2px 白边，AMap marker offset 用 -11,-11 居中）+ 白色数字；
   数字 = 全行程城市连续序号（跨天累加，不按天重置），底色 = 所在天的天数色 */
.pl-dot-c { width: 22px; height: 22px; }
.pl-dot-c b { font-size: 11px; }
.pl-dot::after {
  content: ""; position: absolute; left: -3px; top: -3px; right: -3px; bottom: -3px;
  border-radius: 50%; border: 2px solid var(--c, #0aa87a); opacity: .5;
  animation: plBreath 3.4s ease-in-out infinite;
}
.pl-dot.dim { opacity: .3; }
/* 城市点位的名牌：地图缩小时也能看清城市名 */
.pl-dot-name {
  position: absolute; left: 17px; top: -1px;
  background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 6px;
  padding: 0 5px; font-size: 11px; line-height: 16px; color: var(--text);
  font-family: var(--font-head); white-space: nowrap;
  box-shadow: 0 1px 4px rgba(15,62,74,.18);
}
.pl-dot.dim .pl-dot-name { opacity: .45; }
@keyframes plBreath {
  0%   { transform: scale(.8); opacity: .5; }
  60%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
.pl-dot-city { font-size: 11px; }

/* ---------- 响应式 ---------- */
/* 两栏宽度已经全部由 :root 的变量统一控制（--pl-map-w / --pl-day-w / --pl-day-min），
   断点里不再出现裸百分比；只有这里把页面压成单列（地图在上、右区在下）。 */
@media (max-width: 991px) {
  .pl-body { grid-template-columns: minmax(0,1fr); }
  .pl-mapcol {
    position: relative; top: 0; height: auto; min-height: 0; border-right: 0;
    border-bottom: 1px solid var(--border); padding: 12px;
  }
  .pl-mapwrap { height: 46vh; min-height: 300px; }
  .pl-stats { margin-left: 0; }
  .pl-top-inner { gap: 14px; }
  .pl-daylist, .pl-slots { max-height: none; }
}
@media (max-width: 767px) {
  .pl-detail { grid-template-columns: minmax(0,1fr); }
  .pl-item {
    grid-template-columns: 70px 12px minmax(0,1fr) 14px 24px;
    grid-template-areas:
      "time geo  name grip del"
      "time note note note note"
      "cost cost cost cost cost";
  }
  .pl-item .pl-catwrap, .pl-item .pl-durwrap { display: none; }
  .pl-item .pl-note-in { font-size: .72rem; }
  .pl-slot-conn::before { left: 44px; }
  .pl-slot-conn > i { left: 39px; }
  .pl-tab { padding: 0 11px; font-size: .74rem; }
  .pl-note { width: 190px; }
}
@media print { .planner { display: none; } }

/* ---------- AI import dialog ---------- */
.pl-actions { flex-shrink: 0; }
.pl-aipop { width: min(680px, 94vw); }
.pl-aipop .pl-trippop-body { max-height: min(76vh, 700px); }
.pl-aipop #plAiText { width: 100%; min-height: 168px; margin-top: 10px; }
.pl-ai-imgrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pl-ai-imgnote { font-size: .7rem; color: var(--text-4); line-height: 1.5; }
.pl-ai-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pl-ai-thumb { position: relative; width: 78px; height: 58px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.pl-ai-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-ai-thumb button {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0; border-radius: 50%;
  background: rgba(15,23,42,.62); color: #fff; font-size: .6rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pl-ai-thumb b {
  position: absolute; left: 3px; bottom: 3px; background: var(--primary); color: #fff;
  border-radius: 50%; width: 15px; height: 15px; font-size: .55rem; display: flex; align-items: center; justify-content: center;
}
.pl-ai-bar { height: 4px; border-radius: 99px; background: #eef1f6; overflow: hidden; margin-top: 8px; }
.pl-ai-bar > i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.pl-ai-status { font-size: .74rem; margin: 8px 0 0; min-height: 1.1em; color: var(--text-4); line-height: 1.6; }
.pl-ai-status.ok { color: var(--primary-600); }
.pl-ai-status.warn { color: #b4531b; }
.pl-ai-sum { font-size: .86rem; font-weight: 700; color: var(--text); margin: 2px 0 0; line-height: 1.7; }
.pl-ai-warn { font-size: .72rem; color: #b4531b; margin: 8px 0 0; line-height: 1.7; }
.pl-ai-unmatched { margin-top: 6px; }
.pl-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-ai-chip {
  border: 1px solid #f0d3a8; background: #fff8ee; color: #a2570f; border-radius: 99px;
  padding: 3px 9px; font-size: .74rem; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.pl-ai-chip:hover { background: #fdefd9; }
.pl-ai-chip i { font-size: .62rem; opacity: .7; }
.pl-item.pl-warn { background: #fffaf1; box-shadow: inset 3px 0 0 #e79a3c; }
.pl-item.pl-warn-hit { background: #fff2d9 !important; box-shadow: 0 0 0 2px #e79a3c inset; }

.pl-seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.pl-ai-chip.is-located { border-color: #b7e0cd; background: #f1fbf6; color: #0a7a56; }
.pl-ai-chip.is-located:hover { background: #e5f6ee; }
.pl-item.pl-located { background: #f6fdfa; box-shadow: inset 3px 0 0 #46b98a; }

.pl-geo-btn { border: 0; background: #fff4e6; color: #b4531b; font-weight: 700; font-size: .74rem; cursor: pointer; border-radius: 50%; width: 18px; height: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.pl-geo-btn:hover { background: #ffe8cc; }

.pl-placepop-foot { padding: 8px 10px 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.pl-match-btn { border: 1px solid var(--border); background: #fff; border-radius: 9px; padding: 5px 9px; font-size: .74rem; color: var(--text-2); cursor: pointer; text-align: left; }
.pl-match-btn:hover { border-color: var(--primary-200); color: var(--primary-600); }
.pl-match-manual { display: flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--text-4); flex-wrap: wrap; }
.pl-match-num { width: 76px; height: 28px; border: 1px solid var(--border); border-radius: 8px; padding: 0 7px; font-size: .74rem; }
.pl-placepop-foot .pl-trippop-check { font-size: .72rem; color: var(--text-3); margin: 0; }

/* ---------- 地图兜底：离线示意图 ---------- */
.pl-mapwrap { position: relative; }
/* 模式标签钮：图区左上角一个很小的角标，不占地方、不显示任何提示文字；
   当前是「在线地图」还是「离线示意图」悬停看 title（三语）。默认就是地图，用户点了才切示意图。 */
.pl-modebar { position: absolute; left: 10px; top: 10px; z-index: 6; }
.pl-modetoggle {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px;
  border-radius: 8px; border: 1px solid var(--border); background: rgba(255,255,255,.94);
  color: var(--text-3); font-size: .68rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow-sm);
}
.pl-modetoggle:hover { border-color: var(--primary); color: var(--primary-600); }
.pl-modetoggle.is-svg { color: var(--text-4); background: rgba(255,255,255,.9); }
.pl-modetoggle > i { font-size: .66rem; }
/* 示意图单独一层：盖在高德容器上面，切回地图时只隐藏这一层，绝不动高德的 DOM */
.pl-svg-layer { position: absolute; inset: 0; z-index: 2; display: none; background: #f7fafc; }
.pl-map-svg .pl-svg-layer { display: block; }
.pl-map-svg { background: #f7fafc; }
/* 缩放按钮（页面自带，不依赖高德 ToolBar 插件）：右下角竖排一对，正好落在 .pl-legend 预留的 58px 里 */
.pl-zoom {
  position: absolute; right: 10px; bottom: 10px; z-index: 5;
  display: flex; flex-direction: column; gap: 4px;
}
.pl-zoom button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border-radius: 9px; border: 1px solid var(--border); background: rgba(255,255,255,.95);
  color: var(--text-2); font-size: .74rem; cursor: pointer; box-shadow: var(--shadow-sm);
}
.pl-zoom button:hover { border-color: var(--primary); color: var(--primary-600); }
.pl-map-svg .pl-zoom { display: none; }   /* 示意图没有缩放概念 */
.pl-svg { width: 100%; height: 100%; display: block; }
.pl-svg circle[data-di], .pl-svg circle[data-d] { cursor: pointer; }
.pl-svg-note, .pl-svg-empty { position: absolute; left: 8px; bottom: 8px; right: 8px; background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: .7rem; color: var(--text-4); }
.pl-svg-empty { position: static; margin: 12px; text-align: center; }

/* ---------- 城市 chip 行：城市多了就换行（高度随内容长，卡片跟着长），不再做单行横滚 ---------- */
.pl-citychip {
  flex: 0 0 auto;               /* 不参与伸缩，避免相邻 chip 互相挤压 */
  height: auto;                 /* 点击区/最小高度 24px 只在上面 .pl-citychip 基础规则里声明一次，这里不再重复 */
  max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color .15s, border-color .15s, color .15s;   /* 不再 transition: all */
}
.pl-citychip-x { flex: 0 0 13px; width: 13px; height: 13px; }         /* × 尺寸固定，出现/消失不改 chip 大小 */
.pl-citychip > i { flex: 0 0 auto; }
.pl-cityadd { position: sticky; right: 0; flex: 0 0 18px; background: #fff; }  /* + 固定在最右，不随 chip 增减移位 */

/* ---------- 城市 chip 语义化：地级=蓝，县级=绿，父子同天时地级显示为灰色父级 ---------- */
.pl-citychip.pl-parent { background: #f1f3f6; border-color: #d7dde5; color: #6b7280; }
.pl-citychip.pl-parent > i { color: #9aa4b2; }
.pl-citychip.pl-county { font-weight: 600; }

/* 天卡片 = 两行结构（用户要求）：
   第 1 行：拖拽柄 · 第N天 · 日期 · …… · N个点位 · ✕   （徽章与 ✕ 永远在这行，城市再多少也挤不下来）
   第 2 行起：城市 chip（多了自己往下换行，不影响第 1 行）。
   这里只写「哪个元素在第几行第几列」；属性本体在各自的基础规则里，全文不再重复声明、也不用 !important */
.pl-day-grip  { grid-row: 1; grid-column: 1; }
.pl-day-no    { grid-row: 1; grid-column: 2; }
.pl-day-date  { grid-row: 1; grid-column: 3; justify-self: start; }
.pl-day-badge { grid-row: 1; grid-column: 4; justify-self: end; margin-left: 0; }
.pl-day-acts  { grid-row: 1; grid-column: 5; margin-left: 0; }
/* 城市行的 grid-row: 2 / grid-column: 1 / -1 写在上面它自己的基础规则里（全文只此一条） */

/* ---------- 协作与分享弹层：协作者列表 ---------- */
.pl-collab-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.pl-collab-item { display: flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--text-2);
  background: #f7fbfc; border: 1px solid var(--border); border-radius: 9px; padding: 6px 9px; }
.pl-collab-item em { font-style: normal; font-size: .68rem; color: var(--text-4); }
.pl-collab-item button { margin-left: auto; border: 0; background: transparent; color: var(--text-4); cursor: pointer; padding: 2px 4px; }
.pl-collab-item button:hover { color: #c23b64; }
.pl-collab-empty { font-size: .76rem; color: var(--text-4); }
#plSharePop input[readonly] { background: #f7fbfc; color: var(--text-3); }
#plSharePop select, #plSharePop input[type=email] { border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-size: .82rem; background: #fff; }

/* ---------- 费用标签页：内嵌 /expenses 的费用面板 ---------- */
.pl-expense { padding: 4px 0 28px; }
.pl-expense .xp { max-width: 1100px; margin: 0 auto; }
.pl-expense-empty { max-width: 620px; margin: 40px auto; text-align: center; font-size: .88rem; color: var(--text-3);
  background: #fff; border: 1px dashed var(--border); border-radius: 14px; padding: 26px 20px; line-height: 1.9; }
/* 点位/交通行里的小费用框 */
.pl-costwrap { display: inline-flex; align-items: center; }
.pl-move-costwrap { display: inline-flex; align-items: center; margin-left: 8px; }
.pl-day-cost { margin-left: 6px; font-style: normal; }
.pl-trip-cost { margin-left: 6px; font-weight: 800; color: var(--accent-600); }