/* =========================================================
 *  旅刻 TripCraft — 样式
 * ========================================================= */

:root {
  --bg:        #090d12;
  --bg-soft:   #0d131a;
  --panel:     #101821;
  --panel-2:   #141d27;
  --line:      rgba(var(--ink-rgb), .065);
  --line-2:    rgba(var(--ink-rgb), .12);
  --text:      #e9eef5;
  --text-2:    #b3c0cf;
  --muted:     #7d8b9c;
  --dim:       #5f6d7c;

  --green:     #37d39a;
  --amber:     #f2b34b;
  --grey:      #6b7684;
  --blue:      #5aa9ff;
  --pink:      #f27a8d;

  --radius:    16px;
  --radius-sm: 10px;
  --ring-len:  113.1;

  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, monospace;

  /* 叠加色：暗色主题是「白色半透明」，浅色主题翻成「深色半透明」，
     所以组件里一律写 rgba(var(--ink-rgb), α)，不写死 255,255,255 */
  --ink-rgb:    255, 255, 255;
  --shadow-rgb: 0, 0, 0;
  --on-ink:     #ffffff;          /* 压在深色/高亮块上的文字 */

  --bar-bg:     rgba(9, 13, 18, .72);
  --field-bg:   rgba(10, 15, 21, .82);
  --hover-bg:   rgba(30, 42, 56, .95);
  --card-bg:    rgba(11, 17, 23, .93);
  --scrim:      rgba(4, 7, 10, .72);

  --green-bright: #6df0bb;
  --blue-bright:  #9ecbff;
  --red-soft:     #ff8a93;
  --amber-soft:   #d9a95f;
  --map-bg:       #0c141c;
}

/* =========================================================
 *  白天主题：暖白纸感 + 墨绿文字
 *  只覆盖语义变量，组件规则一行不用改
 * ========================================================= */
html[data-theme="light"] {
  --bg:        #f4f6f2;
  --bg-soft:   #eaece6;
  --panel:     #ffffff;
  --panel-2:   #f2f5f1;
  --line:      rgba(18, 32, 26, .09);
  --line-2:    rgba(18, 32, 26, .17);
  --text:      #16211c;
  --text-2:    #3b4a43;
  --muted:     #5d6b64;
  --dim:       #6f7d75;

  --green:     #0f9d6e;
  --amber:     #a06a12;
  --grey:      #78857f;
  --blue:      #1f6feb;
  --pink:      #c8455c;

  --ink-rgb:    18, 32, 26;
  --shadow-rgb: 92, 108, 100;
  --on-ink:     #ffffff;

  --bar-bg:     rgba(255, 255, 255, .84);
  --field-bg:   #ffffff;
  --hover-bg:   #e6ece7;
  --card-bg:    #ffffff;
  --scrim:      rgba(24, 36, 30, .34);

  --green-bright: #0a7d58;
  --blue-bright:  #1d4ed8;
  --red-soft:     #bb3a2c;
  --amber-soft:   #8a5a0f;
  --map-bg:       #e9ede7;
}

/* 浅色下背景光晕要淡很多，否则像蒙了层雾 */
html[data-theme="light"] body {
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(15, 157, 110, .07), transparent 62%),
    radial-gradient(800px 460px at 92% 4%, rgba(31, 111, 235, .05), transparent 60%);
}
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(18, 32, 26, .18); }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(18, 32, 26, .3); }

/* 主题按钮：暗色显示月亮，白天显示太阳 */
#btnTheme .ico-sun { display: none; }
html[data-theme="light"] #btnTheme .ico-sun { display: block; }
html[data-theme="light"] #btnTheme .ico-moon { display: none; }

/* 简图 SVG 的配色全部走变量，跟着主题走（生成时只写 class） */
#fbSvg .fb-grid  { stroke: rgba(var(--ink-rgb), .055); }
#fbSvg .fb-lead  { stroke: rgba(var(--ink-rgb), .16); }
#fbSvg .fb-ring  { stroke: rgba(var(--shadow-rgb), .5); }
#fbSvg .fb-num   { fill: var(--bg); }
#fbSvg .fb-label { fill: var(--muted); }
#fbSvg .fb-label.is-today { fill: var(--text-2); }

/* 图层按钮：这个城市没有底图时暗着、点不动，也不给 hover 反馈。
   .off 类也带 opacity，所以这里要把选择器写得更具体才压得住 */
.map-btn:disabled,
.map-btn:disabled:hover,
.map-btn.off:disabled {
  opacity: .3;
  cursor: not-allowed;
  color: var(--dim);
  background: var(--field-bg);
  border-color: rgba(var(--ink-rgb), .06);
}

* { box-sizing: border-box; }

