:root {
  /* 蓝色主调：醒目、高对比、移动端可读 */
  --bg: #f3f6fb;
  --panel: #ffffff;
  --border: #dfe5ee;
  --text: #1f2937;
  --text-dim: #6b7280;
  --accent: #2563eb;        /* 主蓝 */
  --accent-ink: #1d4ed8;    /* 深蓝 */
  --accent-2: #0ea5e9;      /* 亮蓝 */
  --accent-soft: #eff6ff;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(30, 40, 55, .10);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; height: 100dvh;
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
body { display: flex; flex-direction: column; overflow: hidden; }

/* ---------- 顶栏 ---------- */
.topbar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--border);
  gap: 10px; min-height: 50px;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { color: var(--accent); font-size: 16px; }
.brand-title { font-weight: 700; letter-spacing: .2px; font-size: 15px; }
.brand-meta { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.meta-label { color: var(--text-dim); font-size: 12px; }
.meta-value { font-size: 18px; font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.admin-link {
  border: 1px solid var(--border); background: var(--bg); color: var(--text-dim);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.admin-link:hover { color: var(--accent-ink); border-color: var(--accent); }

/* ---------- 布局 ---------- */
.layout { flex: 1 1 auto; display: flex; min-height: 0; position: relative; }
.map-wrap { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; }
#map { position: absolute; inset: 0; background: #e5e9ef; }

/* ---------- 侧栏 ---------- */
.sidebar {
  flex: 0 0 360px; width: 360px; background: var(--bg);
  border-left: 1px solid var(--border); display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar-handle { display: none; }
.sidebar-scroll {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 14px;
  display: flex; flex-direction: column; gap: 14px;
}

/* ---------- 面板通用 ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
.panel-title {
  margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--text-dim);
  letter-spacing: .8px; text-transform: uppercase;
}
.panel-sub { margin: 0 0 12px; font-size: 12px; color: var(--text-dim); }
.form-hint { margin: 8px 0 0; font-size: 12px; color: var(--text-dim); text-align: center; }
.link-like {
  background: none; border: none; color: var(--accent-ink); font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline;
}
.link-like:hover { color: var(--accent); }

/* ---------- 访客面板（置顶） ---------- */
.visitor-panel { border-top: 3px solid var(--accent); }
.entry-form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text); }
.field-label em { color: var(--accent); font-style: normal; }
.field-hint { font-size: 11px; color: var(--accent-2); min-height: 14px; }
.input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); padding: 10px 12px; font-size: 15px;
  outline: none; transition: border-color .15s, box-shadow .15s; line-height: 1.4;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.input::placeholder { color: #9ca3af; }

/* 自定义院校下拉 */
.uni-field { position: relative; z-index: 10; }
.suggest-box {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
  max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(30,40,55,.18); z-index: 20;
}
.suggest-item {
  padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover, .suggest-item.active { background: var(--accent-soft); }
.suggest-name { font-size: 14px; color: var(--text); font-weight: 600; }
.suggest-city { font-size: 11px; color: var(--text-dim); }

.btn {
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  border-radius: 10px; padding: 10px 14px; font-size: 14px; cursor: pointer; transition: .15s; line-height: 1.4;
}
.btn:hover { border-color: var(--accent); }
.btn-primary {
  width: 100%; margin-top: 2px; background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: transparent; color: #fff; font-weight: 700; letter-spacing: .4px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary.is-locked { opacity: .75; cursor: progress; }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--accent-ink); }
.btn-sm { padding: 5px 10px; font-size: 12px; width: auto; }
.btn-del-mine { color: var(--danger); border-color: rgba(220,38,38,.35); }
.btn-del-mine:hover { background: rgba(220,38,38,.10); border-color: var(--danger); }

/* 提交进度 */
.entry-progress { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.spinner {
  width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { flex: 1 1 auto; height: 4px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .4s ease; }

/* 成功态 */
.entry-done {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--accent-soft); border: 1px solid rgba(37,99,235,.25); border-radius: 10px;
}
.done-check {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.done-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.done-text strong { font-size: 13px; color: var(--accent-ink); }
.done-text span { font-size: 12px; color: var(--text-dim); }

/* 我的信息 */
.mine-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mine-badge {
  font-size: 12px; font-weight: 700; color: #fff; background: var(--accent-2);
  border-radius: 999px; padding: 3px 10px; letter-spacing: .5px;
}
.mine-loc {
  font-size: 12px; color: var(--accent-2); background: var(--accent-soft); border: 1px solid #bfdbfe;
  border-radius: 8px; padding: 6px 10px; margin-bottom: 6px;
}
.mine-loc.pending { color: var(--text-dim); background: var(--bg); border-color: var(--border); }

/* ---------- 检索 ---------- */
.search-row { display: flex; gap: 8px; }
.search-row .input { flex: 1 1 auto; }
.result-list {
  list-style: none; margin: 10px 0 0; padding: 0; max-height: 220px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.result-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; transition: .15s;
}
.result-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.result-text { min-width: 0; }
.result-name { font-weight: 600; color: var(--text); }
.result-name .arrow { color: var(--accent); margin: 0 4px; }
.result-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.result-empty { margin-top: 10px; color: var(--text-dim); font-size: 12px; }

/* ---------- 统计 ---------- */
.collapser {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: transparent; border: none; color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; padding: 0;
}
.collapser .caret { color: var(--accent); transition: transform .2s; }
.stats-body.collapsed { display: none; }
.stats-body { margin-top: 10px; }
.stats-group + .stats-group { margin-top: 14px; }
.stats-group-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.stats-total { font-weight: 700; color: var(--accent-2); }
.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bar-item { cursor: pointer; }
.bar-row { width: 100%; display: flex; justify-content: space-between; align-items: center; background: transparent; border: none; padding: 0; cursor: pointer; font-size: 13px; color: var(--text); }
.bar-label { font-weight: 600; }
.bar-count { font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 999px; transition: width .4s ease; }
.bar-names { list-style: none; margin: 6px 0 0; padding: 6px 0 0 2px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 3px; }
.bar-names li { font-size: 12px; color: var(--text-dim); }
.bar-item.open .bar-fill { background: linear-gradient(90deg, #3b82f6, #1d4ed8); }
.stats-pending { margin-top: 12px; font-size: 12px; color: var(--accent-2); }

/* ---------- 热力图开关 ---------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; }
.switch-label { font-size: 14px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background .2s; }
.slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s, background .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------- 地图浮层 ---------- */
.heat-legend {
  position: absolute; left: 12px; bottom: 56px; z-index: 500; background: rgba(255,255,255,.94);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; color: var(--text-dim); backdrop-filter: blur(4px);
}
.legend-title { color: var(--text); font-weight: 600; }
.legend-bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(96,165,250,.4), rgba(29,78,216,.95)); }

/* 回到全国视图按钮（替代旧版导出） */
.reset-view-btn {
  position: absolute; right: 12px; bottom: 12px; z-index: 500; background: #fff; border: 1px solid var(--accent);
  color: var(--accent-ink); border-radius: 999px; padding: 9px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow); transition: .15s; white-space: nowrap;
}
.reset-view-btn:hover { background: var(--accent); color: #fff; }

/* 截图模式按钮 */
.poster-btn {
  position: absolute; right: 12px; bottom: 52px; z-index: 500;
  background: #fff; border: 1px solid var(--accent); color: var(--accent-ink);
  border-radius: 999px; padding: 9px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow); transition: .15s;
}
.poster-btn:hover { background: var(--accent); color: #fff; }

/* 截图小贴士面板 */
.tip-panel .tip-text { font-size: 12px; color: var(--text-dim); margin: 0 0 10px; line-height: 1.6; }
.tip-panel .btn { width: 100%; }

/* ---------- 录入成功弹窗 ---------- */
.success-modal {
  position: fixed; inset: 0; z-index: 1200; background: rgba(30,40,55,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(2px);
}
.success-card {
  width: 100%; max-width: 340px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 20px 50px rgba(30,40,55,.28); padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.success-title { font-size: 17px; font-weight: 800; color: var(--accent-ink); display: flex; align-items: center; gap: 6px; }
.success-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; }
.sr-label { color: var(--text-dim); flex: 0 0 auto; }
.sr-value { color: var(--text); font-weight: 600; text-align: right; word-break: break-all; }
.success-card .btn-primary { margin-top: 4px; }

/* ---------- 空状态 ---------- */
.map-empty { position: absolute; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; background: rgba(243,246,251,.72); pointer-events: none; }
.empty-inner { text-align: center; color: var(--text-dim); }
.empty-icon { font-size: 42px; color: var(--accent); margin-bottom: 10px; }
.empty-inner p { margin: 4px 0; }
.empty-sub { font-size: 12px; }

/* ---------- Leaflet 弹窗 ---------- */
.leaflet-popup-content-wrapper { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.leaflet-popup-tip { background: var(--panel); border: 1px solid var(--border); }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--sans); }
.popup-name { font-weight: 700; font-size: 14px; color: var(--text); }
.popup-name .dot { color: var(--accent); margin: 0 4px; }
.popup-meta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.popup-meta.pending { color: var(--accent-2); }
.popup-expand { margin-top: 8px; background: transparent; border: none; color: var(--accent-ink); font-size: 12px; cursor: pointer; padding: 0; }
.popup-detail { margin-top: 6px; font-size: 12px; color: var(--text-dim); display: flex; flex-direction: column; gap: 2px; }
.popup-actions { margin-top: 8px; display: flex; gap: 8px; }
.popup-edit, .popup-del { flex: 1; border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px; font-size: 12px; cursor: pointer; }
.popup-edit { background: var(--bg); color: var(--accent-ink); }
.popup-edit:hover { border-color: var(--accent); }
.popup-del { background: transparent; color: var(--danger); }
.popup-del:hover { background: rgba(220,38,38,.12); }

/* ---------- 编辑弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 1100; background: rgba(30,40,55,.4); display: grid; place-items: center; padding: 16px; }
.modal-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 20px 50px rgba(30,40,55,.25); padding: 16px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 12px; }
.modal-close { border: none; background: transparent; color: var(--text-dim); font-size: 16px; cursor: pointer; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 1000;
  padding: 10px 18px; border-radius: 9px; font-size: 13px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); box-shadow: 0 8px 24px rgba(40,55,80,.18);
}
.toast.ok { border-color: var(--accent); color: var(--accent-ink); }
.toast.err { border-color: var(--danger); color: var(--danger); }

/* ---------- 名字标记（替换蓝点） ---------- */
.mk-wrap { background: transparent; border: none; width: 150px; height: 24px; display: flex; align-items: center; justify-content: center; pointer-events: auto; }
.mk-label {
  display: inline-block; white-space: nowrap; max-width: 220px; overflow: visible;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; line-height: 1;
  padding: 4px 8px; border-radius: 999px; box-shadow: 0 3px 10px rgba(30,40,55,.28);
  border: 2px solid #fff;
}
.mk-wrap:hover .mk-label { background: var(--accent-ink); }
.mk-seq .mk-label { background: var(--accent-2); font-size: 12px; padding: 3px 7px; }

/* ---------- 城市聚合气泡 ---------- */
.mk-cluster { width: auto !important; height: auto !important; }
.mk-cluster .mk-label {
  font-size: 13px; padding: 6px 14px; border-radius: 999px;
  background: var(--accent-ink); border-width: 3px;
  box-shadow: 0 4px 16px rgba(29,78,216,.35);
  cursor: zoom-in;
  display: inline-flex; align-items: baseline; gap: 6px;
}
.mk-cluster:hover .mk-label { background: #1e3a8a; transform: scale(1.06); }
.mk-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}

/* ---------- 高缩放详细标签（院校·学生）---------- */
.mk-detail .mk-label {
  display: inline-flex; align-items: baseline; gap: 3px;
  background: #fff; color: #2a4a3a; font-weight: 600;
  border: 1.5px solid rgba(60, 50, 40, 0.25);
  font-size: 11px; padding: 3px 8px; border-radius: 10px;
  white-space: nowrap;
}
.mk-detail:hover .mk-label { background: #faf6ed; border-color: var(--accent); }
.mk-uni { color: #6a5a4a; font-size: 10px; }
.mk-dot { color: #b09080; font-weight: 700; font-size: 10px; }
.mk-sname { color: #2a4a3a; font-weight: 700; }

/* ---------- PC 端折叠侧栏 ---------- */
.sidebar-toggle {
  position: absolute; top: 12px; right: 12px; z-index: 600;
  background: #fff; border: 1px solid var(--accent); color: var(--accent-ink);
  border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow); transition: .15s; white-space: nowrap;
}
.sidebar-toggle:hover { background: var(--accent); color: #fff; }
.sidebar {
  transition: margin-right .22s ease-out, height .22s ease-out;
}
.sidebar.pc-collapsed { margin-right: -360px; }

/* ---------- 静态导出模式：隐藏仅服务端功能 ---------- */
html.static-mode .visitor-panel,
html.static-mode .admin-link,
html.static-mode .popup-actions,
html.static-mode .popup-del,
html.static-mode .popup-edit,
html.static-mode .result-del { display: none; }

/* ---------- 全局 [hidden] 兜底（防止 .entry-form{display:flex} 覆盖 UA 默认 [hidden]{display:none}） ---------- */
[hidden] { display: none !important; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 移动端优先适配 ---------- */
@media (max-width: 860px) {
  .topbar { padding: 8px 12px; min-height: 44px; }
  .brand-title { font-size: 13px; white-space: normal; line-height: 1.3; }
  .meta-label { display: none; }
  .meta-value { font-size: 15px; }
  /* 移动端用底部抽屉，隐藏 PC 折叠按钮 */
  .sidebar-toggle { display: none; }
  .sidebar.pc-collapsed { margin-right: 0; }

  .layout { flex-direction: column; }
  .map-wrap { flex: 1 1 38%; min-height: 38%; }

  .sidebar {
    position: relative; flex: 0 0 auto; width: 100%; border-left: none; border-top: 1px solid var(--border);
    height: 72vh; transition: height .22s ease-out; background: #fff; z-index: 50;
  }
  .sidebar.mobile-collapsed {
    height: 48px;
  }
  .sidebar.full {
    height: calc(100dvh - 44px);
  }
  .sidebar-scroll {
    display: flex; padding: 12px; gap: 12px; padding-bottom: calc(14px + env(keyboard-inset-height, 0px));
  }
  .sidebar.mobile-collapsed .sidebar-scroll { display: none; }

  .sidebar-handle {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 8px; cursor: pointer; border-bottom: 1px solid var(--border);
    background: #fff; min-height: 48px;
  }
  .handle-bar { width: 36px; height: 4px; background: #cbd5e1; border-radius: 4px; }
  .handle-label { font-size: 11px; color: var(--text-dim); }

  .sidebar-backdrop {
    display: none; position: absolute; inset: 0; background: rgba(0,0,0,.15); z-index: 40;
  }
  .sidebar.mobile-collapsed ~ .sidebar-backdrop { display: none; }
  .sidebar:not(.mobile-collapsed) ~ .sidebar-backdrop { display: block; }

  .reset-view-btn { right: 8px; bottom: 56px; padding: 8px 12px; }
  .heat-legend { left: 8px; bottom: 56px; }

  /* 输入法遮挡：输入框聚焦时面板滚动可用 */
  .input { font-size: 16px; } /* 防止 iOS 缩放 */
  .suggest-box { max-height: 180px; }
}

/* ---------- 截图模式 · 毕业海报（仿师大附中风格：粉底+城市浮卡） ---------- */
.poster-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: #2a1f2a; /* 暗色画框 */
  display: flex; flex-direction: column;
}
.poster-close-bar {
  flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center;
  padding: 6px 16px; background: rgba(255,255,255,0.06);
  color: #ddd;
}
.poster-close-btn {
  border: 1px solid #888; background: rgba(255,255,255,0.08); color: #eee;
  border-radius: 999px; padding: 5px 14px; font-size: 12px; cursor: pointer;
}
.poster-close-btn:hover { background: rgba(255,255,255,0.18); }
.poster-edit-btn, .poster-save-btn {
  border: 1px solid #ffa; background: rgba(255,255,200,0.15); color: #ffd;
  border-radius: 999px; padding: 5px 14px; font-size: 12px; cursor: pointer;
}
.poster-edit-btn:hover, .poster-save-btn:hover { background: rgba(255,255,200,0.3); }
/* 编辑模式下卡片可拖拽 */
.pc-card-absolute.editing { pointer-events: auto !important; cursor: grab; }
.pc-card-absolute.editing:active { cursor: grabbing; }
.poster-hint { font-size: 11px; color: #ccc; }
.poster-hint b { color: #ffd0a0; }

/* 海报画布：铺满剩余空间，粉色调 */
.poster-canvas {
  flex: 1 1 auto; position: relative; overflow: hidden;
  background:
    /* 顶部柔和的米色渐变（让标题更可读） */
    linear-gradient(180deg, rgba(255,250,240,0.55) 0%, rgba(255,250,240,0) 12%),
    /* 整体粉色 */
    linear-gradient(135deg, #f0d4ce 0%, #ecc7c0 50%, #e8b8b3 100%);
  min-height: 0;
}
/* 地图层（放大版，padding 减小让地图占更多空间） */
.poster-map-stage {
  position: absolute; inset: 24px 8px 20px 8px;
  border-radius: 4px;
  overflow: hidden;
  /* 给地图一个柔和的边框 */
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}
#poster-map { position: absolute; inset: 0; background: transparent; }
.poster-map-stage .leaflet-control-zoom,
.poster-map-stage .leaflet-control-attribution { display: none !important; }
.poster-map-stage .leaflet-tile-pane {
  /* 让底图整体偏淡，融入粉色背景 */
  filter: sepia(0.35) saturate(0.85) hue-rotate(-8deg) brightness(1.08);
  opacity: 0.85;
}

/* 标题（左上） */
.poster-title {
  position: absolute; top: 18px; left: 36px; z-index: 2002;
  display: flex; align-items: baseline; gap: 8px;
  color: #2c4a3a;
  font-family: 'STKaiti','KaiTi','Noto Serif SC','Songti SC', serif;
  pointer-events: none;
}
.pt-class { font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.pt-type { font-size: 18px; font-weight: 500; letter-spacing: 4px; color: #5a4a3a; }

/* 落款（右下） */
.poster-sign {
  position: absolute; bottom: 18px; right: 36px; z-index: 10;
  font-size: 11px; color: #6a5a4a; letter-spacing: 2px;
  font-family: 'STKaiti','KaiTi','Noto Serif SC', serif;
  pointer-events: none;
}

/* 四角装饰小图（仿水印感） */
.poster-corner {
  position: absolute; width: 22px; height: 22px; z-index: 5;
  border-color: rgba(80, 60, 50, 0.25);
  border-style: solid; border-width: 0;
  pointer-events: none;
}
.poster-corner-tl { top: 12px; left: 12px; border-top-width: 1.5px; border-left-width: 1.5px; }
.poster-corner-tr { top: 12px; right: 12px; border-top-width: 1.5px; border-right-width: 1.5px; }
.poster-corner-bl { bottom: 12px; left: 12px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.poster-corner-br { bottom: 12px; right: 12px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

/* ============ 海报省份浮卡（优化版）============ */
.pc-card-absolute {
  position: absolute;
  background: rgba(255, 252, 246, 0.98);
  border: 1px solid rgba(140, 120, 100, 0.25);
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(60, 40, 30, 0.12);
  font-family: 'PingFang SC','Microsoft YaHei', sans-serif;
  text-align: left;
  pointer-events: none;
  white-space: nowrap;
  z-index: 600;
  left: 0; top: 0;
  width: var(--pc-w, 140px);
  height: var(--pc-h, 72px);
  font-size: var(--pc-fs, 10px);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  box-sizing: border-box;
  padding: 5px 8px;
  line-height: 1.25;
}
.pc-card-absolute .pc-card-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.pc-prov-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1.5px solid rgba(100, 80, 60, 0.18);
  padding-bottom: 2px;
  margin-bottom: 2px;
  flex: 0 0 auto;
}
.pc-prov-name {
  font-size: 1.2em;
  font-weight: 800;
  color: #2a4a3a;
  letter-spacing: 1.5px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-prov-count {
  background: rgba(42, 74, 58, 0.12);
  color: #3a5a4a;
  border-radius: 8px;
  padding: 0 7px;
  font-size: 0.85em;
  font-weight: 700;
  flex: 0 0 auto;
  margin-left: 6px;
}
.pc-students {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  flex: 1 1 auto;
  overflow: hidden;
}
.pc-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 0.95em;
  color: #3a3025;
  line-height: 1.3;
  white-space: normal;
  word-break: break-all;
  overflow: hidden;
  width: 100%;
}
.pc-row.pc-more {
  color: #8a7a6a;
  font-size: 0.85em;
  font-style: italic;
  justify-content: center;
}
.pc-uni {
  color: #6a5a4a;
  flex: 0 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-dot {
  color: #b09080;
  flex: 0 0 auto;
  font-weight: 700;
}
.pc-name {
  color: #2c2418;
  font-weight: 600;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 竖屏：旋转 90° + 等比缩放（字体由 JS 统一控制） */
@media (orientation: portrait), (max-width: 500px) {
  .poster-overlay { overflow: hidden; }
  .poster-close-bar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 2001;
    background: rgba(0,0,0,0.35);
  }
  .poster-canvas {
    position: absolute;
    top: 50%; left: 50%;
    width: calc(100vw * 16 / 9);
    height: 100vw;
    transform: translate(-50%, -50%) rotate(90deg);
    flex: none !important;
    overflow: hidden;
  }
}

/* 移动端：地图按钮不重叠 */
@media (max-width: 860px) {
  .reset-view-btn { right: 8px; bottom: 56px; }
  .heat-legend { left: 8px; bottom: 56px; }
  .poster-btn { right: auto; left: 12px; bottom: 12px; }
}

@media (max-width: 360px) {
  .brand-title { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner, .bar-fill, .progress-fill, .sidebar, .sidebar-scroll { animation: none; transition: none; }
}

/* 空省占位卡 */
.pc-card-inner.pc-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; min-height: 22px;
}
.pc-card-inner.pc-empty .pc-prov-name { color: #aaa; font-size: 0.9em; }

/* 班级选择器 */
.class-selector-wrap { display: inline-flex; align-items: center; margin: 0 8px; }
.class-select {
  padding: 3px 8px; border: 1px solid var(--border);
  border-radius: 5px; font-size: 13px; background: #fff;
  cursor: pointer; font-family: inherit;
}
.class-select:focus { outline: none; border-color: var(--accent); }
