/* ============================================================
 * 全站样式
 * ------------------------------------------------------------
 * 变量都写在 :root 里，想调颜色、圆角、宽度，改这里就行。
 * ============================================================ */

:root {
  /* 主色：医药感的青绿色 */
  --brand:        #0e8a72;
  --brand-dark:   #0a6b59;
  --brand-light:  #e8f5f1;
  --brand-soft:   #f2faf8;

  /* 文字与背景 */
  --ink:    #1f2937;
  --ink-2:  #4b5563;
  --muted:  #6b7280;
  --line:   #e5e7eb;
  --bg:     #f6f9f8;
  --card:   #ffffff;

  /* 状态色 */
  --rx:     #dc2626;   /* 处方药 */
  --rx-bg:  #fef2f2;
  --otc:    #16a34a;   /* 非处方药 */
  --otc-bg: #f0fdf4;
  --warn:   #d97706;
  --warn-bg:#fffbeb;

  --radius:   14px;
  --radius-s: 9px;
  --shadow:   0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --shadow-h: 0 2px 6px rgba(16,24,40,.06), 0 16px 36px rgba(16,24,40,.10);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

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

img { max-width: 100%; display: block; }

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

.hidden { display: none !important; }

/* ------------------------------------------------------------
 * 顶部导航
 * ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

/* 注意：只用「直接子元素」选择器 —— 顶部公告条内部也有 .container，
 * 用后代选择器会把它也压成 64px 高。 */
.site-header > .container {
  height: 64px;
  display: flex; align-items: center; gap: 28px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--ink);
  letter-spacing: .2px;
}
.logo:hover { color: var(--ink); }

.logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #34d399);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px; flex: none;
}

.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.nav a {
  padding: 8px 14px; border-radius: 8px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 500;
}
.nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.nav a.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }

/* 汉堡按钮：桌面隐藏，移动端显示 */
.nav-toggle {
  display: none;
  width: 42px; height: 42px; margin-left: auto; flex: 0 0 42px;
  flex-direction: column; justify-content: center; gap: 5px;
  background: transparent; border: none; cursor: pointer; padding: 0;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--ink);
  border-radius: 2px; margin: 0 auto; transition: .2s;
}
.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端：导航折叠为下拉菜单 */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-header > .container { gap: 12px; }
  .nav {
    display: none;
    position: absolute; top: 100%; right: 12px; left: 12px;
    flex-direction: column; gap: 2px; margin: 0;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 14px; padding: 8px;
    box-shadow: 0 16px 40px rgba(15,23,42,.16);
  }
  .site-header.nav-open .nav { display: flex; }
  .nav a { padding: 12px 12px; font-size: 15px; text-align: left; }
  .nav a.active { background: var(--brand-light); }
}

/* ------------------------------------------------------------
 * 首页横幅
 * ------------------------------------------------------------ */
.hero {
  background:
    radial-gradient(900px 340px at 12% -10%, rgba(14,138,114,.10), transparent 62%),
    radial-gradient(700px 320px at 92% 8%, rgba(52,211,153,.14), transparent 60%),
    #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 56px 0 48px;
}

.hero-inner { max-width: 720px; }

.hero-tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--brand-light); color: var(--brand-dark);
  border-radius: 999px; padding: 5px 14px;
  font-size: 13px; font-weight: 600; margin-bottom: 18px;
}

.hero h1 {
  font-size: 36px; line-height: 1.28; margin: 0 0 14px;
  letter-spacing: -.5px; font-weight: 750;
}

.hero p { color: var(--ink-2); font-size: 16px; margin: 0 0 26px; }

