/* styles.css — 图书馆书架导航系统 · 学术图书馆（暖纸 + 深墨绿 + 铜色） */

:root {
  --bg: #f5f2ea;
  --bg-2: #efeade;
  --surface: #fffdf8;
  --surface-2: #f7f4ec;
  --border: #e4ddcd;
  --border-strong: #d3c9b4;
  --ink: #1d2b26;
  --ink-2: #55655d;
  --ink-3: #8a978f;

  --primary: #0f5c4c;
  --primary-hover: #0b4739;
  --primary-soft: #dcebe5;
  --primary-tint: #eef5f1;
  --accent: #bf6b2c;
  --accent-soft: #f6e7d7;

  --ok: #3c8f68;
  --ok-soft: #dcefe4;
  --danger: #c15248;
  --danger-soft: #f7e0dc;
  --warn: #c08a2c;
  --warn-soft: #f7ecd6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --sh-sm: 0 1px 2px rgba(29, 43, 38, .06), 0 1px 1px rgba(29, 43, 38, .04);
  --sh-md: 0 6px 18px -8px rgba(29, 43, 38, .22), 0 2px 6px -2px rgba(29, 43, 38, .08);
  --sh-lg: 0 24px 60px -24px rgba(29, 43, 38, .4);

  --f-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", SimSun, Georgia, serif;
  --f-body: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;

  --panel-w: 366px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -8%, #e9f2ec 0%, rgba(233, 242, 236, 0) 58%),
    radial-gradient(880px 460px at 102% -4%, #f8efe0 0%, rgba(248, 239, 224, 0) 52%),
    var(--bg);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 纸张噪点氛围层 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd, dt, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

/* ============ 顶栏 ============ */
.topbar {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 22px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: rgba(255, 253, 248, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand__mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(150deg, var(--primary) 0%, #0a3f34 100%);
  box-shadow: var(--sh-md), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.brand__text h1 {
  font-family: var(--f-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.2;
}
.brand__text p { font-size: 11.5px; color: var(--ink-3); letter-spacing: .6px; }

/* 检索 */
.search { position: relative; flex: 1 1 auto; max-width: 520px; }
.search__icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); pointer-events: none; display: grid; place-items: center;
}
#searchInput {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 40px;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
#searchInput::placeholder { color: var(--ink-3); }
#searchInput:hover { border-color: var(--border-strong); }
#searchInput:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
#searchInput::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

.search__clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2);
  transition: background .15s, color .15s;
}
.search__clear:hover { background: var(--primary-soft); color: var(--primary); }

.search__panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  animation: panelIn .2s ease;
  max-height: min(60vh, 460px);
  overflow-y: auto;
}
@keyframes panelIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.search__meta {
  padding: 10px 14px;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .3px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.search__meta b { color: var(--primary); font-weight: 700; }

.results { }
.result {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .14s;
}
.result:last-child { border-bottom: 0; }
.result:hover { background: var(--primary-tint); }
.result__dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.result__dot[data-status="available"] { background: var(--ok); }
.result__dot[data-status="borrowed"] { background: var(--danger); }
.result__dot[data-status="reserved"] { background: var(--warn); }
.result__main { flex: 1 1 auto; min-width: 0; }
.result__title {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result__sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.result__loc {
  flex: 0 0 auto; font-family: var(--f-mono); font-size: 11px;
  color: var(--primary); background: var(--primary-tint);
  border: 1px solid var(--primary-soft); border-radius: var(--radius-sm);
  padding: 2px 7px; white-space: nowrap;
}
.results__empty { padding: 22px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.results__empty span { font-size: 11.5px; color: var(--ink-3); opacity: .85; }

.sk { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.sk__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-2); }
.sk__bar { height: 11px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2) 0%, #efe9dc 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: sk 1.1s linear infinite; }
.sk__bar--a { flex: 1 1 auto; }
.sk__bar--b { width: 58px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 馆藏统计 */
.topstats { display: flex; gap: 8px; flex: 0 0 auto; }
.ts {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
}
.ts i { width: 8px; height: 8px; border-radius: 50%; }
.ts b { font-family: var(--f-mono); font-size: 13px; font-weight: 700; color: var(--ink); }
.ts span { font-size: 11.5px; color: var(--ink-3); }
.ts[data-k="available"] i { background: var(--ok); }
.ts[data-k="borrowed"] i { background: var(--danger); }
.ts[data-k="reserved"] i { background: var(--warn); }

/* ============ 布局 ============ */
.layout {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr var(--panel-w);
}

/* ============ 平面图区 ============ */
.map { position: relative; min-width: 0; min-height: 0; overflow: hidden; }

.map__viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(29, 43, 38, .07) 1px, transparent 0);
  background-size: 24px 24px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.map__viewport.is-grabbing { cursor: grabbing; }

.plan {
  position: relative;
  display: inline-block;
  padding: 30px;
  transform-origin: 0 0;
  will-change: transform;
}
.plan--anim { transition: transform .5s cubic-bezier(.22, .61, .36, 1); }

/* 首屏 stagger 渐显 */
.shelf { animation: shelfIn .5s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes shelfIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

.plan__grid {
  display: grid;
  grid-template-columns: 46px repeat(6, 122px);
  grid-auto-rows: 98px;
  gap: 34px 22px;
}

/* 区域标签 */
.zone-label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.zone-label__id {
  font-family: var(--f-display);
  font-size: 26px; font-weight: 700; line-height: 1;
  color: var(--primary);
  background: linear-gradient(160deg, var(--primary-soft), transparent);
  -webkit-background-clip: text; background-clip: text;
  padding: 4px 2px;
}
.zone-label__name {
  font-size: 10.5px; letter-spacing: 1px; color: var(--ink-3);
  writing-mode: vertical-rl;
}

/* 书架单元 */
.shelf {
  position: relative;
  display: flex; flex-direction: column;
  padding: 7px 8px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--sh-sm);
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.shelf:hover { border-color: var(--border-strong); box-shadow: var(--sh-md); }
.shelf.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), var(--sh-md); }

.shelf__head {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 0 1px 5px;
  border: 0; background: transparent; color: inherit;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 5px;
}
.shelf__id { font-family: var(--f-mono); font-size: 11.5px; font-weight: 700; color: var(--primary); letter-spacing: .5px; }
.shelf__ratio { font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); }
.shelf__head:hover .shelf__id { color: var(--accent); }

.shelf__levels { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; }
.shelf__level { display: flex; align-items: center; justify-content: space-between; height: 16px; }

/* 书籍 */
.book {
  position: relative;
  width: 12px; height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, #4ea27a 0%, var(--ok) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  cursor: pointer;
  transition: transform .13s ease, box-shadow .13s ease;
}
.book[data-status="borrowed"] { background: linear-gradient(180deg, #d2705f 0%, var(--danger) 100%); }
.book[data-status="reserved"] { background: linear-gradient(180deg, #d5a34a 0%, var(--warn) 100%); }
.book:hover {
  transform: translateY(-3px) scale(1.18);
  z-index: 6;
  box-shadow: 0 3px 8px -2px rgba(29, 43, 38, .4);
}

/* 检索命中高亮 */
.plan.is-searching .book { opacity: .2; }
.plan.is-searching .book.search-hit {
  opacity: 1;
  z-index: 5;
  box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px var(--accent);
  transform: scale(1.15);
}

/* 选中书 */
.book.is-selected { z-index: 9; transform: translateY(-2px) scale(1.35); }
.book.is-selected::after {
  content: ""; position: absolute; inset: -4px;
  border-radius: 5px;
  border: 2px solid var(--accent);
  animation: ring 1.5s ease-out infinite;
}
@keyframes ring {
  0% { transform: scale(.85); opacity: 1; }
  100% { transform: scale(1.9); opacity: 0; }
}
.book.is-flash { animation: flash .9s ease-out; }
@keyframes flash {
  0%, 100% { filter: none; }
  40% { filter: brightness(1.7) drop-shadow(0 0 8px var(--accent)); }
}

/* 平面图地标 */
.plan__landmarks { display: flex; gap: 22px; margin-top: 34px; }
.plan__landmark {
  height: 86px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: repeating-linear-gradient(45deg, rgba(29, 43, 38, .022) 0 8px, transparent 8px 16px);
  color: var(--ink-2);
}
.plan__landmark b { font-family: var(--f-display); font-size: 14px; letter-spacing: 1px; }
.plan__landmark span { font-size: 10.5px; color: var(--ink-3); }
.plan__landmark[data-cls="entrance"] { border-style: solid; border-color: var(--primary); color: var(--primary); background: linear-gradient(180deg, var(--primary-tint), transparent); }
.plan__landmark[data-cls="entrance"] span { color: var(--primary); opacity: .75; }
.plan__landmark[data-cls="desk"] { border-style: solid; border-color: var(--border-strong); }

/* 悬浮标记（选中书上方指针） */
.map-pin {
  position: absolute;
  z-index: 12;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 7px;
  background: var(--ink);
  color: #fff;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border-radius: var(--radius-pill);
  box-shadow: var(--sh-md);
  transform: translate(-50%, calc(-100% - 12px));
  pointer-events: none;
  animation: pinIn .28s cubic-bezier(.22, .61, .36, 1);
}
.map-pin::after {
  content: ""; position: absolute; left: 50%; bottom: -5px;
  width: 9px; height: 9px; background: var(--ink);
  transform: translateX(-50%) rotate(45deg);
}
.map-pin__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.map-pin.is-anim { transition: left .5s cubic-bezier(.22, .61, .36, 1), top .5s cubic-bezier(.22, .61, .36, 1); }
@keyframes pinIn { from { opacity: 0; transform: translate(-50%, calc(-100% - 2px)); } to { opacity: 1; } }

/* 悬浮提示（hover 书名） */
.map-tip {
  position: absolute; z-index: 13;
  padding: 6px 10px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 11.5px; white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  box-shadow: var(--sh-md);
}
.map-tip b { display: block; font-size: 12px; font-weight: 600; }
.map-tip span { color: rgba(255, 255, 255, .72); font-size: 10.5px; }

/* 图例 */
.map__legend {
  position: absolute; top: 14px; left: 14px; z-index: 10;
  display: flex; gap: 12px; align-items: center;
  padding: 7px 13px;
  background: rgba(255, 253, 248, .9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--sh-sm);
  font-size: 11.5px; color: var(--ink-2);
}
.map__legend span { display: flex; align-items: center; gap: 5px; }
.map__legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.map__legend i[data-status="available"] { background: var(--ok); }
.map__legend i[data-status="borrowed"] { background: var(--danger); }
.map__legend i[data-status="reserved"] { background: var(--warn); }
.map__legend i.dot-select { background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 2px var(--accent-soft); }

/* 视图控制 */
.viewctl {
  position: absolute; right: 16px; bottom: 16px; z-index: 10;
  display: flex; align-items: center; gap: 2px;
  padding: 4px;
  background: rgba(255, 253, 248, .92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--sh-md);
}
.viewctl__btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink);
  transition: background .15s, color .15s;
}
.viewctl__btn:hover { background: var(--primary-soft); color: var(--primary); }
.viewctl__btn:active { transform: scale(.94); }
.viewctl__label {
  min-width: 46px; text-align: center;
  font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-2);
}

/* 操作提示 */
.map__hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  background: rgba(29, 43, 38, .78);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  box-shadow: var(--sh-md);
  white-space: nowrap;
}
.map__hint svg { opacity: .8; flex: 0 0 auto; }

/* 加载态 */
.map__loading {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(245, 242, 234, .72);
  backdrop-filter: blur(3px);
  font-size: 12.5px; color: var(--ink-2);
  transition: opacity .3s;
}
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--primary-soft);
  border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 详情骨架 */
