/* ============================================================
   药信网 PharmaXin · 页面级样式（core.css）
   复用 tokens.css 的设计令牌与基础组件；仅承载核心信息页。
   ============================================================ */

/* ---------------- 通用 ---------------- */
.hide { display: none !important; }

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
}
.alert.error { background: var(--red-soft); border: 1px solid #f3c6c6; color: var(--red); }
.alert.ok { background: var(--jade-soft); border: 1px solid #bfdbfe; color: var(--jade-dark); }

.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 12.5px; color: var(--muted-2); padding-top: 4px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--jade-dark); }

.mono { font-family: var(--mono); font-size: 12px; }

/* 长标题 / 英文单词换行安全，避免窄屏横向溢出 */
.hero-title, .page-title, .lead-title, .card-title, .article-title, .announce-title,
.detail-sub, .field-value, .cell, .cell-en, .qa-question, .exam-question, .rank-title,
.mini-title, .side-news-title, .topic-card .card-title, .lib-card .card-title,
.score-title, .score-comment, .roadmap-body h3, .notfound-title {
  overflow-wrap: anywhere;
}
img, svg, video { max-width: 100%; height: auto; }
.prose img, .prose video, .prose iframe { max-width: 100%; height: auto; }
.prose .md-table, .prose pre, .table-wrap { max-width: 100%; }

/* 空态 / 错误态（tokens 提供 .empty，这里补充结构） */
.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-state .empty-icon { font-size: 30px; opacity: .42; margin-bottom: 10px; line-height: 1; }
.empty-title { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.empty-desc { font-size: 13px; color: var(--muted); max-width: 500px; margin: 0 auto; line-height: 1.8; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.error-state .empty-icon { color: var(--red); opacity: .7; }
.region-empty { font-size: 12.5px; color: var(--muted-2); padding: 10px 0; line-height: 1.7; }
.region-empty a { color: var(--jade-dark); }

.skeleton-row {
  display: flex; gap: 16px; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}

/* 侧栏通用 */
.aside-card { padding: 16px 18px; }
.aside-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.aside-title { font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--ink); margin: 0; }
.aside-link { font-size: 12px; color: var(--muted); white-space: nowrap; }
.aside-link:hover { color: var(--jade-dark); }
.aside-note { font-size: 12.5px; color: var(--muted); line-height: 1.8; margin: 0; }
.aside-actions { display: flex; gap: 8px; margin-top: 14px; }
.live-pill {
  font-size: 9.5px; letter-spacing: .14em; font-weight: 700;
  color: var(--jade-dark); background: var(--jade-soft);
  border-radius: 999px; padding: 2px 7px; white-space: nowrap;
}

.quick-links { display: flex; flex-direction: column; }
.quick-links a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px dashed var(--line);
  font-size: 13px; color: var(--ink-3);
}
.quick-links a:last-child { border-bottom: 0; }
.quick-links a::after { content: "→"; color: var(--muted-2); font-size: 12px; }
.quick-links a:hover { color: var(--jade-dark); }

