/* 药品说明书查询系统 — 极简白蓝（2026-08-11 全面重做） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: #fff;
  color: #1f2937;
  line-height: 1.8;
  font-size: 16px;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 顶部导航：白底细线 ===== */
.navbar { border-bottom: 1px solid #eef0f3; }
.navbar-inner {
  max-width: 1000px; margin: 0 auto; padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.navbar .brand { font-size: 18px; font-weight: 600; color: #111827; }
.navbar .brand small { font-size: 13px; color: #9ca3af; font-weight: 400; margin-left: 6px; }
.nav-right { position: relative; display: flex; align-items: center; }
.nav-links { display: flex; gap: 24px; font-size: 15px; }
.nav-links a { color: #4b5563; }
.nav-links a:hover { color: #2563eb; text-decoration: none; }
.nav-more { display: none; }

/* ===== 首页 ===== */
.container { max-width: 1000px; margin: 0 auto; padding: 36px 24px 60px; }
.search-hero { max-width: 720px; margin: 90px auto 0; text-align: center; padding: 0 16px; }
.search-hero h1 { font-size: 34px; font-weight: 700; color: #111827; letter-spacing: 1px; }
.search-hero p { color: #9ca3af; font-size: 15px; margin: 10px 0 36px; }
.search-form { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.search-form input[name="q"] {
  flex: 1 1 300px; padding: 15px 20px; font-size: 18px;
  border: 1px solid #d1d5db; border-radius: 12px; outline: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.search-form input[name="q"]:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.search-form select {
  padding: 12px 14px; font-size: 15px; border: 1px solid #d1d5db;
  border-radius: 8px; background: #fff; color: #374151;
}
.btn {
  display: inline-block; padding: 11px 30px; font-size: 16px;
  background: #2563eb; color: #fff; border: none; border-radius: 8px; cursor: pointer;
}
.btn:hover { background: #1d4ed8; text-decoration: none; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #2563eb; color: #fff; }
.btn-success:hover { background: #1d4ed8; }
.btn-ghost { background: #f3f4f6; color: #374151; }
.btn-ghost:hover { background: #e5e7eb; }
.btn-danger { background: #fef2f2; color: #b91c1c; }
.btn-danger:hover { background: #fee2e2; }

/* 兼容旧模板结构：无边框白卡 */
.card { background: #fff; }

/* 分类入口卡片（辅助色系） */
.cat-cards {
  max-width: 1000px; margin: 44px auto 0; padding: 0 24px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.cat-card {
  border: 1px solid #eef0f3; border-left: 4px solid #2563eb; border-radius: 10px;
  padding: 18px 16px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.cat-card:hover { box-shadow: 0 2px 8px rgba(17,24,39,.08); text-decoration: none; }
.cat-card .t { font-size: 15px; font-weight: 600; color: #111827; margin-bottom: 3px; }
.cat-card .n { font-size: 13px; color: #9ca3af; }
.cc-0 { border-left-color: #2563eb; } .cc-1 { border-left-color: #16a34a; }
.cc-2 { border-left-color: #ea580c; } .cc-3 { border-left-color: #7c3aed; }
.cc-4 { border-left-color: #0891b2; } .cc-5 { border-left-color: #db2777; }
.cc-6 { border-left-color: #d97706; }

/* 分类抽屉 */
.cat-toggle {
  background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 7px 14px; font-size: 15px; color: #374151; cursor: pointer;
}
.cat-toggle:hover { border-color: #2563eb; color: #2563eb; }
.cat-toggle span { font-size: 14px; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 85vw;
  background: #fff; box-shadow: 2px 0 16px rgba(17,24,39,.12); z-index: 200;
  transform: translateX(-100%); transition: transform .2s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-mask {
  position: fixed; inset: 0; background: rgba(17,24,39,.35); z-index: 199;
  display: none;
}
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid #eef0f3; font-weight: 600; font-size: 16px;
}
.drawer-close { border: none; background: none; font-size: 16px; cursor: pointer; color: #6b7280; }
.drawer-body { overflow-y: auto; padding: 10px 0; }
.tree-item { border-bottom: 1px solid #f6f7f9; }
.tree-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 18px; cursor: pointer;
}
.tree-head:hover { background: #f8fafc; }
.tree-head .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tree-head .t { flex: 1; font-size: 15px; color: #1f2937; }
.tree-head .n { font-size: 12px; color: #9ca3af; }
.tree-head .arrow { color: #9ca3af; font-size: 12px; }
.tree-kids { background: #fafbfc; padding: 4px 0 8px; }
.tree-kid {
  display: flex; justify-content: space-between; padding: 9px 18px 9px 34px;
  font-size: 14px; color: #374151;
}
.tree-kid:hover { color: #2563eb; background: #eff6ff; }
.tree-kid .n { font-size: 12px; color: #9ca3af; }

/* ===== 列表 ===== */
.meta, .result-meta { color: #6b7280; font-size: 14px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 13px; font-weight: 600; color: #9ca3af;
  padding: 10px 14px; border-bottom: 1px solid #e5e7eb; white-space: nowrap;
}
table.list td { padding: 16px 14px; border-bottom: 1px solid #f3f4f6; font-size: 16px; }
table.list tr:hover td { background: #f0f6ff; }
table.list td a { font-weight: 600; color: #1d4ed8; }
table.list td:nth-child(2), table.list td:nth-child(3) { color: #6b7280; font-size: 14.5px; }
.empty-tip { text-align: center; color: #9ca3af; padding: 40px 0; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500;
}
.badge-high { background: #fef2f2; color: #b91c1c; }
.badge-otc { background: #ecfdf5; color: #047857; }
.badge-rx { background: #fff7ed; color: #c2410c; }

/* 固定列宽表格（管理列表等）：内容超宽省略号，悬停 title 看全文 */
table.table-fixed { table-layout: fixed; }
table.table-fixed th, table.table-fixed td {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 药品名与厂家显示全文（允许换行），规格列保持省略号 */
table.table-fixed td:first-child,
table.table-fixed td:nth-child(2) { white-space: normal; overflow: visible; text-overflow: clip; }
table.table-fixed td:last-child { white-space: nowrap; overflow: visible; }

/* 条目式药品列表（无表头） */
.drug-list { display: flex; flex-direction: column; }
.drug-item {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid #f3f4f6;
}
.drug-item:hover { background: #f0f6ff; }
.drug-item .main { flex: 1; min-width: 0; }
.drug-item .row1 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.drug-item .name { font-size: 17px; font-weight: 600; color: #1d4ed8; }
.drug-item .name:hover { text-decoration: underline; }
.drug-item .spec { font-size: 14px; color: #6b7280; }
.drug-item .fac { font-size: 14px; color: #6b7280; margin-top: 2px; }
.drug-item .btns { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
@media (max-width: 640px) {
  .drug-item { flex-wrap: wrap; padding: 12px 14px; }
  .drug-item .btns { width: 100%; justify-content: flex-end; }
}

/* 分页 */
.pagination {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 24px; font-size: 14px; color: #6b7280;
}
.pagination a { padding: 6px 13px; border: 1px solid #e5e7eb; border-radius: 6px; color: #374151; }
.pagination a:hover { border-color: #2563eb; color: #2563eb; text-decoration: none; }

/* ===== 详情 ===== */
.detail-title { margin-bottom: 28px; }
.detail-title h1 { font-size: 28px; font-weight: 700; color: #111827; }
.detail-title .sub { color: #6b7280; font-size: 15px; margin-top: 6px; }
.info-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.info-tag {
  background: #f3f4f6; border-radius: 999px; padding: 3px 13px;
  font-size: 13px; color: #374151;
}
.info-tag.hl { background: #eff6ff; color: #1d4ed8; font-weight: 500; }
.info-tag.danger { background: #fef2f2; color: #b91c1c; font-weight: 500; }
.high-banner {
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
  border-radius: 8px; padding: 10px 16px; font-weight: 500; margin: 0 0 26px; font-size: 15px;
}
.section-card { margin-bottom: 26px; }
.section-card h2 { font-size: 14px; font-weight: 600; color: #1d4ed8; letter-spacing: 1px; margin-bottom: 8px; }
details.section-card h2 { color: #9ca3af; }  /* 折叠区内弱化，区分层级 */
.section-card p {
  background: #f8fafc; border: 1px solid #eef0f3; border-radius: 8px;
  padding: 14px 16px; margin-bottom: 0;
}
.section-card .muted { background: none; border: none; padding: 0; }
.section-pair .section-card p { margin-bottom: 10px; }
.section-pair .section-card p:last-child { margin-bottom: 0; }
.section-card p { font-size: 16.5px; color: #1f2937; max-width: 70ch; }
.section-card .muted { color: #9ca3af; }
.section-pair { display: flex; gap: 32px; flex-wrap: wrap; }
.section-pair > div { flex: 1 1 260px; }
details.section-card summary {
  cursor: pointer; font-size: 14px; font-weight: 600; color: #2563eb;
  margin-bottom: 10px; list-style: none;
}
details.section-card summary::before { content: "▸ "; }
details.section-card[open] summary::before { content: "▾ "; }

/* 诊断建议 */
.diag-list { border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px 22px; margin-bottom: 26px; }
.diag-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 10px; }
.diag-list .diag-title { font-size: 14px; font-weight: 600; color: #111827; white-space: nowrap; }
.btn-sm { padding: 4px 14px; font-size: 13px; border-radius: 6px; width: auto; }
.diag-item { padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.diag-item:last-child { border-bottom: none; }
.diag-item .need { color: #6b7280; font-size: 13.5px; margin-top: 3px; }
.diag-item .need .badge-otc { font-weight: 400; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 20px; position: relative; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 8px; }
.form-group input[type="text"], .form-group input[type="password"],
.form-group textarea, .form-group select {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1px solid #d1d5db; border-radius: 8px; outline: none;
  font-family: inherit; background: #fff; color: #1f2937;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-group .hint { font-size: 13px; color: #9ca3af; margin-top: 6px; }

/* 提交建议搭配行 */
.link-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.link-row input[type="text"] { flex: 1; }

/* 实时下拉 */
.ac-box {
  position: absolute; background: #fff; border: 1px solid #d1d5db;
  border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.1);
  max-height: 240px; overflow-y: auto; z-index: 100; width: 100%; display: none;
}
.ac-item { padding: 10px 14px; cursor: pointer; font-size: 15px; }
.ac-item:hover, .ac-item.active { background: #eff6ff; color: #1d4ed8; }
.ac-sub { color: #9ca3af; font-size: 13px; }

/* ===== 审核/管理 ===== */
.review-item { border: 1px solid #e5e7eb; border-radius: 10px; padding: 18px 20px; margin-bottom: 14px; }
.review-item .review-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.review-item .drug-name { font-size: 16px; color: #111827; font-weight: 600; }
.review-item .meta { color: #9ca3af; font-size: 13px; }
.review-item .content {
  background: #f9fafb; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px;
  color: #374151; font-size: 15px;
}
.review-item form.inline { display: inline; margin-right: 8px; }
.review-item form.inline input[type="text"] {
  padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; width: 180px; font-size: 14px;
}
.hint-block {
  background: #f9fafb; border: 1px solid #eef0f3; color: #6b7280;
  padding: 10px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px;
}
h1.page-title { font-size: 20px; font-weight: 700; color: #111827; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }

/* ===== 页脚 ===== */
footer { text-align: center; color: #d1d5db; font-size: 13px; padding: 30px 0 40px; }

/* ===== 手机版（≤640px） ===== */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .navbar-inner { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .navbar .brand { font-size: 16px; }
  .navbar .brand small { display: none; }
  .cat-toggle span { display: none; }  /* 手机端分类按钮只留图标 */
  /* 管理入口折叠为右侧「更多」菜单 */
  .nav-links {
    position: absolute; top: calc(100% + 6px); right: 12px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    box-shadow: 0 6px 20px rgba(17,24,39,.12);
    flex-direction: column; gap: 0; padding: 6px 0;
    min-width: 120px; display: none; z-index: 150;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 18px; font-size: 14px; color: #374151; }
  .nav-links a:hover { background: #f3f4f6; color: #2563eb; }
  .nav-more {
    display: inline-block; background: none; border: none; cursor: pointer;
    font-size: 22px; color: #374151; padding: 2px 6px; line-height: 1;
  }
  .nav-more:hover { color: #2563eb; }
  .container { padding: 22px 16px 50px; }
  .search-hero { margin-top: 48px; padding: 0 4px; }
  .search-hero h1 { font-size: 26px; }
  .search-hero p { margin: 8px 0 24px; }
  .search-form input[name="q"] { padding: 14px 16px; font-size: 17px; }
  .search-form select { flex: 1 1 110px; }
  .btn { width: 100%; }
  .btn-sm { width: auto; }  /* 小号按钮保持自适应，不占满整行 */
  .cat-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 16px; margin-top: 28px; }
  .cat-card { padding: 14px 12px; }
  .detail-title h1 { font-size: 23px; }
  table.list td { padding: 13px 10px; font-size: 15px; }
  table.list th { padding: 9px 10px; }
  .pagination { gap: 8px; }
}