/* 让 hidden 属性优先于任何 display 声明 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(55,211,154,.09), transparent 62%),
    radial-gradient(800px 460px at 92% 4%, rgba(90,169,255,.075), transparent 60%);
}

button { font-family: inherit; cursor: pointer; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(var(--ink-rgb), .11);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(var(--ink-rgb), .2); }

/* ============ 顶栏 ============ */
.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bar-bg);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: #06120d;
  background: linear-gradient(140deg, #4ee6ac, #22a97a);
  box-shadow: 0 4px 14px rgba(55,211,154,.28);
}

.brand-text { display: flex; align-items: baseline; gap: 7px; }
.brand-text strong { font-size: 16px; letter-spacing: .06em; font-weight: 700; }
.brand-text span {
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--dim);
  text-transform: uppercase;
  font-family: var(--mono);
}

.topbar-mid {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--muted);
  min-width: 0;
  justify-content: center;
}
.topbar-mid .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(55,211,154,.14);
  flex-shrink: 0;
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
#topSummaryText {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar-right { display: flex; gap: 8px; flex-shrink: 0; }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: rgba(var(--ink-rgb), .03);
  color: var(--text-2);
  font-size: 12.5px;
  transition: .18s;
}
.ghost-btn:hover {
  background: rgba(var(--ink-rgb), .07);
  color: var(--text);
  border-color: rgba(var(--ink-rgb), .2);
}
/* 还没生成路线时，「考察路线」不可点 */
.ghost-btn:disabled {
  opacity: .38;
  cursor: default;
}
.ghost-btn:disabled:hover {
  background: transparent;
  color: var(--dim);
  border-color: var(--line);
}
/* 已展开时高亮 */
.ghost-btn.on {
  color: var(--green-bright);
  border-color: rgba(55,211,154,.4);
  background: rgba(55,211,154,.1);
}

/* ============ 布局 ============ */
/* 默认两栏：左侧遗址列表 + 中间全部遗存地图，右侧路线面板收起 */
.layout {
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  height: calc(100vh - 58px);
  transition: grid-template-columns .24s cubic-bezier(.4,0,.2,1);
}
.layout.show-plan {
  grid-template-columns: 312px minmax(0, 1fr) 344px;
}

.panel {
  min-width: 0;
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* 右侧路线面板：默认不占位，点「考察路线」才展开 */
.panel-plan { display: none; }
.layout.show-plan .panel-plan { display: flex; }

/* ============ 左：配置面板 ============ */
/* 城市列表是主内容，撑满剩余高度；月份与天数折叠起来让位 */
.panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 11px 12px 6px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.field { margin-bottom: 0; }

.field-city {
  flex: 1 1 auto;
  min-height: 168px;
  display: flex;
  flex-direction: column;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
  flex-shrink: 0;
}
.field-head label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--text-2);
}
.field-hint {
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
}
.head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* 智能推荐：靠右的小胶囊按钮 */
.auto-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(var(--ink-rgb), .03);
  color: var(--dim);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: .16s;
}
.auto-btn:hover { color: var(--text-2); border-color: rgba(var(--ink-rgb), .2); }
.auto-btn.on {
  color: var(--green-bright);
  border-color: rgba(55,211,154,.42);
  background: rgba(55,211,154,.13);
}

/* 折叠字段：什么时候出发 / 考察几天 */
.fold {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding-top: 2px;
}
.fold-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0 5px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.fold-head::-webkit-details-marker { display: none; }
.fold-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--text-2);
}
.fold-value {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.fold-head::after {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.5px solid var(--dim);
  border-bottom: 1.5px solid var(--dim);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s;
  flex-shrink: 0;
}
.fold[open] .fold-head::after {
  transform: rotate(225deg) translateY(-2px);
}
.fold-head:hover .fold-label { color: var(--text); }
.fold-body { padding: 2px 0 8px; }

/* 城市 chips */
.city-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  margin-right: -2px;
}
/* 大区分组标题 */
.city-group-label {
  grid-column: span 3;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 17px;
  margin-top: 3px;
  color: var(--dim);
  font-size: 9.5px;
  letter-spacing: .16em;
}
.city-group-label span { flex-shrink: 0; }
.city-group-label i {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0;
  opacity: .7;
}
.city-group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--ink-rgb), .09), transparent);
}
/* 重点区（欧洲/非洲/中亚/美洲）：标签亮一档，前面加一颗金色小点 */
.city-group-label.prime { color: var(--text-2); letter-spacing: .13em; }
.city-group-label.prime span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 6px;
  border-radius: 50%;
  background: #c9a227;
  vertical-align: 1px;
}
.city-group-label.prime::after {
  background: linear-gradient(90deg, rgba(201,162,39,.24), transparent);
}
.city-chip {
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(var(--ink-rgb), .025);
  color: var(--text-2);
  font-size: 12px;
  padding: 0 4px;
  transition: .16s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.city-chip:hover { background: rgba(var(--ink-rgb), .07); color: var(--text); }
.city-chip.on {
  background: rgba(55,211,154,.14);
  border-color: rgba(55,211,154,.45);
  color: var(--green-bright);
  font-weight: 600;
}

/* 境外城市分组标题（可展开/收起） */
.city-divider {
  grid-column: span 3;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 20px;
  margin-top: 3px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--dim);
  font-size: 9.5px;
  letter-spacing: .14em;
  transition: color .16s;
}
.city-divider span { flex-shrink: 0; order: 0; }
.city-divider::after {
  content: "";
  flex: 1;
  order: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--ink-rgb), .1), transparent);
}
.city-divider i {
  order: 2;
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0;
  opacity: .75;
}
.city-divider:hover { color: var(--text-2); }