.detail-sk { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.detail-sk__bar { height: 14px; border-radius: 5px; background: linear-gradient(90deg, var(--surface-2) 0%, #efe9dc 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: sk 1.1s linear infinite; }
.detail-sk__bar--title { height: 26px; width: 72%; }
.detail-sk__bar--sm { width: 40%; height: 12px; }
.detail-sk__box { height: 132px; border-radius: var(--radius-lg); background: var(--surface-2); }

/* ============ 详情面板 ============ */
.panel {
  min-width: 0; min-height: 0; overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 22px;
}

/* 概览 */
.ov__head { margin-bottom: 18px; }
.ov__head h2 { font-family: var(--f-display); font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.ov__head p { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.ov__head p b { color: var(--primary); font-family: var(--f-mono); }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.kpi {
  position: relative;
  padding: 13px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: shelfIn .45s cubic-bezier(.22, .61, .36, 1) both;
}
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ink-3); }
.kpi--total::after { background: var(--primary); }
.kpi--ok::after { background: var(--ok); }
.kpi--dan::after { background: var(--danger); }
.kpi--warn::after { background: var(--warn); }
.kpi__num { display: block; font-family: var(--f-mono); font-size: 22px; font-weight: 700; line-height: 1.15; color: var(--ink); }
.kpi--total .kpi__num { color: var(--primary); }
.kpi__label { font-size: 11.5px; color: var(--ink-3); letter-spacing: .3px; }

.ov__sec { margin-bottom: 22px; }
.ov__sec h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px; color: var(--ink-2);
  text-transform: uppercase;
  margin-bottom: 11px;
}
.ov__sec h3::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--border); }

