/* ==========================================================================
   安栖 Wiki · 样式表
   设计取向：纸感暖白 + 青绿主色 + 维基式三栏骨架，兼顾长文阅读与数据检索
   ========================================================================== */

:root {
  --bg: #f6f5f1;
  --bg-soft: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f1ec;
  --ink: #1c2321;
  --ink-2: #414d4a;
  --ink-3: #6b7874;
  --muted: #8a9490;
  --line: #e3e1da;
  --line-soft: #eeece5;
  --brand: #1f6f68;
  --brand-2: #2b8a81;
  --brand-ink: #16504b;
  --brand-soft: #e4efed;
  --brand-line: #c4ddd9;
  --accent: #b0553c;
  --accent-soft: #fbeee9;
  --gold: #a17c22;
  --gold-soft: #faf1dd;
  --shadow-sm: 0 1px 2px rgba(28, 35, 33, .05), 0 1px 3px rgba(28, 35, 33, .04);
  --shadow-md: 0 2px 6px rgba(28, 35, 33, .06), 0 8px 24px rgba(28, 35, 33, .05);
  --radius: 14px;
  --radius-sm: 9px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --serif: "Songti SC", "SimSun", "Source Han Serif SC", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --topbar-h: 60px;
}

[data-theme="dark"] {
  --bg: #141917;
  --bg-soft: #181e1c;
  --surface: #1c2321;
  --surface-2: #232b28;
  --ink: #e6ebe8;
  --ink-2: #bcc6c2;
  --ink-3: #93a09b;
  --muted: #7d8a85;
  --line: #2d3734;
  --line-soft: #262e2c;
  --brand: #4fb3a8;
  --brand-2: #6cc7bc;
  --brand-ink: #a8ddd5;
  --brand-soft: #1d3330;
  --brand-line: #2f514c;
  --accent: #e08b6d;
  --accent-soft: #38261f;
  --gold: #d3ab55;
  --gold-soft: #32291a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, .34), 0 12px 30px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; text-decoration: none; color: inherit;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.brand-mark svg { width: 19px; height: 19px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .2px; }

.topbar-spacer { flex: 1; }

.search-wrap { position: relative; width: min(330px, 34vw); }
.search-wrap svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; opacity: .45; pointer-events: none;
}
#search {
  width: 100%; height: 36px;
  padding: 0 42px 0 33px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit; font-size: 13.5px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
#search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
#search::placeholder { color: var(--muted); }
.search-kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
  background: var(--bg-soft); pointer-events: none;
}

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); cursor: pointer; flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--brand-line); color: var(--brand); }
.icon-btn svg { width: 16px; height: 16px; }

.menu-btn { display: none; }

/* 搜索下拉 */
.search-panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-md);
  max-height: 66vh; overflow: auto; z-index: 80; padding: 6px;
  display: none;
}
.search-panel.open { display: block; }
.sp-group { padding: 8px 10px 3px; font-size: 11px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.sp-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 8px; border: 0; background: none;
  font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; text-align: left;
}
.sp-item:hover, .sp-item:focus { background: var(--brand-soft); outline: none; }
.sp-item .sp-sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.sp-empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- 骨架 */
.shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr) 268px;
  gap: 34px;
  max-width: 1460px;
  margin: 0 auto;
  padding: 26px 26px 90px;
  align-items: start;
}

.sidebar, .rail { position: sticky; top: calc(var(--topbar-h) + 20px); }