/* 月份网格 */
.month-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}
.month-cell {
  position: relative;
  height: 25px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(var(--ink-rgb), .025);
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--mono);
  display: grid;
  place-items: center;
  transition: .16s;
  overflow: hidden;
}
.month-cell .mbar {
  position: absolute;
  left: 3px; bottom: 3px;
  height: 2px;
  max-width: calc(100% - 6px);
  border-radius: 2px;
  background: var(--grey);
  opacity: .8;
}
.month-cell:hover { background: rgba(var(--ink-rgb), .07); color: var(--text-2); }
.month-cell.on {
  background: rgba(90,169,255,.16);
  border-color: rgba(90,169,255,.5);
  color: var(--blue-bright);
  font-weight: 700;
}
.month-cell.on .mbar { background: var(--blue); }

.month-brief {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(var(--ink-rgb), .028);
  border-left: 2px solid rgba(90,169,255,.45);
}
.month-brief b { color: var(--text-2); font-weight: 600; }

/* 天数步进 */
.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-btn {
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: rgba(var(--ink-rgb), .04);
  color: var(--text-2);
  font-size: 17px;
  line-height: 1;
  display: grid; place-items: center;
  transition: .16s;
}
.step-btn:hover { background: rgba(var(--ink-rgb), .09); color: var(--on-ink); }
.step-btn:disabled { opacity: .3; cursor: not-allowed; }
.step-value {
  flex: 1;
  height: 34px;
  border-radius: 9px;
  background: rgba(var(--ink-rgb), .028);
  border: 1px solid var(--line);
  display: flex; align-items: baseline; justify-content: center; gap: 3px;
}
.step-value b { font-size: 16px; font-family: var(--mono); }
.step-value span { font-size: 11px; color: var(--muted); }

/* 通用 chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 25px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(var(--ink-rgb), .025);
  color: var(--text-2);
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 5px;
  transition: .16s;
}
.chip:hover { background: rgba(var(--ink-rgb), .07); color: var(--text); }
.chip.on {
  background: rgba(55,211,154,.13);
  border-color: rgba(55,211,154,.42);
  color: var(--green-bright);
  font-weight: 600;
}

/* 标签网格 */
.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 4px;
}
.tag-chip {
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(var(--ink-rgb), .025);
  color: var(--text-2);
  font-size: 11.5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  transition: .16s;
  padding: 0 2px;
}
.tag-chip .ico { font-size: 12px; opacity: .85; }
.tag-chip:hover { background: rgba(var(--ink-rgb), .07); color: var(--text); }
.tag-chip.on {
  background: rgba(55,211,154,.13);
  border-color: rgba(55,211,154,.42);
  color: var(--green-bright);
  font-weight: 600;
}

/* 分段控件 */
.seg-row {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  gap: 8px;
}
.seg-col { min-width: 0; }
.seg-col .field-head { margin-bottom: 6px; }

.seg {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(var(--ink-rgb), .03);
  border: 1px solid var(--line);
}
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 7px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
  white-space: nowrap;
  letter-spacing: -.02em;
  transition: .16s;
}
.seg-btn small { display: block; font-size: 9.5px; opacity: .65; margin-top: 1px; }
.seg-btn:hover { color: var(--text-2); background: rgba(var(--ink-rgb), .04); }
.seg-btn.on {
  background: rgba(55,211,154,.16);
  color: var(--green-bright);
  font-weight: 600;
  box-shadow: 0 1px 8px rgba(var(--shadow-rgb), .25);
}
.seg-btn.on small { opacity: .7; }

/* 生成按钮 */
.panel-foot {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(var(--shadow-rgb), .25));
}
.primary-btn {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #45e0a8, #1f9e72);
  color: #04140e;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .04em;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 6px 20px rgba(55,211,154,.24);
  transition: .18s;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 26px rgba(55,211,154,.34); }
.primary-btn:active { transform: translateY(0); }
.primary-btn.loading { opacity: .7; pointer-events: none; }

/* ============ 中：地图区 ============ */
.stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 10px;
}

.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 4px 0;
  flex-shrink: 0;
}
.stage-title h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
}
.stage-title p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