.legend-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.legend-list li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.legend-list i { width: 13px; height: 13px; border-radius: 3px; flex: 0 0 auto; }
.legend-list i[data-status="available"] { background: var(--ok); }
.legend-list i[data-status="borrowed"] { background: var(--danger); }
.legend-list i[data-status="reserved"] { background: var(--warn); }
.legend-list i.legend-sel { background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 2px var(--accent-soft); }

.guide { display: flex; flex-direction: column; gap: 9px; counter-reset: g; }
.guide li { position: relative; padding-left: 26px; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.guide li::before {
  counter-increment: g; content: counter(g);
  position: absolute; left: 0; top: 1px;
  width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 10px; font-weight: 700;
  color: var(--primary); background: var(--primary-tint); border: 1px solid var(--primary-soft);
}
.guide li b { color: var(--ink); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 13px;
  font-size: 12.5px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all .15s;
}
.chip:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-tint); }

/* 详情 */
.detail { animation: detailIn .3s cubic-bezier(.22, .61, .36, 1); }
@keyframes detailIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.detail__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
}
.status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status[data-status="available"] { color: var(--ok); background: var(--ok-soft); }
.status[data-status="borrowed"] { color: var(--danger); background: var(--danger-soft); }
.status[data-status="reserved"] { color: var(--warn); background: var(--warn-soft); }