/* 首页横幅里的搜索框（放在介绍文字下面，独立于筛选区） */
.hero-search { position: relative; max-width: 560px; margin: 0 0 18px; }
.hero-search input {
  width: 100%; padding: 14px 44px 14px 44px;
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px; font-family: inherit; background: #fff;
  color: var(--ink); outline: none; transition: .16s;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .06);
}
.hero-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 138, 114, .14);
}
.hero-search .ico {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 16px; pointer-events: none;
}
.hero-search .clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 4px 8px; border-radius: 6px;
}
.hero-search .clear:hover { background: var(--bg); color: var(--ink); }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* 数字统计 */
.hero-stats { display: flex; gap: 40px; margin-top: 36px; flex-wrap: wrap; }
.hero-stats .num { font-size: 26px; font-weight: 750; color: var(--brand-dark); line-height: 1.2; }
.hero-stats .lbl { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------
 * 按钮
 * ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: 9px; border: 1px solid transparent;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: .16s ease; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }

.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: #cbd5e1; color: var(--ink); background: #fcfdfd; }

.btn-danger { background: #fff; color: var(--rx); border-color: #fecaca; }
.btn-danger:hover { background: var(--rx-bg); }

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ------------------------------------------------------------
 * 筛选区
 * ------------------------------------------------------------ */
.filters {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 18px 0; position: sticky;
  /* --topbar-h 由 layout.js 按顶部公告条实际高度写入 */
  top: calc(64px + var(--topbar-h, 0px)); z-index: 40;
}

.filter-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* 分类筛选折叠按钮：仅在移动端显示（见下方 @media 覆盖） */
.filter-toggle { display: none; }

.search-box {
  position: relative; flex: 1 1 300px; min-width: 220px;
}
.search-box input {
  width: 100%; padding: 11px 40px 11px 40px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 14.5px; font-family: inherit; background: #fcfdfd;
  color: var(--ink); outline: none; transition: .16s;
}
.search-box input:focus {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(14,138,114,.12);
}
.search-box .ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 15px; pointer-events: none;
}
.search-box .clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 4px 8px; border-radius: 6px;
}
.search-box .clear:hover { background: var(--bg); color: var(--ink); }

select.sel {
  padding: 11px 34px 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14.5px; font-family: inherit;
  background: #fcfdfd url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4.5 6 8.5l4-4z'/%3E%3C/svg%3E") no-repeat right 13px center;
  appearance: none; color: var(--ink); outline: none; cursor: pointer;
}
select.sel:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,138,114,.12); }

.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.chip {
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font-size: 13.5px; color: var(--ink-2); cursor: pointer;
  font-family: inherit; transition: .16s;
}
.chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.chip.active {
  background: var(--brand); border-color: var(--brand);
  color: #fff; font-weight: 600;
}
.chip .n { opacity: .7; margin-left: 4px; font-size: 12px; }

/* ------------------------------------------------------------
 * 主体
 * ------------------------------------------------------------ */
main { padding: 34px 0 60px; }

.section-head {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px;
}
.section-head h2 { font-size: 20px; margin: 0; font-weight: 700; }
.section-head .count { color: var(--muted); font-size: 14px; }
.section-head .right { margin-left: auto; }

/* 药品网格：卡片整体约为原尺寸的一半（列宽 232→152） */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
}

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: .2s ease; cursor: pointer;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-h); border-color: #d7e6e1; }