.stage-meta { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.score-ring { position: relative; width: 44px; height: 44px; }
.score-ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 3.4; stroke-linecap: round; }
.ring-bg { stroke: rgba(var(--ink-rgb), .08); }
.ring-fg {
  stroke: var(--green);
  stroke-dasharray: var(--ring-len);
  stroke-dashoffset: var(--ring-len);
  transition: stroke-dashoffset .9s cubic-bezier(.22,1,.36,1), stroke .4s;
}
.score-ring span {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  font-family: var(--mono);
}
.score-label {
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: .12em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  line-height: 1;
}

/* 地图容器：必须有确定高度 */
.map-wrap {
  position: relative;
  flex: 1;
  min-height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--map-bg);
  box-shadow: 0 18px 50px -18px rgba(var(--shadow-rgb), .8), inset 0 0 0 1px rgba(var(--ink-rgb), .03);
}
/* ★ 必须让 #map 自成一个层叠上下文（isolation + z-index:0）。
   TMap 初始化后会往 #map 里插 CANVAS 和带高 z-index 的 DIV，
   而 #map 若只是 position:relative、z-index:auto，它内部那些 z-index
   会直接跑到根层叠上下文里，把 z-index:15 的简图整个盖住 —— 点位就点不动了。 */
#map {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 0;
  isolation: isolate;
  /* 瓦片没出来时 TMap 会铺白底，深色兜底至少不刺眼 */
  background: var(--bg-soft);
}
/* 用简图时把真底图彻底让开：不透明为 0 但仍占位，避免 TMap 拿到 0 尺寸后再切回来需要 resize */
.map-wrap.fb-on #map { opacity: 0; pointer-events: none; }

/* 白天主题：腾讯默认底图偏灰绿（实测平均 rgb(231,232,221)，比页面底色暗一截），
   整体提亮 + 去一点黄绿 + 轻微提对比，让道路和地名在纸白界面上更清楚。
   只作用于 #map，简图和图钉浮层在外面，不受影响 */
html[data-theme="light"] #map {
  filter: brightness(1.08) saturate(.88) contrast(1.02);
}


/* 还没生成路线时：地图照常展示全部遗存，只把「结果型」的安全指数收起来 */
.stage.is-empty .stage-meta { display: none; }

.panel-plan.is-empty .plan-foot,
.panel-plan.is-empty #btnReplan,
.panel-plan.is-empty #exportWrap { display: none; }

/* 左下：当前视图说明（全部遗存 / 某天路线） */
.map-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 20;
  max-width: min(62%, 520px);
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--field-bg);
  border: 1px solid rgba(var(--ink-rgb), .09);
  color: var(--dim);
  font-size: 10.5px;
  line-height: 1.5;
  backdrop-filter: blur(14px);
  pointer-events: none;
}
.map-hint b { color: var(--text-2); font-weight: 600; }
.map-hint[hidden] { display: none; }

/* 地图内浮层统一玻璃质感 */
.map-legend, .map-tools, .spot-card, .map-fallback {
  backdrop-filter: blur(14px);
}

.map-legend {
  position: absolute;
  left: 12px; top: 12px;
  z-index: 20;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--field-bg);
  border: 1px solid rgba(var(--ink-rgb), .09);
  display: flex; flex-direction: column; gap: 5px;
  pointer-events: none;
}
.legend-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px;
  color: var(--text-2);
}
.legend-row i {
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.legend-sep { height: 1px; background: rgba(var(--ink-rgb), .1); margin: 2px 0; }

.map-tools {
  position: absolute;
  right: 12px; top: 12px;
  z-index: 20;
  display: flex; flex-direction: column; gap: 6px;
}
.map-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(var(--ink-rgb), .1);
  background: var(--field-bg);
  color: var(--text-2);
  display: grid; place-items: center;
  transition: .16s;
}
.map-btn:hover { background: var(--hover-bg); color: var(--on-ink); }
.map-btn.off { color: var(--dim); opacity: .55; }
.map-btn.on { color: var(--blue); border-color: rgba(90,169,255,.45); }