.side-list { display: flex; flex-direction: column; }
.side-news {
  display: flex; flex-direction: column; gap: 3px;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.side-news:last-child { border-bottom: 0; }
.side-news-title {
  font-size: 13px; line-height: 1.6; color: var(--ink-2); font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.side-news:hover .side-news-title { color: var(--jade-dark); }
.side-news-meta { font-size: 11.5px; color: var(--muted-2); }

.status-list { margin: 0; display: flex; flex-direction: column; }
.status-list > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
}
.status-list > div:last-child { border-bottom: 0; }
.status-list dt { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.status-list dd { margin: 0; font-size: 12.5px; color: var(--ink); font-weight: 500; text-align: right; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-count { font-size: 10px; color: var(--muted-2); margin-left: 3px; }
.chip.active .tag-count, .chip.active .chip-count { color: #bae6fd; }
.chip-count { font-size: 10.5px; color: var(--muted-2); margin-left: 2px; }
.chip.sm { height: 24px; padding: 0 9px; font-size: 11.5px; }
.chip:disabled { opacity: .5; cursor: not-allowed; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------- 首页 Hero ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #e8f1ff;
  background:
    radial-gradient(1100px 460px at 12% -20%, #1e5f9e 0%, transparent 62%),
    linear-gradient(135deg, #071a33 0%, #0d2b52 58%, #0a3f73 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5;
}
.hero::after {
  content: ""; position: absolute; right: -140px; top: -160px;
  width: 460px; height: 460px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(29, 111, 224, .5), transparent 66%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr);
  gap: 46px; align-items: center;
  padding-top: 46px; padding-bottom: 46px;
}
.hero .eyebrow { color: #7dd3fc; }
.hero-title {
  font-family: var(--serif);
  font-size: 44px; line-height: 1.15; letter-spacing: .02em;
  color: #eaf4ff; margin: 0;
}
.hero-brand { color: #bae6fd; }
.hero-desc { color: #a9c3df; font-size: 15px; line-height: 1.85; max-width: 650px; margin: 14px 0 0; }
.hero-search { display: flex; gap: 10px; max-width: 620px; margin-top: 22px; }
.hero-search .input {
  flex: 1 1 auto; height: 46px; font-size: 14.5px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .09);
  color: #fff;
}
.hero-search .input::placeholder { color: #9fb8d6; }
.hero-search .input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .18);
  background: rgba(255, 255, 255, .12);
}
.hero-search .btn { height: 46px; padding: 0 22px; flex: 0 0 auto; }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hero-link {
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .04);
  color: #cfe1f7; font-size: 12.5px;
  transition: all .15s;
}
.hero-link:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .3); }

.hero-panel {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
}
.hero-panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: #a9c3df; font-weight: 700; margin-bottom: 14px;
}
.hero-panel .live-pill { color: #7dd3fc; background: rgba(56, 189, 248, .15); }
.hero-panel-foot {
  font-size: 11.5px; color: #8fa8c6; line-height: 1.7;
  border-top: 1px solid rgba(255, 255, 255, .09);
  padding-top: 12px; margin-top: 14px;
}
.hero-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: rgba(255, 255, 255, .1);
  border-radius: 10px; overflow: hidden;
}
.hero-stats .stat {
  display: flex; flex-direction: column; gap: 1px;
  background: #0b2447; padding: 12px 14px;
}
.stat-num {
  font-family: var(--serif); font-size: 23px; font-weight: 700;
  line-height: 1.15; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.hero-stats .stat-num { color: #e0f2fe; }
.hero-stats .stat-label { color: #93a9c7; }
.hero-stats .skeleton { display: block; height: 25px; }

/* 首页主体 */
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  align-items: start;
}
.home-main { min-width: 0; }
.home-aside {
  position: sticky; top: calc(var(--header-h) + 12px);
  display: flex; flex-direction: column; gap: 16px;
  min-width: 0;
}
.home-section { margin: 34px 0; }
.home-section:first-child { margin-top: 0; }

.lead-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.lead-card {
  display: flex; flex-direction: column; height: 100%;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--jade);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  box-shadow: var(--shadow-sm);
}
.lead-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lead-title {
  font-family: var(--serif); font-size: 24px; line-height: 1.45;
  margin: 0 0 10px; color: var(--ink);
}
.lead-title a { color: inherit; }
.lead-title a:hover { color: var(--jade-dark); }
.lead-summary {
  font-size: 13.5px; color: var(--muted); line-height: 1.8; margin: 0 0 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lead-card .meta { margin-top: auto; }
.lead-more { font-size: 12.5px; font-weight: 500; margin-top: 12px; color: var(--jade-dark); }
.lead-side { min-width: 0; }
.lead-side .side-news { padding: 10px 0; }
.lead-side .side-news-title { font-size: 13.5px; }
.lead-side .empty-state { padding: 24px 14px; }

.rank-list { display: flex; flex-direction: column; }
.rank-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 11px 4px; border-bottom: 1px dashed var(--line);
}
.rank-item:last-child { border-bottom: 0; }
.rank-num {
  flex: 0 0 auto; width: 26px;
  font-family: var(--mono); font-size: 13px; color: var(--muted-2);
  padding-top: 2px; font-variant-numeric: tabular-nums;
}
.rank-num.hot { color: var(--gold); font-weight: 700; }
.rank-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rank-title {
  font-size: 13.5px; color: var(--ink-2); line-height: 1.55; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rank-item:hover .rank-title { color: var(--jade-dark); }
.rank-meta { font-size: 11.5px; color: var(--muted-2); }

.subhead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 24px 0 8px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.subhead-title { font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin: 0; letter-spacing: .02em; }
.subhead-more { font-size: 12px; color: var(--muted); }

.region-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.region-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 14px 16px 10px;
  display: flex; flex-direction: column; min-height: 170px;
}
.region-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.region-name { font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--ink); }
.region-count { font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.region-list { flex: 1 1 auto; display: flex; flex-direction: column; }
.mini-news { display: flex; flex-direction: column; gap: 2px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.mini-news:last-child { border-bottom: 0; }
.mini-title {
  font-size: 12.5px; line-height: 1.5; color: var(--ink-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mini-news:hover .mini-title { color: var(--jade-dark); }
.mini-meta { font-size: 10.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.region-more { font-size: 11.5px; color: var(--muted); padding-top: 8px; margin-top: auto; }
.region-more:hover { color: var(--jade-dark); }

.cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.cat-col { padding: 14px 16px 10px; border-left: 1px solid var(--line); min-width: 0; }
.cat-col:first-child { border-left: 0; }
.cat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 2px;
}
.cat-head a { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--ink); }
.cat-head a:hover { color: var(--jade-dark); }
.cat-arrow { color: var(--muted-2); font-size: 12px; }
.cat-list { display: flex; flex-direction: column; }

.dataset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dataset-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.dataset-card:hover { transform: translateY(-2px); border-color: var(--jade); box-shadow: var(--shadow-md); }
.dataset-abbr {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--jade-soft), #dbeafe);
  color: var(--jade-dark); font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .02em;
}
.dataset-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.dataset-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.dataset-count { font-size: 11px; color: var(--muted-2); }
.dataset-arrow { color: var(--muted-2); font-size: 13px; flex: 0 0 auto; }

.dtable { font-size: 13px; }
.dtable-head, .dtable-row {
  display: grid; gap: 0 14px; align-items: center;
  padding: 11px 16px;
}
.dtable-head {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  background: var(--paper-3);
  border-bottom: 1px solid var(--line-strong);
}
.dtable-row {
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  transition: background .14s;
}
.dtable-row:last-child { border-bottom: 0; }
.dtable-row:hover { background: var(--jade-mist); }
.dtable-row:hover .cell-name b { color: var(--jade-dark); }
.dtable.drugs .dtable-head, .dtable.drugs .dtable-row {
  grid-template-columns:
    minmax(170px, 1.5fr) 100px 108px minmax(110px, 1.05fr)
    minmax(110px, 1fr) 92px 66px 78px;
}
.dtable.drugs .drug-tags {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 8px; border-top: 1px dashed var(--line); margin-top: 2px;
}
.dtable.drugs .drug-tags .badge { font-weight: 500; }
.dtable.drugs .drug-tags .tag-empty { color: var(--muted-2); background: transparent; border: 1px dashed var(--line-strong); }

.dtable.hot .dtable-head, .dtable.hot .dtable-row {
  grid-template-columns: minmax(200px, 2fr) minmax(130px, 1.2fr) 108px 96px;
}
.cell { min-width: 0; overflow-wrap: anywhere; }
.cell-name b { display: block; font-weight: 600; color: var(--ink); line-height: 1.45; }
.cell-en {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 11.5px; color: var(--muted-2); line-height: 1.45; margin-top: 2px;
}
.cell-mono { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.cell-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cell .badge { margin: 1px 2px 1px 0; }
.home-more { display: flex; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }

.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.topic-grid.compact { grid-template-columns: repeat(4, 1fr); }
.topic-card { display: block; color: inherit; }
.topic-card:hover { color: inherit; }
.topic-card .card-body { display: flex; flex-direction: column; height: 100%; }
.topic-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.topic-date { font-size: 11px; color: var(--muted-2); }
.topic-card .card-title { font-size: 16px; margin-bottom: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.topic-card-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line);
}
.topic-author { font-size: 11.5px; color: var(--muted); }
.topic-tags { font-size: 11px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.announce-list { list-style: none; margin: 0; padding: 0; }
.announce-list li {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.announce-list li:last-child { border-bottom: 0; }
.announce-list a { flex: 1 1 60%; min-width: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-3); }
.announce-list a:hover { color: var(--jade-dark); }
.announce-date { font-size: 10.5px; color: var(--muted-2); margin-left: auto; white-space: nowrap; }

/* ---------------- 列表页通用 ---------------- */
.dataset-tabs-wrap {
  overflow-x: auto; border-bottom: 1px solid var(--line);
  margin-bottom: 16px; -webkit-overflow-scrolling: touch;
}
.dataset-tabs { display: flex; gap: 2px; min-width: max-content; }
.tab {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 12px; color: var(--muted); font-size: 13.5px;
  white-space: nowrap; transition: color .15s, border-color .15s, background .15s;
}
.tab:hover { color: var(--ink); background: var(--jade-mist); }
.tab.active { color: var(--jade-dark); border-color: var(--jade); font-weight: 600; }
.tab-count {
  margin-left: 5px; font-size: 10.5px; color: var(--muted-2);
  background: var(--paper-3); border-radius: 9px; padding: 1px 6px;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-count { background: var(--jade-soft); color: var(--jade-dark); }

.filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
  padding: 16px 18px; margin-bottom: 14px;
}
.filter-field { display: flex; flex-direction: column; flex: 0 0 170px; min-width: 0; }
.filter-field .label { margin-bottom: 5px; }
.filter-grow { flex: 2 1 320px; }
.filter-head {
  flex: 1 1 100%; display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding-bottom: 2px;
}
.filter-head b { font-size: 13px; color: var(--ink); }
.filter-head span { font-size: 11.5px; color: var(--muted); }
.filter-primary {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; flex: 1 1 100%;
}
.filter-primary .filter-field { flex: 0 1 175px; }
.filter-primary .filter-grow { flex: 2 1 280px; }
.filter-more {
  flex: 1 1 100%; border-top: 1px dashed var(--line); padding-top: 9px;
}
.filter-more > summary {
  cursor: pointer; color: var(--jade-dark); font-size: 12px; font-weight: 600;
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
.filter-more > summary::before { content: '＋'; font-weight: 700; }
.filter-more[open] > summary::before { content: '－'; }
.filter-more > summary::-webkit-details-marker { display: none; }
.filter-advanced {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px 14px; flex: 1 1 100%; padding-top: 12px; margin-top: 2px;
}
.filter-actions { display: flex; gap: 8px; }
.filter-actions .btn { height: 38px; }

.tech-filter { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin: 4px 0 16px; }
.tech-filter-label {
  font-size: 11px; color: var(--muted-2); font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}

.list-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 18px 0 10px;
}
.list-hint { font-size: 11.5px; color: var(--muted-2); }
.list-panel { overflow: hidden; }
#drug-list, #patent-list, #qa-list, #topic-list, #lib-body,
#exam-form, #exam-result, #home-latest { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ---------------- 详情页通用 ---------------- */
.detail-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin: 14px 0 22px;
}
.detail-eyebrow { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.detail-sub { color: var(--muted); font-size: 14px; margin: 6px 0 0; line-height: 1.6; }
.detail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.bp-cta .btn { width: 100%; justify-content: center; margin-top: 10px; }
.bp-inline-cta .block-head { margin-bottom: 6px; }
.bp-inline-cta .aside-note { color: var(--muted); line-height: 1.7; margin: 4px 0 12px; }
.detail-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.detail-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.block-title { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--ink); margin: 0 0 14px; }
.block-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--line); padding-bottom: 9px; margin-bottom: 12px;
}
.block-head .block-title { margin: 0; border: 0; padding: 0; }
.block-link { font-size: 12px; color: var(--muted); white-space: nowrap; }
.block-link:hover { color: var(--jade-dark); }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.field { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field-label {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-2); font-weight: 700;
}
.field-value { font-size: 14px; color: var(--ink); line-height: 1.75; overflow-wrap: anywhere; }
.related-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------- 专题详情 ---------------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }
.article-main { padding: 30px 34px; min-width: 0; }
.article-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.article-head { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 22px; }
.article-title { font-family: var(--serif); font-size: 31px; line-height: 1.4; color: var(--ink); margin: 0 0 12px; letter-spacing: .01em; }
.article-summary {
  font-size: 14.5px; color: var(--muted); line-height: 1.85; margin: 0 0 14px;
  padding-left: 14px; border-left: 3px solid var(--jade-soft);
}
.article-meta { font-size: 12.5px; }
.article-meta a { color: var(--jade-dark); }
.article-tags {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line);
}
.article-tags-label { font-size: 11.5px; color: var(--muted-2); letter-spacing: .1em; text-transform: uppercase; }
.topic-side-list { display: flex; flex-direction: column; }
.topic-side-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.topic-side-item:last-child { border-bottom: 0; }
.topic-side-title { font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.topic-side-item:hover .topic-side-title { color: var(--jade-dark); }
.topic-side-meta { font-size: 11px; color: var(--muted-2); }

/* Markdown 正文 */
.prose { font-size: 15.5px; line-height: 1.95; color: var(--text); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--ink);
  margin: 1.7em 0 .65em; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.prose h3 { font-family: var(--serif); font-size: 18px; color: var(--ink-2); margin: 1.5em 0 .55em; }
.prose h4 { font-size: 15.5px; color: var(--ink-2); margin: 1.3em 0 .5em; }
.prose p { margin: 0 0 1.05em; }
.prose ul, .prose ol { margin: .5em 0 1.1em; padding-left: 1.5em; }
.prose li { margin: .3em 0; }
.prose li > ul, .prose li > ol { margin: .2em 0; }
.prose blockquote {
  margin: 1.2em 0; padding: 12px 18px;
  border-left: 3px solid var(--jade);
  background: var(--jade-mist); color: var(--ink-3);
  border-radius: 0 8px 8px 0;
}
.prose blockquote p { margin: 0 0 .4em; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  background: var(--paper-3); border-radius: 4px; padding: 1px 5px;
  font-family: var(--mono); font-size: .86em; color: var(--ink-2);
}
.prose pre {
  background: var(--ink); color: #dfe9f7;
  padding: 16px 18px; border-radius: 10px;
  overflow-x: auto; margin: 1.2em 0;
}
.prose pre code { background: transparent; color: inherit; padding: 0; font-size: 12.5px; line-height: 1.7; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose a { color: var(--jade-dark); text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--ink); }
.prose .md-table { overflow-x: auto; margin: 1.2em 0; }
.prose .md-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.prose .md-table th, .prose .md-table td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; vertical-align: top; }
.prose .md-table th { background: var(--paper-3); font-weight: 700; white-space: nowrap; }
.prose .md-table tr:nth-child(even) td { background: #f8fbff; }
.prose .cite-ref { color: var(--jade); font-weight: 700; font-size: 11px; }

.lib-group { margin-bottom: 28px; }
.lib-group-title {
  font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--ink);
  margin: 0 0 13px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.lib-group-count {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  color: var(--muted); background: var(--paper-3);
  border-radius: 9px; padding: 1px 8px;
}
.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lib-card { display: block; color: inherit; }
.lib-card:hover { color: inherit; }
.lib-card .card-body { display: flex; flex-direction: column; height: 100%; }
.lib-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.lib-year { font-size: 11px; color: var(--muted-2); font-family: var(--mono); }
.lib-card .card-title { font-size: 15.5px; margin-bottom: 4px; }
.lib-org { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.lib-card .card-text { margin-bottom: 10px; }
.lib-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.ext-arrow { color: var(--jade); font-size: 12px; }

.qa-list { display: flex; flex-direction: column; gap: 10px; }
.qa-item {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.qa-item.open { border-color: var(--jade); box-shadow: var(--shadow-md); }
.qa-q {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  background: transparent; border: 0; text-align: left;
  padding: 15px 18px; color: var(--ink);
}
.qa-mark {
  flex: 0 0 auto; width: 23px; height: 23px; border-radius: 6px;
  display: grid; place-items: center;
  background: var(--jade); color: #fff;
  font-size: 11.5px; font-weight: 600; font-family: var(--sans);
  margin-top: 2px;
}
.qa-question {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--serif); font-size: 16px; font-weight: 700; line-height: 1.6; color: var(--ink);
}
.qa-chevron { flex: 0 0 auto; color: var(--muted); font-size: 16px; line-height: 1.4; transition: transform .2s; }
.qa-item.open .qa-chevron { transform: rotate(180deg); }
.qa-a { display: none; padding: 0 18px 16px 53px; border-top: 1px dashed var(--line); }
.qa-item.open .qa-a { display: block; }
.qa-answer { display: flex; gap: 12px; padding-top: 14px; }
.qa-answer .qa-mark.answer-mark { background: var(--gold); }
.qa-answer-text { flex: 1 1 auto; min-width: 0; font-size: 13.5px; line-height: 1.9; color: var(--ink-3); }
.qa-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-top: 14px;
}
.qa-date { font-size: 11.5px; color: var(--muted-2); }

.exam-cats { margin-bottom: 16px; }
.exam-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 18px;
}
.exam-toolbar-left { min-width: 0; }
.exam-toolbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.exam-tip { font-size: 11.5px; color: var(--muted-2); }
.exam-progress { display: flex; align-items: center; gap: 10px; margin-top: 7px; flex-wrap: wrap; }
.exam-progress-text { font-size: 12px; color: var(--muted); }
.exam-progress-text b { color: var(--ink); }
.exam-progress-bar {
  width: 140px; height: 6px; border-radius: 999px;
  background: var(--paper-3); overflow: hidden; display: inline-block;
}
.exam-progress-bar > span { display: block; height: 100%; background: var(--jade); border-radius: 999px; transition: width .2s; }