.card-img {
  position: relative; aspect-ratio: 4 / 3; background: #f8fbfa; overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }

.badge-type {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 9px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
}
.badge-type.rx  { background: var(--rx);  color: #fff; }
.badge-type.otc { background: var(--otc); color: #fff; }

.card-body { padding: 14px 15px 16px; display: flex; flex-direction: column; flex: 1; }

.card-title {
  font-size: 15.5px; font-weight: 650; margin: 0 0 5px; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.45; min-height: 2.9em;
}

.card-sub {
  font-size: 12.5px; color: var(--muted); margin: 0 0 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-meta {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto;
}
.tagpill {
  font-size: 11.5px; color: var(--brand-dark); background: var(--brand-light);
  padding: 3px 9px; border-radius: 6px; white-space: nowrap;
}
.tagpill.plain { background: #f3f4f6; color: var(--ink-2); }

/* 分页 */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.pager button {
  min-width: 38px; height: 38px; padding: 0 11px;
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  cursor: pointer; font-family: inherit; font-size: 14px; color: var(--ink-2);
  transition: .16s;
}
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-dark); }
.pager button.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* 空状态 */
.empty {
  text-align: center; padding: 70px 20px; color: var(--muted);
}
.empty .big { font-size: 40px; margin-bottom: 12px; opacity: .55; }
.empty h3 { color: var(--ink); margin: 0 0 6px; font-size: 17px; }

/* ------------------------------------------------------------
 * 详情页
 * ------------------------------------------------------------ */
.crumb { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--brand); }
.crumb .sep { margin: 0 7px; opacity: .55; }

.detail-top {
  display: grid; grid-template-columns: 380px 1fr; gap: 34px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
}

.detail-img {
  border-radius: var(--radius-s); overflow: hidden;
  background: #f8fbfa; border: 1px solid var(--line);
}
.detail-img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

.detail-info h1 { font-size: 25px; margin: 0 0 8px; font-weight: 750; letter-spacing: -.3px; }
.detail-generic { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 11px 16px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); }

.detail-actions { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; }

/* 说明书区块 */
.blocks { margin-top: 26px; display: grid; gap: 16px; }

.block {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px;
}
.block h3 {
  font-size: 15.5px; margin: 0 0 10px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.block h3::before {
  content: ''; width: 3px; height: 15px; border-radius: 2px; background: var(--brand);
}
.block p { margin: 0; color: var(--ink-2); font-size: 14.5px; white-space: pre-wrap; }
.block.warn { background: var(--warn-bg); border-color: #fde68a; }
.block.warn h3::before { background: var(--warn); }
.block.warn p { color: #92400e; }

/* ------------------------------------------------------------
 * 页脚
 * ------------------------------------------------------------ */
.site-footer {
  background: #fff; border-top: 1px solid var(--line);
  padding: 40px 0 30px; margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 34px; }
.footer-grid h4 { font-size: 14px; margin: 0 0 12px; color: var(--ink); }
.footer-grid p, .footer-grid li { font-size: 13.5px; color: var(--muted); margin: 0 0 7px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--brand); }

.footer-bottom {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); line-height: 1.8;
}
.footer-bottom .disclaimer { color: #92400e; background: var(--warn-bg); padding: 12px 16px; border-radius: var(--radius-s); margin-bottom: 14px; }

/* ------------------------------------------------------------
 * 管理后台
 * ------------------------------------------------------------ */
.admin-wrap { max-width: var(--maxw); margin: 0 auto; padding: 30px 20px 70px; }

.admin-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 20px;
}
.admin-bar h1 { font-size: 19px; margin: 0; font-weight: 700; }
.admin-bar .who { color: var(--muted); font-size: 13.5px; margin-left: auto; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 20px;
}
.stat .n { font-size: 26px; font-weight: 750; color: var(--brand-dark); line-height: 1.25; }
.stat .l { font-size: 13px; color: var(--muted); }
.stat.rx .n { color: var(--rx); }
.stat.otc .n { color: var(--otc); }

.panel {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 16px; margin: 0; font-weight: 700; }
.panel-head .right { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

.table-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 780px; }
table.tbl th {
  text-align: left; padding: 11px 16px; background: #fafcfb;
  color: var(--muted); font-weight: 600; font-size: 12.5px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 12px 16px; border-bottom: 1px solid #f1f4f3; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr:hover td { background: #fafdfc; }

.cell-name { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.cell-name img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; border: 1px solid var(--line); }
.cell-name .t { font-weight: 600; color: var(--ink); }
.cell-name .s { font-size: 12px; color: var(--muted); }
.td-actions { white-space: nowrap; text-align: right; }

.mini-badge {
  display: inline-block; padding: 2px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
}
.mini-badge.rx  { background: var(--rx-bg);  color: var(--rx); }
.mini-badge.otc { background: var(--otc-bg); color: var(--otc); }

/* 登录页 */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(800px 400px at 20% 0%, rgba(14,138,114,.12), transparent 60%),
    radial-gradient(700px 400px at 85% 100%, rgba(52,211,153,.14), transparent 60%),
    var(--bg);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background: #fff;
  border: 1px solid var(--line); border-radius: 18px;
  padding: 34px 32px 30px; box-shadow: var(--shadow);
}
.login-card .logo { justify-content: center; margin-bottom: 6px; }
.login-card h1 { font-size: 20px; text-align: center; margin: 14px 0 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13.5px; margin: 0 0 26px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 14.5px; font-family: inherit;
  background: #fcfdfd; color: var(--ink); outline: none; transition: .16s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(14,138,114,.12);
}
.field textarea { resize: vertical; min-height: 76px; line-height: 1.65; }
.field select { appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4.5 6 8.5l4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.form-msg {
  padding: 10px 13px; border-radius: 9px; font-size: 13.5px; margin-bottom: 16px;
}
.form-msg.err { background: var(--rx-bg); color: var(--rx); }
.form-msg.ok  { background: var(--otc-bg); color: var(--otc); }

.demo-tip {
  margin-top: 20px; padding: 13px 15px; border-radius: 10px;
  background: var(--brand-soft); border: 1px dashed #b8ded4;
  font-size: 13px; color: var(--brand-dark); line-height: 1.75;
}
.demo-tip b { font-weight: 700; }

/* 弹窗表单 */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,.42); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 30px 20px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 720px;
  box-shadow: 0 24px 60px rgba(15,23,42,.24);
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16.5px; font-weight: 700; }
.modal-head .x {
  margin-left: auto; border: 0; background: none; font-size: 22px;
  color: var(--muted); cursor: pointer; line-height: 1; padding: 2px 8px; border-radius: 7px;
}
.modal-head .x:hover { background: var(--bg); color: var(--ink); }

.modal-body { padding: 22px 24px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 24px; border-top: 1px solid var(--line); background: #fbfdfc;
  border-radius: 0 0 16px 16px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* 折叠的补充字段面板 */
details#advPanel, #advPanel {
  grid-column: 1 / -1;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; background: #fcfdfd;
}
#advPanel summary {
  cursor: pointer; font-size: 13.5px; font-weight: 600;
  color: var(--brand-dark); user-select: none;
}
#advPanel[open] summary { margin-bottom: 4px; }