/* 景点浮卡 */
.spot-card {
  position: absolute;
  left: 12px; bottom: 12px;
  width: 306px;
  z-index: 25;
  padding: 13px 14px 12px;
  border-radius: 13px;
  background: var(--card-bg);
  border: 1px solid rgba(var(--ink-rgb), .1);
  box-shadow: 0 16px 40px -10px rgba(var(--shadow-rgb), .85);
  animation: cardIn .26s cubic-bezier(.22,1,.36,1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.sc-close {
  position: absolute; right: 8px; top: 7px;
  width: 22px; height: 22px;
  border: none; border-radius: 6px;
  background: transparent;
  color: var(--dim);
  font-size: 16px; line-height: 1;
  display: grid; place-items: center;
}
.sc-close:hover { background: rgba(var(--ink-rgb), .08); color: var(--text); }

.sc-top { display: flex; gap: 6px; align-items: center; margin-bottom: 5px; }
.sc-cat {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(var(--ink-rgb), .07);
  color: var(--text-2);
}
.sc-season {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 600;
}
.sc-season.good { background: rgba(55,211,154,.16); color: var(--green-bright); }
.sc-season.mid  { background: rgba(242,179,75,.16); color: var(--amber-soft); }
.sc-season.low  { background: rgba(107,118,132,.2); color: #9aa6b4; }

.spot-card h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; padding-right: 20px; }
.spot-card > p#scDesc { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.sc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 10px 0 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.sc-stats div { text-align: center; }
.sc-stats span { display: block; font-size: 9.5px; color: var(--dim); margin-bottom: 2px; }
.sc-stats b { font-size: 12px; font-family: var(--mono); color: var(--text); font-weight: 600; }

.sc-tip {
  font-size: 11px;
  color: var(--amber);
  line-height: 1.5;
  opacity: .9;
  margin-bottom: 9px;
}
.sc-tip::before { content: "TIP "; font-size: 9px; letter-spacing: .1em; opacity: .7; }

.sc-months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
}
.sc-months i {
  height: 14px;
  border-radius: 2px;
  background: rgba(var(--ink-rgb), .06);
  position: relative;
}
.sc-months i.best { background: rgba(55,211,154,.55); }
.sc-months i.near { background: rgba(242,179,75,.38); }
.sc-months i.now { box-shadow: 0 0 0 1.5px var(--blue); }

/* 地图降级视图 */
.map-fallback {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: radial-gradient(circle at 50% 40%, #12202c, #0a1118 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px 16px;
}
/* 简图铺满可用高度：图越大，点位越散，越好点 */
.fb-inner {
  width: 100%;
  max-width: 760px;
  height: 100%;
  display: flex;
  flex-direction: column;
  text-align: center;
}
.fb-title { font-size: 13px; color: var(--text-2); font-weight: 600; flex-shrink: 0; }
.fb-sub { font-size: 11px; color: var(--dim); margin: 3px 0 6px; flex-shrink: 0; }
/* 临时反馈（比如点了图层按钮但没地图服务）：换成提示色，让人一眼看到有反应 */
.fb-sub.flash { color: var(--amber); font-weight: 600; }
/* SVG 按宽度缩放，但不超过可用高度，避免上下被容器裁掉 */
#fbSvg { width: 100%; height: auto; max-height: 100%; min-height: 0; }
/* 点位悬停：名字提亮，提示「这里可以点」 */
#fbSvg .fb-spot:hover text { fill: var(--on-ink); }
#fbSvg .fb-spot:hover circle:nth-of-type(2) { fill-opacity: .3; }

/* 底部天气条 */
.stage-foot {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 16px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(var(--ink-rgb), .035), rgba(var(--ink-rgb), .015));
  border: 1px solid var(--line);
}
.foot-item { display: flex; flex-direction: column; gap: 1px; }
.foot-item span { font-size: 9.5px; color: var(--dim); letter-spacing: .1em; }
.foot-item b { font-size: 13px; font-family: var(--mono); font-weight: 600; }
.foot-note {
  flex: 1;
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ 右：行程面板 ============ */
.plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 15px 16px 11px;
  flex-shrink: 0;
}
.plan-head h2 { font-size: 14px; font-weight: 700; letter-spacing: .03em; }
.plan-head p { font-size: 11px; color: var(--dim); margin-top: 2px; }

.icon-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(var(--ink-rgb), .03);
  color: var(--muted);
  display: grid; place-items: center;
  transition: .16s;
}
.icon-btn:hover { background: rgba(var(--ink-rgb), .08); color: var(--text); }

/* 导出菜单 */
.plan-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.export-wrap { position: relative; }
.export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 198px;
  padding: 5px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  box-shadow: 0 14px 34px rgba(var(--shadow-rgb), .5);
  z-index: 60;
}
.export-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.35;
  transition: .14s;
}
.export-menu button:hover { background: rgba(var(--ink-rgb), .07); }
.export-menu button span {
  display: block;
  font-size: 10.5px;
  color: var(--dim);
  margin-top: 1px;
}

.day-tabs {
  display: flex;
  gap: 5px;
  padding: 0 16px 11px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  flex-shrink: 0;
  height: 27px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(var(--ink-rgb), .025);
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--mono);
  transition: .16s;
  display: inline-flex; align-items: center; gap: 5px;
}
.day-tab:hover { background: rgba(var(--ink-rgb), .07); color: var(--text-2); }
.day-tab.on {
  background: rgba(90,169,255,.15);
  border-color: rgba(90,169,255,.45);
  color: var(--blue-bright);
  font-weight: 600;
}
.day-tab i {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: .7;
}

.plan-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 12px;
  min-height: 0;
}
.plan-body { display: flex; flex-direction: column; }

