/* ============================================================
   药信网 PharmaXin 设计系统
   由 Lead 维护：设计令牌 + 基础组件。页面样式请放 core.css / news.css。
   ============================================================ */
:root {
  --ink: #0a1e3a;
  --ink-2: #12325a;
  --ink-3: #1e4b7a;
  --jade: #1d6fe0;
  --jade-dark: #0b4fb3;
  --jade-soft: #e7f1ff;
  --jade-mist: #f2f7ff;
  --paper: #f5f8fd;
  --paper-2: #ffffff;
  --paper-3: #eaf1fb;
  --line: #d9e3f2;
  --line-strong: #c3d2e8;
  --gold: #0284c7;
  --gold-soft: #e0f2fe;
  --red: #b3402f;
  --red-soft: #fde8e8;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --text: #172b4d;
  --muted: #5b7292;
  --muted-2: #8296b3;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(10, 30, 60, .06), 0 4px 14px rgba(10, 30, 60, .04);
  --shadow-md: 0 4px 12px rgba(10, 30, 60, .08), 0 18px 40px rgba(10, 30, 60, .07);
  --radius: 10px;
  --radius-lg: 16px;
  --radius-sm: 6px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
  --max: 1240px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--jade-dark); text-decoration: none; }
a:hover { color: var(--jade); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: #bae6fd; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--ink); color: #c9d8ed; font-size: 12.5px; letter-spacing: .02em;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 34px; gap: 16px; }
.topbar a { color: #c9d8ed; }
.topbar a:hover { color: #fff; }
.topbar .topbar-left, .topbar .topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar .dot { color: var(--gold); }
.topbar .live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #38bdf8; display: inline-block;
  margin-right: 6px; box-shadow: 0 0 0 3px rgba(56, 189, 248, .16);
}

/* ---------- 站点头部 ---------- */
.site-header {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(10, 30, 60, .02);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--jade) 0%, var(--ink-2) 100%);
  color: #e0f2fe; font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: -1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.brand-name { font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--ink); line-height: 1.1; letter-spacing: .02em; }
.brand-sub { font-size: 9.5px; letter-spacing: .22em; color: var(--muted-2); text-transform: uppercase; margin-top: 3px; }
.main-nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; }
.main-nav a {
  padding: 8px 12px; border-radius: 7px; color: var(--ink-2); font-size: 14px; font-weight: 500;
  white-space: nowrap; transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--jade-mist); color: var(--jade-dark); }
.main-nav a.active { color: var(--jade-dark); background: var(--jade-soft); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.search-trigger {
  display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  color: var(--muted); font-size: 13px; min-width: 150px;
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--ink); }
.search-trigger kbd {
  margin-left: auto; font-family: var(--sans); font-size: 10px; color: var(--muted-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; background: var(--paper);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--white); color: var(--ink); font-size: 13.5px; font-weight: 500;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--jade); color: var(--jade-dark); }
.btn.primary { background: var(--jade); border-color: var(--jade); color: #fff; }
.btn.primary:hover { background: var(--jade-dark); border-color: var(--jade-dark); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--jade-mist); color: var(--jade-dark); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 通用区块 ---------- */
.page { padding-top: 34px; padding-bottom: 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--ink); margin: 0; line-height: 1.25; letter-spacing: .01em; }
.page-desc { color: var(--muted); font-size: 14px; margin: 7px 0 0; max-width: 760px; }
.eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 8px; }
.section { margin: 42px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 11px; }
.section-title { font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--ink); margin: 0; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 4px; height: 19px; background: var(--jade); border-radius: 2px; }
.section-more { font-size: 13px; color: var(--muted); }
.section-more:hover { color: var(--jade); }

.panel { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel-pad { padding: 20px 22px; }
.card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.card-body { padding: 18px 20px; }
.card-title { font-family: var(--serif); font-size: 17px; font-weight: 700; line-height: 1.5; margin: 0 0 6px; color: var(--ink); }
.card-title a { color: inherit; }
.card-title a:hover { color: var(--jade-dark); }
.card-text { color: var(--muted); font-size: 13.5px; line-height: 1.7; margin: 0; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; color: var(--muted-2); font-size: 12px; }
.meta .sep { color: var(--line-strong); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px;
  border-radius: 5px; background: var(--jade-soft); color: var(--jade-dark);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}
.badge.gold { background: var(--gold-soft); color: #0369a1; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: var(--paper-3); color: var(--muted); }
.badge.outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  color: var(--ink-3); font-size: 12.5px; white-space: nowrap; transition: all .15s;
}
.chip:hover { border-color: var(--jade); color: var(--jade-dark); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #e0f2fe; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 表单 ---------- */
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: var(--white);
  border-radius: 8px; padding: 9px 12px; font-size: 14px; color: var(--ink);
  outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(29, 111, 224, .11); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.field { margin-bottom: 14px; }
.label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .02em; }
.searchbox { display: flex; gap: 8px; }
.searchbox .input { flex: 1 1 auto; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .spacer { flex: 1 1 auto; }
.result-count { font-size: 13px; color: var(--muted); }
.result-count b { color: var(--ink); font-weight: 700; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--jade-mist); }
.table .num { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 30px 0 6px; flex-wrap: wrap; }
.pager button, .pager a {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--white); color: var(--ink-3); font-size: 13px; display: inline-flex;
  align-items: center; justify-content: center;
}
.pager .active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager .info { color: var(--muted); font-size: 12.5px; border: 0; background: transparent; }

