/* ===========================================================================
   南明史 · 时空图谱 —— 样式
   ---------------------------------------------------------------------------
   只有一套配色：白底、深墨字、DeepSeek 蓝作强调色。
   地图 canvas 用的颜色在 assets/app.js 的 PALETTE 里，改动时两边要一致。
   ======================================================================== */

:root {
  --bg:        #ffffff;
  --bg2:       #f8fafc;
  --bg3:       #f1f5f9;
  --bg4:       #e2e8f0;
  --line:      #dbe3ec;
  --line-soft: #eaeff5;

  --accent:      #4d6bfe;
  --accent-dim:  #3b5bdb;
  --accent-soft: #eef2ff;
  --accent-glow: rgba(77, 107, 254, .14);

  --text:      #1a2b4a;
  --text2:     #54637a;
  --text3:     #8a97a8;

  --radius:    6px;
  --mono:      ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  --shadow:    0 1px 2px rgba(16,32,64,.06), 0 4px 14px rgba(16,32,64,.05);
  --panel-head-bg: #f7f9fc;
  --side-w:    356px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
               sans-serif;
  font-size: 13px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 主区 + 右侧栏并排。最右一列拆两行：侧栏占满剩余高度，页脚（备案）固定在下。
   页脚放在 .app 这一层而不是 .side 里面 —— 否则会被侧栏的滚动容器卷走。 */
.app {
  display: grid;
  grid-template-columns: 1fr var(--side-w);
  grid-template-rows: 1fr auto;
  height: 100%; width: 100%;
}
.app-main { grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* ── 顶栏 ─────────────────────────────────────────────────────────────── */
.topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand-title { font-size: 17px; font-weight: 600; letter-spacing: .06em; color: var(--text); }
.brand-title::before {
  content: ''; display: inline-block; width: 4px; height: 15px;
  background: var(--accent); border-radius: 2px;
  margin-right: 9px; vertical-align: -2px;
}
.brand-sub { font-size: 11.5px; color: var(--text3); margin-top: 2px; padding-left: 13px; }
.brand-sub b { color: var(--accent); font-weight: 600; font-family: var(--mono); }
.topbar-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.btn {
  background: var(--bg); color: var(--text2); border: 1px solid var(--line);
  padding: 6px 13px; border-radius: var(--radius); cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 500;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── 势力筛选条 ───────────────────────────────────────────────────────── */
.faction-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 18px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
}
.ctl-label {
  font-size: 11.5px; color: var(--text3); font-weight: 500;
  letter-spacing: .06em; flex: 0 0 auto;
}
.legend { display: flex; flex-wrap: wrap; gap: 5px; flex: 1 1 auto; min-width: 0; }
.legend-item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; cursor: pointer;
  font-size: 11.5px; color: var(--text2);
  border: 1px solid var(--line); background: var(--bg);
  transition: background .15s, border-color .15s, opacity .15s; user-select: none;
}
.legend-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.legend-item .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.legend-item .n { font-family: var(--mono); font-size: 10px; color: var(--text3); }
.legend-item.off { opacity: .38; }
.legend-item.off .dot { background: var(--text3) !important; }
.legend-item.off .lbl { text-decoration: line-through; }

.search {
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  padding: 5px 12px; border-radius: var(--radius); font-family: inherit;
  font-size: 12.5px; width: 210px; flex: 0 0 auto; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search::placeholder { color: var(--text3); }

/* ── 地图 ─────────────────────────────────────────────────────────────── */
.map-wrap {
  flex: 1 1 auto; position: relative; min-height: 160px;
  background: #dbe6f3; overflow: hidden;
}
#map { display: block; width: 100%; height: 100%; cursor: grab; }
#map.dragging { cursor: grabbing; }

.map-tools { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 5px; }
.tool {
  width: 30px; height: 30px; border-radius: var(--radius);
  background: var(--bg); color: var(--text2);
  border: 1px solid var(--line); cursor: pointer;
  font-size: 15px; line-height: 1; display: grid; place-items: center;
  box-shadow: var(--shadow); transition: background .15s, color .15s, border-color .15s;
}
.tool:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* 地图左上角：当前年份 + 在场势力 */
.map-topbar {
  position: absolute; top: 12px; left: 54px;
  display: flex; align-items: center; gap: 10px;
  max-width: calc(100% - 242px);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 5px 12px;
  box-shadow: var(--shadow);
}
.mt-year {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  color: var(--accent); letter-spacing: .02em; flex: 0 0 auto;
}
.mt-year.all { font-size: 13px; }
.mt-factions {
  font-size: 11.5px; color: var(--text2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mt-factions .fdot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 4px; vertical-align: 0;
}
.mt-factions .fitem { margin-right: 10px; white-space: nowrap; }

/* 图层开关：右上角 */
.map-layers {
  position: absolute; top: 12px; right: 12px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 11px;
  display: flex; flex-direction: column; gap: 5px;
  box-shadow: var(--shadow); max-width: 168px;
  max-height: calc(100% - 62px); overflow-y: auto;
}
.layer-title {
  font-size: 11px; color: var(--text3); font-weight: 600;
  letter-spacing: .1em; padding-bottom: 5px;
  border-bottom: 1px solid var(--line-soft); margin-bottom: 1px;
}
.layer-div { height: 1px; background: var(--line-soft); margin: 4px 0; }
.layer-legend { display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.ll-row { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text3); line-height: 1.3; }
.ll-size { display: inline-flex; align-items: center; gap: 1.5px; height: 14px; }
.ll-size i { display: block; border-radius: 50%; background: var(--text3); opacity: .8; }
.ll-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

/* ── 浮动详情面板（像 PS 的浮动小面板，浮在地图左侧，不挡看地图） ─────── */
.float-panel {
  position: absolute; top: 62px; left: 12px;
  width: 320px; min-width: 240px; max-width: 560px;
  max-height: calc(100% - 82px);
  display: none; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 30px rgba(16,32,64,.16), 0 1px 3px rgba(16,32,64,.08);
  overflow: hidden; z-index: 30;
}
.float-panel.open { display: flex; }
.fp-head {
  flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; padding: 10px 12px 9px;
  border-bottom: 1px solid var(--line-soft); background: var(--panel-head-bg);
  cursor: grab;
}
.fp-head:active { cursor: grabbing; }
.fp-title { font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: .03em; }
.fp-sub { font-size: 11px; color: var(--text3); font-family: var(--mono); margin-top: 1px; }
.fp-close {
  flex: 0 0 auto; background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 4px;
}
.fp-close:hover { color: var(--accent); background: var(--accent-soft); }
.fp-body { flex: 1 1 auto; overflow-y: auto; padding: 10px 14px 16px; }
/* 右下角拖拽调大小 */
.fp-resize {
  position: absolute; right: 0; bottom: 0; width: 16px; height: 16px;
  cursor: nwse-resize; z-index: 2;
  background: linear-gradient(135deg, transparent 48%, var(--bg4) 48%, var(--bg4) 62%, transparent 62%,
                                        transparent 70%, var(--bg4) 70%, var(--bg4) 84%, transparent 84%);
}
.fp-resize:hover { background-color: var(--accent-soft); }

.map-scale {
  position: absolute; bottom: 10px; left: 12px;
  font-family: var(--mono); font-size: 10.5px; color: var(--text2);
  background: var(--bg); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: var(--radius);
}
.zoom-hint {
  position: absolute; bottom: 10px; right: 12px;
  max-width: 420px; text-align: right;
  font-size: 11.5px; color: var(--text3);
  background: var(--bg); border: 1px solid var(--line);
  padding: 3px 11px; border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: opacity .5s; pointer-events: none;
}
.zoom-hint.hide { opacity: 0; }

/* ── 时间轴 ───────────────────────────────────────────────────────────── */
.timeline-wrap {
  flex: 0 0 auto; position: relative;
  background: var(--bg2); border-top: 1px solid var(--line);
}
#timeline { display: block; width: 100%; height: 86px; cursor: crosshair; }
.tl-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px 8px;
}
.btn.play { min-width: 88px; }
.btn.step { padding: 5px 11px; font-size: 15px; line-height: 1; }
.tl-year {
  font-family: var(--mono); font-size: 21px; font-weight: 600;
  color: var(--text); min-width: 64px; text-align: center;
  letter-spacing: .02em;
}
.tl-year.all { font-size: 15px; color: var(--accent); min-width: 104px; }
.tl-readout { font-size: 11.5px; color: var(--text3); margin-left: 4px; }
.tl-tip {
  position: absolute; pointer-events: none; opacity: 0;
  background: var(--text); border-radius: var(--radius);
  padding: 3px 9px; font-size: 11px;
  font-family: var(--mono); color: #fff; white-space: nowrap;
  transition: opacity .12s; z-index: 20;
}

/* ── 右侧栏：只有四个统计板块，没有页签、没有总标题 ────────────────────── */
.side {
  grid-column: 2; grid-row: 1;
  flex: 0 0 var(--side-w); width: var(--side-w);
  display: flex; flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--line);
  min-height: 0; position: relative;
}

/* ── 侧栏页脚（备案 + 免责声明入口） ──────────────────────────────────── */
.side-foot {
  grid-column: 2; grid-row: 2;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 10px;
  font-size: 11px; line-height: 1.5;
  color: var(--text3);
  background: var(--bg);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line-soft);
  white-space: nowrap; overflow: hidden;
}
.sf-link {
  border: none; background: none; padding: 0;
  font: inherit; color: var(--text3);
  cursor: pointer; text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.sf-link:hover { color: var(--accent); }
.sf-sep { color: var(--line); }
.sf-beian a { color: inherit; text-decoration: none; }
.sf-beian a:hover { color: var(--accent); text-decoration: underline; }
/* 左侧边缘：按住左右拖可调宽 */
.side-resize {
  position: absolute; left: -3px; top: 0; bottom: 0; width: 7px;
  cursor: col-resize; z-index: 5;
}
.side-resize:hover, .side-resize.active { background: var(--accent-glow); }
body.resizing { cursor: col-resize; user-select: none; }
.pane-body { flex: 1 1 auto; overflow-y: auto; padding: 10px 12px 24px; }

.side-block { margin-top: 10px; }
.sb-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 4px; font-size: 12px; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--line-soft);
}
.sb-head > span:first-child::before {
  content: ''; display: inline-block; width: 3px; height: 11px;
  background: var(--accent); border-radius: 2px;
  margin-right: 7px; vertical-align: -1px;
}
.sb-title { display: flex; align-items: center; }
.sb-tools { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.sb-body { padding: 6px 2px 2px; }

/* 折叠块 */
.collapsible > .sb-head { cursor: pointer; user-select: none; }
.collapsible > .sb-head:hover .sb-title { color: var(--accent); }
.caret {
  display: inline-block; width: 13px; color: var(--text3);
  font-size: 10px; transition: transform .15s;
}
.collapsible.closed .caret { transform: rotate(-90deg); }
.collapsible.closed > .sb-body { display: none; }

/* "显示 N 条"输入框 */
.limit-input {
  width: 50px; padding: 2px 5px; text-align: right;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg); color: var(--text);
  font-family: var(--mono); font-size: 11px; outline: none;
}
.limit-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.limit-label { font-size: 10.5px; color: var(--text3); }