/* 行程时间轴 */
.day-block { animation: fadeUp .3s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.day-summary {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px;
  color: var(--dim);
  padding: 0 0 10px 2px;
  flex-wrap: wrap;
}
.day-summary .pill {
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(var(--ink-rgb), .05);
  color: var(--text-2);
}

.leg {
  position: relative;
  padding-left: 26px;
  padding-bottom: 13px;
}
.leg:last-child { padding-bottom: 4px; }
.leg::before {
  content: "";
  position: absolute;
  left: 7px; top: 15px; bottom: -2px;
  width: 1px;
  background: linear-gradient(180deg, rgba(90,169,255,.35), rgba(90,169,255,.05));
}
.leg:last-child::before { display: none; }
.leg-dot {
  position: absolute;
  left: 2px; top: 7px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(90,169,255,.1);
}
.leg-dot.time {
  width: 9px; height: 9px;
  left: 3px; top: 8px;
  border: none;
  background: var(--dim);
  box-shadow: none;
}

.leg-time {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--dim);
  letter-spacing: .06em;
  margin-bottom: 2px;
}
.leg-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
  transition: color .15s;
}
.leg-name:hover { color: var(--blue-bright); }
.leg-name .cat {
  font-size: 9.5px;
  font-weight: 400;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(var(--ink-rgb), .06);
  color: var(--muted);
}
.leg-meta {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  display: flex; gap: 9px; flex-wrap: wrap;
}
.leg-meta em { font-style: normal; color: var(--dim); }

.leg-move {
  font-size: 10px;
  color: var(--dim);
  padding: 3px 0 3px 0;
  display: flex; align-items: center; gap: 5px;
}
.leg-move::before {
  content: "";
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--dim);
}

/* 空态 */
.empty {
  padding: 28px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}
.empty-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--dim);
}
.empty-list {
  margin-top: 16px;
  display: inline-flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}
.empty-list li {
  position: relative;
  padding-left: 14px;
  font-size: 11px;
  color: var(--dim);
  line-height: 1.5;
}
.empty-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(55,211,154,.55);
}

/* 底部备选 */
.plan-foot {
  border-top: 1px solid var(--line);
  padding: 11px 16px 13px;
  flex-shrink: 0;
  background: rgba(var(--shadow-rgb), .18);
}
.alt-head {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--dim);
  margin-bottom: 7px;
}
.alt-list { display: flex; flex-direction: column; gap: 5px; }
.alt-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(var(--ink-rgb), .02);
  cursor: pointer;
  transition: .16s;
}
.alt-item:hover { background: rgba(var(--ink-rgb), .06); border-color: var(--line-2); }
.alt-rank {
  width: 17px; height: 17px;
  border-radius: 5px;
  display: grid; place-items: center;
  font-size: 9.5px;
  font-family: var(--mono);
  background: rgba(var(--ink-rgb), .06);
  color: var(--muted);
  flex-shrink: 0;
}
.alt-item:nth-child(1) .alt-rank { background: rgba(55,211,154,.16); color: var(--green-bright); }
.alt-name { font-size: 12px; color: var(--text-2); flex: 1; }
.alt-score { font-size: 11px; font-family: var(--mono); color: var(--dim); }

/* ============ 弹层 ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--scrim);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: 82vh;
  overflow-y: auto;
  padding: 26px 28px;
  border-radius: 18px;
  background: linear-gradient(180deg, #131c26, #0d141b);
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px -20px #000;
  animation: cardIn .28s cubic-bezier(.22,1,.36,1);
}
.modal-card h2 { font-size: 17px; margin-bottom: 8px; }
.modal-card > p { font-size: 12.5px; color: var(--muted); }
.modal-card ol { margin: 14px 0; counter-reset: n; }
.modal-card li {
  position: relative;
  padding-left: 26px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 9px;
  counter-increment: n;
}
.modal-card li::before {
  content: counter(n);
  position: absolute;
  left: 0; top: 4px;
  width: 17px; height: 17px;
  border-radius: 5px;
  display: grid; place-items: center;
  font-size: 9.5px;
  font-family: var(--mono);
  background: rgba(55,211,154,.14);
  color: var(--green-bright);
}
.modal-card li b { color: var(--text); font-weight: 600; }
.modal-foot {
  font-size: 11px !important;
  color: var(--dim) !important;
  line-height: 1.7;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.modal-close {
  position: absolute; right: 14px; top: 12px;
  width: 26px; height: 26px;
  border: none; border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font-size: 18px; line-height: 1;
  display: grid; place-items: center;
}
.modal-close:hover { background: rgba(var(--ink-rgb), .08); color: var(--text); }

/* ============ 响应式 ============ */
@media (max-width: 1320px) {
  .layout { grid-template-columns: 268px minmax(0,1fr) 340px; }
  .spot-card { width: 276px; }
}

@media (max-width: 1120px) {
  body { overflow: auto; }
  .layout {
    grid-template-columns: 264px minmax(0, 1fr);
    grid-template-rows: minmax(420px, calc(100vh - 82px)) auto;
    height: auto;
  }
  .panel-config { grid-row: span 2; }
  .stage { grid-column: 2; grid-row: 1; }
  .panel-plan {
    grid-column: 1 / -1;
    grid-row: 2;
    max-height: none;
  }
  .plan-scroll { max-height: 460px; }
  .topbar-mid { display: none; }
}