/* ---------- 空态 / 加载 ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-title { font-family: var(--serif); font-size: 19px; color: var(--ink-2); margin-bottom: 6px; }
.empty-icon { font-size: 34px; opacity: .35; margin-bottom: 12px; }
.skeleton {
  background: linear-gradient(90deg, var(--paper-3) 25%, #f5f8fd 50%, var(--paper-3) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 5px; color: transparent !important;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-line { height: 14px; margin: 10px 0; }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--ink); color: #aabdd6; margin-top: 58px; font-size: 13px; }
.site-footer .wrap { padding-top: 42px; padding-bottom: 26px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 30px; }
.footer-brand { font-family: var(--serif); font-size: 20px; color: #eaf2ff; margin-bottom: 9px; }
.footer-desc { color: #9fb3d0; font-size: 12.5px; line-height: 1.8; max-width: 360px; }
.footer-col h4 { font-size: 12px; letter-spacing: .14em; color: #cfe1f7; margin: 0 0 12px; font-weight: 600; }
.footer-col a { display: block; color: #aabdd6; padding: 3px 0; font-size: 12.5px; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .09); margin-top: 32px; padding-top: 18px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: #8fa8c6; font-size: 11.5px;
}
.footer-legal a { color: #cfe1f7; }
.footer-note { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); border-radius: 8px; padding: 10px 13px; margin-top: 20px; color: #9fb3d0; font-size: 11.5px; line-height: 1.7; }

/* ---------- 搜索弹层 ---------- */
.dialog-mask {
  position: fixed; inset: 0; background: rgba(6, 20, 42, .55); backdrop-filter: blur(3px);
  z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 10vh 18px 18px;
}
.dialog-mask.open { display: flex; }
.dialog {
  width: min(720px, 100%); background: var(--paper-2); border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35); overflow: hidden; border: 1px solid var(--line);
}
.dialog-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dialog-head input { flex: 1; border: 0; background: transparent; font-size: 17px; outline: none; }
.dialog-close { border: 0; background: transparent; color: var(--muted); font-size: 20px; padding: 4px 8px; }
.dialog-body { max-height: 58vh; overflow-y: auto; padding: 10px; }
.dialog-group-title { font-size: 11px; letter-spacing: .12em; color: var(--muted-2); padding: 10px 10px 6px; text-transform: uppercase; }
.dialog-item { display: block; padding: 10px 12px; border-radius: 8px; }
.dialog-item:hover { background: var(--jade-mist); }
.dialog-item .t { color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.5; }
.dialog-item .d { color: var(--muted); font-size: 12px; margin-top: 3px; }
.dialog-foot { border-top: 1px solid var(--line); padding: 9px 18px; color: var(--muted-2); font-size: 11.5px; display: flex; justify-content: space-between; }

/* ---------- 工具类 ---------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.hide { display: none !important; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.divider { height: 1px; background: var(--line); border: 0; margin: 24px 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .main-nav a { padding: 8px 8px; font-size: 13px; }
  .search-trigger { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .search-trigger .search-label, .search-trigger kbd { display: none; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
@media (max-width: 860px) {
  .wrap { padding: 0 16px; }
  .site-header .wrap { gap: 12px; height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .header-actions { margin-left: auto; }
  .brand-name { font-size: 19px; }
  .page-title { font-size: 25px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .topbar .topbar-left span:not(.live-dot):not(:first-child) { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .panel-pad { padding: 16px; }
  /* 保留 .wrap 的左右内边距，避免新闻页标题贴边被裁切 */
  .page { padding-top: 24px; padding-bottom: 46px; }
}

/* 顶栏窄屏防挤压（Lead 集成修正） */
.topbar .topbar-left, .topbar .topbar-right { flex-wrap: nowrap; white-space: nowrap; }
.topbar .topbar-right { gap: 12px; }
@media (max-width: 700px) {
  .topbar .topbar-left { display: none; }
  .topbar .wrap { justify-content: flex-end; }
  .topbar .topbar-right { gap: 12px; }
}
@media (max-width: 420px) {
  .topbar .topbar-right a:first-child { display: none; }
}