.img-preview {
  width: 96px; height: 76px; border-radius: 9px; object-fit: cover;
  border: 1px solid var(--line); background: #f8fbfa;
}

/* 提示条（toast）样式已统一在 css/components.css 中定义，
 * 由 ui.js 的 toast() 使用 #toastBox 容器 + .toast 子元素实现，
 * 此处不再重复定义，避免 position 冲突导致提示框偏移成“长条形”。 */

/* 帮助面板 */
.help-list { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.help-list li { margin-bottom: 7px; }
.kbd {
  background: #f3f4f6; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; font-size: 12.5px; font-family: ui-monospace, monospace;
}

/* ------------------------------------------------------------
 * 响应式
 * ------------------------------------------------------------ */
@media (max-width: 900px) {
  .detail-top { grid-template-columns: 1fr; gap: 22px; padding: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero { padding: 38px 0 32px; }
  .hero h1 { font-size: 26px; }
  .hero-stats { gap: 26px; margin-top: 26px; }
  .site-header > .container { height: 58px; gap: 12px; }
  .filters { top: calc(58px + var(--topbar-h, 0px)); }
  .filter-toggle {
    display: flex; width: 100%; align-items: center; justify-content: space-between;
    padding: 12px 14px; margin-bottom: 10px; background: var(--card);
    border: 1px solid var(--line); border-radius: 12px;
    font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer;
  }
  .filter-toggle .caret { color: var(--muted); font-size: 13px; }
  .filters .filter-row, .filters .cat-grid { display: none; }
  .filters.open .filter-row { display: flex; }
  .filters.open .cat-grid { display: grid; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 9px; }
  .card-title { font-size: 14.5px; }
  .detail-info h1 { font-size: 21px; }
  .kv { grid-template-columns: 78px 1fr; font-size: 14px; }
  .modal-mask { padding: 12px; }
  .stat-row { gap: 11px; }
  .stat { padding: 14px 15px; }
  .stat .n { font-size: 22px; }
}
