:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #7b8794;
  --line: #e4e9f0;
  --brand: #2f6df0;
  --brand-d: #1f4fb0;
  --brand-soft: rgba(47, 109, 240, 0.08);
  --ok: #1f9d55;
  --warn: #d9822b;
  --danger: #d64545;
  --shadow: 0 2px 10px rgba(31, 41, 51, 0.07);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tag { display: inline-block; margin: 0 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; line-height: 18px; background: var(--line); color: var(--ink); }
.tag:empty { display: none; }

/* 登录页 */
.login-wrap {
  min-height: 100vh; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: flex-end;
  padding: 24px;
  background: url('/assets/index.jpg') center / cover no-repeat;
  background-attachment: fixed;
  animation: bgFadeIn 1s ease-out;
}
.login-form-panel {
  flex: 0 0 50%; max-width: 50%; display: flex; align-items: center; justify-content: center;
  padding: 24px 24px 64px;
}
.login-card {
  width: 100%; max-width: 360px; background: #ffffff; padding: 36px; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(31, 41, 51, 0.12);
  animation: cardIn 0.8s ease-out;
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card .sub { margin: 0 0 28px; color: var(--muted); font-size: 13px; }
.login-card label { display: block; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.login-card input { width: 100%; margin-top: 6px; padding: 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.login-card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.login-card .btn.block { width: 100%; padding: 12px; margin-top: 6px; font-size: 15px; }

/* 滑动验证 */
.slider-verify { margin: 2px 0 18px; }
.slider-track {
  position: relative; height: 42px; border-radius: 10px;
  background: #eef2f7; border: 1px solid var(--line); overflow: hidden;
  user-select: none; touch-action: none;
}
.slider-mask {
  position: absolute; left: 0; top: 0; height: 100%; width: 0;
  background: var(--brand); opacity: .18; transition: width .05s linear;
}
.slider-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted); pointer-events: none; z-index: 1; letter-spacing: .5px;
}
.slider-btn {
  position: absolute; left: 0; top: 0; width: 42px; height: 42px;
  background: #ffffff; border: 1px solid var(--line); border-right: none; border-radius: 10px 0 0 10px;
  display: flex; align-items: center; justify-content: center; color: var(--brand);
  font-size: 18px; cursor: grab; z-index: 2; transition: background .15s;
}
.slider-btn:active { cursor: grabbing; }
.slider-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.slider-track.done { background: #e6f4ea; border-color: #1e8e3e; }
.slider-track.done .slider-mask { background: #1e8e3e; opacity: .22; }
.slider-track.done .slider-text { color: #1e8e3e; }
.slider-track.done .slider-btn { background: #1e8e3e; color: #fff; border-color: #1e8e3e; border-radius: 10px; }

.login-footer {
  position: fixed; left: 0; right: 0; bottom: 18px; z-index: 20;
  display: flex; justify-content: center; pointer-events: none;
}
.login-footer .beian {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center;
  font-size: 12px; color: #5a6b82; pointer-events: auto;
}
.beian-item { display: inline-flex; align-items: center; gap: 6px; color: #5a6b82; text-decoration: none; transition: color .2s; }
.beian-item:hover { color: #1565c0; }
.beian-logo { height: 16px; width: auto; display: inline-block; }
.beian-cert { cursor: pointer; user-select: none; }
.beian-cert:hover { color: #1565c0; text-decoration: underline; }

/* 版权证书放大层 */
.cert-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 35, 0.78); cursor: zoom-out;
  animation: certFade .2s ease-out;
}
.cert-img {
  max-width: min(86vw, 760px); max-height: 90vh; width: auto; height: auto;
  border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); cursor: zoom-out;
}
@keyframes certFade { from { opacity: 0; } to { opacity: 1; } }

@keyframes cardIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bgFadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .login-wrap { justify-content: center; overflow: auto; }
  .login-form-panel { flex: 0 0 100%; max-width: 100%; min-height: 100vh; padding: 24px; }
  .login-card { max-width: 400px; margin: 0 auto; }
}


/* 按钮 */
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px;
  border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #f0c5c5; }
.btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.warn { color: #ef6c00; border-color: #ffd9b3; }
.btn.warn:hover { background: #ef6c00; color: #fff; border-color: #ef6c00; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; padding: 11px; margin-top: 6px; }
/* 效期列表「上传」按钮：红（待上传）→ 绿（已确认） */
.btn.up-red { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.up-red:hover { filter: brightness(0.93); }
.btn.up-green { background: #1e8e3e; border-color: #1e8e3e; color: #fff; }
.btn.up-green:hover { filter: brightness(0.93); }

/* 折扣价录入弹窗 */
.price-form-row { display: flex; flex-direction: column; gap: 12px; }
.price-form-row label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 6px; }
.price-form-row input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: var(--ink); }
.price-form-row input:focus { outline: none; border-color: var(--brand); }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #fff; border-right: 1px solid var(--line); display: flex;
  flex-direction: column; padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; }
.brand { font-weight: 700; font-size: 16px; padding: 6px 10px 16px; color: var(--brand); }
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--brand); color: #fff; }
.me { border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; }
.me #me-name { font-weight: 600; }
.me .btn { margin-top: 8px; }
.store-badge { margin-top: auto; padding: 12px 10px; border-top: 1px solid var(--line);
  text-align: center; font-size: 18px; font-weight: 700; color: var(--brand);
  word-break: break-all; line-height: 1.3; }

.content { flex: 1; padding: 22px 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.topbar h2 { margin: 0; font-size: 19px; }
.store-picker label { color: var(--muted); font-size: 13px; }
.store-picker select { margin-left: 6px; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 8px; }

/* 卡片/统计 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; box-shadow: var(--shadow); }
.card .num { font-size: 26px; font-weight: 700; color: var(--brand); }
.card .lbl { color: var(--muted); margin-top: 4px; }
.card.highlight { border-color: var(--brand); background: linear-gradient(135deg, #f4f8ff, #fff); }
.overview-summary { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.store-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .15s, transform .15s; }
.store-card:hover { box-shadow: 0 6px 20px rgba(31, 41, 51, .08); transform: translateY(-2px); }
.store-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.store-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.store-meta { font-size: 12px; color: var(--muted); }
.store-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.metric { background: #f7f9fc; border-radius: 8px; padding: 10px 6px; text-align: center; }
.m-num { font-size: 19px; font-weight: 700; color: var(--brand); }
.m-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }
.store-foot { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px dashed var(--line); padding-top: 10px; }
.mini { font-size: 12px; color: var(--muted); background: #f2f4f7; border-radius: 999px; padding: 2px 10px; }
.mini.ok { background: #e8f5e9; color: #2e7d32; }
.mini.warn { background: #fff3e0; color: #e65100; }

/* 表格 */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=text], .toolbar input[type=search] { padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; min-width: 220px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
/* 订单详情：门店信息折叠按钮（表下方） */
#order-info-toggle { margin: 0; }
th { background: #fafbfc; color: var(--muted); font-weight: 600; font-size: 12px; }
/* 药品管理：表格可滚动 + 表头固定 + 固定行高 */
.table-scroll { max-height: calc(100vh - 240px); overflow: auto; }
.table-scroll thead th { position: sticky; top: 0; z-index: 2; background: #fafbfc; box-shadow: 0 1px 0 var(--line); white-space: nowrap; }
/* 每行固定高度 64px，确保图片(36px+padding) / 双行名称 / 操作按钮都能放下 */
.table-scroll tbody tr { height: 64px; }
.table-scroll tbody td { vertical-align: middle; padding: 8px 14px; }
/* 取消固定列宽：不再使用 table-layout:fixed 与每列固定 px，由内容自然撑开（表头/表体按列自动对齐）；
   仅给图片列与操作列一个最小宽度，避免被压得太窄；名称列自动占剩余宽度 */
.table-scroll table { width: 100%; }
.table-scroll td:nth-child(1) { width: 56px; text-align: center; white-space: nowrap; }   /* 图片 */
.table-scroll td:nth-child(11) { width: 124px; text-align: center; white-space: nowrap; } /* 操作图标 */
/* 名称列：不压缩，完整显示（可换行）；外层 flex 保证单行时也能垂直居中 */
.drug-name-wrap { display: flex; align-items: center; min-height: 36px; }
.drug-name { line-height: 1.35; word-break: break-word; }
/* 订单列表：按下单日期分组的分隔行 */
tr.date-group td { background: #f2f6ff; color: #3355cc; font-weight: 600; font-size: 13px; padding: 7px 14px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; }
.pager .muted { font-size: 13px; }
tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: nowrap; white-space: nowrap; }
.row-actions .muted { display: inline-flex; align-items: center; justify-content: center; }
/* 用户管理：参考「药品管理」的做法保证行高一致 ——
   tr 固定 height:56px，且操作单元格保持为普通 table-cell（不设为 flex）。
   关键：若操作单元格是 flex，会破坏 tr 的 height 约束导致各行高度参差（见药品表 .cell-actions 注释）；
   按钮/「—」仅作行内普通内容，由 text-align:center + vertical-align:middle 居中，不会单独撑高行。 */
.users-table tbody tr { height: 56px; }
.users-table tbody td { vertical-align: middle; padding-top: 10px; padding-bottom: 10px; }
.users-table .row-actions { display: table-cell; text-align: center; white-space: nowrap; }
.users-table .row-actions .btn { margin: 0 3px; vertical-align: middle; }
/* 最后活跃：始终两行（缺值用「—」占位），与固定行高互补，保证每行高度一致 */
.last-active-cell { font-size: 12px; line-height: 1.5; white-space: nowrap; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; display: inline-block; vertical-align: middle; }
.btn.small { height: 28px; display: inline-flex; align-items: center; }
.thumb:hover { border-color: var(--brand); }
/* 药品列表：行首操作图标按钮 */
/* 注意：cell-actions 必须保持为普通 table-cell（不要用 display:flex），
   否则会破坏 tbody tr 的 height:64px 约束，导致各行按内容自适应高度而参差不齐 */
.cell-actions { text-align: center; white-space: nowrap; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; margin: 0 1px;
  border: none; border-radius: 7px; background: transparent;
  color: #55607a; cursor: pointer; transition: background .15s, color .15s;
  vertical-align: middle; line-height: 1; box-sizing: border-box;
}
.icon-btn:hover { background: #eef2fb; color: var(--brand); }
.icon-btn.danger:hover { background: #fdecec; color: #e23b3b; }
.icon-btn svg { display: block; }

/* 药品列表：货位号标签（区分营业区 A / 仓储区 B） */
.cell-locs { text-align: left; }
/* 货位号单元格内：营业区在左、仓储区在右，分两组左右排布 */
.loc-zones { display: flex; align-items: center; justify-content: flex-start; gap: 2px; min-height: 36px; }
.loc-zone { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
/* 营业区：横向排列（通常最多 1 个） */
.loc-zone.business { flex-direction: row; justify-content: flex-start; }
/* 仓储区：始终竖向叠放（最多 2 个位置） */
.loc-zone.warehouse { flex-direction: column; align-items: flex-end; justify-content: flex-start; }
.loc-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 6px; border-radius: 12px; font-size: 12px; font-weight: 600;
  line-height: 1.3; margin: 0; white-space: nowrap;
  background: #f0f2f5; color: #55607a; border: 1px solid #e0e3e9;
}
.loc-pill.business { background: #e6f4ff; color: #0066cc; border: 1px solid #bfe3ff; }
.loc-pill.warehouse { background: #fff3c8; color: #9a7000; border: 1px solid #ffe69c; }

/* 通用标签中的营业区/仓储区颜色（货位设置弹窗等） */
.tag.business { background: #e6f4ff; color: #0066cc; border: 1px solid #bfe3ff; }
.tag.warehouse { background: #fff3c8; color: #9a7000; border: 1px solid #ffe69c; }

/* 厂家列：列宽收窄，过长时省略 */
.table-scroll td:nth-child(7) {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.settings-grid { display: grid; grid-template-columns: 1fr; gap: 18px; max-width: 640px; }
.settings-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.settings-card .sc-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.settings-card .sc-head .sc-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.settings-card .sc-head .sc-title { font-weight: 600; font-size: 15px; }
.settings-card .sc-head .sc-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.settings-card .sc-body { padding: 18px 20px; }
.settings-card .sc-body label { display: block; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.settings-card .sc-body label:last-child { margin-bottom: 0; }
.settings-card .sc-body input { width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: var(--ink); }
.settings-card .sc-body input:focus { outline: none; border-color: var(--brand); }
.settings-card .sc-hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.settings-card .sc-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 10px; border-radius: 999px; margin-left: auto; }
.settings-card .sc-status.ok { background: #e8f5e9; color: var(--ok); }
.settings-card .sc-status.no { background: #fbe9e7; color: var(--danger); }
.settings-footer { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.api-field-grid { display: grid; grid-template-columns: max-content 1fr; gap: 9px 16px; align-items: center; }
.api-field-grid code, .api-key-once code { padding: 3px 6px; border-radius: 5px; background: #eef3ff; color: var(--brand-d); font-family: Consolas, monospace; }
.api-key-once { margin-top: 10px; padding: 12px; border: 1px solid #b9d1ff; border-radius: 8px; background: #f3f7ff; color: var(--ink); line-height: 1.7; }
.settings-card .sc-status.ready { background: #e8f5e9; color: var(--ok); }
.settings-card .sc-status.empty { background: #fbe9e7; color: var(--danger); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex;
  align-items: center; justify-content: center; z-index: 50; }
.modal { width: 440px; max-width: 92vw; background: #fff; border-radius: 12px; padding: 22px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 16px; }
#modal-form label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
#modal-form input, #modal-form select, #modal-form textarea { width: 100%; margin-top: 6px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: var(--ink); }
#modal-form input:focus, #modal-form select:focus { outline: none; border-color: var(--brand); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* 处方列表：表高固定为 10 行（内容满 10 行即占满，不出现内部上下滚动）；列宽固定、长文本省略 */
.rx-scroll { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; min-height: calc(10 * 60px + 2.6rem); }
.rx-scroll table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rx-scroll thead th { position: sticky; top: 0; z-index: 2; background: var(--brand-soft); color: var(--ink); font-weight: 600; white-space: nowrap; padding: 10px 12px; box-shadow: 0 1px 0 var(--line); text-align: left; overflow: hidden; text-overflow: ellipsis; }
.rx-scroll tbody td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; height: 60px; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-scroll tbody tr:hover { background-color: rgba(24, 144, 255, 0.13); }
/* 处方列表缩略图：订单号前的处方图，点击放大再点缩小 */
.rx-thumb-cell { width: 64px; text-align: center; }
.rx-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; background: #f8f9fa; }
.rx-thumb:hover { box-shadow: 0 0 0 2px var(--brand); }
/* 线上处方列宽（第1列处方图由 th 内联 64px；其余按占宽，长文本自动省略） */
.rx-online th:nth-child(2) { width: 16%; }
.rx-online th:nth-child(3) { width: 8%; }
.rx-online th:nth-child(4) { width: 10%; }
.rx-online th:nth-child(5) { width: 10%; }
.rx-online th:nth-child(6) { width: 22%; }
.rx-online th:nth-child(7) { width: 13%; }
.rx-online th:nth-child(8) { width: 9%; }
.rx-online th:nth-child(9) { width: 8%; }
/* 线下处方列宽（第1列处方图 th 内联 64px；第2列处方编号 th 内联 160px；其余按占宽） */
.rx-offline th:nth-child(3) { width: 12%; }
.rx-offline th:nth-child(4) { width: 12%; }
.rx-offline th:nth-child(5) { width: 22%; }
.rx-offline th:nth-child(6) { width: 14%; }
.rx-offline th:nth-child(7) { width: 10%; }
.rx-offline th:nth-child(8) { width: 9%; }
/* 处方详情弹窗：比通用表单弹窗更宽、内容可滚动，不干扰 #modal */
.rx-modal { width: 560px; max-width: 94vw; max-height: 88vh; overflow: auto; background: #fff; border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
.rx-modal h4 { margin: 16px 0 8px; }
.rx-modal .panel { background: var(--panel); }

.error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 1px; }

/* toast */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: #1f2933;
  color: #fff; padding: 11px 18px; border-radius: 8px; z-index: 80; box-shadow: var(--shadow); }

/* 风控告警横幅：固定顶部居中，红色，15 秒后自动隐藏 */
.risk-alert {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-200%);
  background: #c0392b; color: #fff; padding: 14px 22px; border-radius: 10px;
  font-size: 15px; font-weight: 600; max-width: 92vw; text-align: center;
  z-index: 200; box-shadow: 0 8px 24px rgba(192,57,43,.35);
  opacity: 0; transition: transform .3s ease, opacity .3s ease; pointer-events: none;
}
.risk-alert.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* 环境错误页：部署问题统一以错误页展示 */
.error-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.error-card { width: 460px; max-width: 100%; background: var(--panel); padding: 36px; border-radius: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--line); }
.error-brand { font-size: 14px; color: var(--brand); font-weight: 700; letter-spacing: .5px; margin-bottom: 10px; }
.error-card h1 { margin: 0 0 4px; font-size: 22px; color: var(--ink); }
.error-card .sub { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.error-card label { display: block; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.error-card input { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; color: var(--ink); background: var(--panel); }
.error-card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* 效期图片 */
.expiry-panel { max-width: 960px; }
.expiry-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap;
  background: var(--panel); padding: 16px; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 16px; }
.expiry-form .form-row { display: flex; flex-direction: column; gap: 6px; min-width: 180px; flex: 1; }
.expiry-form .form-row label { color: var(--muted); font-size: 13px; }
.expiry-form input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.expiry-form input:focus { outline: none; border-color: var(--brand); }
/* 有效期至下拉月份选择框 */
.exp-month-dropdown-wrap { position: relative; }
.exp-month-display { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); font-size: 14px; text-align: left; cursor: pointer; }
.exp-month-display:hover { border-color: var(--brand); }
.exp-month-dropdown { position: absolute; top: calc(100% + 6px); left: 0; z-index: 100;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 12px; min-width: 260px; }
.exp-month-dropdown-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
  padding: 0 4px; font-weight: 600; color: var(--text); }
.exp-year-nav { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--text); cursor: pointer; font-size: 14px; }
.exp-year-nav:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.exp-year-nav:disabled { opacity: .35; cursor: not-allowed; }
.exp-month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.exp-month-btn { padding: 7px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  color: var(--text); font-size: 13px; cursor: pointer; transition: all .12s; }
.exp-month-btn:hover { border-color: var(--brand); color: var(--brand); }
.exp-month-btn.selected { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.exp-month-btn.disabled { color: var(--muted); background: var(--panel); border-color: var(--line); cursor: not-allowed; opacity: .55; }
.exp-month-btn.disabled:hover { border-color: var(--line); color: var(--muted); }
.btn.disabled { opacity: .5; cursor: not-allowed; }
.btn.disabled:hover { filter: none; }
.expiry-info { background: var(--brand-soft); border: 1px solid rgba(47,109,240,0.18); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 16px; }
.expiry-canvas-wrap { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow);
  padding: 20px; text-align: center; min-height: 220px; display: flex; align-items: center; justify-content: center; }
.expiry-canvas { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
.expiry-tip { color: var(--muted); }
.expiry-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.expiry-controls { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.expiry-controls .exp-ctrl-row { display: flex; align-items: center; gap: 12px; }
.expiry-controls .exp-ctrl-row label { width: 84px; color: var(--muted); font-size: 13px; flex: none; }
.expiry-controls .exp-ctrl-row input[type=range] { flex: 1; accent-color: var(--brand); }
.expiry-controls .exp-ctrl-val { width: 46px; text-align: right; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; flex: none; }
.expiry-err { color: var(--danger); margin-top: 12px; }
.expiry-gallery { margin-top: 28px; }
.expiry-gallery-title { font-weight: 600; margin: 0 0 2px; color: var(--ink); }
.expiry-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
/* 效期列表表格：横向滚动 + 表头固定 + 内容随宽度换行（参考药品管理列表） */
.exp-list-table-wrap { overflow: auto; max-height: calc(100vh - 260px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.exp-list-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.exp-list-table th, .exp-list-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; height: 70px; box-sizing: border-box; }
.exp-list-table th { background: var(--brand-soft); color: var(--ink); font-weight: 600; position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--line); }
.exp-list-table tbody tr:hover { background-color: rgba(24, 144, 255, 0.13); }
/* 名称列：允许换行，最多 3 行，超出用 … 省略 */
.exp-list-table td:nth-child(2) { max-width: 180px; overflow: hidden; }
/* 其他文本列：单行显示，超出用 … 省略 */
.exp-list-table td:nth-child(3), .exp-list-table td:nth-child(4), .exp-list-table td:nth-child(5), .exp-list-table td:nth-child(6), .exp-list-table td:nth-child(7) {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px;
}
/* 厂家列：允许换行，最多 2 行，超出用 … 省略 */
.exp-list-table td:nth-child(8) { max-width: 180px; overflow: hidden; }
.exp-mfr { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.35; word-break: break-word; }
/* 图片/数量/日期/操作列保持单行，避免错位 */
.exp-list-table td:nth-child(1), .exp-list-table td:nth-child(9), .exp-list-table td:nth-child(10), .exp-list-table td:nth-child(11), .exp-list-table td:nth-child(12), .exp-list-table td:nth-child(14) { text-align: center; white-space: nowrap; }
.exp-list-table td:nth-child(10) { font-weight: 600; }
/* 名称列在 flex 容器内省略：父级 min-width:0、子项 flex:1 占满宽度 */
.exp-name-wrap { display: flex; align-items: center; min-height: 36px; min-width: 0; overflow: hidden; }
.exp-name { flex: 1; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; line-height: 1.35; word-break: break-word; }
.exp-list-table td.remain-red { background: var(--danger); color: #fff; font-weight: 600; }
.exp-list-table td.remain-yellow { background: #ffff00; color: #000; font-weight: 600; }

/* 表格行悬浮高亮（药品管理 / 货位管理 / 效期列表 / 线上订单 / 操作日志 / 佰药汇日志 等所有表格通用）
   鼠标移到某行时整行加浅蓝底，突出当前行。 */
table tbody tr:hover {
  background-color: rgba(24, 144, 255, 0.13);
}
.exp-list-thumb { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--line); display: block; }
.clickable-img { cursor: zoom-in; }
.img-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.82); display: none; align-items: center; justify-content: center; z-index: 9999; }
.img-lightbox.show { display: flex; }
.img-lightbox-img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.5); background: #fff; }
.img-lightbox-close { position: fixed; top: 24px; right: 24px; width: 40px; height: 40px; border: none; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; z-index: 10000; }
.img-lightbox-close:hover { background: rgba(255,255,255,.3); }
.exp-thumb { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.exp-thumb a { display: block; }
.exp-thumb img { width: 100%; height: 120px; object-fit: contain; background: #fff; display: block; }
.exp-thumb-name { padding: 8px 10px 2px; font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-thumb-sub { padding: 0 10px 10px; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 效期列表：剩余时间筛选 + 分页（主表默认每页 10 条） */
.exp-pagesize { height: 30px; border: 1px solid var(--border, #d9d9d9); border-radius: 6px; padding: 0 6px; background: #fff; color: #333; }
.exp-remain-btn.pg-cur { background: #1890ff; border-color: #1890ff; color: #fff; }

/* 已售完列表分页（每页 20 条） */
.exp-pager { margin: 14px 0 4px; display: flex; justify-content: center; }
.exp-pager-inner { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.exp-pager-inner .btn.small { min-width: 36px; padding: 4px 10px; }
.exp-pager-inner .btn.small[disabled] { opacity: .5; cursor: not-allowed; }
.exp-pager-inner .pg-cur { background: #1890ff; border-color: #1890ff; color: #fff; }
.exp-pager-ellipsis { padding: 0 2px; color: var(--muted); }
.exp-pager-info { margin-left: 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* 效期列表重复记录：粉红色标注 */
.dup-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 9px; background: #d81b60; color: #fff; font-size: 11px; font-weight: 600; vertical-align: middle; }
.unmatched-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 9px; background: #1890ff; color: #fff; font-size: 11px; font-weight: 600; vertical-align: middle; }

/* ============ 顾客咨询（聊天） ============ */
.consult-layout { display: flex; height: calc(100vh - 132px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.consult-list-panel { width: 320px; flex-shrink: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: #fafbfc; }
.consult-list-head { padding: 12px; border-bottom: 1px solid var(--line); }
.consult-search { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--ink); box-sizing: border-box; }
.consult-search:focus { outline: none; border-color: var(--brand); }
.consult-list { flex: 1; overflow-y: auto; }
.consult-item { display: flex; gap: 10px; padding: 12px; cursor: pointer; border-bottom: 1px solid var(--line); align-items: center; }
.consult-item:hover { background: #f0f4fb; }
.consult-item.active { background: var(--brand-soft); }
.consult-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; position: relative; font-size: 15px; }
.consult-avatar.online::after { content: ''; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #2e7d32; border: 2px solid #fafbfc; }
.consult-item-main { flex: 1; min-width: 0; }
.consult-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.consult-item-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.consult-item-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.consult-item-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; gap: 8px; }
.consult-item-last { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.consult-badge { background: var(--danger); color: #fff; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; flex-shrink: 0; }
.consult-chat-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.consult-chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.consult-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.consult-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.consult-head-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.consult-head-status { font-size: 12px; color: var(--muted); }
.consult-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: #f7f9fc; }
.chat-row { display: flex; flex-direction: column; max-width: 68%; }
.chat-row.them { align-self: flex-start; align-items: flex-start; }
.chat-row.me { align-self: flex-end; align-items: flex-end; }
.chat-bubble { padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.chat-row.them .chat-bubble { background: #fff; border: 1px solid var(--line); border-top-left-radius: 2px; color: var(--ink); }
.chat-row.me .chat-bubble { background: var(--brand); color: #fff; border-top-right-radius: 2px; }
.chat-time { font-size: 11px; color: var(--muted); margin-top: 4px; }
.consult-input { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
.consult-input textarea { flex: 1; resize: none; height: 52px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: var(--ink); font-family: inherit; }
.consult-input textarea:focus { outline: none; border-color: var(--brand); }

/* ============ 需求建议（顾客咨询子页签） ============ */
.subtabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.subtab { padding: 9px 16px; cursor: pointer; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtab:hover { color: var(--ink); }
.subtab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
/* ===================== 需求建议 ===================== */
.demand-wrap { display: flex; flex-direction: column; gap: 22px; max-width: 880px; margin: 0 auto; padding: 4px 0 32px; }

/* 页面标题 */
.dm-header { text-align: center; margin-bottom: 4px; }
.dm-title-main { margin: 0; font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: 0.5px; }
.dm-subtitle { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

/* 卡片 */
.dm-card { background: #fff; border: 1px solid #edf0f4; border-radius: 18px; padding: 24px 26px; box-shadow: 0 6px 24px rgba(31, 41, 51, 0.06); }
.dm-card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.dm-card-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.dm-icon-light { background: #fff8e1; }
.dm-icon-list { background: #ede7f6; }
.dm-icon-plan { background: #e8f1ff; }
.dm-card-head > div { flex: 1; min-width: 0; }
.dm-card-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.dm-card-desc { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* 分段控件（上报类型） */
.dm-seg { display: inline-flex; background: #f2f4f7; border-radius: 12px; padding: 4px; gap: 4px; }
.dm-seg-btn { border: none; background: transparent; padding: 9px 20px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit; transition: all .18s; }
.dm-seg-btn:hover { color: var(--ink); }
.dm-seg-btn.active { background: #fff; color: var(--brand); box-shadow: 0 2px 8px rgba(31, 41, 51, 0.1); }

/* 表单 */
.dm-form { display: flex; flex-direction: column; gap: 14px; }
.dm-form-row { display: flex; gap: 12px; align-items: flex-start; }
.dm-form-row .dm-input { flex: 1; }
.dm-form-row .btn { flex: 0 0 auto; padding: 15px 24px; border-radius: 12px; font-weight: 600; }
.dm-form-plan { background: #f9fafc; border: 1px dashed #dde2e9; border-radius: 14px; padding: 16px; margin-bottom: 6px; }
.dm-form-actions { display: flex; align-items: center; gap: 14px; }
.dm-btn-lg { padding: 12px 28px !important; font-size: 15px; border-radius: 12px; }
.dm-btn-refresh { flex: 0 0 auto; align-self: flex-start; }

/* 输入框 */
.dm-input { width: 100%; padding: 15px 18px; border: 1px solid #dde2e9; border-radius: 12px; font-size: 15px; line-height: 1.6; color: var(--ink); font-family: inherit; background: #fff; box-sizing: border-box; transition: border-color .2s, box-shadow .2s; }
.dm-input::placeholder { color: #aab2bd; }
textarea.dm-input { min-height: 72px; resize: vertical; }
.dm-input:hover { border-color: #c6cfda; }
.dm-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
select.dm-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%237b8794' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; cursor: pointer; font-weight: 600; }
.dm-input-lg { font-size: 16px; padding: 16px 18px; }

/* 筛选 chip */
.dm-filter-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #f0f2f5; }
.dm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dm-chip { border: 1px solid #e4e8ee; background: #fff; padding: 7px 15px; border-radius: 20px; font-size: 13px; color: #5b6573; cursor: pointer; font-family: inherit; font-weight: 500; transition: all .18s; }
.dm-chip:hover { border-color: #c6cfda; color: var(--ink); }
.dm-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* 空状态 */
.dm-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 16px; color: var(--muted); font-size: 14px; background: #fafbfc; border-radius: 14px; border: 1px dashed #e0e4ea; }
.dm-empty::before { font-size: 34px; }

/* 建议列表 */
#dm-list { display: flex; flex-direction: column; gap: 12px; }
.dm-item { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; background: #fff; border: 1px solid #edf0f4; border-radius: 14px; transition: box-shadow .15s, transform .15s, border-color .15s; }
.dm-item:hover { box-shadow: 0 8px 22px rgba(31, 41, 51, 0.08); transform: translateY(-2px); border-color: #e0e5ec; }
.dm-item-icon { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.dm-icon-feature { background: #e8f1ff; }
.dm-icon-bug { background: #fff0ef; }
.dm-item-main { flex: 1; min-width: 0; }
.dm-item-title { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.5; word-break: break-word; }
.dm-item-content { margin-top: 8px; font-size: 13px; line-height: 1.7; color: #5b6573; white-space: pre-wrap; word-break: break-word; background: #f7f9fc; padding: 11px 13px; border-radius: 10px; }
.dm-item-meta { margin-top: 11px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dm-badge { font-size: 12px; padding: 4px 11px; border-radius: 20px; font-weight: 600; }
.dm-badge-open { background: #fff4e5; color: #e65100; }
.dm-badge-planned { background: #ede7f6; color: #5e35b1; }
.dm-badge-done { background: #e8f5e9; color: #1f9d55; }
.dm-badge-plan { background: #e8f1ff; color: #2f6df0; }
.dm-meta-text { font-size: 12px; color: var(--muted); }
.dm-item-ops { flex-shrink: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 250px; }
.dm-item-ops select.dm-input { min-width: 135px; width: auto; padding: 8px 32px 8px 12px; font-size: 13px; }
.dm-group-more { display: flex; justify-content: center; padding: 4px 0 10px; }

/* 更新计划（参考图风格） */
.pl-list { display: flex; flex-direction: column; gap: 10px; }
.pl-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; background: #fff; border: 1px solid #edf0f4; border-radius: 12px; box-shadow: 0 2px 8px rgba(31, 41, 51, 0.05); transition: box-shadow .15s, border-color .15s; }
.pl-item:hover { box-shadow: 0 6px 16px rgba(31, 41, 51, 0.09); border-color: #e2e7ee; }
.pl-item-todo { border-left: 4px solid #c6cfda; }
.pl-item-doing { border-left: 4px solid #2f6df0; }
.pl-item-done { border-left: 4px solid #1f9d55; }
.pl-item.pl-done { opacity: 0.85; }
.pl-item.dragging { opacity: 0.45; border-style: dashed; box-shadow: none; }

.pl-number { flex: 0 0 30px; font-size: 26px; font-weight: 800; color: #e4e9ef; line-height: 1.2; text-align: center; user-select: none; }
.pl-item-doing .pl-number { color: #c9d9fc; }
.pl-item-done .pl-number { color: #b9e3c9; }

.pl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pl-title { flex: 1 1 auto; min-width: 120px; font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.4; word-break: break-word; }

.pl-status { display: inline-flex; align-items: center; flex-shrink: 0; font-size: 12px; padding: 3px 11px; border-radius: 20px; font-weight: 700; }
.pl-status-todo { background: #f2f2f2; color: #616161; }
.pl-status-doing { background: #e8f1ff; color: #2f6df0; }
.pl-status-done { background: #1f9d55; color: #fff; }
select.pl-status { width: auto; min-width: 96px; padding: 4px 30px 4px 10px; font-size: 12px; }
.pl-count { flex-shrink: 0; font-size: 12px; color: var(--muted); font-weight: 600; }

.pl-ops { display: flex; gap: 4px; flex-shrink: 0; align-items: center; }
.pl-ops .btn.small { padding: 3px 9px; font-size: 12px; }
.pl-drag { cursor: grab; color: #c4cbd4; font-size: 14px; user-select: none; padding: 4px 6px; border-radius: 6px; line-height: 1; }
.pl-drag:hover { background: #f0f2f5; color: var(--ink); }

.pl-desc { font-size: 13px; line-height: 1.6; color: #5b6573; white-space: pre-wrap; word-break: break-word; }

.pl-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #4b5563; background: #f4f6f9; border-radius: 20px; padding: 3px 10px; border: 1px solid #e8eaed; }
.pl-link-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

/* ===================== 云机更新（App 安装包托管） ===================== */
.cu-wrap { display: flex; flex-direction: column; gap: 18px; max-width: 960px; }
.cu-upload .sc-body textarea { width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; color: var(--ink); font-family: inherit; resize: vertical; }
.cu-upload .sc-body textarea:focus { outline: none; border-color: var(--brand); }
.cu-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.cu-msg { font-size: 13px; color: var(--muted); }
.cu-msg.ok { color: var(--ok); }
.cu-msg.err { color: var(--danger); }
.cu-msg[data-progress] { color: var(--brand); font-weight: 600; font-variant-numeric: tabular-nums; }
.cu-progress-wrap { margin-top: 4px; }
.cu-progress-bar { width: 100%; height: 8px; background: #eef1f5; border-radius: 4px; overflow: hidden; }
.cu-progress-fill { height: 100%; background: linear-gradient(90deg, #3949ab, #5c6bc0); border-radius: 4px; transition: width 120ms ease; }
.cu-progress-text { font-variant-numeric: tabular-nums; }
.cu-list { overflow-x: auto; }
.cu-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cu-table th, .cu-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cu-table th { background: #fafbfc; color: var(--muted); font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
.cu-table td.cu-log { max-width: 320px; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.cu-table td.cu-fname { max-width: 200px; word-break: break-all; color: var(--muted); }
.cu-table td.cu-ops { white-space: nowrap; }
.cu-table td.cu-ops .btn { margin-right: 6px; }
.tag.tag-green { background: #e8f5e9; color: var(--ok); border: 1px solid #bfe3c8; margin: 0; }

/* ============ 门店布局图（推箱子风格门店缩影） ============ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { border: none; background: transparent; padding: 10px 16px; cursor: pointer; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.layout-wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.layout-side { width: 230px; flex: 0 0 auto; }
.layout-main { flex: 1 1 auto; overflow: auto; }

.layout-palette { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.palette-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; font-size: 13px; }
.palette-item:hover { border-color: var(--brand); }
.palette-item.active { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.palette-swatch { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.12); flex: 0 0 auto; }

.layout-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.layout-toolbar .grp { display: flex; align-items: center; gap: 6px; }
.layout-toolbar input[type=number] { width: 56px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.layout-note { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

.layout-grid { display: grid; gap: 0; border: 2px solid #2b303b; width: max-content; background: #2b303b; }
.lc { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; cursor: pointer; user-select: none; border: 1px solid rgba(0,0,0,0.06);
  transition: filter .05s; }
.lc:hover { filter: brightness(1.12); }
.layout-grid.readonly .lc { cursor: default; }
.layout-grid.readonly .lc:hover { filter: none; }
.lc-t0 { background: #eef2f8; color: #6b7686; }   /* 通道 */
.lc-t1 { background: #3a3f4b; color: #fff; }       /* 墙 */
.lc-t2 { background: #c98a3a; color: #fff; }       /* 货架 */
.lc-t3 { background: #43a047; color: #fff; }       /* 门 */
.lc-t4 { background: #2f6df0; color: #fff; }       /* 收银台 */
.lc-t5 { background: #8e44ad; color: #fff; }       /* 打包台 */
.lc-t6 { background: #f1c40f; color: #6b5800; }   /* 起点 */
.lc.lc-path { position: relative; z-index: 1; box-shadow: inset 0 0 0 3px rgba(230,57,70,0.95); }
.lc.lc-path::after { content: ''; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: rgba(214,40,57,0.9); }
.lc.lc-path.lc-t0::after, .lc.lc-path.lc-t3::after, .lc.lc-path.lc-t5::after, .lc.lc-path.lc-t6::after { background: rgba(214,40,57,0.9); }

/* 货架号绑定 */
.layout-shelf-no { display: flex; flex-direction: column; gap: 4px; padding: 10px; background: #fff8e1; border: 1px solid #f1c40f; border-radius: 8px; }
.layout-shelf-no label { color: #b8860b; }
.layout-shelf-no input { font-weight: 700; letter-spacing: 1px; text-align: center; }
/* 货架格显示货架号时字体加粗 */
.lc-t2 { font-weight: 500; }

/* 线上订单：新订单自动出现的入场动画（绿底高亮 + 左侧色条 + 「新」角标，2 秒淡出） */
@keyframes orderNewIn {
  0%   { background-color: #e6ffed; box-shadow: inset 4px 0 0 #2e7d32; }
  60%  { background-color: #e6ffed; box-shadow: inset 4px 0 0 #2e7d32; }
  100% { background-color: transparent; box-shadow: inset 4px 0 0 rgba(46,125,50,0); }
}
tr.order-new > td {
  animation: orderNewIn 2s ease-out;
}
tr.order-new > td:first-child {
  position: relative;
}
tr.order-new > td:first-child::before {
  content: '新';
  position: absolute;
  left: -2px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 1;
  padding: 2px 3px;
  background: #2e7d32;
  color: #fff;
  border-radius: 3px;
  animation: orderNewFade 2s ease-out forwards;
}
@keyframes orderNewFade {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}




/* 处方订单标记：图标与按钮文字垂直居中对齐，20px 高不撑高表格行 */
.rx-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  line-height: 0;
}
.rx-badge .rx-icon {
  display: block;
  vertical-align: middle;
}
