/* ============================================================
 * 组件样式（分类图标、参考价格、探寻低价、公告、水印、后台）
 * ------------------------------------------------------------
 * 依赖 style.css 里的 :root 变量（--brand / --ink / --line 等）。
 * ============================================================ */

/* ---------------- 分类图标网格 ---------------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.cat-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.cat-card:hover {
  border-color: var(--chip, var(--brand));
  box-shadow: 0 6px 18px rgba(16, 24, 40, .08);
  transform: translateY(-1px);
}
.cat-card.active {
  border-color: var(--chip, var(--brand));
  background: color-mix(in srgb, var(--chip, var(--brand)) 7%, #fff);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--chip, var(--brand)) 22%, transparent);
}
/* 分类名固定单行，避免窄卡片里折成两行显得凌乱 */
.cat-card .cat-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 数量徽章固定不收缩，数字再大也不会撑破卡片 */
.cat-card .cat-count {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 8px;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  color: var(--chip, var(--brand));
  background: color-mix(in srgb, var(--chip, var(--brand)) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--chip, var(--brand)) 20%, #fff);
}
.cat-chip svg { display: block; }

.cat-card .cat-name + .cat-count { margin-left: auto; }

/* ---------------- 首页药品卡片（精简版） ----------------
 * 只展示：图片 / 参考价 / 药品名称 / 通用名称 / 适应症前 15 字
 * 图片统一 1:1 裁切 → 所有卡片图片尺寸完全一致。 */
.card-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f8fbfa;
  overflow: hidden;
}
/* 水印脚本会把 <img> 换成 <canvas>，两种节点都要撑满 */
.card-thumb > img,
.card-thumb > canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body {
  padding: 5px 7px 6px;
  display: flex; flex-direction: column; gap: 1px;   /* 行间距约原来的三分之一 */
}
.card-name {
  margin: 0; font-size: 12.5px; font-weight: 650; line-height: 1.22; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.card-generic {
  margin: 0; font-size: 11px; line-height: 1.2; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-ind {
  margin: 0; font-size: 11px; line-height: 1.2; color: #9aa8b6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 卡片上的分类小角标：新卡片太小，直接隐藏 */
.card-type { display: none; }

/* ---------------- 卡片上的参考价角标（紧贴图片右下角） ---------------- */
.price-badge {
  position: absolute;
  right: 3px;
  bottom: 3px;
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: 1px 6px 2px;
  border-radius: 7px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 55%, #b91c1c 100%);
  color: #fff;
  box-shadow: 0 3px 9px rgba(220, 38, 38, .4), inset 0 1px 0 rgba(255, 255, 255, .28);
  font-weight: 700;
  letter-spacing: .2px;
  z-index: 3;
}
.price-badge .pb-label {
  display: none;          /* 小卡片上省略「参考价」三个字，只留数字 */
}
.price-badge .pb-deal { font-size: 9px; font-weight: 700; opacity: .95; margin-right: 2px; }
.price-badge .pb-symbol { font-size: 10px; margin-right: 1px; opacity: .95; }
.price-badge .pb-value {
  font-size: 14px;
  line-height: 1.15;
  font-family: "SF Pro Display", -apple-system, "PingFang SC", sans-serif;
  font-variant-numeric: tabular-nums;
}
.price-badge--none {
  background: rgba(15, 23, 42, .62);
  box-shadow: none;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px 2px;
}

/* ---------------- 详情页价格块 ---------------- */
.price-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  margin: 9px 0 10px;
  padding: 9px 12px;
  border-radius: var(--radius-s);
  background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 60%, #fff 100%);
  border: 1px solid #fecaca;
}
.price-main { display: flex; align-items: baseline; gap: 3px; }
.price-label {
  font-size: 11px;
  font-weight: 700;
  color: #b91c1c;
  letter-spacing: .5px;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(220, 38, 38, .1);
}
.price-symbol {
  font-size: 13px;
  font-weight: 800;
  color: #dc2626;
  transform: translateY(-1px);
}
.price-value {
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
  color: #dc2626;
  letter-spacing: -.5px;
  font-family: "SF Pro Display", -apple-system, "PingFang SC", sans-serif;
  font-variant-numeric: tabular-nums;
  transition: color .3s, transform .3s;
}
.price-value--none { font-size: 15px; color: #94a3b8; font-weight: 700; letter-spacing: 0; }
.price-was {
  font-size: 13px;
  color: #94a3b8;
  text-decoration: line-through;
  margin-left: 6px;
}
.price-note { font-size: 12px; color: #b91c1c99; }
.price-flash { animation: pricePulse 1.1s ease 2; }
@keyframes pricePulse {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.13); color: #b91c1c; }
}
.price-source {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--line);
}

/* ---------------- 探寻低价按钮 ---------------- */
.btn-explore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 6px 16px rgba(234, 88, 12, .32);
  transition: transform .16s, box-shadow .16s;
}
.btn-explore:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(234, 88, 12, .4); }
.btn-explore:active { transform: translateY(0); }

/* ---------------- 探寻低价弹窗 ---------------- */
.ex-mask {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .52);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}
.ex-mask.show { opacity: 1; pointer-events: auto; }

.ex-dialog {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-radius: 16px;
  padding: 22px 22px 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
  transform: translateY(10px) scale(.98);
  transition: transform .24s cubic-bezier(.2, .9, .3, 1.2);
}
.ex-mask.show .ex-dialog { transform: none; }