/* ---------------------------------------------------------------- 侧栏导航 */
.nav { font-size: 13.5px; }
.nav-section { margin-bottom: 22px; }
.nav-title {
  font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  padding: 0 10px 8px; display: flex; align-items: center; gap: 7px;
}
.nav-title::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px;
  color: var(--ink-2); border-left: 2px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.nav-list a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-list a.active {
  background: var(--brand-soft); color: var(--brand-ink);
  border-left-color: var(--brand); font-weight: 600;
}
.nav-list .count {
  margin-left: auto; font-size: 11px; color: var(--muted);
  font-family: var(--mono); background: var(--surface-2);
  padding: 0 6px; border-radius: 20px; line-height: 17px;
}
.nav-list a.active .count { background: var(--brand-soft); background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.nav-list .nav-ico { width: 14px; height: 14px; opacity: .6; flex-shrink: 0; }

/* 侧栏按地区：按地理分区折叠 */
.nav-group { margin-bottom: 2px; }
.nav-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border: 0; border-radius: 8px;
  background: none; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--ink-3); cursor: pointer; text-align: left;
  transition: background .12s, color .12s;
}
.nav-toggle:hover { background: var(--surface-2); color: var(--ink); }
.nav-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.nav-toggle .chev {
  width: 6px; height: 6px; flex-shrink: 0; margin-right: 1px;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg); transition: transform .18s ease;
}
.nav-group.open .nav-toggle .chev { transform: rotate(45deg); }
.nav-toggle .count {
  margin-left: auto; font-size: 11px; color: var(--muted);
  font-family: var(--mono); background: var(--surface-2);
  padding: 0 6px; border-radius: 20px; line-height: 17px;
}
.nav-group .nav-list { margin-left: 9px; }
.nav-list[hidden] { display: none; }

/* 全国覆盖一览 */
.rgrid { display: flex; flex-wrap: wrap; gap: 6px; }
.rcell {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border: 1px solid var(--line-soft);
  border-radius: 999px; background: var(--bg-soft);
  font-size: 12.5px; white-space: nowrap;
}
.rcell a { color: var(--ink); text-decoration: none; font-weight: 600; }
.rcell a:hover { color: var(--brand); text-decoration: underline; }
.rcell .rc-n { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.rdot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; background: var(--line); flex-shrink: 0;
}
.rdot.on { background: var(--brand); }

.side-note {
  margin-top: 22px; padding: 13px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; font-size: 12.5px; color: var(--ink-3); line-height: 1.65;
}
.side-note strong { color: var(--ink-2); display: block; margin-bottom: 4px; font-size: 12.5px; }

/* ---------------------------------------------------------------- 右栏 */
.rail-box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.rail-title {
  font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 10px;
}
.toc { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 4px 0 4px 10px;
  border-left: 2px solid var(--line); color: var(--ink-3);
}
.toc a:hover { color: var(--brand); border-left-color: var(--brand-line); text-decoration: none; }
.toc a.lv3 { padding-left: 22px; font-size: 12.5px; }
.rail-links { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.rail-links li { padding: 4px 0; }
.rail-links a { color: var(--ink-2); }
.rail-links .muted { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- 主区 */
.content { min-width: 0; }

.page-head { margin-bottom: 22px; }
.crumbs {
  font-size: 12.5px; color: var(--muted); margin-bottom: 8px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { opacity: .5; }

h1.page-title {
  font-size: 30px; line-height: 1.3; margin: 0 0 10px;
  font-weight: 700; letter-spacing: -.4px;
}
.page-lede { font-size: 15.5px; color: var(--ink-2); margin: 0 0 16px; max-width: 74ch; line-height: 1.8; }

h2.sec {
  font-size: 19px; margin: 34px 0 12px; font-weight: 700;
  letter-spacing: -.2px; scroll-margin-top: calc(var(--topbar-h) + 20px);
  display: flex; align-items: center; gap: 9px;
}
h2.sec::before {
  content: ""; width: 3px; height: 17px; border-radius: 2px;
  background: var(--brand); flex-shrink: 0;
}
h3.sub {
  font-size: 16px; margin: 24px 0 8px; font-weight: 650; color: var(--ink);
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.hero {
  background:
    radial-gradient(120% 130% at 100% 0%, var(--brand-soft) 0%, transparent 55%),
    var(--surface);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 32px; margin-bottom: 26px; box-shadow: var(--shadow-sm);
}
.hero h1 {
  font-size: 32px; margin: 0 0 8px; letter-spacing: -.6px; line-height: 1.28;
}
.hero .hero-sub { color: var(--brand); font-weight: 600; font-size: 14px; letter-spacing: .4px; margin-bottom: 12px; }
.hero p { color: var(--ink-2); max-width: 72ch; margin: 0 0 8px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px;
  padding-top: 16px; border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--muted);
}

/* 数据卡 */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 20px 0 26px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--brand); font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* 按钮 */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn svg { width: 15px; height: 15px; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 20px; font-size: 12px;
  background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line-soft);
  white-space: nowrap;
}
.tag.brand { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.tag.gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

a.tag:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }

/* 医院卡片 */
.hosp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 14px;
}
.hcard {
  display: flex; flex-direction: column; gap: 9px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 17px;
  box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s, border-color .16s;
}
.hcard:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-line);
}
.hcard-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.hcard h3 { margin: 0; font-size: 15.5px; line-height: 1.45; font-weight: 650; }
.hcard h3 a { color: var(--ink); }
.hcard h3 a:hover { color: var(--brand); text-decoration: none; }
.hcard .loc { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.hcard .meta { font-size: 12.5px; color: var(--ink-3); }
.hcard .foot {
  margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--muted);
}
.hcard .score-line { display: flex; align-items: center; gap: 7px; }
.dot-score {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex-shrink: 0;
}
.dot-score.none { background: var(--line); }
.dot-score.low { background: var(--gold); }

