:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #e3e8ef;
  --brand: #1b7f5a;
  --brand-d: #15623f;
  --accent: #2f6fed;
  --chip: #eef2f7;
  --red: #c0392b;
  --green: #1b7f5a;
  --blue: #2f6fed;
  --gray: #8a94a6;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.6;
}
/* 登录页绿色主题（更贴合「隆升农业」；登录后由 JS 移除 login-page 恢复中性底） */
body.login-page { background: linear-gradient(160deg, #dcefe2 0%, #eef6f1 45%, #f7faf8 100%); }
header {
  background: linear-gradient(135deg, var(--brand), var(--brand-d));
  color: #fff; padding: 18px 24px; text-align: center;
}
header h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: 1px; }
header p { margin: 4px 0 0; opacity: .85; font-size: 13px; }
/* 客户端顶部：安卓 App 下载入口（登录前也可见） */
.app-dl { margin-top: 12px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.btn-download {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 999px; text-decoration: none;
  background: #fff; color: var(--brand-d); font-weight: 600; font-size: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); transition: transform .08s, box-shadow .08s;
}
.btn-download:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.btn-download:active { transform: translateY(0); }
.app-ver { font-size: 12px; opacity: .9; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.tabs { display: flex; gap: 8px; margin: 16px 0; justify-content: center; }
.tabs a { padding: 8px 16px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 500; }
.tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.search-input { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; outline: none; background: #fff; color: var(--ink); }
.search-input:focus { border-color: var(--brand); }

/* search */
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.searchbar select, .searchbar input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none;
}
.searchbar select:focus, .searchbar input:focus { border-color: var(--brand); }
.searchbar input[type=text] { flex: 1; min-width: 240px; }
.searchbar button {
  padding: 10px 22px; background: var(--brand); color: #fff; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.searchbar button:hover { background: var(--brand-d); }
.meta { color: var(--muted); font-size: 13px; margin: 14px 2px 6px; text-align: center; }
.meta b { color: var(--ink); }

/* 高级筛选（组合查询） */
.adv-toggle { text-align: center; margin: 10px 0 4px; }
.adv-toggle button {
  background: transparent; border: none; color: var(--brand); cursor: pointer;
  font-size: 13px; padding: 4px 6px;
}
.adv-toggle button:hover { text-decoration: underline; }
.adv-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 6px 0 4px; }
.adv-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.adv-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.adv-grid input {
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none;
}
.adv-grid input:focus { border-color: var(--brand); }
.adv-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.btn-primary { padding: 10px 22px; background: var(--brand); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--brand-d); }
.btn-ghost { padding: 10px 18px; background: #fff; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; cursor: pointer; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.adv-hint { color: var(--muted); font-size: 12px; }

/* 常用筛选 / 历史搜索 */
.quickrow { display: flex; gap: 16px; margin: 12px 0 4px; flex-wrap: wrap; }
.quick-block { flex: 1; min-width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.quick-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.linkbtn { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 2px 4px; }
.linkbtn:hover { color: var(--red); text-decoration: underline; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip.qf { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: #eef4fb; color: #1f4e79; border: 1px solid #d6e4f2; padding: 4px 10px; border-radius: 20px; font-size: 12px; transition: background .12s; }
.chip.qf:hover { background: #dceafb; }
.chip.qf .qf-x { color: #9aabbf; font-weight: 700; line-height: 1; }
.chip.qf .qf-x:hover { color: var(--red); }
.muted { color: var(--muted); font-size: 12px; }

/* result card */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 10px; overflow: hidden; transition: box-shadow .15s;
  display: flex; flex-wrap: wrap; align-items: stretch; }
.card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.08); }
.card-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.card-head { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 14px 16px 8px; cursor: pointer; }
.card-head .pname { font-size: 16px; font-weight: 600; flex: 1; text-align: center; }
.card-head .arrow { color: var(--muted); transition: transform .2s; }
.card.open .card-head .arrow { transform: rotate(90deg); }
/* 2026-09-08d 郑先生反馈"图下面空一块"：缩略图提为卡片左列，纵贯 head+subline 全高（align-self:stretch）；
   detail 展开时 flex-basis:100% 换行到图下方全宽，不被图压住 */
.card-thumb { flex: 0 0 148px; align-self: stretch; border-radius: 12px 0 0 12px; overflow: hidden; background: #f0f4f8; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #7fa650; cursor: pointer; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chip.stock-chip { background: #e8f6ec; color: #1e7e34; font-weight: 600; }
.badge { font-size: 12px; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.badge.ok { background: #e3f3ec; color: var(--green); }
.badge.no { background: #f0f1f4; color: var(--gray); }
.badge.ex { background: #e6effd; color: var(--blue); }
.badge.warn { background: #fff3e0; color: #b45309; }
.subline { color: var(--muted); font-size: 13px; padding: 0 16px 10px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.chip { background: var(--chip); color: #374151; border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.chip.hit { background: #fff3e0; color: #b45309; }

/* layered detail */
.detail { display: none; flex-basis: 100%; border-top: 1px solid var(--line); padding: 6px 16px 16px; background: #fcfdfe; }
.card.open .detail { display: block; }
.layer { border-left: 3px solid var(--brand); background: #fff; margin: 10px 0; border-radius: 0 8px 8px 0; }
.layer > .layer-title { font-weight: 600; padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; }
.layer > .layer-title:hover { background: #f7faf9; }
.layer .layer-body { padding: 0 12px 12px; display: none; }
.layer.open .layer-body { display: block; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 10px; padding: 4px 0; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--ink); }
.sub-block { margin: 8px 0; border-left: 3px solid var(--brand, #2e8b57); padding: 4px 10px; background: #f7fbf9; border-radius: 0 4px 4px 0; }
.sub-title { font-weight: 600; color: #1f6f43; margin-bottom: 2px; font-size: 13px; }
.sub-body { white-space: pre-wrap; line-height: 1.65; color: var(--ink); font-size: 13px; }
table.tbl { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 13px; }
table.tbl th, table.tbl td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
table.tbl th { background: #f3f6f9; font-weight: 600; }
/* 拜访记录明细表：三列撑满宽度 */
.visit-detail { margin-top: 14px; }
.vd-title { font-size: 14px; font-weight: 700; color: #1f2a44; margin: 10px 2px 6px; }
.visit-tbl th, .visit-tbl td { padding: 8px 10px; font-size: 13px; white-space: nowrap; text-align: center; }
.visit-tbl th { position: sticky; top: 0; background: #f3f6f9; z-index: 1; }
.visit-tbl td:nth-child(2), .visit-tbl th:nth-child(2) { text-align: left; width: 50%; }
.visit-tbl td:nth-child(1), .visit-tbl th:nth-child(1),
.visit-tbl td:nth-child(3), .visit-tbl th:nth-child(3) { width: 25%; }
/* 骨架屏（方案③）：列表加载占位，去白屏感 */
.skeleton { display: flex; align-items: center; pointer-events: none; }
.skeleton .sk-thumb { width: 56px; height: 56px; border-radius: 10px; margin: 14px 16px; background: #e9edf2; flex: none; }
.skeleton .sk-lines { flex: 1; padding: 16px 16px 16px 0; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.skeleton .sk-line { display: block; height: 12px; border-radius: 6px; background: #e9edf2; }
.skeleton .sk-line.short { width: 45%; }
.skeleton .sk-thumb, .skeleton .sk-line { animation: sk-pulse 1.1s ease-in-out infinite; }
@keyframes sk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.empty { color: var(--muted); padding: 6px 0; }
.empty.notfound{display:flex;flex-direction:column;align-items:center;gap:10px;padding:48px 16px}
.empty.notfound .empty-icon{font-size:48px;line-height:1}
.empty.notfound .empty-text{font-size:18px;color:var(--ink);font-weight:600}
.empty.notfound .empty-sub{font-size:14px;color:var(--muted)}
.empty.notfound .empty-btn{margin-top:14px;background:var(--brand);color:#fff;border:none;border-radius:999px;padding:10px 22px;font-size:14px;font-weight:600}
.err { color: var(--red); padding: 20px; }

/* admin */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--brand); }
.field.full { grid-column: 1 / -1; }
.section { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 18px; }
.section h3 { margin: 0 0 12px; font-size: 15px; }
/* 类目快选（1级 → 2级 点击筛选定位） */
.cat-quick { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.cat-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-line.sub { margin-top: 2px; }
.cat-label { font-size: 12px; color: var(--muted); min-width: 64px; font-weight: 600; flex: 0 0 auto; }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: var(--chip); color: var(--ink); border: 1px solid var(--line); padding: 5px 12px; border-radius: 20px; font-size: 13px; transition: all .12s; user-select: none; }
.cat-chip:hover { background: #e3f0ea; border-color: var(--brand); }
.cat-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.cat-chip .cnt { font-size: 11px; opacity: .7; }
.cat-chip.active .cnt { opacity: .92; }
.row-tools { display: flex; gap: 8px; margin: 8px 0; }
.mini { padding: 5px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; font-size: 13px; }
.mini.add { color: var(--brand); border-color: var(--brand); }
.mini.del { color: var(--red); }
.repeat-row { display: grid; gap: 8px; margin-bottom: 8px; padding: 8px; border: 1px dashed var(--line); border-radius: 8px; }
.repeat-row.ing { grid-template-columns: 1.4fr 1.4fr 1fr auto; }
.repeat-row.use { grid-template-columns: 1.2fr 1.2fr 1.4fr 1.2fr auto; }
.repeat-row input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.submit { padding: 11px 26px; background: var(--brand); color: #fff; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 6px; }
.submit:hover { background: var(--brand-d); }
.submit.warn { background: var(--red); }
.submit.warn:hover { background: #a93226; }
.del-preview { margin: 14px 0 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.del-preview h4 { margin: 0 0 10px; font-size: 15px; color: var(--text); }
.del-preview .prev-block { margin: 10px 0; }
.del-preview .prev-block > b { display: block; margin-bottom: 6px; color: var(--accent, #2c6e9b); font-size: 13px; }
.del-preview .kv { width: 100%; border-collapse: collapse; }
.del-preview .kv th, .del-preview .kv td { text-align: left; padding: 5px 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
.del-preview .kv th { width: 130px; color: #666; font-weight: 600; background: #f3f5f7; white-space: nowrap; }
.del-preview .data-table { margin-top: 4px; }
.del-preview .err { color: var(--red); }
.toast { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: 14px; display: none; }
.toast.ok { display: block; background: #e3f3ec; color: var(--green); }
.toast.err { display: block; background: #fdecea; color: var(--red); }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.prod-img { margin: 2px 0 10px; }
.prod-img img { max-width: 160px; max-height: 160px; border-radius: 8px; border: 1px solid var(--line);
  object-fit: contain; background: #fff; display: block; }
.prod-img.empty { color: var(--muted); font-size: 12px; padding: 6px 0; }
.prod-img .img-actions { margin-top: 6px; display: flex; gap: 8px; }
.zoomable { cursor: zoom-in; }
.zoomable.broken { display: none; }

/* lightbox 放大查看 */
.lightbox { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; }
.lightbox.hidden { display: none; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.lb-panel { position: relative; background: #fff; border-radius: 12px; max-width: 94vw; max-height: 94vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.lb-bar { display: flex; gap: 8px; justify-content: flex-end; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.lb-imgwrap { padding: 10px; overflow: hidden; }
.lb-imgwrap img { max-width: 88vw; max-height: 80vh; display: block; object-fit: contain;
  transform-origin: 0 0; user-select: none; -webkit-user-drag: none; cursor: zoom-in;
  will-change: transform; touch-action: none; }

/* 备份与回滚 */
.backup-list { display: flex; flex-direction: column; gap: 10px; }
.backup-item { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.backup-item .bi-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.backup-item .chip { background: #eef4fb; color: #1f4e79; border: 1px solid #d6e4f2; padding: 1px 8px; border-radius: 12px; font-size: 12px; }

/* 后台：左右分割（左功能区 / 右操作区） */
.admin-shell { display: flex; gap: 16px; align-items: flex-start; margin-top: 8px; }
.admin-side { width: 210px; flex: 0 0 210px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; position: sticky; top: 12px; }
.admin-side h4 { margin: 2px 8px 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.admin-side button { display: block; width: 100%; text-align: left; padding: 11px 12px; margin-bottom: 6px;
  border: 1px solid transparent; background: transparent; border-radius: 8px; cursor: pointer;
  font-size: 14px; color: var(--ink); }
.admin-side button:hover { background: #f3f6f9; }
.admin-side button.active { background: var(--brand); color: #fff; }
.admin-side .side-logout { margin-top: 14px; color: var(--red); border-top: 1px solid var(--line);
  border-radius: 0; padding-top: 14px; }
.admin-side .side-logout:hover { background: #fdecea; }
.admin-side .side-back { display: block; width: 100%; text-align: left; padding: 11px 12px; margin-top: 6px;
  border: 1px solid var(--brand); border-radius: 8px; cursor: pointer; font-size: 14px;
  color: var(--brand); text-decoration: none; background: transparent; }
.admin-side .side-back:hover { background: var(--brand); color: #fff; }
.admin-main { flex: 1; min-width: 0; }

/* login */
.login-box { max-width: 420px; margin: 60px auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 28px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.login-box h3 { margin: 0 0 18px; }
.login-box label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
.login-box input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; }
.login-box label.remember { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink);
  margin: 12px 0 0; cursor: pointer; }
.login-box label.remember input { width: auto; padding: 0; margin: 0; }
.login-box .submit { width: 100%; margin-top: 16px; }
.login-foot { margin-top: 14px; text-align: center; }
.login-foot a { color: var(--brand); font-size: 13px; text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }
.app-build { margin-top: 10px; text-align: center; font-size: 12px; color: var(--muted); opacity: .8; }
.admin-back .back-link { display: inline-block; padding: 8px 16px; color: var(--brand); font-size: 14px; text-decoration: none; border: 1px solid var(--brand); border-radius: 8px; }
.admin-back .back-link:hover { background: var(--brand); color: #fff; }
.user-kv { grid-template-columns: 88px 1fr; margin-top: 8px; }
.hidden { display: none !important; }

/* ===== 手机适配（适配主流在售安卓机型：三星/小米/OPPO/Vivo/华为/一加等，含刘海安全区） ===== */
@media (max-width: 768px) {
  header { padding: calc(14px + env(safe-area-inset-top)) 14px 14px; }
  header h1 { font-size: 21px; }
  header p { font-size: 12px; }
  .wrap { padding: 14px 10px calc(48px + env(safe-area-inset-bottom)); max-width: 100%; }
  .tabs { flex-wrap: nowrap; }
  .tabs a { flex: 1; text-align: center; padding: 10px 10px; }
  /* 搜索栏竖排、控件整宽、字号 16px 防止手机聚焦缩放 */
  .searchbar { flex-direction: column; align-items: stretch; }
  .searchbar select, .searchbar input, .searchbar button { width: 100%; font-size: 16px; min-height: 44px; }
  .searchbar input[type=text] { min-width: 0; }
  /* 历史搜索整宽 */
  .quickrow { flex-direction: column; gap: 12px; }
  .quick-block { min-width: 0; width: 100%; }
  /* 表单与筛选：整列、输入框 16px + 触控高度 */
  .form-grid { grid-template-columns: 1fr; }
  .adv-grid { grid-template-columns: 1fr; }
  .adv-grid input, .field input, .field select, .field textarea { font-size: 16px; min-height: 42px; }
  .adv-actions { flex-direction: column; align-items: stretch; }
  .adv-actions .btn-primary, .adv-actions .btn-ghost { width: 100%; min-height: 44px; }
  .repeat-row.ing, .repeat-row.use { grid-template-columns: 1fr; }
  .repeat-row input { font-size: 16px; min-height: 42px; }
  /* 结果卡片：标题左对齐更适合窄屏 */
  .card-head { flex-wrap: wrap; min-height: 64px; }
  .card-thumb { flex-basis: 120px; }
  .card-head .pname { text-align: left; }
  .card-head .arrow { display: none; }
  /* 工具栏：输入控件整宽，按钮整宽便于触摸（表格内小按钮保持自适应） */
  .row-tools { flex-wrap: wrap; gap: 8px; }
  .row-tools > input, .row-tools > select { flex: 1 1 100%; min-height: 42px; font-size: 16px; }
  .row-tools .mini, .submit, .btn-ghost { width: 100%; min-height: 44px; }
  .row-tools .mini { width: auto; }
  .kv { grid-template-columns: 100px 1fr; }
  .detail, .layer-body { overflow-x: auto; }
  table.tbl { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .login-box { margin: 24px 12px; padding: 22px 16px; }
  /* 后台：左右结构改为上下；侧栏重排为 2 列网格（8 个功能区全部可见，退出登录整行区分，不再横向滚动） */
  .admin-shell { flex-direction: column; gap: 12px; }
  .admin-side { width: 100%; flex: none; position: static; display: grid;
    grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
  .admin-side h4 { display: none; }
  .admin-side button { width: 100%; margin-bottom: 0; text-align: center;
    padding: 12px 8px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .admin-side .side-logout { grid-column: 1 / -1; margin-top: 4px; border-top: 1px solid var(--line);
    border-radius: 8px; padding: 12px 8px; color: var(--red); text-align: center; }
  /* 商品列表：手机端改为卡片（避免 7 列横滑）；表头隐藏、每行 label:value；操作按钮整宽 */
  .table-wrap { overflow: visible; }
  #list-table.data-table { min-width: 0; display: block; }
  #list-table.data-table thead { display: none; }
  #list-table.data-table tbody { display: block; }
  #list-table.data-table tr.clickable-row { display: block; background: var(--panel);
    border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
  #list-table.data-table tr.clickable-row td { display: flex; justify-content: space-between;
    align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
  #list-table.data-table tr.clickable-row td:last-child { border-bottom: none; padding-bottom: 0; }
  #list-table.data-table tr.clickable-row td::before { content: attr(data-label); color: var(--muted);
    font-size: 13px; font-weight: 600; flex: 0 0 auto; text-align: left; }
  #list-table.data-table tr.clickable-row td.cell-img { justify-content: flex-end; }
  #list-table.data-table .cell-img img { width: 56px; height: 56px; }
  #list-table.data-table .pname { font-size: 15px; justify-content: flex-start; gap: 8px; }
  #list-table.data-table .pname .name-actions { margin-left: auto; }
  #list-table.data-table tr.clickable-row td:last-child { display: block; }
  #list-table.data-table tr.clickable-row td:last-child::before { display: none; }
  /* 操作列现在只含「删除」：移动端整行宽便于点按 */
  #list-table.data-table tr.clickable-row .btn-del { width: 100%; min-height: 42px; margin-left: 0; }
  /* 商品名后内联「详情/添加」在移动端保持小按钮，不撑满整行 */
  #list-table.data-table tr.clickable-row .pname .btn-detail,
  #list-table.data-table tr.clickable-row .pname .btn-add { width: auto; min-height: 0; padding: 3px 10px; font-size: 12px; }
  #list-table.data-table tr.clickable-row .mark-sel { min-width: 120px; min-height: 38px; margin-top: 4px; }
  #list-table.data-table th { position: static; }
  /* 详情弹窗/ICAMA/删除预览内的子表：手机端改为卡片（每行 label:value），不再横向滚动 */
  .modal-body table.data-table, .icama-groups table.data-table, .del-preview table.data-table, .detail table.data-table {
    min-width: 0; display: block; width: 100%; }
  .modal-body table.data-table thead, .icama-groups table.data-table thead, .del-preview table.data-table thead, .detail table.data-table thead { display: none; }
  .modal-body table.data-table tbody, .icama-groups table.data-table tbody, .del-preview table.data-table tbody, .detail table.data-table tbody { display: block; }
  .modal-body table.data-table tr, .icama-groups table.data-table tr, .del-preview table.data-table tr, .detail table.data-table tr {
    display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin-bottom: 10px; }
  .modal-body table.data-table td, .icama-groups table.data-table td, .del-preview table.data-table td, .detail table.data-table td {
    display: flex; justify-content: space-between; gap: 12px; padding: 6px 0;
    border: none; border-bottom: 1px dashed var(--line); text-align: right; }
  .modal-body table.data-table td:last-child, .icama-groups table.data-table td:last-child, .del-preview table.data-table td:last-child, .detail table.data-table td:last-child { border-bottom: none; }
  .modal-body table.data-table td::before, .icama-groups table.data-table td::before, .del-preview table.data-table td::before, .detail table.data-table td::before {
    content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; flex: 0 0 auto; }
  .modal-body table.data-table td img, .icama-groups table.data-table td img, .del-preview table.data-table td img, .detail table.data-table td img { flex: 0 0 auto; }
  /* 弹窗整宽、底部按钮堆叠 */
  .modal { width: 100%; max-height: calc(92vh - env(safe-area-inset-bottom)); }
  .modal-foot { flex-direction: column; gap: 8px; }
  /* 安卓 App 自动更新弹窗（与原始可用版本一致） */
  .update-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
  .update-modal.hidden { display: none; }
  .update-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
  .update-box { position: relative; width: 82%; max-width: 320px; background: #fff; border-radius: 12px; padding: 18px 18px 14px; box-shadow: 0 10px 34px rgba(0,0,0,.28); }
  .update-title { font-size: 16px; font-weight: 700; color: #1a1a1a; margin-bottom: 8px; }
  .update-note { font-size: 13px; color: #555; line-height: 1.5; margin-bottom: 14px; min-height: 18px; }
  .update-actions { display: flex; gap: 10px; justify-content: flex-end; }
  .btn-update-later { padding: 8px 14px; border: 1px solid #ccc; background: #f5f5f5; color: #555; border-radius: 8px; font-size: 14px; }
  .btn-update-now { padding: 8px 16px; border: none; background: #2e7d32; color: #fff; border-radius: 8px; font-size: 14px; font-weight: 600; }
  .modal-foot .submit, .modal-foot .btn-ghost { width: 100%; min-height: 44px; }
}
@media (max-width: 480px) {
  header h1 { font-size: 19px; }
  .kv { grid-template-columns: 1fr; }
  .kv .k { color: var(--muted); font-size: 12px; }
  .card-head .pname { font-size: 15px; }
}
@media (max-width: 360px) {
  .wrap { padding: 12px 8px calc(44px + env(safe-area-inset-bottom)); }
  header h1 { font-size: 17px; }
}

/* ⑦ 数据列表 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
table.data-table th, table.data-table td { border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; }
table.data-table th { background: #f3f6f9; font-weight: 600; color: var(--ink); position: sticky; top: 0; }
table.data-table tbody tr:hover { background: #fafbfc; }
table.data-table .pname { font-weight: 600; color: var(--ink); }
table.data-table .cert { font-family: "SFMono-Regular", Consolas, monospace; color: var(--blue); }
table.data-table .cell-img img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; }
table.data-table .cell-img img.zoomable { cursor: zoom-in; transition: box-shadow .12s, transform .12s; }
table.data-table .cell-img img.zoomable:hover { box-shadow: 0 0 0 2px rgba(27,127,90,.45); transform: scale(1.08); }
table.data-table .cell-img img.zoomable.broken { display: none; }
table.data-table .cell-img .noimg { color: var(--muted); font-size: 12px; }
/* 2026-09-09 后台列表加三列库存后操作列被挤到视口外：压缩库存列 + 操作列右侧吸附常驻 */
table.data-table .cell-stock, table.data-table .cell-occ, table.data-table .cell-exp {
  white-space: nowrap; width: 1%; font-variant-numeric: tabular-nums; }
#list-table.data-table th, #list-table.data-table td { padding: 8px 9px; }
@media (min-width: 721px) {
  #list-table.data-table th:last-child, #list-table.data-table td:last-child {
    position: sticky; right: 0; z-index: 3; background: var(--panel);
    box-shadow: -3px 0 8px rgba(15, 30, 45, .10); }
  #list-table.data-table th:last-child { background: #f3f6f9; z-index: 4; }
  #list-table.data-table tbody tr:hover td:last-child { background: #fafbfc; }
}
.st-badge { font-size: 12px; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.st-badge.ok { background: #e3f3ec; color: var(--green); }
.st-badge.no { background: #f0f1f4; color: var(--gray); }
.mark-badge, .mark-chip { font-size: 12px; padding: 2px 9px; border-radius: 20px; white-space: nowrap; display: inline-block; }
.mark-badge.mk-ok, .mark-chip.mk-ok { background: #e3f3ec; color: var(--green); }
.mark-badge.mk-stop, .mark-chip.mk-stop { background: #fde8e8; color: #c0392b; }
.mark-badge.mk-low, .mark-chip.mk-low { background: #fff3e0; color: #b45309; }
.mark-badge.mk-na, .mark-chip.mk-na { background: #f0f1f4; color: var(--gray); }
.mark-chip { font-weight: 600; }
/* 卡片右上角「停用」角标（网页端，内联于 card-head 右侧，避免与箭头重叠） */
.combo-chip { background: #efe7ff; color: #6d28d9; border: 1px solid #d8c7f5; font-weight: 600; }
.fert-chip { background: #e6f7ec; color: #1a7a43; border: 1px solid #b6e3c6; font-weight: 600; }
/* 新品角标（对齐安卓 .tag.new：#ffe8f0/#c2185b），与「正常经营」标记并存显示 */
.new-chip { background: #ffe8f0; color: #c2185b; border: 1px solid #f5c2d6; font-weight: 600; }
/* 字段值着色：类别/品牌/登记证 由 app.js 按值哈希生成内联 style（同值同色、异值异色），与状态芯片(绿/红/橙)区分 */
.btn-add { padding: 5px 12px; border: 1px solid var(--brand); color: var(--brand); background: #fff;
  border-radius: 7px; cursor: pointer; font-size: 13px; }
.btn-add:hover { background: var(--brand); color: #fff; }

/* 共用弹窗 */
.modal-mask { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,.5); padding: 16px; }
.modal-mask.hidden { display: none; }
.modal { background: #fff; border-radius: 14px; width: 760px; max-width: 100%; max-height: 92vh;
  display: flex; flex-direction: column; box-shadow: 0 18px 60px rgba(0,0,0,.32); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
  border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-x { background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-x:hover { color: var(--ink); }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal .form-grid { margin-top: 8px; }
.modal h4 { margin: 0 0 6px; font-size: 14px; color: var(--ink); }
.modal #dlg-img { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; width: 100%; }

/* 设置片区：可视化映射表 */
.region-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.region-table th, .region-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.region-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.region-table .rp-name { font-weight: 600; white-space: nowrap; }
.region-table select, .region-table input { width: 100%; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; background: #fff; box-sizing: border-box; }
.region-table select:focus, .region-table input:focus { outline: none; border-color: var(--brand); }
/* 逐个增删片区 tag */
.rp-row .rp-region { min-width: 260px; }
.rp-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rp-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 11px; background: var(--brand);
  color: #fff; border-radius: 999px; font-size: 13px; line-height: 1.4; }
.rp-tag .rp-del { border: none; background: transparent; color: #fff; font-size: 16px; line-height: 1; cursor: pointer;
  padding: 0 3px; opacity: .8; }
.rp-tag .rp-del:hover { opacity: 1; }
.rp-empty { color: var(--muted); font-size: 13px; }
.rp-add { display: flex; gap: 6px; margin-top: 8px; }
.rp-add .rp-select { flex: 1; min-width: 0; }

/* 商品列表：整行可点击进入详情 */
.clickable-row { cursor: pointer; transition: background-color .15s; }
.clickable-row:hover { background-color: #f3f7ff; }
.btn-detail { padding: 5px 12px; border: 1px solid var(--accent); color: var(--accent); background: #fff;
  border-radius: 7px; cursor: pointer; font-size: 13px; }
.btn-detail:hover { background: var(--accent); color: #fff; }
.btn-del { padding: 5px 12px; border: 1px solid #c0392b; color: #c0392b; background: #fff;
  border-radius: 7px; cursor: pointer; font-size: 13px; margin-left: 6px; }
.btn-del:hover { background: #c0392b; color: #fff; }
.mark-sel { font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 20px;
  background: #fff; color: var(--ink); cursor: pointer; outline: none; min-width: 72px; }
.mark-sel:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(27,127,90,.15); }
/* 后台经营标记单元格：新品徽标 + 经营标记下拉 横向并列（is_new 为独立字段，不写入经营标记） */
.mark-cell { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mark-cell .new-badge { background: #ffe8f0; color: #c2185b; border: 1px solid #f5c2d6; }
.new-badge { background: #ffe8f0; color: #c2185b; border: 1px solid #f5c2d6; }

/* 商品名后内联「详情/添加」按钮：与右侧「删除」分离，避免两个按钮挤在一起 */
.pname-text { font-weight: 600; color: var(--ink); }
.name-actions { margin-left: 10px; white-space: nowrap; display: inline-block; vertical-align: middle; }
#list-table.data-table .pname .btn-detail,
#list-table.data-table .pname .btn-add { padding: 2px 9px; font-size: 12px; margin-left: 0; }

/* 详情弹窗顶部只读摘要 */
#dlg-summary { margin-bottom: 14px; padding: 12px 14px; background: #fafbff;
  border: 1px solid var(--line); border-radius: 10px; }
#dlg-summary .kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; }
#dlg-summary .k { color: var(--muted); font-size: 13px; align-self: center; }
#dlg-summary .v { font-size: 13px; }
.badge.ok { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #dcfce7; color: #15803d; font-size: 12px; }
.badge.ex { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #fee2e2; color: #b91c1c; font-size: 12px; }

/* ⑧ 关联对照 */
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn { border: 0; background: #fff; color: var(--muted); padding: 6px 12px; font-size: 13px; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.active { background: #2f5496; color: #fff; }
.icama-groups { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.icama-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.icama-card:hover { box-shadow: 0 2px 10px rgba(20,40,80,.06); }
.icama-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px;
  background: #f7f9fc; border-bottom: 1px solid var(--line); font-size: 14px; }
.icama-head .chip { padding: 1px 8px; border-radius: 10px; background: #eef2f8; color: #44506a; font-size: 12px; }
.icama-tbl { margin: 0; border: 0; }
.icama-tbl th, .icama-tbl td { padding: 7px 10px; font-size: 13px; }
.icama-tbl thead th { background: #fff; }
.icama-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line);
  cursor: zoom-in; background: #fff; }
.icama-thumb:hover { outline: 2px solid var(--accent); }
.badge.bad { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #fee2e2; color: #b91c1c; font-size: 12px; font-weight: 600; }
.badge.bad.sm { font-size: 11px; padding: 0 7px; }



/* 数据过期高亮（库存/档案超过 7 天未更新） */
.kv.stale .k, .kv.stale .v { color: #c0392b; }
.kv.stale { background: #fff4f4; border-radius: 6px; }
.hint.stale { color: #c0392b !important; font-weight: 600; }
/* 过期库存（过期产品仓库）警示样式 */
.expired-kv { background: #fff8ec; border-radius: 6px; }
.expired-kv .k { color: #b26a00; }
.exp-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; font-size: 11px; line-height: 1.6;
  color: #fff; background: #e08e0b; border-radius: 4px; vertical-align: middle; }

/* 销售数据板块 */
.topnav { display: flex; gap: 8px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.topnav-btn { border: 0; background: transparent; color: var(--muted); padding: 8px 14px; font-size: 15px; cursor: pointer; border-bottom: 2px solid transparent; }
.topnav-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.sales-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.stab-btn { border: 1px solid var(--line); background: #fff; color: var(--muted); padding: 6px 14px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.stab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.sales-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.sales-toolbar label { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.sales-toolbar select, .sales-toolbar input[type=date] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.sales-tip { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.sales-updated { font-size: 12px; color: var(--muted); margin-bottom: 8px; text-align: right; }
.sales-block { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px 24px; margin-top: 24px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-align: center; color: #b3402f; font-size: 15px; font-weight: 600; }
.sales-block::before { content: "\1F512"; font-size: 40px; line-height: 1; }
.sales-tbl, .visit-tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sales-tbl th, .sales-tbl td, .visit-tbl th, .visit-tbl td { padding: 8px 10px; font-size: 13px; border-bottom: 1px solid var(--line); text-align: left; }
.sales-tbl thead th, .visit-tbl thead th { background: #f3f6fb; color: #44506a; font-weight: 600; }
.sales-tbl tbody tr:hover, .visit-tbl tbody tr:hover { background: #fafcff; }
.sales-tbl details { font-size: 12px; }
.sales-tbl summary { cursor: pointer; color: var(--blue); }

/* 销售预测：管理员汇总栏（总计划 / 总销量 / 完成率），仅管理员 + 全部业务员视图显示 */
.summary-bar { display: flex; align-items: stretch; gap: 0; background: linear-gradient(135deg, #1f7a3d, #2a9d54); border-radius: 12px; padding: 14px 8px; margin-bottom: 12px; box-shadow: 0 2px 6px rgba(31,122,61,.18); }
.sum-item { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.sum-item + .sum-item { border-left: 1px solid rgba(255,255,255,.25); }
.sum-k { font-size: 12px; color: rgba(255,255,255,.85); margin-bottom: 4px; white-space: nowrap; }
.sum-v { font-size: 18px; font-weight: 800; color: #fff; white-space: nowrap; }

/* 销售预测卡片 + 突出月计划/月销售 */
.sales-cards { display: flex; flex-direction: column; gap: 12px; }
.sales-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(20,40,80,.04); }
.sc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sc-name { font-size: 16px; font-weight: 700; color: #1f2a44; }
.sc-region { font-size: 12px; font-weight: 600; color: #fff; background: var(--accent); padding: 2px 8px; border-radius: 10px; margin-left: 6px; vertical-align: middle; }
.sc-rate { font-size: 14px; font-weight: 700; padding: 2px 10px; border-radius: 12px; }
.sc-rate.good { background: #e7f7ee; color: #14803a; }
.sc-rate.mid { background: #fff4e0; color: #b9740a; }
.sc-rate.low { background: #fdecec; color: #c0392b; }
.sc-kv { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.sc-kv b { color: #1f2a44; font-size: 14px; }
.month-mini { width: 100%; border-collapse: collapse; }
.month-mini th, .month-mini td { padding: 6px 8px; font-size: 13px; border-bottom: 1px solid #eef1f6; text-align: center; }
.month-mini thead th { background: #f3f6fb; color: #44506a; font-weight: 600; }
.month-mini .m-label { font-weight: 700; color: #1f2a44; }
/* 月计划 / 月销售 突出：加粗 + 配色底 */
.month-mini .col-plan { background: #eaf1ff; color: #1d4ed8; font-weight: 700; }
.month-mini .col-sale { background: #e9f9f0; color: #137a3b; font-weight: 700; }
.cell-edit { width: 64px; padding: 4px 6px; border: 1px solid var(--accent); border-radius: 6px; font-size: 13px; text-align: center; font-weight: 700; color: #1f2a44; }
.cell-edit:focus { outline: 2px solid var(--accent); }
/* 业务员预测填报输入框：外观同管理员编辑框，用橙色边框区分本人可填 */
.cell-fill { width: 64px; padding: 4px 6px; border: 1px solid #f59e0b; border-radius: 6px; font-size: 13px; text-align: center; font-weight: 700; color: #1f2a44; background: #fffbeb; }
.cell-fill:focus { outline: 2px solid #f59e0b; }
.fill-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-left: 8px; }
.fill-board { width: 100%; border-collapse: collapse; margin-top: 4px; }
.fill-board th, .fill-board td { padding: 8px 10px; font-size: 13px; border-bottom: 1px solid #eef1f6; text-align: center; }
.fill-board thead th { background: #f3f6fb; color: #44506a; font-weight: 600; }
.fill-board .col-plan { background: #eaf1ff; color: #1d4ed8; font-weight: 700; }
.fill-board td:nth-child(1), .fill-board td:nth-child(2) { text-align: left; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.tag.ok { background: #e9f9f0; color: #137a3b; }
.tag.todo { background: #fff3e0; color: #c2680c; }
/* 待提交(防呆)高亮：输入后尚未确认提交 */
.cell-fill.dirty { background: #fde68a; border-color: #d97706; box-shadow: 0 0 0 2px rgba(217,119,6,.25); }
/* 管理员「当月总目标」输入条 */
.total-target-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #fff7ed; border: 1px dashed #f59e0b; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; color: #7c4a03; }
.total-target-bar label { font-weight: 600; }
.total-target-bar #monthTotalInput { width: 96px; padding: 4px 6px; border: 1px solid #f59e0b; border-radius: 6px; font-size: 13px; text-align: center; font-weight: 700; }
.total-target-bar .tt-info { color: #6b4a1b; }
.total-target-bar .tt-info b { color: #b45309; }
/* 预测填写「确认提交」防呆栏 */
.confirm-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px 14px; margin-top: 14px; box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
.confirm-bar .cf-count { font-size: 13px; color: #6b7280; font-weight: 600; }
.btn-confirm { background: linear-gradient(135deg, #1f7a3d, #2a9d54); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 14px; font-weight: 700; cursor: pointer; }
.btn-confirm:disabled { background: #cbd5e1; cursor: not-allowed; }
.btn-confirm:not(:disabled):hover { filter: brightness(1.05); }
.btn-ghost { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.btn-ghost:disabled { color: #cbd5e1; cursor: not-allowed; }
.btn-ghost:not(:disabled):hover { background: #e2e8f0; }

/* 拜访记录柱状图 */
.chart-title { font-size: 14px; font-weight: 700; color: #1f2a44; margin: 4px 0 12px; }
.bar-chart { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { width: 86px; font-size: 13px; color: #33405c; text-align: right; flex: 0 0 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1 1 auto; height: 18px; background: #eef1f6; border-radius: 9px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 9px; transition: width .3s; }
.bar-val { width: 34px; font-size: 13px; font-weight: 700; color: #1f2a44; text-align: left; flex: 0 0 auto; }

/* 用户角色徽章 */
.badge.admin { background: #e6effd; color: #1d4ed8; }
.badge.sales { background: #e3f3ec; color: #15803d; }
.badge.warn { background: #fef3c7; color: #b45309; }

/* 打开小程序入口：放在 App 下载旁，点击弹出居中弹窗（避免被父容器遮挡） */
.wx-entry { position: relative; display: inline-flex; align-items: center; }
.wx-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 999px;
  text-decoration: none; background: linear-gradient(135deg, #07c160, #06ad56); color: #fff;
  font-weight: 600; font-size: 14px; box-shadow: 0 2px 10px rgba(7, 193, 96, .25);
  transition: transform .08s, box-shadow .08s;
}
.wx-link:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(7, 193, 96, .32); }
/* 居中弹窗：fixed 全屏遮罩 + 卡片，脱离父级 overflow 裁剪，不再被遮挡 */
.wx-modal-mask {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .55);
}
.wx-modal-mask.hidden { display: none; }
.wx-modal-card {
  position: relative; width: 280px; max-width: 86vw; background: #fff; border-radius: 18px;
  padding: 22px 20px 18px; text-align: center; box-shadow: 0 18px 50px rgba(10, 20, 40, .35);
  animation: wx-pop-in .16s ease-out;
}
@keyframes wx-pop-in { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wx-modal-close {
  position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; border: none; border-radius: 50%;
  background: #f1f3f5; color: #495057; font-size: 20px; line-height: 1; cursor: pointer;
}
.wx-modal-close:hover { background: #e9ecef; }
.wx-modal-title { font-size: 16px; font-weight: 600; color: #1f2d3d; margin-bottom: 14px; }
.wx-modal-qr { display: block; width: 200px; height: 200px; object-fit: contain; border-radius: 10px; background: #f7f8fa; margin: 0 auto; }
.wx-modal-hint { margin-top: 12px; font-size: 13px; color: var(--muted); line-height: 1.6; }