.ghost-btn {
  padding: 5px 12px; font-size: 12px; color: var(--ink-2);
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all .15s;
}
.ghost-btn:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

.detail__title {
  font-family: var(--f-display);
  font-size: 25px; font-weight: 700; line-height: 1.3; letter-spacing: .5px;
  color: var(--ink);
}
.detail__author { font-size: 13.5px; color: var(--ink-2); margin-top: 5px; }
.detail__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.tag {
  padding: 3px 10px; font-size: 11.5px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.tag.mono { font-family: var(--f-mono); color: var(--primary); }

.locate {
  margin: 18px 0;
  padding: 14px;
  background: linear-gradient(160deg, var(--primary-tint) 0%, var(--surface-2) 100%);
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius-lg);
}
.locate__label { font-size: 11px; letter-spacing: 1.4px; color: var(--primary); font-weight: 700; margin-bottom: 8px; }
.locate__path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 13px; }
.locate__path span, .locate__path b {
  padding: 4px 10px; border-radius: var(--radius-sm); font-size: 12.5px;
}
.locate__path span { color: var(--ink-2); background: rgba(255, 255, 255, .78); border: 1px solid var(--border); }
.locate__path b { color: #fff; background: var(--primary); font-weight: 600; }
.locate__path span + span::before,
.locate__path b + span::before { content: "›"; margin-right: 6px; color: var(--ink-3); }

.primary-btn {
  width: 100%; height: 40px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; color: #fff;
  background: var(--primary); border: 0; border-radius: var(--radius-md);
  box-shadow: var(--sh-sm);
  transition: background .15s, transform .12s;
}
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.primary-btn:active { transform: translateY(0); }

.meta { display: flex; flex-direction: column; }
.meta > div {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.meta > div:last-child { border-bottom: 0; }
.meta dt { font-size: 12.5px; color: var(--ink-3); flex: 0 0 auto; }
.meta dd { font-size: 13px; color: var(--ink); text-align: right; }
.mono { font-family: var(--f-mono); letter-spacing: .3px; }

/* 面板滚动条 */
.panel::-webkit-scrollbar, .search__panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb, .search__panel::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: var(--radius-pill); border: 2px solid var(--surface);
}

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  :root { --panel-w: 330px; }
  .brand__text p { display: none; }
}
@media (max-width: 980px) {
  .topstats { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 52dvh) minmax(0, 1fr); }
  .panel { border-left: 0; border-top: 1px solid var(--border); padding: 18px; }
  .map__hint { display: none; }
  .kpis { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .kpi { padding: 10px; }
  .kpi__num { font-size: 17px; }
  .kpi__label { font-size: 10.5px; }
}
@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 10px 14px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .legend-list { grid-template-columns: 1fr; }
}