.ex-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.ex-close:hover { background: #eef2f6; color: var(--ink); }

.ex-head { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 16px; }
.ex-icon {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #ea580c;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
}
.ex-title { margin: 0 0 3px; font-size: 17px; color: var(--ink); }
.ex-sub { margin: 0; font-size: 12.5px; color: var(--muted); }

.ex-tip { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
/* 「微信客服」高亮可点：点了复制后台设置的微信号并跳转微信 */
.ex-tip-link {
  display: inline-block;
  color: var(--brand);
  font-weight: 700;
  font-style: normal;
  cursor: pointer;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(14, 138, 114, .10);
  border-bottom: 1px dashed rgba(14, 138, 114, .55);
  transition: background .18s, transform .18s;
}
.ex-tip-link:hover { background: rgba(14, 138, 114, .20); }
.ex-tip-link:active { transform: scale(.97); }
.ex-input-row { display: flex; gap: 8px; }
.ex-input {
  flex: 1;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  font: inherit;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.ex-input:focus { outline: 2px solid rgba(14, 138, 114, .25); border-color: var(--brand); }
.ex-err { margin: 8px 0 0; font-size: 12.5px; color: #dc2626; }
.ex-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }

.ex-hit {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; border-radius: var(--radius-s);
  background: #f0fdf4; border: 1px solid #bbf7d0; margin-bottom: 14px;
}
.ex-hit-icon {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 50%; background: #16a34a; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.ex-hit-text { display: flex; flex-direction: column; }
.ex-hit-text strong { font-size: 14px; color: #15803d; }
.ex-hit-text span { font-size: 12px; color: #4d7c62; }

.ex-price {
  display: flex; align-items: baseline; gap: 4px;
  padding: 14px 16px; border-radius: var(--radius-s);
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff; margin-bottom: 14px;
}
.ex-price-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: 1px;
  background: rgba(255, 255, 255, .22); padding: 2px 7px; border-radius: 5px;
  margin-right: 6px;
}
.ex-price-sym { font-size: 17px; font-weight: 700; }
.ex-price-num {
  font-size: 34px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ex-price-old { margin-left: auto; font-size: 12.5px; opacity: .8; text-decoration: line-through; }

.wechat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  border: 0;
  border-radius: var(--radius-s);
  background: #07c160;
  color: #fff;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(7, 193, 96, .3);
  transition: filter .16s, transform .16s;
}
.wechat-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.ex-wechat-id {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.ex-wechat-id b { color: var(--ink); letter-spacing: .6px; }

.link-wechat {
  border: 0; background: none; padding: 0;
  color: var(--brand); font: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}

/* ---------------- 轻提示 ---------------- */
.toast-box {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: min(440px, 90vw);
  width: max-content;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .95);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.55;
  text-align: left;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .35);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .3s, transform .3s;
}
.toast.show { opacity: 1; transform: none; }
.toast span:last-child { flex: 1; }
.toast-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #38bdf8; flex: 0 0 7px; margin-top: 6px;
}
.toast--ok { background: linear-gradient(135deg, #0f766e, #115e59); }
.toast--warn { background: linear-gradient(135deg, #b45309, #92400e); }
.toast--info { background: rgba(15, 23, 42, .95); }
.toast--ok .toast-dot { background: #6ee7b7; }
.toast--warn .toast-dot { background: #fcd34d; }
.toast--info .toast-dot { background: #60a5fa; }

/* ---------------- 水印层 ---------------- */
[data-watermark] { position: relative; overflow: hidden; }
.wm-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-repeat: repeat;
  background-position: 0 0;
  mix-blend-mode: normal;
}
.wm-canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
img[data-protect], canvas[data-wm-canvas] {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ---------------- 公告资讯 ---------------- */
/* 全站顶部公告（一句话）：由 layout.js 注入到吸顶 header 内，
 * 因此每个页面都固定可见；文字左右滑动 + 呼吸闪烁。 */
.top-banner {
  background: linear-gradient(90deg, #0b7a66, #14a487 55%, #0b7a66);
  color: #fff;
  font-size: 13px;
  overflow: hidden;
}
.top-banner[hidden] { display: none; }
.top-banner .container {
  display: flex; align-items: center; gap: 7px;
  height: 30px; padding-top: 0; padding-bottom: 0;
}
.top-banner-ico { flex: none; font-size: 13px; line-height: 1; }

/* 滚动视窗：文字从右往左匀速滑过，左侧再补一段文字，视觉上左右都有内容 */
.top-banner-scroll {
  flex: 1; min-width: 0; overflow: hidden; position: relative;
  height: 100%; display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22px, #000 calc(100% - 22px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 22px, #000 calc(100% - 22px), transparent);
}
.tb-track {
  display: inline-flex; white-space: nowrap; will-change: transform;
  animation: tbMarquee 20s linear infinite;
}
/* 每一段右侧留 90px 空白，两段拼起来刚好「-50%」处无缝衔接 */
.tb-item {
  padding-right: 90px;
  animation: tbBlink 2.6s ease-in-out infinite;
}
@keyframes tbMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes tbBlink {
  0%, 100% { opacity: 1;    text-shadow: 0 0 0 rgba(255,255,255,0); }
  50%      { opacity: .62;  text-shadow: 0 0 9px rgba(255,255,255,.85); }
}
/* 鼠标悬停暂停，方便看清内容 */
.top-banner-scroll:hover .tb-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .tb-track { animation: none; }
  .tb-item { animation: none; padding-right: 0; }
}

.notice-strip {
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
  border-bottom: 1px solid var(--line);
}
.notice-strip .container { padding-top: 14px; padding-bottom: 14px; }
.notice-strip-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.notice-badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: #b45309; background: #fef3c7; border-radius: 5px; padding: 3px 8px;
}
.notice-more { font-size: 12.5px; color: var(--brand); text-decoration: none; }
.notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.notice-list a {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--ink-2); text-decoration: none;
}
.notice-list a:hover .n-title { color: var(--brand); }
.notice-list .n-title {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notice-list .n-date { font-size: 12px; color: var(--muted); }
.top-flag {
  font-size: 11px; font-weight: 700; color: #dc2626;
  background: #fee2e2; border-radius: 4px; padding: 1px 5px;
}

/* 多条公告：置顶项固定显示，其余项在固定行内轮流淡入淡出（最多 5 条） */
.notice-list.rolling { display: block; }
.notice-list.rolling .pinned { display: block; }
.notice-list.rolling .pinned a { padding: 1px 0; }

.notice-list.rolling .roll-host {
  position: relative;
  height: 23px;            /* 单行高度，超出隐藏 */
  overflow: hidden;
}
.notice-list.rolling .roll-inner {
  position: relative;
  height: 100%;
}
.notice-list.rolling .roll-item {
  position: absolute; inset: 0;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .5s ease, transform .5s ease;
  pointer-events: none;
}
.notice-list.rolling .roll-item a {
  display: flex; align-items: center; height: 100%;
}
.notice-list.rolling .roll-item.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------------- 资讯页 ---------------- */
.news-layout { display: grid; gap: 18px; padding: 26px 0 40px; }
.news-item {
  display: flex; gap: 16px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: box-shadow .18s, transform .18s;
}
.news-item:hover { box-shadow: var(--shadow-h); transform: translateY(-2px); }
.news-item-body { flex: 1; min-width: 0; }
.news-item h3 { margin: 0 0 6px; font-size: 16.5px; color: var(--ink); }
.news-item p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.news-meta { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--muted); }
.news-cat {
  background: var(--brand-light); color: var(--brand-dark);
  border-radius: 5px; padding: 2px 8px; font-weight: 600;
}
.news-cover {
  width: 148px; height: 100px; flex: 0 0 148px;
  border-radius: var(--radius-s); overflow: hidden; position: relative;
  background: var(--bg);
}
.news-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.article { padding: 26px 0 46px; }
.article-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 30px 34px; max-width: 860px; margin: 0 auto;
}
.article-card h1 { margin: 0 0 10px; font-size: 25px; line-height: 1.4; color: var(--ink); }
.article-meta {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.article-body { font-size: 15px; line-height: 1.95; color: var(--ink-2); }
.article-body h2 { font-size: 18px; color: var(--ink); margin: 26px 0 10px; }
.article-body h3 { font-size: 16px; color: var(--ink); margin: 20px 0 8px; }
.article-body img { max-width: 100%; border-radius: var(--radius-s); }
.article-body p { margin: 0 0 14px; }
.article-body a { color: var(--brand); }

/* ---------------- 详情页布局 ---------------- */
.detail-top {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  margin: 18px 0 30px;
}
.detail-gallery { position: sticky; top: calc(84px + var(--topbar-h, 0px)); }
.gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  aspect-ratio: 4 / 3;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb {
  width: 62px; height: 62px; padding: 0; border-radius: 8px;
  border: 2px solid var(--line); overflow: hidden; cursor: pointer; background: #fff;
}
.thumb.active { border-color: var(--brand); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.detail-head { min-width: 0; }
/* 药品名称缩小到原来的约 1/3（27px → 18px） */
.dh-name { margin: 0 0 3px; font-size: 18px; line-height: 1.3; color: var(--ink); }
.dh-en {
  margin: 0; font-size: 13.5px; color: var(--muted);
  letter-spacing: .3px; word-break: break-word;
}
.dh-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg); color: var(--ink-2); border: 1px solid var(--line);
}
.tag-cat {
  color: var(--chip, var(--brand));
  background: color-mix(in srgb, var(--chip, var(--brand)) 10%, #fff);
  border-color: color-mix(in srgb, var(--chip, var(--brand)) 24%, #fff);
  font-weight: 600;
}
.dh-summary {
  font-size: 14.5px; line-height: 1.85; color: var(--ink-2);
  background: var(--brand-soft); border-left: 3px solid var(--brand);
  padding: 12px 15px; border-radius: 0 var(--radius-s) var(--radius-s) 0;
  margin: 0 0 16px;
}
.dh-kv {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  border-top: 1px solid var(--line);
}
.kv {
  display: flex; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--line); font-size: 13.5px;
}
.kv-k { flex: 0 0 84px; color: var(--muted); }
.kv-v { flex: 1; color: var(--ink); word-break: break-word; }
/* 适应症 / 禁忌症 / 不良反应这类长段文字占整行，两列排版才不会一边高一边低 */
.kv.kv-wide { grid-column: 1 / -1; }
.kv.kv-wide .kv-v { line-height: 1.75; }

.manual { margin-top: 8px; }
.manual-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.manual-head h2 { margin: 0; font-size: 19px; color: var(--ink); }
.manual-note { font-size: 12px; color: var(--muted); }
.manual-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.manual-block {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 16px 18px;
}
.manual-block.wide { grid-column: 1 / -1; }
.manual-block h3 {
  margin: 0 0 9px; font-size: 14.5px; color: var(--brand-dark);
  display: flex; align-items: center; gap: 7px;
}
.manual-block h3::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--brand);
}
.manual-text { font-size: 13.5px; line-height: 1.9; color: var(--ink-2); }

.detail-foot-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line);
}

/* ---------------- 药品评价（详情页） ---------------- */
.comments {
  margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line);
}
.comments-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.comments-head h2 { font-size: 19px; margin: 0; font-weight: 700; }
.comments-note { font-size: 13px; color: var(--muted); }
.comments-list { display: grid; gap: 12px; margin-bottom: 18px; }
.comments-empty { color: var(--muted); font-size: 14px; padding: 8px 0 4px; }
.comment-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; }
.ci-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ci-head b { font-size: 14px; color: var(--ink); }
.ci-stars { color: #f59e0b; font-size: 13px; letter-spacing: 1px; }
.ci-date { font-size: 12px; color: var(--muted); margin-left: auto; }
.ci-content { font-size: 14px; color: var(--ink-2); line-height: 1.7; margin-top: 7px; white-space: pre-wrap; }

.comment-form {
  background: var(--brand-soft); border: 1px solid #d4ece4;
  border-radius: 14px; padding: 16px;
}
.cf-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cf-stars { display: inline-flex; gap: 2px; }
.cf-star {
  border: 0; background: none; cursor: pointer; font-size: 22px; line-height: 1;
  color: #cbd5e1; padding: 0; transition: color .12s;
}
.cf-star.on { color: #f59e0b; }
.cf-hint { font-size: 12.5px; color: var(--muted); }
.cf-input {
  width: 100%; min-height: 84px; resize: vertical; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 10px; font: inherit;
  background: #fff; color: var(--ink); outline: none;
}
.cf-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,138,114,.12); }
/* 底部一行：昵称输入框 · 提示语 · 提交按钮（三者高度统一） */
.cf-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.cf-nick {
  flex: none; width: 96px; height: 32px; box-sizing: border-box;
  padding: 0 10px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink);
}
.cf-nick::placeholder { color: #9aa8b6; }
.cf-nick:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,138,114,.12); }
.cf-tip { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); }
.cf-foot .btn { flex: none; height: 32px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
.cf-msg {
  margin-top: 12px; padding: 10px 13px; border-radius: 9px; font-size: 13.5px;
  background: var(--otc-bg); color: var(--otc);
}
@media (max-width: 640px) {
  .ci-date { margin-left: 0; width: 100%; }
  .cf-foot { flex-direction: column; align-items: stretch; }
  .cf-nick { width: 100%; }
  .cf-foot .btn { width: 100%; }
  .cf-tip { text-align: center; }
}

/* ---------------- 后台：标签页 ---------------- */
.admin-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.admin-tab {
  border: 0; background: none; font: inherit;
  font-size: 14px; color: var(--muted); cursor: pointer;
  padding: 11px 15px; border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
}
.admin-tab:hover { color: var(--ink); background: var(--bg); }
.admin-tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 700; }
.admin-tab .badge {
  display: inline-block; margin-left: 6px; font-size: 11px;
  background: var(--brand-light); color: var(--brand-dark);
  border-radius: 999px; padding: 1px 7px;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 18px;
}
.panel-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 15px;
}
.panel-head h3 { margin: 0; font-size: 16px; color: var(--ink); flex: 1; }
.panel-head .muted { font-size: 12.5px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
}
.stat-box {
  padding: 15px 16px; border-radius: var(--radius-s);
  background: var(--brand-soft); border: 1px solid var(--brand-light);
}
.stat-box .sn { font-size: 25px; font-weight: 800; color: var(--brand-dark); line-height: 1.1; }
.stat-box .sl { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.bar {
  height: 10px; border-radius: 999px; background: var(--line);
  overflow: hidden; margin: 8px 0 4px;
}
.bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #34d399);
}
.bar.warn > i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar.danger > i { background: linear-gradient(90deg, #dc2626, #f87171); }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td {
  padding: 9px 11px; text-align: left;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.tbl th { background: var(--bg); color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.tbl tr:hover td { background: #fbfdfc; }
.tbl td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.tbl td.nowrap { white-space: nowrap; }
.tbl .ellip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pager-mini { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.pager-mini button {
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer;
}
.pager-mini button:disabled { opacity: .45; cursor: not-allowed; }
.pager-mini .info { font-size: 12.5px; color: var(--muted); }

.role-tag {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}
.role-tag.admin { background: #fee2e2; color: #b91c1c; }
.role-tag.editor { background: #dbeafe; color: #1d4ed8; }

/* 后台表格里的药品行 */
.row-drug { display: flex; align-items: center; gap: 10px; }
.row-thumb {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 8px; overflow: hidden; background: var(--bg);
  border: 1px solid var(--line);
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-drug span { display: flex; flex-direction: column; min-width: 0; }
.row-drug b { font-size: 13.5px; color: var(--ink); }
.row-drug em {
  font-style: normal; font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px;
}
.cat-inline {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--chip, var(--ink-2));
  background: color-mix(in srgb, var(--chip, #64748b) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--chip, #64748b) 20%, #fff);
  border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.money {
  color: #dc2626; font-variant-numeric: tabular-nums;
  font-size: 14px; letter-spacing: -.2px;
}

/* 后台：价格输入框 */
.price-input-wrap {
  display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: #fff; overflow: hidden;
}
.price-input-wrap .pi-symbol {
  padding: 0 10px; color: #dc2626; font-weight: 700;
  background: #fef2f2; align-self: stretch; display: flex; align-items: center;
  border-right: 1px solid #fecaca;
}
.price-input-wrap input {
  flex: 1; border: 0; padding: 10px 12px;
  font: inherit; font-size: 15px; font-weight: 700; color: #dc2626;
  outline: none; min-width: 0;
}
.price-input-wrap input::placeholder { font-weight: 400; color: var(--muted); }

.img-preview-box {
  width: 96px; height: 96px; flex: 0 0 96px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg);
}
.img-preview-box .img-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
img.img-preview { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }

.quota-tip {
  font-size: 12.5px; color: var(--warn);
  background: var(--warn-bg); border: 1px solid #fde68a;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .detail-top { grid-template-columns: 1fr; gap: 20px; }
  .detail-gallery { position: static; }
  .manual-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .dh-kv { grid-template-columns: 1fr; }
  .price-value { font-size: 21px; }
  .news-item { flex-direction: column-reverse; }
  .news-cover { width: 100%; flex: none; height: 168px; }
  .article-card { padding: 22px 18px; }
  .kv-k { flex: 0 0 72px; }
}

/* ================= 首页：低价好物 / 热榜点击 =================
 * 布局：一整条横带 = [标题块 132px] [4 个商品格] [查看更多 96px]
 * 整条高度约 76px，相当于旧版（横条 45 + 4 格 158 ≈ 203）的三分之一。 */
.home-block { padding: 22px 0 2px; }
.home-block + .home-block { padding-top: 10px; }

.promo-strip {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr) 100px;
  gap: 8px;
  align-items: stretch;
}

/* 标题块：图标 + 大字，带扫光与呼吸动画 */
.promo-lead {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 6px;
  border-radius: 12px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #0e8a72, #19b394);
  box-shadow: 0 4px 14px rgba(14,138,114,.22);
  overflow: hidden;
}
.promo--hot .promo-lead {
  background: linear-gradient(135deg, #ec6a2a, #f5a13d);
  box-shadow: 0 4px 14px rgba(236,106,42,.22);
}
/* 斜向扫光 */
.promo-lead::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-18deg);
  animation: promoShine 3.4s ease-in-out infinite;
}
@keyframes promoShine {
  0%   { left: -60%; }
  55%  { left: 125%; }
  100% { left: 125%; }
}
.promo-lead-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: rgba(255,255,255,.2);
  position: relative; z-index: 1;
  animation: promoIcoBob 2.6s ease-in-out infinite;
}
.promo-lead-ico svg { display: block; }
@keyframes promoIcoBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-2px) rotate(-6deg); }
}
.promo-lead-txt {
  position: relative; z-index: 1;
  font-size: 18px; font-weight: 800; letter-spacing: 1.5px; line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
  animation: promoTitleGlow 2.4s ease-in-out infinite;
}
@keyframes promoTitleGlow {
  0%, 100% { transform: scale(1);     text-shadow: 0 1px 2px rgba(0,0,0,.18); }
  50%      { transform: scale(1.055); text-shadow: 0 0 12px rgba(255,255,255,.9), 0 1px 2px rgba(0,0,0,.2); }
}

/* 商品行 */
.promo-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.promo-item {
  position: relative;
  display: flex; align-items: center; gap: 7px;
  padding: 5px 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: var(--ink);
  transition: .16s ease; min-width: 0;
}
.promo-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-h); border-color: #d7e6e1; }
.promo--hot .promo-item:hover { border-color: #f3cbb4; }
.promo-item .pi-thumb { flex: none; width: 52px; height: 52px; border-radius: 8px; background: #f8fbfa; overflow: hidden; }
.promo-item .pi-thumb img,
.promo-item .pi-thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.pi-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pi-name {
  font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.promo-rank {
  position: absolute; left: 2px; top: 2px; z-index: 3;
  min-width: 16px; height: 16px; padding: 0 4px;
  font-size: 10px; font-weight: 800; color: #fff; line-height: 16px; text-align: center;
  background: linear-gradient(135deg,#f97316,#ef4444);
  border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
/* 红底价胶囊 */
.promo-price {
  align-self: flex-start;
  display: inline-flex; align-items: baseline; gap: 1px;
  background: #e53935; color: #fff; font-weight: 700;
  border-radius: 6px; padding: 1px 7px;
  font-size: 12px; line-height: 1.5; white-space: nowrap;
}
.promo-price .pb-symbol { font-size: 10px; }
.promo-price .pb-was { font-size: 10px; opacity: .82; text-decoration: line-through; margin-left: 3px; }
.promo-price--na { background: #94a3b8; font-size: 11px; font-weight: 600; }
.promo-price.has-deal { background: #c0392b; }

/* 右侧「查看更多」 */
.promo-more {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; font-weight: 600; text-align: center; line-height: 1.3;
  color: var(--brand-dark); text-decoration: none;
  background: #f0faf6; border: 1px dashed #bfe6d8; border-radius: 12px;
  padding: 6px;
  transition: .16s;
}
.promo--hot .promo-more { color: #c2410c; background: #fff6ef; border-color: #f3c9ad; }
.promo-more:hover { background: #e3f7ef; }
.promo--hot .promo-more:hover { background: #ffeade; }
.promo-more .ar { font-size: 14px; line-height: 1; animation: promoArrow 1.6s ease-in-out infinite; }
@keyframes promoArrow {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(3px); }
}

@media (max-width: 780px) {
  .promo-strip { grid-template-columns: 1fr; gap: 6px; }
  .promo-lead { flex-direction: row; gap: 7px; padding: 7px 10px; }
  .promo-lead-ico { width: 22px; height: 22px; border-radius: 7px; }
  .promo-lead-txt { font-size: 16px; letter-spacing: 1px; }
  .promo-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .promo-item { padding: 4px 6px; gap: 6px; }
  .promo-item .pi-thumb { width: 44px; height: 44px; }
  .promo-more { flex-direction: row; gap: 4px; padding: 6px; font-size: 11.5px; }
}

/* 热榜名次角标（缩略图左上角） */
.hot-rank {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 3;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 9px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, .35);
  letter-spacing: .5px;
}
/* 前三名用更亮的金红 */
.card .hot-rank[data-top] {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

/* 热榜点击次数（卡片右下角） */
.hot-views {
  margin-left: auto;
  font-size: 12px;
  color: #c2410c;
  white-space: nowrap;
}

/* ================= 后台：挑选列表 / 勾选列表 ================= */
.pick-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 300px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
  padding: 6px;
}
.pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.pick-item:hover { background: rgba(14, 138, 114, .08); }
.pick-item.added { opacity: .45; cursor: default; }
.pick-item img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
  background: #f1f5f9;
}
.pick-item span { display: flex; flex-direction: column; min-width: 0; }
.pick-item b { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-item em { font-style: normal; font-size: 12px; color: var(--muted); }
.pick-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* 后台「低价好物 / 热榜点击」列表：整体压缩到原来的约 1/8
 * 做法：原来一行占满整宽（约 900×30），改成多列密排的小条（约 190×21），
 * 单条面积 = 1/8 左右；两个板块共用同一套尺寸。 */
.pick-rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
  max-height: 340px;
  overflow: auto;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}
.pick-rows:empty { display: none; }
.pick-rows > .empty { grid-column: 1 / -1; }
.pick-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  min-width: 0;
  height: 21px;
}
.pick-no {
  flex: 0 0 14px;
  height: 14px;
  border-radius: 4px;
  background: rgba(14, 138, 114, .12);
  color: var(--brand);
  font-weight: 700;
  font-size: 9.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pick-thumb img,
.pick-thumb canvas {
  width: 16px; height: 16px;
  object-fit: cover;
  border-radius: 3px;
  background: #f1f5f9;
  display: block;
}
.pick-name { display: flex; flex-direction: row; align-items: baseline; gap: 4px; min-width: 0; flex: 1; line-height: 1; }
.pick-name b {
  font-size: 10.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0;
}
/* 分类这一列在这么窄的行里挤掉名字，直接不显示（搜索框里能看到分类） */
.pick-name em { display: none; }
.pick-ops { display: flex; gap: 2px; flex: 0 0 auto; align-items: center; }
.pick-ops .btn-sm {
  padding: 0 4px; font-size: 10px; line-height: 15px; height: 15px;
  border-radius: 4px; min-width: 0;
}
/* 热榜点击次数的输入框（要挤进这么小的一行里） */
.pick-rows .hot-count-input {
  width: 46px; height: 16px; box-sizing: border-box;
  padding: 0 3px; font-size: 10px; line-height: 16px;
  border: 1px solid var(--line); border-radius: 4px; background: #fff;
}

.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
}
.check-item:has(input:checked) {
  border-color: var(--brand);
  background: rgba(14, 138, 114, .08);
  color: var(--brand);
  font-weight: 600;
}

/* ================= X 码：分类药品明细（单药品专属价） ================= */
.ov-table {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--paper, #fff);
}
.ov-head {
  position: sticky; top: 0; z-index: 1;
  display: grid;
  grid-template-columns: 1fr 90px 150px 110px;
  gap: 8px;
  padding: 8px 12px;
  background: var(--soft, #f6f7f9);
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.ov-row {
  display: grid;
  grid-template-columns: 1fr 90px 150px 110px;
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.ov-row:last-of-type { border-bottom: none; }
.ov-row:hover { background: rgba(14, 138, 114, .04); }
.ov-name b { display: block; font-weight: 600; line-height: 1.35; }
.ov-name em {
  display: block; font-style: normal;
  font-size: 11.5px; color: var(--muted); margin-top: 2px;
}
.ov-name em b { display: inline; color: var(--brand); font-size: 11.5px; }
.ov-price { font-weight: 600; white-space: nowrap; }
.ov-row select,
.ov-row input {
  width: 100%;
  padding: 5px 8px;
  font-size: 12.5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: inherit;
}
.ov-row input:focus, .ov-row select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(14, 138, 114, .12);
}
.ov-empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.ov-foot {
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--soft, #f6f7f9);
  border-top: 1px solid var(--line);
}
@media (max-width: 720px) {
  .ov-head { grid-template-columns: 1fr 70px 120px 90px; }
  .ov-row { grid-template-columns: 1fr 70px 120px 90px; }
}

/* ============================================================
 * X 码专属优惠（24 小时留存）相关样式
 * ============================================================ */

/* 首页顶部提示条：已应用专属优惠 */
.unlock-bar {
  background: linear-gradient(90deg, rgba(14, 138, 114, .12) 0%, rgba(14, 138, 114, .05) 60%, rgba(14, 138, 114, 0) 100%);
  border-bottom: 1px solid rgba(14, 138, 114, .18);
}
.unlock-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 24px;
  font-size: 13.5px; color: #0f766e;
}
.unlock-bar .ub-ico { font-size: 16px; line-height: 1; }
.unlock-bar .ub-text b { color: #0d9488; }
.unlock-bar .ub-clear {
  margin-left: auto;
  padding: 4px 12px;
  border: 1px solid rgba(14, 138, 114, .35);
  border-radius: 999px;
  background: #fff;
  color: #0f766e;
  font: inherit; font-size: 12.5px;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}
.unlock-bar .ub-clear:hover { background: rgba(14, 138, 114, .10); border-color: var(--brand); }

/* 卡片价格角标：专属价状态 */
.price-badge.has-deal {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 55%, #115e59 100%);
  box-shadow: 0 6px 16px rgba(13, 148, 136, .38), inset 0 1px 0 rgba(255, 255, 255, .28);
  flex-wrap: wrap;
  max-width: calc(100% - 16px);
}
.price-badge .pb-deal {
  flex: 0 0 100%;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: .92;
  margin-bottom: 1px;
}
.price-badge .pb-was {
  font-size: 10px;
  font-weight: 500;
  opacity: .72;
  text-decoration: line-through;
  margin-left: 3px;
}

/* 详情页价格块：专属价状态 */
.price-block.has-deal {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 60%, #fff 100%);
  border-color: #99f6e4;
}
.price-block.has-deal .price-label { color: #0f766e; background: rgba(13, 148, 136, .12); }
.price-block.has-deal .price-symbol,
.price-block.has-deal .price-value { color: #0d9488; }

/* 详情页：专属优惠说明 */
.price-deal-note {
  flex: 0 0 100%;
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #0f766e;
  line-height: 1.6;
}
.price-deal-note b { color: #0d9488; }
.price-deal-note a { color: #0f766e; text-decoration: underline; cursor: pointer; }

/* 弹窗：已是最优惠价格 */
.ex-step--best { padding-top: 2px; }
.ex-hit--best { background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%); border: 1px solid #99f6e4; }
.ex-hit--best .ex-hit-icon { background: #0d9488; }
.ex-best-tip {
  margin: 14px 0 12px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* ============================================================
 * 客服挂件 + 到访提醒弹窗（js/contact.js）
 * ============================================================ */
.contact-fab {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 900;
}
.contact-fab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 16px 0 13px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(14, 138, 114, .38);
  transition: transform .18s, box-shadow .18s, opacity .18s;
}
.contact-fab-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(14, 138, 114, .45); }
.contact-fab--done .contact-fab-btn { opacity: .82; }
.contact-fab--done .contact-fab-btn::after {
  content: '✓';
  margin-left: 2px;
  font-size: 12px;
  opacity: .9;
}

/* 客服面板 */
.contact-panel {
  position: fixed;
  right: 18px;
  bottom: 80px;
  z-index: 901;
  width: 268px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(16, 24, 40, .18);
  padding: 14px;
  opacity: 0;
  transform: translateY(8px) scale(.98);
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.contact-panel.show { opacity: 1; transform: none; pointer-events: auto; }
.cp-head { display: flex; align-items: center; gap: 10px; }
.cp-ava {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; background: var(--brand-light); color: var(--brand-dark);
}
.cp-head b { display: block; font-size: 14px; color: var(--ink); }
.cp-head span { font-size: 12px; color: var(--muted); }
.cp-close { margin-left: auto; border: 0; background: none; font-size: 19px; color: var(--muted); cursor: pointer; line-height: 1; }
.cp-id {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 9px 10px;
  background: var(--brand-soft); border: 1px dashed var(--brand); border-radius: 10px;
}
.cp-id-label { font-size: 12px; color: var(--muted); }
.cp-id-val { flex: 1; font-size: 14.5px; color: var(--ink); word-break: break-all; }
.cp-tip { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.cp-acts { display: flex; gap: 8px; margin-top: 12px; }
.cp-acts .btn { flex: 1; justify-content: center; }

/* 「有什么可以帮你？」提醒弹窗 */
.contact-pop {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -46%) scale(.96);
  z-index: 950;
  width: min(340px, calc(100vw - 40px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .26);
  padding: 22px 20px 18px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
}
.contact-pop.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.contact-pop-close {
  position: absolute; right: 10px; top: 8px;
  border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1;
}
.contact-pop-ico {
  width: 48px; height: 48px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: var(--brand-light); color: var(--brand-dark);
}
.contact-pop h4 { margin: 0 0 6px; font-size: 17px; color: var(--ink); }
.contact-pop p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.65; }
.contact-pop-id {
  margin: 12px 0 14px; padding: 9px 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  font-size: 13px; color: var(--ink-2);
}
.contact-pop-id b { color: var(--ink); font-size: 14.5px; }
.contact-pop-acts { display: flex; gap: 9px; }
.contact-pop-acts .btn { flex: 1; justify-content: center; }

/* 定位授权浮层（js/geo.js） */
.geo-banner {
  position: fixed;
  left: 50%; bottom: 84px;
  transform: translateX(-50%);
  z-index: 940;
  display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(16, 24, 40, .18);
  font-size: 13px; color: var(--ink-2);
}
.gb-ico { font-size: 15px; }
.gb-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-close { border: 0; background: none; font-size: 17px; color: var(--muted); cursor: pointer; line-height: 1; }

/* 探寻低价弹窗里的「授权位置」步骤 */
.ex-geo { text-align: center; padding: 6px 4px 2px; }
.ex-geo-ico { font-size: 34px; }
.ex-geo h4 { margin: 8px 0 6px; font-size: 16px; color: var(--ink); }
.ex-geo p { margin: 0 auto 14px; max-width: 300px; font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.ex-geo .btn { min-width: 180px; justify-content: center; }
.ex-geo-err { margin: 10px 0 0 !important; font-size: 12.5px; color: var(--rx); }
.ex-geo-note { margin-top: 12px !important; font-size: 12px; color: var(--muted); }

/* ============================================================
 * 后台：Excel 导入
 * ============================================================ */
.imp-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) { .imp-grid { grid-template-columns: 1fr; } }

.imp-drop {
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--bg);
  padding: 26px 18px;
  text-align: center;
  transition: border-color .16s, background .16s;
}
.imp-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.imp-drop-ico { font-size: 34px; }
.imp-drop p { margin: 8px 0 4px; font-size: 13.5px; color: var(--ink-2); }
.imp-drop .muted { font-size: 12px; }
.link { color: var(--brand); font-weight: 600; cursor: pointer; text-decoration: underline; }

.imp-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; }
.imp-actions .muted { font-size: 12.5px; }
.btn-ok { background: var(--otc); color: #fff; }
.btn-ok:hover { filter: brightness(1.06); }
.btn-ok:disabled { opacity: .5; cursor: not-allowed; }

.imp-rules { margin-top: 16px; padding: 13px 15px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.imp-rules h4 { margin: 0 0 8px; font-size: 13.5px; color: var(--ink); }
.imp-rules ul { margin: 0; padding-left: 18px; }
.imp-rules li { font-size: 12.5px; color: var(--ink-2); line-height: 1.85; }

.imp-preview { min-height: 220px; }
.imp-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.imp-sum .muted { font-size: 12.5px; }
.imp-cats { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.imp-bad { background: #fff7f7; }
.imp-err { font-size: 11.5px; color: var(--rx); }
.imp-done h4 { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.imp-done > p { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }

/* ============================================================
 * 后台：访客记录分组视图
 * ============================================================ */
.vg-row { cursor: pointer; }
.vg-row:hover { background: var(--brand-soft); }
.vg-row.open { background: var(--brand-soft); }
.vg-detail > td { background: #fbfdfd; padding: 14px 16px !important; }
.vg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .vg-cols { grid-template-columns: 1fr; } }
.vg-cols h5 { margin: 0 0 8px; font-size: 13px; color: var(--ink); }
.vg-pages { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; }
.vg-pages li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-bottom: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-2);
}
.vg-pages li .mono { color: var(--muted); font-size: 11.5px; }
.vg-pages li .muted { margin-left: auto; font-size: 11.5px; }
.vg-n { flex: 0 0 auto; color: var(--brand-dark); font-weight: 600; font-size: 11.5px; }

/* 小标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.tag--xcode { background: var(--brand-light); color: var(--brand-dark); }
.tag--err   { background: var(--rx-bg); color: var(--rx); }
.tag--geo   { background: #eef2ff; color: #4338ca; margin-left: 6px; }

/* 分段切换 + 复选框（后台通用） */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--card); }
.seg button {
  border: 0; background: none; padding: 6px 13px;
  font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--brand); color: #fff; }

.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.chk input { accent-color: var(--brand); }

/* 后台小表格（分组详情 / 导入结果用） */
.tbl--mini { font-size: 12.5px; }
.tbl--mini th, .tbl--mini td { padding: 6px 9px; }

/* ---------------- 快速修改（后台标签页） ---------------- */
.hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; line-height: 1.6; }

.quick-search { position: relative; max-width: 520px; }
.quick-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .5; }
.quick-search input {
  width: 100%; padding: 11px 14px 11px 36px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; font-size:14px; background: var(--card); color: var(--ink);
}
.quick-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(16,24,40,.14); max-height: 320px; overflow: auto; padding: 6px;
}
.qr-item { display: flex; flex-direction: column; padding: 9px 11px; border-radius: 8px; cursor: pointer; }
.qr-item:hover { background: var(--brand-light, #eef2ff); }
.qr-item b { font-size: 13.5px; color: var(--ink); }
.qr-item span { font-size: 12px; color: var(--muted); margin-top: 2px; }
.qr-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }

.quick-form { margin-top: 18px; max-width: 760px; }
.quick-id { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.quick-id span { color: var(--ink-2); font-family: ui-monospace, Menlo, Consolas, monospace; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* 覆盖 style.css 里 .field 自带的 margin-bottom，否则横竖间距不一致（竖 30px / 横 16px） */
.form-grid > .field { margin-bottom: 0; }
.form-grid > .field > .hint { margin: 5px 0 0; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
  font: inherit; font-weight: 400; font-size: 13.5px; color: var(--ink);
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); resize: vertical;
}
.form-grid textarea { line-height: 1.5; }
.req { color: var(--rx); }
.img-row { display: flex; gap: 8px; align-items: center; }
.img-row input { flex: 1; }
.img-preview { margin-top: 8px; }
.img-preview img { max-width: 160px; max-height: 160px; border: 1px solid var(--line); border-radius: 8px; }

/* ---------------- 药品图片：最多 3 张 ----------------
 * 每个槽位 = 预览图 + 网址输入 + 两个按钮；
 * 按钮统一 30px 高，「选择本地图片」用 <label> 包 file input 也强制同样高度。 */
.img-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.img-slot {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px;
  background: #fff; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.img-slot-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 11.5px; color: var(--muted); font-weight: 600;
}
.img-slot-box {
  position: relative; aspect-ratio: 1 / 1; border-radius: 7px; overflow: hidden;
  background: #f6f9f8; border: 1px dashed #dfe8e4;
}
.img-slot-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 覆盖 img.img-preview 的固定 96px 尺寸，让预览铺满当前格子 */
.img-slot-box > img.img-preview { width: 100%; height: 100%; margin: 0; object-fit: cover; }
.img-slot-box.is-empty img { display: none; }
.img-slot-box.is-empty::after {
  content: '未选择'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; color: #b6c2c9;
}
.img-slot input[type="text"] {
  font: inherit; font-size: 11.5px; padding: 5px 7px;
  border: 1px solid var(--line); border-radius: 6px; width: 100%; box-sizing: border-box;
}
.img-slot-ops { display: flex; gap: 6px; }
/* 统一高度：label 包 input 与普通 button 视觉一致 */
.img-slot-ops .btn,
.img-slot-ops > label.btn {
  height: 30px; box-sizing: border-box; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 9px; font-size: 12px; flex: 1 1 0; min-width: 0; white-space: nowrap;
}
@media (max-width: 640px) {
  .img-slots { grid-template-columns: 1fr; }
}
.quick-actions { margin-top: 16px; display: flex; align-items: center; gap: 14px; }
.quick-msg { font-size: 12.5px; color: var(--muted); }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* 后台二级菜单（药品管理下的 快速修改 / Excel 导入 / X 码管理） */
.sub-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.sub-tab {
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink-2);
  font-size: 13.5px; font-weight: 500; cursor: pointer; font-family: inherit;
}
.sub-tab:hover { border-color: var(--brand); color: var(--brand-dark); }
.sub-tab.active {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
}

/* 文章封面本地上传 */
.img-up { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.img-prev { margin-top: 10px; }
.img-prev img { max-width: 220px; max-height: 140px; border-radius: 10px; border: 1px solid var(--line); }
.sel-sm { padding: 6px 8px; font-size: 13px; }

/* 评价审核 */
.cmt-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cmt-list { display: grid; gap: 12px; }
.cmt-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; }
.cmt-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cmt-user { font-size: 14px; color: var(--ink); }
.cmt-stars { color: #f59e0b; font-size: 13px; letter-spacing: 1px; }
.cmt-drug { font-size: 13px; color: var(--muted); margin: 8px 0 6px; }
.cmt-drug a { color: var(--brand); }
.cmt-content { font-size: 14px; color: var(--ink-2); line-height: 1.7; white-space: pre-wrap; }
.cmt-foot { font-size: 12px; margin-top: 8px; }
.cmt-ops { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
