/* ============ RxOnline 全局样式 · 现代主义冷色系矩形 UI ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1a5fb4;          /* 冷蓝 */
  --primary-light: #4a9ae8;
  --primary-dark: #0f3d75;
  --cyan: #0aa2c0;
  --ink: #15222e;
  --muted: #5f7386;
  --line: #d5dfe8;
  --bg: #edf1f5;
  --card: #ffffff;
  --danger: #d64545;
  --radius: 2px;               /* 矩形 */
  --shadow: 4px 4px 0 rgba(15, 40, 70, .07);
  --mono: "SF Mono", Consolas, "Courier New", monospace;
}
body { font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.flex { display: flex; align-items: center; }
.hidden { display: none !important; }

/* ---------- 顶部条 ---------- */
.topbar { background: #101d29; color: #8fa5b8; font-size: 12px; border-bottom: 1px solid #1e3040; }
.topbar .wrap { display: flex; justify-content: space-between; height: 34px; align-items: center; }
.topbar a:hover { color: #7cc4ff; }

/* ---------- 头部 ---------- */
.site-header { background: #fff; border-bottom: 2px solid var(--ink); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; padding-top: 18px; padding-bottom: 18px; }
.logo img { height: 44px; display: block; }
.search-box { flex: 1; display: flex; max-width: 640px; border: 2px solid var(--ink); background: #fff; }
.search-box input { flex: 1; border: none; outline: none; padding: 12px 16px; font-size: 15px; }
.search-box button { background: var(--ink); color: #fff; padding: 0 30px; font-size: 15px; letter-spacing: 2px; }
.search-box button:hover { background: var(--primary-dark); }
.header-cart { border: 2px solid var(--ink); padding: 10px 18px; display: flex; gap: 8px; align-items: center; background: #fff; font-weight: 600; }
.header-cart:hover { background: var(--ink); color: #fff; }
.header-cart .badge { background: var(--danger); color: #fff; min-width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 11px; padding: 0 4px; margin-left: 2px; }
.hotwords { font-size: 12px; color: var(--muted); margin-top: 6px; }
.hotwords a { margin-right: 10px; } .hotwords a:hover { color: var(--primary); }

/* ---------- 药价资讯波动栏（跑马灯） ---------- */
.ticker { background: #101d29; border-bottom: 2px solid var(--ink); overflow: hidden; position: relative; }
.ticker::before { content: "药价资讯"; position: absolute; left: 0; top: 0; bottom: 0; z-index: 2; background: var(--danger); color: #fff; font-size: 12px; letter-spacing: 2px; display: flex; align-items: center; padding: 0 14px; font-weight: 700; }
.ticker-track { display: inline-flex; white-space: nowrap; animation: marquee 36s linear infinite; padding: 8px 0 8px 120px; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { color: #b9ccdd; font-size: 12.5px; margin-right: 46px; font-family: var(--mono); }
.ticker-track b.up { color: #ff7b7b; } .ticker-track b.down { color: #4ade80; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- 主导航 ---------- */
.main-nav { background: var(--ink); }
.main-nav .wrap { display: flex; height: 46px; align-items: center; }
.main-nav .all-cat { background: var(--primary); color: #fff; width: 220px; height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; letter-spacing: 1px; }
.main-nav a.nav-link { color: #c3d3e2; padding: 0 20px; height: 46px; display: flex; align-items: center; font-size: 15px; border-left: 1px solid rgba(255,255,255,.07); }
.main-nav a.nav-link:hover, .main-nav a.nav-link.active { background: var(--primary); color: #fff; }

/* ---------- 首屏 ---------- */
.hero { padding: 18px 0 6px; }
.hero .wrap { display: grid; grid-template-columns: 220px 1fr 260px; gap: 16px; }
.cat-menu { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 6px 0; align-self: start; }
.cat-menu a { display: flex; justify-content: space-between; padding: 10px 16px; font-size: 13px; border-bottom: 1px solid #eef3f7; }
.cat-menu a:last-child { border-bottom: none; }
.cat-menu a:hover { background: #eaf2fa; color: var(--primary-dark); }
/* 中心循环展示图（矩形现代主义） */
.banner { position: relative; height: 330px; overflow: hidden; border: 2px solid var(--ink); box-shadow: var(--shadow); background: #101d29; }
.banner .slide { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 56px; color: #fff; opacity: 0; transition: opacity .55s; }
.banner .slide.on { opacity: 1; }
.banner .slide-txt { position: relative; z-index: 2; max-width: 55%; }
.banner .slide h2 { font-size: 34px; margin-bottom: 12px; letter-spacing: 3px; font-weight: 800; }
.banner .slide p { font-size: 15px; opacity: .9; line-height: 1.8; }
.banner .slide .slide-btn { display: inline-block; margin-top: 18px; border: 2px solid #fff; padding: 8px 22px; font-size: 13px; letter-spacing: 2px; }
.banner .slide .slide-btn:hover { background: #fff; color: var(--ink); }
.slide-deco { position: absolute; right: 40px; top: 0; bottom: 0; width: 300px; z-index: 1; }
.slide-deco i { position: absolute; border: 2px solid rgba(255,255,255,.5); }
.slide-deco i:nth-child(1) { width: 180px; height: 180px; right: 60px; top: 30px; }
.slide-deco i:nth-child(2) { width: 120px; height: 120px; right: 150px; top: 130px; background: rgba(255,255,255,.12); }
.slide-deco i:nth-child(3) { width: 70px; height: 70px; right: 20px; bottom: 30px; border-color: rgba(255,255,255,.8); }
.slide-deco b { position: absolute; right: 90px; top: 120px; font-size: 42px; font-family: var(--mono); color: rgba(255,255,255,.9); font-weight: 800; }
.banner .dots { position: absolute; bottom: 14px; left: 56px; display: flex; gap: 6px; z-index: 3; }
.banner .dots i { width: 26px; height: 4px; background: rgba(255,255,255,.35); cursor: pointer; }
.banner .dots i.on { background: #fff; }
.hero-side .panel { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.hero-side .panel h4 { font-size: 13px; color: var(--muted); margin-bottom: 10px; letter-spacing: 1px; }
.notice-line { background: #fff; border-left: 4px solid var(--primary); color: #31506b; padding: 11px 16px; font-size: 13px; margin: 14px 0; box-shadow: var(--shadow); }

/* ---------- 区块 ---------- */
.section { margin: 24px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.section-head h3 { font-size: 20px; letter-spacing: 1px; } .section-head h3 span { color: var(--primary); }
.section-head a { color: var(--muted); font-size: 13px; }

/* ---------- 药品卡片 ---------- */
.drug-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.drug-card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 14px; transition: transform .12s; display: flex; flex-direction: column; }
.drug-card:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 rgba(15,40,70,.12); border-color: var(--ink); }
.drug-img { aspect-ratio: 1 / 1; height: auto; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; background: #f2f6fa; border: 1px solid #e3ebf2; position: relative; overflow: hidden; }
.drug-label-img { width: 100%; height: 100%; object-fit: cover; }
.drug-card h5 { font-size: 14px; height: 38px; overflow: hidden; }
.drug-card .spec { font-size: 12px; color: var(--muted); margin: 4px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; min-height: 22px; align-items: center; }
.tbadge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 1px 7px; border: 1px solid; background: #fff; line-height: 18px; }
.tbadge img { width: 16px; height: 16px; object-fit: contain; }
.tbadge svg { width: 12px; height: 12px; }
.rxlabel { height: 18px; max-width: 34px; width: auto; border: 1px solid var(--line); background: #fff; padding: 1px 3px; object-fit: contain; }
/* 详情页放大 Rx/OTC 专用标识 */
.detail-info .rxlabel, .detail-box .rxlabel { height: 26px; max-width: 52px; }
.price-row { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.price { color: var(--danger); font-size: 19px; font-weight: 800; font-family: var(--mono); } .price::before { content: '¥'; font-size: 13px; }
.price-row del { color: #a8b6c2; font-size: 12px; }
.card-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; font-size: 14px; border: 2px solid var(--ink); background: #fff; color: var(--ink); transition: all .12s; font-weight: 600; }
.btn:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 rgba(15,40,70,.15); }
.btn-primary { background: var(--primary); border-color: var(--primary-dark); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: #eaf2fa; }
.btn-danger { background: var(--danger); border-color: #a83232; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-width: 1px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 详情页 ---------- */
.crumbs { font-size: 13px; color: var(--muted); margin: 18px 0; }
.crumbs a:hover { color: var(--primary); }
.detail-box { background: #fff; border: 2px solid var(--ink); box-shadow: var(--shadow); padding: 26px; display: grid; grid-template-columns: 320px 1fr; gap: 30px; }
.detail-img { height: 280px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #f5f8fb; }
.detail-label-img { width: 150px; height: 150px; object-fit: contain; }
.detail-info h1 { font-size: 24px; margin-bottom: 6px; }
.detail-info .generic { color: var(--muted); margin-bottom: 10px; }
.detail-meta { border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 14px 0; margin: 14px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }
.detail-meta b { font-weight: 600; color: var(--ink); }
.buy-notice { padding: 14px 16px; margin: 16px 0; font-size: 13px; line-height: 1.7; display: flex; gap: 10px; align-items: flex-start; border-left: 4px solid; }
.buy-notice svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.buy-notice.red { background: #fdf0f0; border-color: var(--danger); color: #8f2b2b; }
.buy-notice.orange { background: #fdf5e8; border-color: #e8890c; color: #7a4a00; }
.buy-notice.purple { background: #f3effc; border-color: #7048e8; color: #4a2ba8; }
.buy-notice.green { background: #ecf8f1; border-color: #0ca678; color: #056348; }
.buy-notice.blue { background: #eaf3fc; border-color: var(--primary); color: #12467e; }
.qty-box { display: inline-flex; border: 2px solid var(--ink); }
.qty-box button { width: 34px; background: #eef3f8; font-size: 16px; }
.qty-box input { width: 50px; text-align: center; border: none; outline: none; }
.detail-tabs { background: #fff; border: 2px solid var(--ink); box-shadow: var(--shadow); margin-top: 20px; }
.detail-tabs .tab-head { display: flex; border-bottom: 2px solid var(--ink); }
.detail-tabs .tab-head button { padding: 14px 26px; background: none; font-size: 15px; border-right: 1px solid var(--line); }
.detail-tabs .tab-head button.on { background: var(--ink); color: #fff; font-weight: 600; }
.detail-tabs .tab-body { padding: 22px 26px; line-height: 1.9; color: #31414f; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table td { border: 1px solid var(--line); padding: 9px 14px; }
.spec-table td:first-child { background: #f2f6fa; width: 140px; color: var(--muted); }

/* ---------- 登录/注册 ---------- */
.auth-wrap { min-height: calc(100vh - 240px); display: flex; align-items: center; justify-content: center; padding: 40px 16px; background: linear-gradient(135deg, #dfe9f3, #edf2f7); }
.auth-card { background: #fff; border: 2px solid var(--ink); box-shadow: 8px 8px 0 rgba(15,40,70,.1); width: 420px; padding: 34px; }
.auth-card .logo { text-align: center; margin-bottom: 20px; } .auth-card .logo img { height: 52px; }
.auth-card h2 { text-align: center; font-size: 20px; margin-bottom: 22px; letter-spacing: 2px; }
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; border: 1px solid var(--line); padding: 10px 12px; outline: none; background: #fbfdfe; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); background: #fff; }
.form-msg { font-size: 13px; padding: 9px 12px; margin-bottom: 14px; display: none; border-left: 3px solid; }
.form-msg.err { display: block; background: #fdf0f0; border-color: var(--danger); color: #8f2b2b; }
.form-msg.ok { display: block; background: #ecf8f1; border-color: #0ca678; color: #056348; }
.auth-tip { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; line-height: 1.8; }
.auth-tip a { color: var(--primary); }

/* ---------- 购物车抽屉 ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(10,25,40,.45); z-index: 90; display: none; }
.drawer-mask.on { display: block; }
.drawer { position: fixed; top: 0; right: -420px; width: 400px; height: 100%; background: #fff; z-index: 91; transition: right .25s; display: flex; flex-direction: column; border-left: 2px solid var(--ink); }
.drawer.on { right: 0; }
.drawer .d-head { padding: 16px; border-bottom: 2px solid var(--ink); display: flex; justify-content: space-between; align-items: center; }
.drawer .d-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.cart-item .ci-img { width: 56px; height: 56px; flex: none; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #f5f8fb; }
.cart-item h6 { font-size: 13px; margin-bottom: 4px; }
.cart-item .ci-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.drawer .d-foot { padding: 16px; border-top: 2px solid var(--ink); }
.empty-tip { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------- 后台 ---------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-side { background: #101d29; color: #8fa5b8; padding: 18px 0; }
.admin-side .a-logo { padding: 0 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px; }
.admin-side .a-logo img { height: 36px; filter: brightness(0) invert(1); }
.admin-side a.mi { display: flex; gap: 10px; align-items: center; padding: 12px 20px; font-size: 14px; border-left: 3px solid transparent; }
.admin-side a.mi svg { width: 17px; height: 17px; }
.admin-side a.mi:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-side a.mi.on { background: var(--primary); color: #fff; border-left-color: #7cc4ff; }
.admin-main { background: var(--bg); min-width: 0; }
.admin-top { background: #fff; border-bottom: 2px solid var(--ink); height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 10; }
.admin-top h1 { font-size: 17px; letter-spacing: 1px; }
.admin-body { padding: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 20px; border-top: 3px solid var(--primary); }
.stat-card .s-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-card .s-value { font-size: 26px; font-weight: 800; font-family: var(--mono); }
.stat-card .s-foot { font-size: 12px; color: var(--muted); margin-top: 6px; }
.panel-box { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.panel-box h3 { font-size: 16px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: #101d29; color: #c3d3e2; text-align: left; padding: 10px 12px; font-weight: 600; white-space: nowrap; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:hover td { background: #f4f8fc; }
.tag { display: inline-block; padding: 2px 8px; font-size: 12px; }
.tag.green { background: #e2f6ec; color: #056348; }
.tag.orange { background: #fdf2dd; color: #8a5400; }
.tag.red { background: #fdeaea; color: #a83232; }
.tag.blue { background: #e6f0fc; color: #12467e; }
.tag.gray { background: #edf1f5; color: #5f7386; }
.tag.purple { background: #f0eafd; color: #5528b8; }
.tlabel-mini { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; margin-right: 2px; }
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { border: 1px solid var(--line); padding: 8px 12px; outline: none; background: #fbfdfe; }
.modal-mask { position: fixed; inset: 0; background: rgba(10,25,40,.5); z-index: 100; display: none; align-items: center; justify-content: center; }
.modal-mask.on { display: flex; }
.modal { background: #fff; border: 2px solid var(--ink); box-shadow: 10px 10px 0 rgba(15,40,70,.15); width: 640px; max-width: 94vw; max-height: 88vh; overflow-y: auto; padding: 26px; }
.modal h3 { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.type-check { display: flex; flex-wrap: wrap; gap: 8px; }
.type-check label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); padding: 6px 10px; font-size: 13px; cursor: pointer; background: #fbfdfe; }
.type-check label:has(input:checked) { border-color: var(--primary); background: #eaf2fa; color: var(--primary-dark); font-weight: 600; }
.type-check label img { width: 22px; height: 22px; object-fit: contain; }
.edit-banner-row { display: grid; grid-template-columns: 1fr 1.4fr 1fr 34px; gap: 10px; margin-bottom: 10px; align-items: center; }
.edit-banner-row input { border: 1px solid var(--line); padding: 8px 10px; width: 100%; background: #fbfdfe; }
.icon-btn { width: 30px; height: 30px; background: #fdeaea; color: var(--danger); display: inline-flex; align-items: center; justify-content: center; border: 1px solid #f2c9c9; }
.notice-edit-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: center; margin-bottom: 10px; }
.notice-edit-row textarea { border: 1px solid var(--line); padding: 8px 10px; width: 100%; resize: vertical; min-height: 40px; background: #fbfdfe; }
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: #101d29; color: #fff; padding: 11px 22px; z-index: 200; font-size: 14px; box-shadow: 4px 4px 0 rgba(0,0,0,.25); display: none; border-left: 3px solid var(--cyan); }
.toast.on { display: block; }

/* ---------- 机构徽章 / 认证 ---------- */
.org-badge { background: var(--primary); color: #fff; font-size: 11px; padding: 1px 6px; margin-left: 4px; letter-spacing: 1px; }

/* ---------- 页脚 ---------- */
.site-footer { background: #101d29; color: #8fa5b8; margin-top: 40px; border-top: 3px solid var(--primary); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; padding: 40px 16px 24px; }
.site-footer h5 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.site-footer a { display: block; font-size: 13px; margin-bottom: 9px; }
.site-footer a:hover { color: #7cc4ff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); text-align: center; padding: 16px; font-size: 12px; color: #5d7f96; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .cat-menu { display: none; }
  .drug-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-side { display: none; }
  .detail-box { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 64px 1fr; }
  .admin-side .a-logo img { height: 26px; }
  .admin-side a.mi span { display: none; }
  .banner .slide-txt { max-width: 100%; }
  .slide-deco { display: none; }
}
@media (max-width: 640px) {
  .drug-grid { grid-template-columns: repeat(2, 1fr); }
  .search-box { display: none; }
  .ticker::before { content: "药价"; padding: 0 8px; }
}