/* 筛选栏 */
.filters {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
  padding: 13px 15px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
/* 上下两排筛选栏挨紧一点，避免中间出现大片空白 */
.filters + .filters { margin-top: -9px; }
/* 排序下拉：即使被挤到下一行也保持右对齐 */
.filters select.sel.push { margin-left: auto; }
.filters .flabel { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.chip {
  padding: 4px 12px; border-radius: 20px; font-size: 12.5px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink-2);
  font-family: inherit; transition: all .13s; white-space: nowrap;
}
.chip:hover { border-color: var(--brand-line); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.filters .spacer { flex: 1; }
.filters .result-n { font-size: 12.5px; color: var(--muted); }
select.sel, input.sel {
  font: inherit; font-size: 12.5px; padding: 5px 9px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink-2);
  outline: none; cursor: pointer;
}
input.sel { cursor: text; }
select.sel:focus, input.sel:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* 信息表 */
.infotable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.infotable th, .infotable td { text-align: left; padding: 9px 12px; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.infotable th { width: 108px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.infotable tr:last-child th, .infotable tr:last-child td { border-bottom: 0; }
.infotable td { color: var(--ink-2); }
.infotable ul { margin: 0; padding-left: 17px; }

/* 体验条目 */
.exp {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 20px 22px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.exp-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.exp-head h3 { margin: 0; font-size: 16.5px; font-weight: 650; }
.exp-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.exp-quote {
  border-left: 3px solid var(--brand-line); background: var(--brand-soft);
  padding: 11px 15px; border-radius: 0 10px 10px 0;
  margin: 12px 0 16px; font-size: 14.5px; color: var(--brand-ink); line-height: 1.7;
}
.exp-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 860px) { .exp-cols { grid-template-columns: 1fr; } }

.pc { margin-bottom: 12px; }
.pc-title {
  font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 6px;
}
.pc ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); }
.pc li { margin-bottom: 5px; }
.pc.pos li::marker { color: var(--brand); }
.pc.con li::marker { color: var(--accent); }

/* 评分条 */
.ratings { display: flex; flex-direction: column; gap: 7px; }
.rating-row { display: grid; grid-template-columns: 82px 1fr 34px; gap: 10px; align-items: center; font-size: 12.5px; }
.rating-row .rn { color: var(--ink-3); }
.rating-row .rv { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.bar { height: 7px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.bar.mid i { background: linear-gradient(90deg, #d9b45c, var(--gold)); }
.bar.low i { background: linear-gradient(90deg, #d58a6c, var(--accent)); }

.overall {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px;
  padding-bottom: 10px; border-bottom: 1px dashed var(--line);
}
.overall .big { font-size: 30px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; line-height: 1; }
.overall .of { font-size: 12.5px; color: var(--muted); }

/* 提示块 */
.callout {
  border-radius: 12px; padding: 14px 17px; margin: 16px 0;
  background: var(--gold-soft); border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--gold) 26%, transparent);
  font-size: 13.5px; color: var(--ink-2);
}
.callout.brand { background: var(--brand-soft); border-color: var(--brand-line); }
.callout.accent { background: var(--accent-soft); border-color: var(--line); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.callout .ct { font-weight: 700; color: var(--ink); display: block; margin-bottom: 4px; font-size: 13.5px; }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.callout li { margin-bottom: 3px; }

/* 正文（markdown 渲染） */
.prose { font-size: 15px; color: var(--ink-2); }
.prose h2 {
  font-size: 18px; margin: 30px 0 10px; font-weight: 700; color: var(--ink);
  scroll-margin-top: calc(var(--topbar-h) + 20px);
  display: flex; align-items: center; gap: 9px;
}
.prose h2::before {
  content: ""; width: 3px; height: 16px; border-radius: 2px; background: var(--brand); flex-shrink: 0;
}
.prose h3 { font-size: 15.5px; margin: 22px 0 8px; font-weight: 650; color: var(--ink); }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--brand); }
.prose blockquote {
  margin: 14px 0; padding: 10px 16px; border-left: 3px solid var(--brand-line);
  background: var(--brand-soft); border-radius: 0 10px 10px 0; color: var(--brand-ink);
}
.prose strong { color: var(--ink); font-weight: 650; }
.prose code {
  font-family: var(--mono); font-size: 12.5px; background: var(--surface-2);
  padding: 1px 5px; border-radius: 5px;
}
.prose .num { color: var(--brand); font-weight: 650; }

/* 主题卡 */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 13px; }
.topic {
  display: block; padding: 16px 17px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); color: inherit;
  box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s, border-color .16s;
}
.topic:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-line); text-decoration: none; }
.topic h3 { margin: 0 0 6px; font-size: 15px; font-weight: 650; color: var(--brand); }
.topic p { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.7; }
.topic .tcount { margin-top: 10px; font-size: 11.5px; color: var(--muted); }