/* 条形统计 */
.bar-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 8px; padding: 3px 5px; cursor: pointer; border-radius: 4px;
  transition: background .12s;
}
.bar-row:hover { background: var(--accent-soft); }
.bar-label { font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label .swatch {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.bar-n { font-family: var(--mono); font-size: 11px; color: var(--text3); }
.bar-track { grid-column: 1 / -1; height: 3px; background: var(--bg4); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; }

/* 事件年表 */
.log-item {
  display: grid; grid-template-columns: 74px 1fr; gap: 9px;
  padding: 5px 6px; border-radius: 4px; cursor: pointer;
  border-left: 2px solid transparent; transition: background .12s, border-color .12s;
}
.log-item:hover { background: var(--accent-soft); border-left-color: var(--accent); }
.log-item .t { font-family: var(--mono); font-size: 11px; color: var(--text3); padding-top: 1px; }
.log-item .e { font-size: 12px; color: var(--text2); }
.log-item .e .meta { color: var(--text3); font-size: 11px; }
.log-item .e mark { background: #fef3c7; color: #92400e; padding: 0 2px; border-radius: 2px; }


.dw-head { border-bottom: 1px solid var(--line); padding-bottom: 11px; margin-bottom: 12px; }
.dw-title { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: .03em; }
.dw-sub { font-size: 11.5px; color: var(--text3); margin-top: 3px; font-family: var(--mono); }
.dw-precision {
  display: inline-block; margin-top: 8px; font-size: 10.5px; padding: 2px 9px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--text3); background: var(--bg3);
}
.dw-precision.exact { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.dw-precision.approx { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.dw-precision.area { color: #3730a3; border-color: #c7d2fe; background: #eef2ff; }
.dw-section { margin: 14px 0 7px; font-size: 11px; font-weight: 600; color: var(--text3); letter-spacing: .1em; }
.dw-ev {
  padding: 6px 0 6px 11px; border-left: 2px solid var(--line);
  margin-bottom: 4px; font-size: 12px; color: var(--text2);
}
.dw-ev .dt { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.dw-ev .df { font-size: 11px; color: var(--text3); margin-top: 1px; }
.dw-fact { font-size: 12.5px; color: var(--text2); }

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

/* ── 弹窗 ─────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: none; place-items: center; z-index: 60; backdrop-filter: blur(2px);
}
.modal.open { display: grid; }
.modal-box {
  width: min(740px, 90vw); max-height: 84vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 26px 30px; position: relative;
  box-shadow: 0 12px 40px rgba(16,32,64,.18);
}
.modal-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; color: var(--text3); cursor: pointer; font-size: 16px;
}
.modal-close:hover { color: var(--accent); }
.modal-box h2 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.modal-box h3 {
  font-size: 13px; font-weight: 600; color: var(--accent);
  margin: 20px 0 7px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.modal-box h3:first-of-type { border-top: none; padding-top: 0; }
.modal-box p { font-size: 12.5px; color: var(--text2); margin-bottom: 8px; }
.modal-box ul { margin: 0 0 9px 20px; }
.modal-box li { font-size: 12.5px; color: var(--text2); margin-bottom: 4px; }
.modal-box code {
  font-family: var(--mono); font-size: 11.5px; color: var(--accent);
  background: var(--accent-soft); padding: 1px 6px; border-radius: 4px;
}
.modal-box table { width: 100%; border-collapse: collapse; margin-bottom: 9px; }
.modal-box th, .modal-box td {
  text-align: left; font-size: 12px; padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--line-soft); color: var(--text2);
}
.modal-box th { color: var(--text3); font-weight: 500; width: 34%; }
.modal-box.wide { width: min(900px, 92vw); }

/* ── 免责声明 ─────────────────────────────────────────────────────────── */
.notice-box { width: min(560px, 92vw); }
.notice-box h2 { margin-bottom: 14px; }
.notice-text {
  font-size: 13.5px; line-height: 1.95; color: var(--text2);
  margin-bottom: 12px;
}
.notice-text b { color: var(--text); font-weight: 600; }
.notice-feedback { padding-top: 12px; border-top: 1px solid var(--line-soft); }
.notice-mail {
  color: var(--accent); font-weight: 600;
  text-decoration: none; border-bottom: 1px solid var(--accent-glow);
  word-break: break-all;
}
.notice-mail:hover { background: var(--accent-soft); }
.notice-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.notice-beian { font-size: 11.5px; color: var(--text3); }
.notice-beian a { color: inherit; text-decoration: none; }
.notice-beian a:hover { color: var(--accent); text-decoration: underline; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #3f5ae8; color: #fff; border-color: #3f5ae8; }
/* ── 文字总览 ─────────────────────────────────────────────────────────── */
.ov-lead { font-size: 12.5px; color: var(--text2); line-height: 1.75; margin-bottom: 4px; }
.ov-nav {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin: 14px 0 6px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.ov-chip {
  font-family: var(--mono); font-size: 11px; padding: 2px 7px;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg); color: var(--text2); cursor: pointer;
  transition: all .14s;
}
.ov-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ov-entry { padding: 16px 0 14px; border-bottom: 1px solid var(--line-soft); }
.ov-entry:last-child { border-bottom: none; }
.ov-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ov-year {
  font-family: var(--mono); font-size: 22px; font-weight: 600;
  color: var(--accent); line-height: 1; letter-spacing: .01em;
}
.ov-label { font-size: 14px; font-weight: 600; color: var(--text); }
.ov-stats { margin-left: auto; font-size: 11px; color: var(--text3); white-space: nowrap; }
.ov-text { font-size: 13px; color: var(--text2); line-height: 1.85; margin-top: 8px; }
.ov-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.ov-fact { font-size: 11.5px; color: var(--text3); }
.ov-fact b { color: var(--text2); font-weight: 500; }
.ov-fact .fdot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 4px; vertical-align: 0;
}
.ov-jump {
  margin-left: 8px; font-size: 11px; font-family: inherit;
  padding: 1px 7px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg); color: var(--text3); cursor: pointer;
}
.ov-jump:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ── 词条大全 ─────────────────────────────────────────────────────────── */
.wiki-box { display: flex; flex-direction: column; max-height: 86vh; }
.wiki-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0 12px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 2;
}
.wiki-tabs { display: flex; gap: 4px; }
.wiki-tab {
  padding: 4px 12px; border-radius: 999px; cursor: pointer;
  font-size: 12.5px; color: var(--text2);
  border: 1px solid var(--line); background: var(--bg);
  transition: all .15s;
}
.wiki-tab:hover { border-color: var(--accent); color: var(--accent); }
.wiki-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.wiki-tab .n { font-family: var(--mono); font-size: 10.5px; opacity: .75; margin-left: 4px; }
.wiki-search { width: 200px; }
.wiki-select {
  border: 1px solid var(--line); border-radius: 4px; background: var(--bg);
  color: var(--text2); font-family: inherit; font-size: 12px; padding: 3px 6px; outline: none;
}
.wiki-select:focus { border-color: var(--accent); }
.wiki-count { margin-left: auto; font-size: 11.5px; color: var(--text3); white-space: nowrap; }

.wiki-list { flex: 1 1 auto; overflow-y: auto; min-height: 200px; }
.wiki-more { flex: 0 0 auto; display: flex; gap: 8px; justify-content: center; padding-top: 12px; border-top: 1px solid var(--line-soft); }

.wk-item { border-bottom: 1px solid var(--line-soft); }
.wk-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 6px; cursor: pointer; border-radius: 4px;
  transition: background .12s;
}
.wk-row:hover { background: var(--accent-soft); }
.wk-name { font-size: 13.5px; font-weight: 600; color: var(--text); flex: 0 0 auto; }
.wk-name .fdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.wk-hint { font-size: 11.5px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.wk-count { font-family: var(--mono); font-size: 11px; color: var(--text3); flex: 0 0 auto; }
.wk-caret { font-size: 9px; color: var(--text3); flex: 0 0 auto; }

.wk-detail { padding: 2px 6px 14px 22px; }
.wk-kv { display: flex; gap: 8px; font-size: 12px; color: var(--text2); margin: 5px 0; }
.wk-kv .k { flex: 0 0 auto; color: var(--text3); min-width: 62px; }
.wk-kv .v { flex: 1 1 auto; }
.wk-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.wk-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg3); color: var(--text2);
}
.wk-chip .fdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.wk-chip .n { font-family: var(--mono); font-size: 10px; color: var(--text3); }
.wk-chip.link { cursor: pointer; }
.wk-chip.link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.wk-ev { font-size: 11.5px; color: var(--text2); padding: 3px 0 3px 9px; border-left: 2px solid var(--line); margin-bottom: 3px; }
.wk-ev .dt { font-family: var(--mono); font-size: 10.5px; color: var(--accent); }
.wk-ev .df { font-size: 10.5px; color: var(--text3); }
.wk-actions { margin-top: 9px; display: flex; gap: 8px; }

.empty { color: var(--text3); font-size: 12px; padding: 10px 5px; }

@media (max-width: 1180px) {
  /* 窄屏的默认宽度靠 JS 初始化时读一次即可；内联 --side-w 会永久覆盖这里，故不在此处设置 */
  .search { width: 150px; }
  .map-topbar { max-width: calc(100% - 200px); }
}

/* 尊重系统的"减少动态效果" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