.exam-list { display: flex; flex-direction: column; gap: 14px; }
.exam-item {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}
.exam-item-head { display: flex; align-items: flex-start; gap: 12px; }
.exam-index {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--ink); color: #eaf2ff;
  font-family: var(--mono); font-size: 12px; font-weight: 600; margin-top: 1px;
}
.exam-question { flex: 1 1 auto; min-width: 0; font-size: 15.5px; font-weight: 600; color: var(--ink); line-height: 1.7; }
.exam-cat { margin-left: auto; flex: 0 0 auto; }
.exam-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 14px 0 0 40px; }
.exam-opt {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--line); background: var(--white);
  border-radius: 8px; padding: 10px 12px;
  font-size: 13.5px; line-height: 1.6; color: var(--ink-3);
  cursor: pointer; transition: border-color .14s, background .14s, box-shadow .14s;
  position: relative;
}
.exam-opt:hover { border-color: var(--jade); background: var(--jade-mist); }
.exam-opt:focus-within { box-shadow: 0 0 0 3px rgba(29, 111, 224, .16); border-color: var(--jade); }
.exam-opt input {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.exam-letter {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); color: var(--muted);
  font-size: 11px; font-weight: 600; font-family: var(--mono);
  transition: all .14s;
}
.exam-opt.selected { border-color: var(--jade); background: var(--jade-mist); box-shadow: inset 0 0 0 1px var(--jade); }
.exam-opt.selected .exam-letter { background: var(--jade); border-color: var(--jade); color: #fff; }
.exam-opt.correct { border-color: #0284c7; background: #e0f2fe; box-shadow: inset 0 0 0 1px #0284c7; }
.exam-opt.correct .exam-letter { background: #0284c7; border-color: #0284c7; color: #fff; }
.exam-opt.wrong { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.exam-opt.wrong .exam-letter { background: var(--red); border-color: var(--red); color: #fff; }
.exam-item.is-ok { border-left: 3px solid #0284c7; }
.exam-item.is-bad { border-left: 3px solid var(--red); }

.exam-analysis { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--jade); background: var(--jade-mist); border-radius: 0 8px 8px 0; }
.exam-analysis.ok { border-left-color: #0284c7; background: #eff6ff; }
.exam-analysis.bad { border-left-color: var(--red); background: var(--red-soft); }
.analysis-head { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 12.5px; color: var(--muted); }
.answer-mark { display: inline-flex; align-items: center; border-radius: 5px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; }
.answer-mark.ok { background: #dbeafe; color: #075985; }
.answer-mark.bad { background: #fbd5d5; color: var(--red); }
.analysis-exp { margin-top: 8px; font-size: 13px; line-height: 1.85; color: var(--ink-3); }
.analysis-exp b { color: var(--ink); }

.score-card {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: 22px 26px; margin-bottom: 20px;
}
.score-ring {
  width: 96px; height: 96px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--jade) calc(var(--pct) * 1%), var(--paper-3) 0);
  display: grid; place-items: center; position: relative;
}
.score-ring::before {
  content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--paper-2);
}
.score-value { position: relative; z-index: 1; font-family: var(--serif); font-size: 25px; font-weight: 700; color: var(--ink); }
.score-value small { font-size: 12px; color: var(--muted); margin-left: 1px; }
.score-info { flex: 1 1 240px; min-width: 0; }
.score-title { font-family: var(--serif); font-size: 19px; color: var(--ink); }
.score-title b { color: var(--jade-dark); }
.score-comment { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.score-note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted-2); }
.score-note code { font-family: var(--mono); font-size: 11px; background: var(--paper-3); border-radius: 4px; padding: 1px 5px; }

/* ---------------- 关于 ---------------- */
.about-hero { padding: 8px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.about-lead { max-width: 880px; color: var(--ink-3); font-size: 15px; line-height: 1.95; margin: 14px 0 18px; }
.about-links .hero-link { border-color: var(--line); background: var(--paper-2); color: var(--ink-3); }
.about-links .hero-link:hover { border-color: var(--jade); background: var(--jade-mist); color: var(--jade-dark); }
.about-panel { margin-bottom: 10px; }
.about-stats { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; margin-top: 16px; }
.about-stats .stat {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px;
}
.about-stats .stat-num { font-size: 21px; }
.about-stats .stat-label { font-size: 10.5px; }
.about-stats .region-empty { grid-column: 1 / -1; text-align: center; }

.roadmap { position: relative; padding-left: 26px; }
.roadmap::before {
  content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px;
  width: 2px; background: var(--line);
}
.roadmap-item { position: relative; padding-bottom: 26px; }
.roadmap-item:last-child { padding-bottom: 0; }
.roadmap-item::before {
  content: ""; position: absolute; left: -26px; top: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--line-strong);
}
.roadmap-item.done::before { background: var(--jade); border-color: var(--jade); }
.roadmap-item.active::before { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.roadmap-step {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 4px;
}
.roadmap-item.done .roadmap-step { color: var(--jade-dark); }
.roadmap-item.active .roadmap-step { color: var(--gold); }
.roadmap-body h3 { font-family: var(--serif); font-size: 19px; color: var(--ink); margin: 0 0 6px; }
.roadmap-body p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.85; max-width: 900px; }
.roadmap-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-card h3 { font-family: var(--serif); font-size: 17px; color: var(--ink); margin: 0 0 8px; }
.info-card p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; line-height: 1.85; }
.info-link { font-size: 12.5px; font-weight: 500; color: var(--jade-dark); }

.arch-panel { padding: 0; overflow: hidden; }
.arch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.arch-item { display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; background: var(--paper-2); }
.arch-key { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.arch-val { font-size: 13.5px; color: var(--ink-3); line-height: 1.75; }
.disclaimer p { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; line-height: 1.9; }
.disclaimer p:last-child { margin-bottom: 0; }

/* ---------------- 公告 ---------------- */
.announce-full { display: flex; flex-direction: column; gap: 14px; }
.announce-card {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 22px 24px;
}
.announce-card.pinned { border-color: #7dd3fc; background: linear-gradient(180deg, var(--gold-soft) 0, var(--paper-2) 150px); }
.announce-card-head {
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px dashed var(--line); padding-bottom: 12px; margin-bottom: 14px;
}
.announce-title { font-family: var(--serif); font-size: 20px; color: var(--ink); margin: 0; flex: 1 1 60%; line-height: 1.5; }
.announce-time { margin-left: auto; font-size: 12px; color: var(--muted-2); white-space: nowrap; }
.announce-content p { margin: 0 0 10px; color: var(--ink-3); font-size: 14px; line-height: 1.9; }
.announce-content p:last-child { margin-bottom: 0; }

/* ---------------- 404 ---------------- */
.notfound { max-width: 760px; margin: 30px auto; text-align: center; padding: 16px; }
.notfound-code {
  font-family: var(--serif); font-size: 120px; line-height: 1;
  font-weight: 700; color: var(--jade); opacity: .22; letter-spacing: .08em;
}
.notfound-title { font-family: var(--serif); font-size: 30px; color: var(--ink); margin: 4px 0 10px; }
.notfound-desc { color: var(--muted); font-size: 14.5px; line-height: 1.85; max-width: 560px; margin: 0 auto 22px; }
.notfound-search { display: flex; gap: 10px; max-width: 560px; margin: 0 auto 22px; }
.notfound-search .input { height: 44px; }
.notfound-search .btn { height: 44px; flex: 0 0 auto; }
.notfound-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.notfound-tip { margin-top: 24px; font-size: 12px; color: var(--muted-2); }
.notfound-tip kbd {
  font-family: var(--sans); font-size: 10.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; background: var(--paper-2);
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1180px) {
  .hero-title { font-size: 38px; }
  .dtable.drugs .dtable-head, .dtable.drugs .dtable-row {
    grid-template-columns: minmax(150px, 1.5fr) 90px 96px minmax(100px, 1fr) minmax(100px, 1fr) 84px 62px 72px;
    gap: 0 10px;
  }
  .topic-grid.compact { grid-template-columns: repeat(3, 1fr); }
  .about-stats { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1020px) {
  .home-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 26px; }
  .detail-grid, .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-main { padding: 26px 26px; }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 28px; padding-top: 34px; padding-bottom: 34px; }
  .hero-side { max-width: 560px; }
  .hero-title { font-size: 34px; }
  .home-layout { grid-template-columns: 1fr; }
  .home-aside {
    position: static;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px; align-items: start;
  }
  .home-aside > :first-child { grid-column: 1 / -1; }
  .region-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-col:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .cat-col:nth-child(4) { border-top: 1px solid var(--line); }
  .dataset-grid { grid-template-columns: repeat(2, 1fr); }
  .lead-grid { grid-template-columns: 1fr; }
  .article-title { font-size: 26px; }
  .about-stats { grid-template-columns: repeat(4, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
  .arch-grid { grid-template-columns: 1fr; }

  /* 列表表格 -> 卡片 */
  .dtable-head { display: none; }
  .dtable.drugs .dtable-row, .dtable.hot .dtable-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px 16px;
    padding: 14px 16px;
    align-items: start;
  }
  .dtable .cell-name { grid-column: 1 / -1; }
  .dtable .cell { font-size: 12.5px; }
  .dtable .cell::before {
    content: attr(data-label);
    display: block;
    font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted-2); font-weight: 700; margin-bottom: 2px;
  }
  .dtable .cell-name::before { display: none; }
  /* 药卡在移动端隐藏源数据为空的字段，减少无效纵向空间 */
  .dtable.drugs .cell-empty { display: none; }
  .dtable.drugs .drug-tags .tag-empty { display: none; }
  .exam-opts { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .filter-field { flex: 1 1 100%; }
  .filter-actions { flex: 1 1 100%; }
  .filter-actions .btn { flex: 1 1 auto; }
  .topic-grid, .topic-grid.compact { grid-template-columns: 1fr; }
  .lib-grid { grid-template-columns: 1fr; }
  .home-aside { grid-template-columns: 1fr; }
  .home-aside > :first-child { grid-column: auto; }
  .region-grid { grid-template-columns: 1fr; }
  .dataset-grid { grid-template-columns: 1fr 1fr; }
  .article-main { padding: 22px 18px; }
  .article-title { font-size: 23px; }
  .prose { font-size: 15px; line-height: 1.9; }
  .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .exam-toolbar-right { width: 100%; justify-content: space-between; }
  .score-card { gap: 18px; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
  .notfound-code { font-size: 92px; }
}

@media (max-width: 560px) {
  .hero-title { font-size: 30px; }
  .hero-desc { font-size: 14px; }
  .hero-search { flex-direction: column; }
  .hero-search .btn { width: 100%; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .cat-col { border-left: 0; border-top: 1px solid var(--line); }
  .cat-col:first-child { border-top: 0; }
  .dataset-grid { grid-template-columns: 1fr; }
  .lead-title { font-size: 21px; }
  .exam-opts { margin-left: 0; }
  .qa-a { padding-left: 18px; }
  .qa-question { font-size: 15px; }
  .score-ring { width: 78px; height: 78px; }
  .score-value { font-size: 21px; }
  .notfound-search { flex-direction: column; }
  .notfound-search .btn { width: 100%; }
  .article-aside { gap: 14px; }
}

/* ============================================================
   超窄屏（≤440px，覆盖 390 / 375 / 360 视口）
   目标：单列、无横向滚动、长内容可断行、信息密度不塌陷
   ============================================================ */
@media (max-width: 440px) {
  .wrap { padding: 0 14px; }

  /* 导航换行，避免横向滚动被截断 */
  .main-nav {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 2px;
    padding-bottom: 0;
  }
  .main-nav a { padding: 6px 9px; font-size: 12.5px; }
  .site-header .wrap { gap: 8px; }

  /* hero 单列 + 统计两列 + 搜索纵向 */
  .hero-inner { grid-template-columns: 1fr; gap: 22px; padding-top: 26px; padding-bottom: 28px; }
  .hero-side { max-width: none; }
  .hero-title { font-size: 27px; }
  .hero-desc { font-size: 13.5px; line-height: 1.8; }
  .hero-search { flex-direction: column; max-width: none; margin-top: 18px; }
  .hero-search .btn { width: 100%; }
  .hero-links { gap: 6px; margin-top: 16px; }
  .hero-link { padding: 5px 10px; font-size: 12px; }
  .hero-panel { padding: 16px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats .stat { padding: 10px 12px; }
  .hero-stats .stat-num { font-size: 20px; }
  .hero-panel-foot { font-size: 11px; }

  /* 内容网格全部单列 */
  .lead-grid, .region-grid, .cat-grid, .dataset-grid,
  .topic-grid, .topic-grid.compact, .lib-grid,
  .info-grid, .arch-grid, .field-grid, .home-aside { grid-template-columns: 1fr; }
  .home-aside > :first-child { grid-column: auto; }
  .cat-col { border-left: 0; border-top: 1px solid var(--line); }
  .cat-col:first-child { border-top: 0; }
  .dataset-card { padding: 12px 12px; }

  /* 区块与标题 */
  /* 只改纵向内边距，保留 .wrap 的左右安全边距，避免新闻页标题贴边被裁切 */
  .page { padding-top: 20px; padding-bottom: 42px; }
  .page-head { gap: 12px; margin-bottom: 18px; }
  .page-title { font-size: 23px; }
  .hero-title { letter-spacing: 0; }
  .section { margin: 28px 0; }
  .home-section { margin: 28px 0; }
  .section-head { flex-wrap: wrap; row-gap: 4px; align-items: baseline; }
  .section-title { font-size: 19px; }
  .section-more { font-size: 12px; }
  .block-head { flex-wrap: wrap; row-gap: 4px; }
  .block-head > .muted { flex: 1 1 100%; }
  .lead-card { padding: 18px 16px 16px; }
  .lead-title { font-size: 20px; }
  .subhead { margin-top: 18px; }

  /* 列表 / 筛选 */
  .filter-bar { padding: 13px 13px; gap: 10px; }
  .filter-field, .filter-grow, .filter-actions { flex: 1 1 100%; }
  .filter-actions .btn { flex: 1 1 auto; }
  .dataset-tabs { gap: 0; }
  .tab { padding: 9px 10px; font-size: 12.5px; }
  .list-head { margin: 14px 0 8px; gap: 4px; }
  .list-hint { display: none; }
  .dtable .dtable-row { gap: 7px 12px; padding: 12px 13px; }
  .dtable.drugs .dtable-row, .dtable.hot .dtable-row {
    grid-template-columns: 1fr 1fr !important;
  }

  /* 详情 / 文章 */
  .breadcrumb { font-size: 11.5px; gap: 6px; }
  .detail-head { gap: 12px; margin: 10px 0 16px; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1 1 auto; }
  .article-main { padding: 18px 14px; }
  .article-title { font-size: 21px; }
  .article-summary { font-size: 13.5px; }
  .prose { font-size: 14.5px; }
  .prose h2 { font-size: 19px; }
  .prose h3 { font-size: 16.5px; }
  .prose blockquote { padding: 10px 14px; }
  .prose .md-table { font-size: 12.5px; }

  /* 关于 / 公告 / 404 */
  .qa-q { padding: 13px 14px; }
  .qa-question { font-size: 14.5px; }
  .qa-a { padding: 0 14px 14px; }
  .exam-toolbar { padding: 12px 13px; }
  .exam-toolbar-right { flex-direction: column; align-items: stretch; width: 100%; }
  .exam-toolbar-right .btn { width: 100%; }
  .exam-tip { display: none; }
  .exam-progress-bar { width: 100px; }
  .exam-item { padding: 16px 13px; }
  .exam-question { font-size: 14.5px; }
  .exam-opts { margin-left: 0; }
  .score-card { padding: 18px 16px; gap: 16px; }
  .score-info { flex-basis: 100%; }
  .about-hero { padding-top: 0; }
  .about-lead { font-size: 14px; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .roadmap { padding-left: 22px; }
  .roadmap-item::before { left: -22px; }
  .roadmap-body h3 { font-size: 17px; }
  .announce-card { padding: 16px 14px; }
  .announce-title { font-size: 17px; }
  .notfound { margin-top: 10px; }
  .notfound-code { font-size: 82px; }
  .notfound-title { font-size: 24px; }
  .notfound-search { flex-direction: column; }
  .notfound-search .btn { width: 100%; }
  .score-ring { width: 76px; height: 76px; }
  .score-value { font-size: 20px; }
}

@media (max-width: 360px) {
  .wrap { padding: 0 12px; }
  .hero-title { font-size: 24px; }
  .hero-stats .stat-num { font-size: 18px; }
  .main-nav a { padding: 6px 7px; font-size: 12px; }
  .exam-item { padding: 14px 12px; }
  .score-ring { width: 68px; height: 68px; }
}

/* 来源外链（Lead 集成：首页所有新闻标注来源并可跳原文） */
.src-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.src-link:hover { color: var(--jade-dark); text-decoration: underline; text-underline-offset: 2px; }
.src-link .ext-icon { font-size: 9px; opacity: .65; }
.lead-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.lead-actions .lead-more { margin-top: 12px; }
.rank-title { color: inherit; }
.rank-src { font-size: 11.5px; }

/* 通用导出条 */
.export-bar, .export-buttons { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.export-bar { margin: 10px 0 0; }
.export-bar .label { margin: 0 4px 0 0; color: var(--muted); font-size: 12px; }
.export-buttons .btn { white-space: nowrap; }
.list-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

/* 全站搜索页 */
.search-page-head { margin: 12px 0 20px; }
.search-page-form { display: flex; gap: 10px; max-width: 820px; margin-top: 16px; }
.search-page-form .input { flex: 1 1 auto; }
.search-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.search-summary { color: var(--muted); font-size: 13px; margin: 8px 0 14px; }
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-result {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2);
  color: var(--ink-3); text-decoration: none; transition: border-color .15s, background .15s;
}
.search-result:hover { border-color: var(--jade); background: var(--jade-mist); }
.search-result-type { flex: 0 0 auto; min-width: 56px; color: var(--jade-dark); font-size: 11px; font-weight: 700; padding-top: 2px; }
.search-result-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.search-result-main b { color: var(--ink); font-weight: 600; }
.search-result-main span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.search-result-arrow { color: var(--muted-2); }
.search-empty { padding: 28px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 10px; }
@media (max-width: 720px) { .search-page-form { flex-direction: column; } .search-result-type { min-width: 44px; } }

/* 账号 / 管理 */
.auth-page { max-width: 620px; margin: 40px auto; }
.auth-card { padding: 28px 30px; }
.auth-form { display: flex; flex-direction: column; gap: 9px; margin: 18px 0; }
.auth-form .label { margin-top: 5px; }
.auth-form .btn { margin-top: 10px; }
.auth-error { color: #b3402f; background: #fff2ef; border: 1px solid #f0c7bf; border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.auth-switch { color: var(--muted); font-size: 13px; margin-top: 16px; }
.auth-switch a { color: var(--jade-dark); }
.admin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.admin-stat { padding: 16px; }
.admin-stat .stat-value { font-size: 24px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 8px 7px; text-align: left; vertical-align: top; }
.admin-table th { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.account-list { display: flex; flex-direction: column; gap: 7px; margin: 10px 0 18px; }
.account-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.account-item .muted { font-size: 12px; }
@media (max-width: 720px) { .admin-grid { grid-template-columns: 1fr 1fr; } .admin-table { display: block; overflow-x: auto; } .auth-page { margin: 16px auto; } }

/* 模块权限：未开通时隐藏入口 */
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.account-grid > .panel { min-width: 0; }
@media (max-width: 820px) { .account-grid { grid-template-columns: 1fr; } }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row .input { flex: 1 1 auto; }
.code-row .btn { flex: 0 0 auto; white-space: nowrap; }
.admin-row-actions { display: flex; flex-direction: column; gap: 5px; min-width: 86px; }
.btn.danger { color: #b3402f; border-color: #e5b9b1; }
.btn.danger:hover { background: #fff2ef; }
.detail-user-head { margin-bottom: 14px; line-height: 1.8; }
.ip-map { position: relative; width: 100%; max-width: 1000px; margin: 12px 0 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f7fafd; }
.ip-map img { display: block; width: 100%; height: auto; opacity: .9; }
.ip-map-points { position: absolute; inset: 0; }
.ip-point { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #d64545; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(214,69,69,.25); }
@media (max-width: 720px) { .admin-row-actions { flex-direction: row; flex-wrap: wrap; } }
.admin-table-wrap { overflow-x: auto; }
.admin-create-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; align-items: end; }
.admin-create-grid .label { margin-bottom: 4px; }
.admin-create-checks { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); padding-bottom: 9px; }
.admin-create-checks label { display: flex; align-items: center; gap: 5px; }
@media (max-width: 900px) { .admin-create-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .admin-create-grid { grid-template-columns: 1fr; } }
.pager-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 10px 0 4px; color: var(--muted); font-size: 12px; }
.pager-tools .select { width: auto; min-width: 92px; }
@media (max-width: 620px) { .pager-tools { justify-content: center; } }

.module-locked { opacity: .82; }
.module-locked:hover { opacity: 1; }

/* ---------- 访客门禁：仅首页可见 + 注册提示 ---------- */
.guest-banner {
  background: linear-gradient(90deg, #082446 0%, #0d3768 62%, #115089 100%);
  border-bottom: 1px solid rgba(125, 211, 252, .22);
  color: #cfe4ff;
}
.guest-banner-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 44px; padding-top: 8px; padding-bottom: 8px; font-size: 12.5px;
}
.guest-banner-text { line-height: 1.55; }
.guest-banner-text strong { color: #fff; margin-right: 7px; letter-spacing: .04em; }
.guest-banner-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.guest-banner-actions a { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.guest-banner-login { color: #dbeafe; border: 1px solid rgba(191, 219, 254, .38); }
.guest-banner-login:hover { color: #fff; border-color: rgba(255, 255, 255, .7); }
.guest-banner-register { background: #7dd3fc; color: #062344; }
.guest-banner-register:hover { background: #bae6fd; color: #062344; }
.guest-home .module-locked { opacity: .72; }

.guest-gate-mask {
  position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center;
  padding: 20px; background: rgba(4, 16, 36, .68); backdrop-filter: blur(6px);
}
.guest-gate-mask.open { display: flex; }
body.guest-gate-open { overflow: hidden; }
.guest-gate-dialog {
  position: relative; width: min(460px, 100%); padding: 34px 32px 26px; text-align: center;
  border-radius: 18px; border: 1px solid rgba(191, 219, 254, .9);
  background: linear-gradient(165deg, #ffffff 0%, #f3f8ff 100%);
  box-shadow: 0 34px 90px rgba(2, 12, 30, .48), 0 2px 0 rgba(255, 255, 255, .7) inset;
}
.guest-gate-close {
  position: absolute; top: 9px; right: 11px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 22px; line-height: 1;
}
.guest-gate-close:hover { background: var(--paper-3); color: var(--ink); }
.guest-gate-mark {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-family: var(--serif); font-size: 17px;
  background: linear-gradient(135deg, #0b4fb3 0%, #1d6fe0 55%, #38bdf8 100%);
  box-shadow: 0 8px 20px rgba(13, 79, 179, .3);
}
.guest-gate-dialog .eyebrow { margin-bottom: 6px; color: var(--blue); }
.guest-gate-dialog h2 { margin: 0 0 10px; color: var(--ink); font-family: var(--serif); font-size: 25px; letter-spacing: .02em; }
.guest-gate-dialog p { margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.75; }
.guest-gate-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 0; }
.guest-gate-actions .btn { height: 42px; justify-content: center; }
.guest-gate-later {
  margin-top: 12px; border: 0; background: transparent; color: var(--muted-2); font-size: 12px; padding: 4px 8px;
}
.guest-gate-later:hover { color: var(--ink-3); }
.guest-gate-note { margin-top: 16px !important; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted-2) !important; font-size: 11.5px !important; }
@media (max-width: 620px) {
  .guest-banner-inner { align-items: flex-start; flex-direction: column; gap: 6px; padding-top: 9px; padding-bottom: 10px; }
  .guest-banner-actions { width: 100%; }
  .guest-banner-actions a { flex: 1; justify-content: center; }
  .guest-gate-dialog { padding: 30px 20px 22px; }
  .guest-gate-actions { grid-template-columns: 1fr; }
}

.atc-levels { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.atc-level { display: flex; align-items: baseline; gap: 7px; font-size: 12px; color: var(--muted); }
.atc-level b { color: var(--ink-2); font-size: 10px; min-width: 18px; }
.atc-level code { color: var(--ink); background: var(--paper-3); border-radius: 3px; padding: 1px 5px; font-family: var(--mono); }

.atc-source { font-size: 11px; color: var(--muted-2); margin-top: 2px; }

.terms-check { display:flex; align-items:flex-start; gap:8px; margin:4px 0 12px; color:var(--muted); font-size:12.5px; line-height:1.6; }
.terms-check input { margin-top:3px; flex:none; }
.terms-check a { color:var(--primary); }