/* 列表行 */
.rows { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft); color: inherit;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--bg-soft); text-decoration: none; }
.row .r-main { min-width: 0; flex: 1; }
.row .r-t { font-size: 14px; font-weight: 600; color: var(--ink); }
.row .r-s { font-size: 12px; color: var(--muted); }
.row .r-side { font-size: 12px; color: var(--muted); text-align: right; flex-shrink: 0; }

.empty {
  padding: 44px 20px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface);
}
.empty .e-t { font-size: 15px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }

/* 页脚 */
.foot {
  margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 20px;
}
.foot .dis {
  flex-basis: 100%; font-size: 12px; color: var(--muted); line-height: 1.7;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 15px;
}

/* 表格（维度说明） */
.dtable { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 6px 0 4px; }
.dtable th, .dtable td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.dtable thead th { font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.dtable tbody tr:hover { background: var(--bg-soft); }
.dtable td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }

/* 返回顶部 */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; opacity: 0; pointer-events: none;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md);
  cursor: pointer; color: var(--ink-2); transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { color: var(--brand); border-color: var(--brand); }

/* 响应式 */
@media (max-width: 1240px) {
  .shell { grid-template-columns: 232px minmax(0, 1fr); }
  .rail { display: none; }
}
@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 20px 16px 70px; gap: 0; }
  .sidebar {
    position: fixed; inset: var(--topbar-h) auto 0 0; width: 268px; z-index: 70;
    background: var(--bg-soft); border-right: 1px solid var(--line);
    padding: 18px 16px; overflow: auto; transform: translateX(-100%);
    transition: transform .22s ease; top: 0; padding-top: calc(var(--topbar-h) + 18px);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
  .menu-btn { display: grid; }
  .brand-sub { display: none; }
  .search-wrap { width: 100%; }
  .topbar { gap: 10px; padding: 0 14px; }
  .topbar-spacer { display: none; }
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 25px; }
  h1.page-title { font-size: 24px; }
}
@media (max-width: 560px) {
  .hosp-grid, .topic-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .brand-name { font-size: 14px; }
}

.scrim {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .38); z-index: 65;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.scrim.show { opacity: 1; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