@media (max-width: 780px) {
  html, body { overflow-x: hidden; overflow-y: auto; }
  .layout { width: 100%; }
  .layout {
    display: flex;
    flex-direction: column;
    height: auto;
    padding: 10px;
    gap: 10px;
  }
  .panel-config { order: 1; }
  .panel-scroll { max-height: none; }
  .stage { order: 2; }
  .map-wrap { height: 380px; flex: none; }
  .panel-plan { order: 3; }
  .spot-card { left: 8px; right: 8px; width: auto; bottom: 8px; }
  .map-legend { display: none; }
  .stage-title h1 { font-size: 20px; }
  .stage-foot { gap: 14px; padding: 0 12px; height: 48px; }
  .foot-note { display: none; }
  .brand-text span { display: none; }
}

/* =========================================================
 *  导出稿（#printSheet）：屏幕隐藏，仅打印时显示
 *  —— 导出 PDF 走浏览器打印面板「另存为 PDF」
 * ========================================================= */
#printSheet { display: none; }

#printSheet .ps-head {
  border-bottom: 2px solid #1b2430;
  padding-bottom: 10px;
  margin-bottom: 14px;
}
#printSheet .ps-brand {
  font-size: 10px;
  letter-spacing: .22em;
  color: #7b8794;
  text-transform: uppercase;
}
#printSheet h1 {
  font-size: 23px;
  line-height: 1.3;
  margin: 4px 0 6px;
  color: #10161d;
  letter-spacing: .01em;
}
#printSheet .ps-sub {
  font-size: 12.5px;
  color: #46515e;
}
#printSheet .ps-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  font-size: 11px;
  color: #46515e;
}
#printSheet .ps-meta b { color: #10161d; font-weight: 600; }
#printSheet .ps-intro {
  margin: 12px 0 4px;
  font-size: 11.5px;
  color: #46515e;
  line-height: 1.7;
}

#printSheet .ps-day {
  margin-top: 15px;
  padding-left: 10px;
  border-left: 2.5px solid #37a97c;
}
#printSheet .ps-day-head {
  font-size: 13px;
  font-weight: 700;
  color: #10161d;
  margin-bottom: 2px;
}
#printSheet .ps-day-sub {
  font-size: 10.5px;
  color: #7b8794;
  margin-bottom: 8px;
}
#printSheet .ps-item { margin-bottom: 9px; }
#printSheet .ps-item-time {
  font-size: 11px;
  font-weight: 700;
  color: #37a97c;
  font-variant-numeric: tabular-nums;
}
#printSheet .ps-item-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #10161d;
  margin-left: 6px;
}
#printSheet .ps-item-cat {
  font-size: 10px;
  color: #7b8794;
  margin-left: 6px;
}
#printSheet .ps-item-meta {
  font-size: 10.5px;
  color: #5b6672;
  margin: 1px 0 0 0;
}
#printSheet .ps-item-desc {
  font-size: 11px;
  color: #39424d;
  line-height: 1.65;
}
#printSheet .ps-item-tip {
  font-size: 10.5px;
  color: #8a6a3a;
  line-height: 1.6;
}
#printSheet .ps-move {
  font-size: 10px;
  color: #97a1ad;
  margin: 2px 0 2px;
  padding-left: 2px;
}
#printSheet .ps-empty {
  font-size: 11px;
  color: #97a1ad;
}
#printSheet .ps-alts {
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px solid #dfe4ea;
  font-size: 11px;
  color: #46515e;
}
#printSheet .ps-alts b { color: #10161d; }
#printSheet .ps-foot {
  margin-top: 16px;
  font-size: 9.5px;
  color: #8d97a3;
  line-height: 1.6;
}

@media print {
  @page { size: A4; margin: 13mm 12mm 14mm; }

  html, body {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
    background-image: none !important;
    color: #10161d;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .topbar, .layout, .modal { display: none !important; }

  #printSheet {
    display: block !important;
    font-family: var(--font);
    font-size: 11.5px;
    line-height: 1.62;
    color: #10161d;
  }

  /* 还没生成行程就打印：给一句提示，避免打出一张白纸 */
  #printSheet:empty::before {
    content: "还没有生成行程 —— 先在左侧点「生成我的攻略」，再导出或打印。";
    display: block;
    font-size: 13px;
    color: #46515e;
  }

  #printSheet .ps-day-head,
  #printSheet .ps-day-sub,
  #printSheet .ps-move,
  #printSheet .ps-item-name,
  #printSheet h1 { break-after: avoid; }
  #printSheet .ps-item,
  #printSheet .ps-move { break-inside: avoid; }
  #printSheet .ps-day + .ps-day { margin-top: 16px; }
}

