/* ============================================================
   BioHao Portal — 学术简洁风样式表
   设计目标：中文长文可读性优先；表格密集的报告也能清爽呈现；
            移动端友好；不依赖任何外部资源（离线可用）。
   ============================================================ */

:root {
  --c-primary: #0f766e;
  --c-primary-dark: #115e59;
  --c-primary-soft: #ccfbf1;
  --c-accent: #0369a1;
  --c-text: #0f172a;
  --c-text-soft: #475569;
  --c-muted: #64748b;
  --c-border: #e2e8f0;
  --c-bg: #f8fafc;
  --c-surface: #ffffff;
  --c-warn-bg: #fffbeb;
  --c-warn-border: #fcd34d;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 12px rgba(15, 23, 42, .04);
  --shadow-hover: 0 2px 6px rgba(15, 23, 42, .07), 0 12px 28px rgba(15, 23, 42, .08);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --wrap: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-bg);
}

a { color: var(--c-primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--c-primary);
  color: #fff; padding: 10px 16px; z-index: 99;
}
.skip-link:focus { left: 8px; top: 8px; }

.muted { color: var(--c-muted); }
.small { font-size: .9rem; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 64px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; color: var(--c-text); }
.brand-text small { font-size: 12px; color: var(--c-muted); }

.top-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.top-nav a {
  padding: 6px 11px; border-radius: 999px; font-size: 14.5px;
  color: var(--c-text-soft); white-space: nowrap;
}
.top-nav a:hover { background: var(--c-primary-soft); color: var(--c-primary-dark); text-decoration: none; }
.top-nav a.active { background: var(--c-primary); color: #fff; }

.search-mini { display: flex; gap: 0; flex-shrink: 0; }
.search-mini input {
  width: 170px; padding: 7px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--c-border); border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: #fff; color: var(--c-text);
}
.search-mini input:focus { outline: 2px solid var(--c-primary); outline-offset: -1px; }
.search-mini button {
  padding: 7px 14px; font-size: 14px; font-family: inherit; cursor: pointer;
  border: 1px solid var(--c-primary); background: var(--c-primary); color: #fff;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.search-mini button:hover { background: var(--c-primary-dark); }

main { padding: 32px 20px 64px; }

/* ---------------- 首页 Hero ---------------- */
.hero {
  background: linear-gradient(160deg, #ffffff 0%, #f0fdfa 100%);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  padding: 44px 40px 36px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}
.hero h1 {
  margin: 0 0 12px; font-size: 30px; line-height: 1.35;
  letter-spacing: -.3px; color: var(--c-text);
}
.hero-desc {
  margin: 0 0 26px; max-width: 760px;
  color: var(--c-text-soft); font-size: 16px;
}
.search-main { display: flex; gap: 10px; max-width: 620px; margin-bottom: 26px; }
.search-main input {
  flex: 1; padding: 12px 16px; font-size: 15.5px; font-family: inherit;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: #fff; color: var(--c-text);
}
.search-main input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.search-main button {
  padding: 12px 26px; font-size: 15.5px; font-family: inherit; cursor: pointer;
  border: none; border-radius: var(--radius);
  background: var(--c-primary); color: #fff; font-weight: 500;
}
.search-main button:hover { background: var(--c-primary-dark); }

.hero-stats {
  display: flex; gap: 36px; flex-wrap: wrap;
  margin: 0; padding-top: 22px; border-top: 1px solid var(--c-border);
}
.hero-stats div { display: flex; flex-direction: column; gap: 2px; }
.hero-stats dt { font-size: 12.5px; color: var(--c-muted); letter-spacing: .3px; }
.hero-stats dd { margin: 0; font-size: 24px; font-weight: 600; color: var(--c-primary-dark); line-height: 1.2; }
.hero-stats dd.small { font-size: 15px; font-weight: 500; }

/* ---------------- 区块 ---------------- */
.block { margin-bottom: 46px; }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
  padding-bottom: 10px; border-bottom: 2px solid var(--c-border);
}
.block-head h2 {
  margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.2px;
  color: var(--c-text);
}
.block-head h2::before {
  content: ""; display: inline-block; width: 4px; height: 17px;
  background: var(--c-primary); border-radius: 2px;
  margin-right: 10px; vertical-align: -2px;
}
.more { font-size: 14px; color: var(--c-primary-dark); white-space: nowrap; }

/* ---------------- 卡片 ---------------- */
.card-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: #cbd5e1; }
.card-link { display: block; padding: 18px 20px 16px; color: inherit; }
.card-link:hover { text-decoration: none; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-cat { font-size: 12.5px; color: var(--c-muted); }
.card-title {
  margin: 0 0 8px; font-size: 16px; font-weight: 600; line-height: 1.5;
  color: var(--c-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-summary {
  margin: 0 0 12px; font-size: 13.5px; line-height: 1.7; color: var(--c-text-soft);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-size: 12.5px; color: var(--c-muted); display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- 列表行 ---------------- */
.row-list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--c-border);
}
.row:last-child { border-bottom: none; }
.row:hover { background: #fff; box-shadow: var(--shadow); }
.row-date {
  flex-shrink: 0; width: 92px; font-size: 13px;
  color: var(--c-muted); font-variant-numeric: tabular-nums;
}
.row-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; color: var(--c-text); }
.row:hover .row-title { color: var(--c-primary-dark); }
.row-meta { flex-shrink: 0; font-size: 12.5px; color: var(--c-muted); }

/* ---------------- 徽章 ---------------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1.7; white-space: nowrap;
}
.badge-weekly { background: #dbeafe; color: #1e40af; }
.badge-monthly { background: #d1fae5; color: #065f46; }
.badge-topic { background: #fef3c7; color: #92400e; }
.badge-other { background: #e2e8f0; color: #475569; }
.badge-plain { background: #f1f5f9; color: var(--c-text-soft); }

/* ---------------- 页面头 / 面包屑 ---------------- */
.breadcrumb {
  font-size: 13.5px; color: var(--c-muted); margin-bottom: 16px;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.breadcrumb a { color: var(--c-text-soft); }
.crumb-current { color: var(--c-muted); }

.page-head { margin-bottom: 26px; }
.page-head h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.4; letter-spacing: -.3px; }
.page-head .muted { margin: 0; font-size: 14px; }

/* ---------------- 报告页 ---------------- */
.report-layout {
  display: grid; gap: 36px;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: start;
}
.report-head { margin-bottom: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--c-border); }
.report-badges { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.report-head h1 {
  margin: 0 0 12px; font-size: 27px; line-height: 1.42;
  letter-spacing: -.4px; color: var(--c-text);
}
.report-lead {
  margin: 0 0 16px; padding: 14px 18px;
  background: #f0fdfa; border-left: 3px solid var(--c-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14.5px; line-height: 1.8; color: var(--c-text-soft);
}
.report-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--c-muted);
}
.report-meta a { color: var(--c-accent); }

/* 目录侧栏 */
.report-toc { position: sticky; top: 84px; }
.toc-inner {
  max-height: calc(100vh - 130px); overflow-y: auto;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 16px 18px;
  font-size: 13.5px;
}
.toc-title {
  margin: 0 0 10px; font-size: 12.5px; font-weight: 600;
  letter-spacing: .6px; color: var(--c-muted); text-transform: uppercase;
}
.toc-inner ol { list-style: none; margin: 0; padding: 0; }
.toc-inner li { margin-bottom: 5px; line-height: 1.55; }
.toc-inner li a { color: var(--c-text-soft); display: block; padding: 2px 0; }
.toc-inner li a:hover { color: var(--c-primary-dark); text-decoration: none; }
.toc-inner li.lvl-2 { padding-left: 12px; }
.toc-inner li.lvl-3 { padding-left: 24px; font-size: 13px; color: var(--c-muted); }
.toc-inner li.active a { color: var(--c-primary-dark); font-weight: 600; }
.toc-top {
  display: block; margin-top: 14px; padding-top: 10px;
  border-top: 1px solid var(--c-border); font-size: 13px; color: var(--c-muted);
}

/* 正文排版 */
.prose { font-size: 16px; line-height: 1.85; color: var(--c-text); }
.prose > *:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-weight: 600; line-height: 1.45; color: var(--c-text);
  scroll-margin-top: 84px;   /* 锚点跳转不被固定导航遮挡 */
}
.prose h1 { font-size: 25px; margin: 40px 0 16px; }
.prose h2 {
  font-size: 21px; margin: 38px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--c-border);
}
.prose h3 {
  font-size: 18px; margin: 30px 0 12px; padding-left: 11px;
  border-left: 4px solid var(--c-primary);
}
.prose h4 { font-size: 16.5px; margin: 24px 0 10px; color: var(--c-primary-dark); }
.prose h5, .prose h6 { font-size: 15.5px; margin: 20px 0 8px; }
.prose p { margin: 14px 0; }
.prose strong { font-weight: 600; color: #0b1220; }
.prose hr { border: none; border-top: 1px dashed var(--c-border); margin: 34px 0; }
.prose a { color: var(--c-accent); border-bottom: 1px solid #bae6fd; }
.prose a:hover { border-bottom-color: var(--c-accent); text-decoration: none; }
.prose ul, .prose ol { margin: 14px 0; padding-left: 26px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--c-primary); }
.prose blockquote {
  margin: 18px 0; padding: 12px 18px;
  background: #f8fafc; border-left: 3px solid #94a3b8;
  color: var(--c-text-soft); font-size: 15px;
}
.prose blockquote p { margin: 6px 0; }
.prose code {
  font-family: var(--font-mono); font-size: 13.5px;
  background: #f1f5f9; padding: 2px 6px; border-radius: 4px;
  color: #be123c;
}
.prose pre {
  background: #0f172a; color: #e2e8f0; padding: 16px 18px;
  border-radius: var(--radius); overflow-x: auto; font-size: 13.5px; line-height: 1.65;
}
.prose pre code { background: none; color: inherit; padding: 0; }

/* 表格：报告里表格多且列宽不齐，必须可横向滚动 */
.table-wrap {
  overflow-x: auto; margin: 20px 0;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-surface);
  -webkit-overflow-scrolling: touch;
}
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 480px; }
.prose thead th {
  background: #f1f5f9; text-align: left; font-weight: 600;
  padding: 10px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--c-border); color: var(--c-text);
}
.prose tbody td {
  padding: 10px 14px; border-bottom: 1px solid #f1f5f9;
  vertical-align: top; line-height: 1.7; color: var(--c-text-soft);
}
.prose tbody tr:last-child td { border-bottom: none; }
.prose tbody tr:hover { background: #f8fafc; }

/* 上下篇 */
.prev-next {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 50px; padding-top: 26px; border-top: 1px solid var(--c-border);
}
.pn {
  display: flex; flex-direction: column; gap: 5px;
  padding: 14px 18px; border: 1px solid var(--c-border);
  border-radius: var(--radius); background: var(--c-surface);
}
.pn:hover { border-color: var(--c-primary); text-decoration: none; box-shadow: var(--shadow); }
.pn.next { text-align: right; }
.pn-label { font-size: 12.5px; color: var(--c-muted); }
.pn-title { font-size: 14.5px; font-weight: 500; color: var(--c-text); }

/* ---------------- 搜索 ---------------- */
.search-opts { margin: 14px 0 0; font-size: 14px; color: var(--c-text-soft); }
.search-opts label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.result-count { margin: 22px 0 14px; font-size: 14.5px; }
.search-results { list-style: none; margin: 0; padding: 0; }
.search-item {
  padding: 18px 20px; margin-bottom: 14px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.search-title { font-size: 16.5px; font-weight: 600; color: var(--c-text); }
.search-title:hover { color: var(--c-primary-dark); }
.search-meta {
  display: flex; gap: 12px; align-items: center;
  margin: 8px 0; font-size: 12.5px; color: var(--c-muted);
}
.search-excerpt { margin: 8px 0 0; font-size: 14px; line-height: 1.75; color: var(--c-text-soft); }

/* ---------------- 分页 / 提示 / 空态 ---------------- */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  margin-top: 34px; font-size: 14.5px;
}
.pager .disabled { color: #cbd5e1; }
.pager-info { color: var(--c-muted); font-size: 13.5px; }

.notice {
  padding: 14px 18px; border-radius: var(--radius);
  margin-bottom: 26px; font-size: 14.5px; line-height: 1.75;
}
.notice-warn { background: var(--c-warn-bg); border: 1px solid var(--c-warn-border); color: #78350f; }

.empty-state { text-align: center; padding: 70px 20px; }
.empty-state h1, .empty-state h2 { margin: 12px 0; font-size: 23px; }
.empty-state p { color: var(--c-text-soft); }
.empty-code {
  font-size: 56px; font-weight: 700; color: #e2e8f0; margin: 0; line-height: 1;
}
.btn {
  display: inline-block; margin-top: 10px; padding: 10px 22px;
  background: var(--c-primary); color: #fff; border-radius: var(--radius);
  font-size: 15px;
}
.btn:hover { background: var(--c-primary-dark); text-decoration: none; }
.code {
  display: inline-block; margin-top: 14px; padding: 10px 16px;
  background: #0f172a; color: #a5f3fc; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 13.5px;
}

.prose-narrow { max-width: 780px; }

/* ---------------- 页脚 ---------------- */
.site-footer {
  border-top: 1px solid var(--c-border); background: #fff;
  margin-top: 40px; padding: 34px 0;
}
.footer-inner {
  display: flex; justify-content: space-between; gap: 36px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--c-text-soft);
}
.footer-brand { max-width: 520px; }
.footer-brand strong { display: block; margin-bottom: 6px; color: var(--c-text); font-size: 15px; }
.footer-brand p { margin: 0; line-height: 1.75; }
.footer-meta { text-align: right; }
.footer-meta p { margin: 0 0 5px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1040px) {
  .report-layout { grid-template-columns: 1fr; }
  .report-toc { position: static; order: -1; }
  .toc-inner { max-height: 300px; }
  .toc-inner ol { columns: 2; column-gap: 24px; }
}
@media (max-width: 860px) {
  .header-inner { min-height: auto; padding-top: 12px; padding-bottom: 12px; }
  .top-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: 4px; }
  .search-mini { margin-left: auto; }
  .search-mini input { width: 130px; }
  .hero { padding: 30px 22px 26px; }
  .hero h1 { font-size: 24px; }
  .hero-stats { gap: 24px; }
  .hero-stats dd { font-size: 20px; }
  .report-head h1 { font-size: 22px; }
  .search-main { flex-direction: column; max-width: 100%; }
  .search-main button { width: 100%; }
  .prev-next { grid-template-columns: 1fr; }
  .pn.next { text-align: left; }
  .footer-inner { flex-direction: column; }
  .footer-meta { text-align: left; }
}
@media (max-width: 600px) {
  main { padding: 20px 16px 48px; }
  .wrap { padding: 0 16px; }
  .row { flex-wrap: wrap; gap: 6px 12px; }
  .row-date { width: auto; }
  .row-title { flex-basis: 100%; order: -1; font-size: 15.5px; }
  .toc-inner ol { columns: 1; }
  .card-grid { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .site-footer, .report-toc, .prev-next, .breadcrumb { display: none; }
  body { background: #fff; }
  .report-layout { grid-template-columns: 1fr; }
}
/* 底部备案信息：独立全宽块、整体居中 */
.footer-legal {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--c-border);
  text-align: center;
  font-size: 13px;
  line-height: 1.9;
  color: var(--c-muted);
}
.footer-legal p { margin: 0; }
.footer-legal a { color: var(--c-muted); text-decoration: none; }
.footer-legal a:hover { color: var(--c-primary); text-decoration: underline; }