/* =========================================================
 *  考古版新增：安全评估 / 行前清单 / 规则说明
 * ========================================================= */

/* 城市列表里「境外遗址」这个总标题 */
.city-group-label.lead {
  color: var(--text);
  letter-spacing: .16em;
}
.city-group-label.lead i {
  background: rgba(55,211,154,.16);
  color: var(--green-bright);
  border-radius: 4px;
  padding: 0 4px;
}

/* 左侧安全规则 */
.rule-list {
  margin: 2px 0 0;
  padding-left: 15px;
  font-size: 10.5px;
  color: var(--text-2);
  line-height: 1.78;
}
.rule-list li { list-style: disc; }
.rule-list li::marker { color: var(--dim); }
.rule-list b { color: var(--text); font-weight: 600; }

/* 弹层里的安全规则小节（原来在左栏，挪进来了） */
.modal-card .modal-rules-title {
  margin: 18px 0 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--text-2);
}
.modal-card .rule-list {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.72;
  margin-bottom: 14px;
}

/* 城市名下方的遗存统计 */
.stage-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.stage-stats .stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(var(--ink-rgb), .035);
  font-size: 10.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.stage-stats .stat i {
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: .06em;
  color: var(--dim);
}
.stage-stats .stat.grade { font-weight: 600; }
.stage-stats .stat.grade.safe {
  color: var(--green-bright); border-color: rgba(55,211,154,.36); background: rgba(55,211,154,.10);
}
.stage-stats .stat.grade.warn {
  color: #f2b34b; border-color: rgba(242,179,75,.36); background: rgba(242,179,75,.10);
}
.stage-stats .stat.grade.risk {
  color: var(--red-soft); border-color: rgba(242,96,107,.4); background: rgba(242,96,107,.12);
}

/* 每日安全徽章 */
.safe-badge {
  padding: 1px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.safe-badge.safe { background: rgba(55,211,154,.14); color: var(--green-bright); }
.safe-badge.warn { background: rgba(242,179,75,.14); color: #f2b34b; }
.safe-badge.risk { background: rgba(242,96,107,.16); color: var(--red-soft); }

/* 风险提示 */
.risk-list {
  margin: 0 0 12px 2px;
  padding-left: 15px;
  font-size: 11px;
  line-height: 1.72;
  color: var(--amber-soft);
}
.risk-list li { list-style: disc; }
.risk-list li::marker { color: #f2b34b; }
/* 作业提示：照做就行的防护，不算风险，用冷色区分 */
.tip-list {
  margin: -4px 0 12px 2px;
  padding-left: 15px;
  font-size: 10.5px;
  line-height: 1.68;
  color: #7f93a5;
}
.tip-list li { list-style: disc; }
.tip-list li::marker { color: #4f8fb8; }
.risk-none {
  margin: 0 0 12px 2px;
  font-size: 10.5px;
  color: var(--dim);
}

/* 行前清单（可折叠） */
.gear {
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
  margin-bottom: 10px;
}
.gear summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--dim);
  padding: 2px 0;
}
.gear summary::-webkit-details-marker { display: none; }
.gear summary span::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transition: transform .18s;
  color: var(--dim);
}
.gear[open] summary span::before { transform: rotate(90deg); }
.gear summary i { font-style: normal; color: var(--dim); }
.gear-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 168px;
  overflow-y: auto;
}
.gear-list li {
  font-size: 10.5px;
  line-height: 1.62;
  color: var(--text-2);
}
.gear-list li b {
  color: var(--text);
  font-weight: 600;
  margin-right: 6px;
}

/* ---------- 打印稿 ---------- */
#printSheet .ps-safe { font-weight: 700; font-size: 11px; }
#printSheet .ps-safe.safe { color: #2e8b62; }
#printSheet .ps-safe.warn { color: #9a6b18; }
#printSheet .ps-safe.risk { color: #a33b45; }
#printSheet .ps-risk {
  font-size: 10.5px;
  line-height: 1.6;
  color: #8a6a3a;
  margin: 1px 0 7px;
}
#printSheet .ps-tip {
  font-size: 10px;
  line-height: 1.55;
  color: #5f7a8e;
  margin: -5px 0 7px;
}
#printSheet .ps-gear {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid #dfe4ea;
  font-size: 11px;
  color: #46515e;
}
#printSheet .ps-gear ul { margin: 5px 0 0; padding-left: 15px; }
#printSheet .ps-gear li { margin-bottom: 3px; line-height: 1.6; }
#printSheet .ps-gear b { color: #10161d; }

@media print {
  #printSheet .ps-gear { break-inside: avoid; }
  #printSheet .ps-risk { break-after: avoid; }
  #printSheet .ps-tip { break-after: avoid; }
}

/* 日标签上的安全色点 */
.day-tab.safe i { background: #37d39a; opacity: 1; }
.day-tab.warn i { background: #f2b34b; opacity: 1; }
.day-tab.risk i { background: #f2606b; opacity: 1; }
