:root {
  --bg: #f5f1e8;          /* 米色背景，清爽 */
  --panel: #ffffff;
  --ink: #2f2a24;         /* 暖深字 */
  --muted: #9b9186;
  --gold: #bfa05a;
  --gold-deep: #a8884a;
  --gold-soft: #f3ebda;
  --line: #ece3d5;
  --green: #5b9b7a;
  --red: #cf6a52;
  --wx: #07c160;
  --shadow: 0 8px 30px rgba(60, 45, 20, 0.07);
  --shadow-sm: 0 2px 10px rgba(60, 45, 20, 0.06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.msg { color: var(--red); font-size: 13px; min-height: 18px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 2px 16px; }

/* 通用按钮（金底） */
button.primary {
  background: var(--gold); color: #fff; border: none; border-radius: 10px;
  font-weight: 600; cursor: pointer; transition: filter .15s, background .15s;
}
button.primary:hover { filter: brightness(1.05); }
.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 5px 12px; border-radius: 8px; cursor: pointer;
}
.ghost:hover { color: var(--ink); border-color: var(--muted); }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #f7f3ea 0%, #efe7d8 100%);
}
.login-card {
  background: var(--panel); padding: 44px 36px; border-radius: 18px;
  width: 340px; text-align: center; border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.login-card.wide { width: 384px; }
.login-logo {
  display: block; width: 152px; height: auto; margin: 0 auto 16px;
}
.login-card h1 { font-size: 20px; margin: 0 0 6px; color: var(--ink); letter-spacing: 1px; }
.slogan { color: var(--gold); letter-spacing: 5px; margin: 0 0 22px; font-size: 14px; }
.login-card input {
  display: block; width: 100%; margin: 12px 0; padding: 12px 14px;
  background: #fcfaf5; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); font-size: 14px; transition: border-color .15s;
}
.login-card input:focus { outline: none; border-color: var(--gold); }
.login-card button.primary {
  width: 100%; margin-top: 16px; padding: 12px; border-radius: 10px;
  font-size: 15px;
}
.wx-note { color: var(--muted); font-size: 12px; margin: 12px 0 0; }

/* 后端未连接提示 */
.conn-warn {
  text-align: left; margin: 0 0 16px; padding: 12px 14px;
  background: #fdf2f0; border: 1px solid #f0d3cc; border-radius: 10px;
  font-size: 12.5px; line-height: 1.75; color: #7a3a30;
}
.conn-warn .cw-hd { font-size: 13.5px; font-weight: 700; color: #b23b2e; margin-bottom: 6px; }
.conn-warn .cw-why { margin: 0 0 8px; }
.conn-warn .cw-txt { margin: 0 0 6px; color: var(--ink); }
.conn-warn .cw-steps { margin: 0 0 8px; padding-left: 18px; }
.conn-warn .cw-steps li { margin: 4px 0; }
.conn-warn .cw-note { margin: 0 0 10px; color: var(--muted); word-break: break-all; }
.conn-warn code {
  background: #fff; border: 1px solid #f0d3cc; border-radius: 5px;
  padding: 1px 5px; font-size: 11.5px; font-family: Consolas, Menlo, monospace;
}
.conn-warn button { width: 100%; padding: 8px; border-radius: 8px; font-size: 13px; }

/* ---------- 外壳：左菜单 + 右内容 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 234px; flex: 0 0 234px; background: var(--panel);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; box-shadow: var(--shadow-sm);
}
.side-brand {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}
/* 官方毛笔字 logo（一曲水三个字.png，透明底深墨），随侧栏宽度自适应不变形 */
.side-logo { display: block; width: 148px; max-width: 100%; height: auto; }
.side-sub {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 2px;
  line-height: 1.2;
}

.side-nav { flex: 1; padding: 12px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 13px; border: none; background: transparent; color: var(--muted);
  border-radius: 11px; cursor: pointer; font-size: 14.5px; text-align: left;
  position: relative; transition: background .15s, color .15s;
}
.nav svg {
  width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.nav span { flex: 1; }
.nav:hover { background: var(--gold-soft); color: var(--ink); }
.nav.active { background: var(--gold-soft); color: var(--gold-deep); font-weight: 600; }
.nav.active svg { stroke: var(--gold); }
.nav-badge {
  font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--gold); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
  display: none;
}
.nav-badge.show { display: inline-block; }

.side-foot {
  border-top: 1px solid var(--line); padding: 14px 16px; display: flex;
  flex-direction: column; gap: 8px;
}
.who { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.side-foot .ghost { font-size: 12.5px; padding: 7px 10px; }

/* 右侧内容 */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.7);
  backdrop-filter: blur(4px); position: sticky; top: 0; z-index: 10;
}
.crumb { font-size: 17px; color: var(--ink); letter-spacing: .5px; }
.top-tip { font-size: 12px; color: var(--muted); }

.panels { flex: 1; overflow-y: auto; padding: 24px 28px 64px; }
.panel { display: none; max-width: 1080px; margin: 0 auto; }
.panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 表单行 */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row input, .form-row select {
  flex: 1; min-width: 130px; padding: 11px 14px; background: #fcfaf5;
  border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 14px;
  transition: border-color .15s;
}
.form-row input:focus, .form-row select:focus { outline: none; border-color: var(--gold); }
.form-row button {
  padding: 11px 20px; background: var(--gold); color: #fff; border: none;
  border-radius: 10px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: filter .15s;
}
.form-row button:hover { filter: brightness(1.05); }

/* ---------- 看板 ---------- */
.ov-head h2 { font-size: 22px; margin: 4px 0 4px; letter-spacing: .5px; }
/* ---------- 看板顶部速览 chip（每类几件，点了滚到对应卡面分组） ---------- */
.kb-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: #fdfbf6; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; cursor: pointer;
  transition: transform .12s, border-color .15s, background .15s;
}
.kb-chip:hover { transform: translateY(-1px); border-color: var(--gold); background: #fff; }
.kb-chip .c-l { font-size: 12px; color: var(--muted); }
.kb-chip .c-v { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1; }
.kb-chip.alert { border-color: #eccfbe; background: #fdf6f2; }
.kb-chip.alert .c-v { color: var(--red); }
.kb-chip.alert .c-l { color: var(--red); }

.ov-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; margin: 8px 0 4px; }
.ov-metric { background: #fffaf0; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-align: center; }
.ov-metric .v { font-size: 22px; font-weight: 700; color: var(--gold); }
.ov-metric .l { font-size: 12px; color: var(--ink); margin-top: 3px; }

/* ---------- 看板：待办 / 提醒 两大分区，每类「一排排」铺开 ---------- */
/* PC 端放宽看板可用宽度，让每排能横向放下更多卡面 */
#panel-overview { max-width: 1220px; }

/* 顶部两张分区概况卡：先看条数，点 chip 滚到下面那一排 */
.kb-zonecards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 4px; }
.kb-zc {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.kb-zc.remind { border-left-color: var(--green); }
.kb-zc-hd { display: flex; align-items: baseline; gap: 8px; }
.kb-zc-hd .zc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); align-self: center; }
.kb-zc.remind .zc-dot { background: var(--green); }
.kb-zc-hd .zc-nm { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: .5px; }
.kb-zc-hd .zc-n { font-size: 22px; font-weight: 700; color: var(--gold-deep); margin-left: 2px; line-height: 1; }
.kb-zc.remind .zc-n { color: var(--green); }
.kb-zc-hd .zc-unit { font-size: 12px; color: var(--muted); }
.kb-zc-hd .zc-flag {
  margin-left: auto; font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; white-space: nowrap;
}
.kb-zc-desc { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.55; }
.kb-zc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.kb-zc .zc-none { font-size: 12px; color: var(--muted); }

/* 分区：待办 / 提醒 */
.kb-zones { display: flex; flex-direction: column; gap: 24px; margin-top: 22px; }
.kb-zone-hd { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.kb-zone-hd .z-dot { width: 11px; height: 11px; border-radius: 3px; background: var(--gold); flex: 0 0 auto; }
.kb-zone-hd .z-nm { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: .5px; }
.kb-zone-hd .z-n { font-size: 13px; font-weight: 700; color: #fff; background: var(--gold); border-radius: 9px; padding: 1px 9px; }
.kb-zone-hd .z-unit { font-size: 11.5px; color: var(--muted); }
.kb-zone-hd .z-desc { font-size: 12px; color: var(--muted); margin-left: 4px; }
.kb-zone.remind .kb-zone-hd .z-dot { background: var(--green); }
.kb-zone.remind .kb-zone-hd .z-n { background: var(--green); }

/* 一排：左侧类别栏（名称 / 件数 / 全部）+ 右侧横向卡面；同区内一排排并排铺开 */
.kb-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); gap: 12px; align-items: start; }
.kb-row {
  display: flex; align-items: stretch; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.kb-row.flash { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.kb-rail {
  flex: 0 0 128px; display: flex; flex-direction: column; gap: 6px; justify-content: center;
  padding-right: 12px; border-right: 1px dashed var(--line); cursor: pointer;
}
.kb-rail .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.kb-rail .nm { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.kb-rail .n { font-size: 11.5px; color: var(--muted); }
.kb-rail .n i { font-style: normal; margin-left: 1px; }
.kb-rail .go { font-size: 12px; color: var(--gold-deep); }
.kb-rail:hover .nm { color: var(--gold-deep); }
.kb-rail:hover .go { text-decoration: underline; }
.kb-zone.remind .kb-rail .dot { background: var(--green); }
.kb-row.alert .kb-rail .dot { background: var(--red); }
.kb-rowbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }

.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.kb-card {
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--gold);
  border-radius: 14px; padding: 14px 16px 13px; box-shadow: var(--shadow-sm);
  cursor: pointer; display: flex; flex-direction: column; gap: 9px;
  transition: transform .12s, border-color .15s, box-shadow .15s;
}
.kb-card.alert { border-top-color: var(--red); }
/* 提醒区改用青绿主色，和「待办」一眼区分 */
.kb-zone.remind .kb-card { border-top-color: var(--green); }
.kb-zone.remind .kb-card.alert { border-top-color: var(--red); }
.kb-zone.remind .kb-kind { color: var(--green); background: #eaf3ee; }
.kb-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--gold); }
.kb-card-hd { display: flex; align-items: center; gap: 8px; }
.kb-kind { font-size: 11px; letter-spacing: .5px; color: var(--gold-deep); background: var(--gold-soft); border-radius: 8px; padding: 1px 8px; white-space: nowrap; }
.kb-st { margin-left: auto; font-size: 11px; border-radius: 8px; padding: 1px 9px; background: #f1ece2; color: var(--muted); white-space: nowrap; }
.kb-title { font-size: 15.5px; font-weight: 600; color: var(--ink); line-height: 1.45; }
.kb-sub { font-size: 12px; color: var(--muted); line-height: 1.5; word-break: break-all; }
.kb-summary {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 12.5px; line-height: 1.5; color: var(--ink);
}
.kb-summary .kb-f { display: inline-flex; gap: 5px; min-width: 0; }
.kb-summary .kb-f.full { width: 100%; }
.kb-summary .kb-f .k { color: var(--muted); }
.kb-summary .kb-f .v { font-weight: 500; }
.kb-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px;
  background: #fdfbf6; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .25s ease, padding .25s ease, opacity .18s ease;
}
.kb-detail.open { padding: 10px 12px; max-height: 500px; opacity: 1; }
.kb-f { display: flex; gap: 6px; min-width: 0; font-size: 12.5px; line-height: 1.5; }
.kb-f.full { grid-column: 1 / -1; }
.kb-f .k { color: var(--muted); flex: 0 0 auto; }
.kb-f .v { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.kb-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 2px; }
.kb-acts button { font-size: 12.5px; padding: 6px 13px; }
.kb-toggle {
  background: none; border: none; color: var(--gold-deep); font-size: 12.5px; cursor: pointer;
  padding: 6px 2px; display: inline-flex; align-items: center; gap: 3px;
}
.kb-toggle::after { content: '▼'; font-size: 9px; opacity: .7; }
.kb-toggle.open::after { content: '▲'; }
.kb-toggle:hover { text-decoration: underline; }
.kb-go { margin-left: auto; background: none; border: none; color: var(--gold-deep); font-size: 12.5px; cursor: pointer; padding: 6px 2px; }
.kb-go:hover { text-decoration: underline; }
.kb-more {
  margin-top: 10px; background: none; border: 1px dashed var(--line); border-radius: 10px;
  color: var(--muted); font-size: 12.5px; padding: 8px 14px; cursor: pointer; width: 100%;
}
.kb-more:hover { border-color: var(--gold); color: var(--gold-deep); }
.ov-empty { color: var(--muted); font-size: 13px; padding: 14px 18px; }

/* 外部提货对接面板 */
.sec-t { font-size: 15px; font-weight: 700; color: var(--ink); margin: 20px 0 10px; letter-spacing: .5px; }
/* 外部提货订单表：用 #panel-extsync 提高优先级，压过后面通用 .grid th/td 规则
   （通用规则里有 padding 与 nth-child(4) nowrap，会把「兑换规格」撑到近 300px 导致整表溢出） */
#panel-extsync .ext-grid { min-width: 1000px; }
#panel-extsync .ext-grid th, #panel-extsync .ext-grid td { padding: 9px 8px; font-size: 13px; white-space: normal; }
/* 订单号/礼券编号/快递单号这些长串不换行，其余允许折行 */
#panel-extsync .ext-grid td:nth-child(1),
#panel-extsync .ext-grid td:nth-child(3),
#panel-extsync .ext-grid td:nth-child(7),
#panel-extsync .ext-grid .ext-acts { white-space: nowrap; }
.ext-acts { white-space: nowrap; }
.ext-acts button { margin: 0; }
.muted { color: var(--muted); font-size: 12.5px; }
.tag { font-size: 11px; padding: 2px 9px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-deep); border: 1px solid var(--gold-soft); white-space: nowrap; }

/* ---------- 列表 ---------- */
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 12px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.list .main { flex: 1; }
.list .title { font-size: 15px; color: var(--ink); }
.list .title.done { text-decoration: line-through; color: var(--muted); }
.list .meta { font-size: 12px; color: var(--muted); margin-top: 5px; }
.list .tag {
  font-size: 11px; padding: 2px 9px; border-radius: 10px; margin-right: 6px;
  background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold-soft);
}
.list button {
  background: transparent; border: 1px solid var(--gold); color: var(--gold);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  transition: background .15s, color .15s;
}
.list button:hover { background: var(--gold); color: #fff; }
.list button.del { border-color: var(--line); color: var(--muted); }
.list button.del:hover { background: var(--line); color: var(--ink); }

/* ---------- 客户关怀 ---------- */
#panel-care { max-width: 1080px; }
.care-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.care-side { position: sticky; top: 84px; }
.care-add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.care-add input {
  padding: 9px 11px; background: #fcfaf5; border: 1px solid var(--line);
  border-radius: 9px; font-size: 13px; color: var(--ink); min-width: 0; width: 100%;
}
.care-add input:focus { outline: none; border-color: var(--gold); }
.care-add input#cu-birthday { grid-column: 1 / -1; }
.care-add button {
  grid-column: 1 / -1; padding: 10px; background: var(--gold); color: #fff;
  border: none; border-radius: 9px; font-weight: 600; cursor: pointer; font-size: 14px;
}
.care-add button:hover { filter: brightness(1.05); }
.cu-list li { cursor: pointer; padding: 12px 14px; display: block; }
.cu-list li.active { border-color: var(--gold); background: #fffdf8; }
.cu-list li.hint { cursor: default; box-shadow: none; border-style: dashed; }
.cu-name { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.cu-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.lvl { font-size: 11px; padding: 1px 8px; border-radius: 9px; background: var(--gold-soft); color: var(--gold); }
.lvl-核心 { background: #f7e6d0; color: #b8791f; }
.lvl-会员 { background: #e6f0e8; color: var(--green); }
.care-main {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 24px; box-shadow: var(--shadow-sm); min-height: 420px;
}
.care-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.care-head h3 { margin: 0 0 8px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.care-meta { font-size: 12px; color: var(--muted); line-height: 1.7; }
.care-tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag2 { font-size: 11px; background: var(--gold-soft); color: var(--gold); padding: 2px 9px; border-radius: 9px; }
.care-note { font-size: 12px; color: var(--muted); margin-top: 6px; }
#care-analyze { white-space: nowrap; padding: 11px 18px; background: var(--gold); color: #fff; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 14px; }
#care-analyze:disabled { opacity: .6; cursor: default; }
.sec-title { font-size: 14px; margin: 20px 0 10px; color: var(--ink); }
.sec-title .cnt { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.care-cards { display: grid; gap: 12px; }
.care-card { border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 10px; padding: 14px 16px; background: #fffdf9; }
.care-card.lvl-b-高 { border-left-color: var(--red); }
.care-card.lvl-b-中 { border-left-color: var(--gold); }
.care-card.lvl-b-低 { border-left-color: var(--muted); }
.cc-top { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.cc-level { background: #f7e6d0; color: #b8791f; padding: 1px 8px; border-radius: 9px; }
.cc-status { margin-left: auto; padding: 1px 8px; border-radius: 9px; background: #f1ece2; }
.cc-status.ok { background: #e6f0e8; color: var(--green); }
.cc-action { font-size: 15px; font-weight: 600; margin: 10px 0 4px; }
.cc-summary { font-size: 13px; color: var(--ink); }
.cc-reason { font-size: 12px; color: var(--muted); margin-top: 6px; }
.cc-content { font-size: 13px; color: var(--ink); background: var(--gold-soft); border-radius: 8px; padding: 9px 12px; margin-top: 10px; }
.cc-foot { margin-top: 12px; }
.cc-foot button { padding: 8px 16px; background: var(--gold); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.done-tip { font-size: 12px; color: var(--green); }
.track-add { display: flex; gap: 8px; margin-bottom: 12px; }
.track-add select, .track-add input { padding: 9px 11px; background: #fcfaf5; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; color: var(--ink); }
.track-add input { flex: 1; min-width: 0; }
.track-add button { padding: 9px 16px; background: transparent; border: 1px solid var(--gold); color: var(--gold); border-radius: 9px; cursor: pointer; font-size: 13px; }
.track-add button:hover { background: var(--gold); color: #fff; }
.track-list { list-style: none; padding: 0; margin: 0; }
.track-list li { display: flex; gap: 12px; align-items: baseline; padding: 9px 2px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.tk-type { font-size: 11px; background: var(--gold-soft); color: var(--gold); padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.tk-content { flex: 1; }
.tk-time { font-size: 11px; color: var(--muted); }

/* ---------- 朋友圈文案 ---------- */
.mo-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 2px 18px; }
.mo-filter button { background: var(--panel); border: 1px solid var(--line); color: var(--muted); padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; transition: all .15s; }
.mo-filter button:hover { border-color: var(--gold); color: var(--gold); }
.mo-filter button.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.moments-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 640px) { .moments-grid { grid-template-columns: 1fr; } }
.mo-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.mo-card:hover { border-color: var(--gold); }
.mo-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mo-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.mo-occ { font-size: 11px; background: var(--gold-soft); color: var(--gold); padding: 2px 9px; border-radius: 9px; white-space: nowrap; }
.mo-body { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; line-height: 1.75; color: var(--ink); background: #fcfaf5; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; flex: 1; font-family: inherit; }
.mo-foot { display: flex; gap: 8px; margin-top: 14px; }
.mo-foot button { padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; border: 1px solid var(--gold); background: var(--gold); color: #fff; transition: filter .15s; }
.mo-foot button:hover { filter: brightness(1.05); }
.mo-foot button.mo-fav { background: transparent; color: var(--gold); }
.mo-foot button.mo-fav:hover { background: var(--gold-soft); }
.mo-foot button.del { border-color: var(--line); color: var(--muted); background: transparent; }
.mo-foot button.del:hover { background: var(--line); color: var(--ink); }

@media (max-width: 860px) {
  .care-layout { grid-template-columns: 1fr; }
  .care-side { position: static; }
}

/* 经营看板（旧 db 卡片，保留备用） */
.db-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 8px 0 4px; }
.db-card { background: #fffaf0; border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.db-val { font-size: 28px; font-weight: 700; color: var(--gold); }
.db-label { font-size: 13px; color: var(--ink); margin-top: 4px; }
.db-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* 通用表格 */
.grid { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; }
.grid th { background: #f7f2e6; color: var(--muted); font-weight: 600; white-space: nowrap; }
.grid td.low { color: #c0392b; font-weight: 700; }
.grid td:nth-child(2), .grid td:nth-child(4) { white-space: nowrap; }
.grid .del { border-color: var(--line); color: var(--muted); padding: 3px 10px; margin-left: 4px; }
.grid button { padding: 3px 10px; margin-right: 4px; white-space: nowrap; }

/* 提货卡 Excel 导入 */
.form-row button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.form-row button.ghost:hover { border-color: var(--gold); color: var(--gold); filter: none; }
.imp-row input[type="file"] { padding: 8px 10px; font-size: 13px; line-height: 1.5; }
.imp-result { margin: 4px 0 20px; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: 14px 18px; background: #fffdf9; font-size: 13px; }
.imp-result.err { border-left-color: var(--red); }
.imp-sum { display: flex; gap: 22px; flex-wrap: wrap; }
.imp-sum span { color: var(--muted); font-size: 12px; }
.imp-sum b { display: block; font-size: 20px; color: var(--gold); }
.imp-sum b.zero { color: var(--muted); }
.imp-note { color: var(--muted); font-size: 12px; margin-top: 10px; line-height: 1.7; }
.imp-err { margin-top: 12px; max-height: 240px; overflow: auto; border-top: 1px dashed var(--line); padding-top: 10px; }
.imp-err table { width: 100%; border-collapse: collapse; font-size: 12px; }
.imp-err th, .imp-err td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.imp-err th { color: var(--muted); background: #f7f2e6; font-weight: 600; }
.imp-err td.imp-code { font-family: ui-monospace, Consolas, monospace; }
.imp-tip { color: var(--muted); font-size: 12px; margin: 6px 2px 0; }

/* 提货卡核销：券码信息卡 */
.card-info { margin-top: 12px; padding: 14px 16px; background: #fffdf8; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 10px; }
.ci-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ci-head b { font-size: 16px; letter-spacing: .5px; }
.ci-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); }
.ci-tag.muted { background: #eee8dc; color: var(--muted); }
.ci-line { font-size: 13px; margin: 4px 0; line-height: 1.7; }
.ci-line b { color: var(--ink); }
.ci-pick { margin: 10px 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ci-pick label { font-size: 13px; color: var(--muted); }
.ci-pick select, .ci-pick input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; min-width: 240px; font-family: inherit; }
.ci-act { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ci-act label { font-size: 12px; color: var(--muted); }
.ci-act input { width: 72px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; }
.ci-act button { padding: 9px 18px; border-radius: 8px; }

/* 线上提货：申请列表 / 二维码弹窗 */
.inline-hint { color: var(--muted); font-size: 12px; align-self: center; }
.tiny { font-size: 11px; color: var(--muted); }
.cl-acts { white-space: nowrap; }
.cl-acts button { padding: 4px 10px; margin-right: 4px; font-size: 12.5px; border-radius: 7px; }
.grid td .ghost, .grid td .primary { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.st { font-size: 11.5px; padding: 2px 9px; border-radius: 10px; background: #f0ece3; color: var(--muted); }
.st-wait { background: #fdf1dc; color: #b3801f; }
.st-ok { background: #e8f1ec; color: var(--green); }
.st-ship { background: #e7eef7; color: #4a6fa5; }
.st-done { background: #ece9e2; color: #6b6355; }
.st-no { background: #fbecec; color: var(--red); }
.st-exp { background: #fdf1dc; color: #b3801f; }

/* ---------- 发票：方向与往来单位 ---------- */
/* 方向徽章：销项＝开出（红）／进项＝收到（绿） */
.dir { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.dir-out { background: #fbecec; color: var(--red); }
.dir-in  { background: #e8f1ec; color: var(--green); }
/* 往来单位列：金色（表头仍为常规色，只让内容醒目） */
.iv-party { color: var(--gold-deep); font-weight: 600; }
.iv-out { color: var(--red); font-weight: 600; }
.iv-in  { color: var(--green); font-weight: 600; }
/* 往来单位快捷填入（我方开票 / 收票主体） */
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 2px; }
.chip-tip { font-size: 12px; color: var(--muted); }
.chip-row .chip {
  padding: 5px 11px; font-size: 12px; line-height: 1.4; cursor: pointer;
  background: var(--gold-soft); border: 1px solid var(--line); border-radius: 999px;
  color: var(--gold-deep); font-weight: 500; transition: background .15s, border-color .15s;
}
.chip-row .chip:hover { background: #efe3cb; border-color: var(--gold); }
/* 弹窗内：往来单位的标签用金色标示（输入框内文字仍为深色，便于录入） */
.im-form label.iv-lb { color: var(--gold-deep); font-weight: 600; }
.im-form input#iv-f-title { color: var(--ink); }
/* 方向下拉：选中即变色（销项红 / 进项绿），与表格徽章同口径 */
.form-row select.dir-out { color: var(--red); font-weight: 600; }
.form-row select.dir-in { color: var(--green); font-weight: 600; }

/* ---------- 发票：上传原件自动识别 ---------- */
.iv-up { border: 1px dashed var(--gold); border-radius: 10px; background: #fdf8ee; padding: 10px 12px; margin-bottom: 12px; }
.iv-up-lb { display: block; cursor: pointer; }
.iv-up-t { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.iv-up-s { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.iv-up input[type=file] { display: none; }   /* 原生「Choose File」是英文，换成下面的自定义按钮 */
.iv-up-btn {
  display: inline-block; vertical-align: middle; margin-top: 10px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; color: #fff;
  background: var(--gold); border-radius: 8px;
}
.iv-up-lb:hover .iv-up-btn { background: var(--gold-deep); }
.iv-up-fn { display: inline-block; vertical-align: middle; margin-left: 10px; font-size: 12.5px; color: var(--muted); word-break: break-all; }
.iv-up .file-tip { margin-top: 9px; }
/* 票据种类选项文字长，给它多一点宽度，免得「电子发票（普通发票）」被截断 */
#iv-modal .form-row select#iv-f-invoice_type { flex: 1.4; min-width: 0; }
/* 识别填入的字段闪一下金光，便于分辨哪些是自动来的 */
@keyframes ivHit {
  0%   { background: #fdf1d6; border-color: var(--gold); }
  100% { background: #fff; border-color: var(--line); }
}
.iv-hit { animation: ivHit 1.4s ease-out 2; }
.iv-raw { margin-top: 9px; }
.iv-raw summary { font-size: 12.5px; color: var(--muted); cursor: pointer; }
.iv-raw pre {
  max-height: 190px; overflow: auto; white-space: pre-wrap; word-break: break-all;
  font-size: 12px; line-height: 1.6; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0 0;
}

/* ---------- 宽表：横向可滑，短列不折行 ---------- */
/* 发票 / 合同列数多，窄屏（手机）会挤到看不清；用滚动容器兜住，绝不撑破页面。 */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.iv-grid { min-width: 820px; }
.ct-grid { min-width: 1000px; }
/* 短列一律不折行；名称 / 对方（长文本）允许折行，避免把其它列挤扁 */
.tbl-wrap .ct-grid th, .tbl-wrap .ct-grid td { white-space: nowrap; }
.tbl-wrap .ct-grid td:nth-child(2), .tbl-wrap .ct-grid td:nth-child(4) { white-space: normal; min-width: 110px; }
.grid .st { white-space: nowrap; }
.grid td .tiny { white-space: nowrap; }

/* ---------- 合同法律风险标签（高 / 中 / 低 / 未审） ---------- */
.risk { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }
.risk-hi { background: #fbe1db; color: #b3402a; font-weight: 600; }
.risk-mid { background: #fdf1dc; color: #b3801f; font-weight: 600; }
.risk-lo { background: #eef1e8; color: #66744f; }
.risk-none { background: #f0ece3; color: var(--muted); }

/* 合同弹窗：全文输入 + 原件上传 */
.im-form textarea#ct-f-text {
  width: 100%; padding: 10px 12px; font-size: 13px; color: var(--ink); font-family: inherit;
  border: 1px solid var(--line); border-radius: 9px; background: #fdfbf6; line-height: 1.75; resize: vertical;
}
.im-form textarea#ct-f-text:focus { outline: none; border-color: var(--gold); background: #fff; }
.im-form input#ct-f-file {
  width: 100%; padding: 8px 10px; font-size: 12.5px; color: var(--muted);
  background: #fdfbf6; border: 1px solid var(--line); border-radius: 9px;
}
.file-tip {
  font-size: 12.5px; line-height: 1.75; color: var(--muted); background: #faf7f0;
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 9px; padding: 9px 12px; word-break: break-word;
}
.file-tip.warn { border-left-color: #d9a441; background: #fdf9ef; }
.file-tip.err { border-left-color: var(--red); background: #fdf2f0; color: #7a3a30; }
.file-tip a { color: var(--gold-deep); }
.modal-ft button { padding: 10px 22px; border-radius: 9px; font-size: 14px; }
.modal-ft button:disabled { opacity: .6; cursor: default; }

/* ---------- 合同法律审查结果弹窗 ---------- */
#ct-rev-modal .modal-box { width: 680px; }
.rev-head { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; background: #faf7f0; }
.rev-head .rev-lv { font-size: 15px; font-weight: 700; letter-spacing: .5px; color: var(--ink); }
.rev-head .rev-sum { font-size: 13px; line-height: 1.8; color: var(--ink); margin-top: 6px; }
.rev-head .rev-meta { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.rev-head.rev-hi { background: #fdf2f0; border-color: #f2d6ce; }
.rev-head.rev-hi .rev-lv { color: #b3402a; }
.rev-head.rev-mid { background: #fdf9ef; border-color: #f0e3c6; }
.rev-head.rev-mid .rev-lv { color: #b3801f; }
.rev-head.rev-lo { background: #f6f8f2; border-color: #e2e6d8; }
.rev-head.rev-lo .rev-lv { color: #66744f; }
.rev-head.rev-none { background: #f3f7f4; border-color: #dde7e0; }
.rev-head.rev-none .rev-lv { color: var(--green); }
.rev-sec { margin-bottom: 20px; }
.rev-sec-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rev-cnt { font-size: 12px; color: var(--muted); }
.rev-item {
  border: 1px solid var(--line); border-left: 3px solid var(--muted);
  border-radius: 10px; padding: 11px 13px; margin-bottom: 9px; background: #fff;
}
.rev-item.rev-hi { border-left-color: #c9503a; }
.rev-item.rev-mid { border-left-color: #d9a441; }
.rev-item.rev-lo { border-left-color: #8a9a6b; }
.rev-cat { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.rev-clause {
  font-size: 12px; line-height: 1.75; color: var(--muted); background: #faf7f0;
  border-radius: 7px; padding: 7px 10px; margin-bottom: 8px; word-break: break-word;
}
.rev-clause.muted { font-style: italic; background: transparent; padding: 0 0 8px; }
.rev-sug { font-size: 12.5px; line-height: 1.85; color: var(--ink); }
.rev-sug b { color: var(--gold-deep); }

.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(47, 42, 36, .38); padding: 20px; }
.modal-box { width: 380px; max-width: 100%; max-height: 88vh; overflow: auto; background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.modal-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-hd b { font-size: 14px; letter-spacing: .5px; min-width: 0; }
.modal-hd .ghost { flex: 0 0 auto; white-space: nowrap; }
.modal-body { padding: 18px; }
.qr-wrap { text-align: center; margin-bottom: 12px; }
.qr-wrap svg { width: 200px; height: 200px; }
.qr-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; border-top: 1px dashed var(--line); }
.qr-line span { color: var(--muted); }
.qr-url { margin: 10px 0 12px; padding: 9px 11px; background: #faf7f0; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; color: var(--muted); word-break: break-all; }
.qr-act { display: flex; gap: 8px; flex-wrap: wrap; }
.qr-act button { padding: 9px 14px; border-radius: 9px; font-size: 13px; }

/* 商品图文资料弹窗 */
.modal-box.wide { width: 560px; }
.modal-ft { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.im-form { display: flex; flex-direction: column; gap: 12px; }
.im-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.im-form input#im-name, .im-form input#im-spec, .im-form input#im-image, .im-form textarea#im-desc { width: 100%; padding: 10px 12px; font-size: 13.5px; color: var(--ink); font-family: inherit; border: 1px solid var(--line); border-radius: 9px; background: #fdfbf6; }
.im-form textarea { resize: vertical; line-height: 1.7; }
.im-form input#im-name:focus, .im-form input#im-spec:focus, .im-form input#im-image:focus, .im-form textarea:focus { outline: none; border-color: var(--gold); background: #fff; }
.im-form .form-row input[type="file"] { flex: 1; padding: 8px 10px; background: #fdfbf6; }
.im-preview { display: flex; gap: 10px; flex-wrap: wrap; }
.im-preview .pv { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #f7f2e6; }
.im-preview .pv img { display: block; width: 100%; height: 100%; object-fit: cover; }
.im-preview .pv b { position: absolute; left: 0; bottom: 0; right: 0; text-align: center; font-size: 10px; background: rgba(47, 42, 36, .6); color: #fff; font-weight: 500; padding: 2px 0; }
.im-preview .pv.empty img { display: none; }
.im-preview .pv.empty::after { content: '无图'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #c9bda6; font-size: 12px; }
.grid td .thumb { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #f7f2e6; display: flex; align-items: center; justify-content: center; color: #c9bda6; font-size: 11px; }
.grid td .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* 商品资料：官网茶礼关联 */
.off-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--gold-soft, #f6efdd); color: #8a6f2f; border: 1px solid #eadfc6; }
.off-a { font-size: 12px; color: var(--gold, #b08a3e); text-decoration: none; white-space: nowrap; }
.off-a:hover { text-decoration: underline; }
.off-box { border: 1px solid #eadfc6; background: #fbf7ec; border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.off-hd { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.off-hd b { font-size: 14.5px; }
.off-series { font-size: 11.5px; letter-spacing: .5px; color: #8a6f2f; border: 1px solid currentColor; border-radius: 999px; padding: 0 8px; }
.off-tag { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.off-kv { display: flex; gap: 10px; padding: 5px 0; border-top: 1px dashed var(--line); }
.off-kv span { color: var(--muted); flex: 0 0 74px; }
.off-kv b { font-weight: 500; }
.off-desc { margin-top: 8px; line-height: 1.75; color: var(--ink); }
.off-foot { margin-top: 10px; }
.off-foot a { color: var(--gold, #b08a3e); font-size: 12.5px; text-decoration: none; }
.off-foot a:hover { text-decoration: underline; }
.off-img { display: block; margin-top: 10px; width: 100%; max-width: 220px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

/* ---- 官网产品库（商品资料 → 从官网取用 / 转发到微信） ---- */
.off-lib { display: flex; flex-direction: column; gap: 18px; margin-top: 6px; }
.off-grp-hd { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.off-grp-hd b { font-size: 13.5px; letter-spacing: .5px; }
.off-idx { font-size: 11px; color: #fff; background: var(--gold, #b08a3e); border-radius: 999px; padding: 1px 7px; }
.off-en { font-size: 10.5px; letter-spacing: 1.4px; color: #c9bda6; text-transform: uppercase; }
.off-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 12px; }
.off-card { display: flex; flex-direction: column; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.off-card.joined { background: #fdfbf6; }
.off-thumb { width: 100%; height: 112px; border-radius: 9px; overflow: hidden; background: #f7f2e6; display: flex; align-items: center; justify-content: center; color: #c9bda6; font-size: 12px; }
.off-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.off-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.off-nm { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.off-mt { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.off-sp { font-size: 11.5px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.off-pr { font-size: 12.5px; color: #8a6f2f; }
.off-acts { display: flex; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.off-acts button { font-size: 12.5px; padding: 6px 11px; }
.off-joined { font-size: 12px; color: #6f8f5f; }
@media (max-width: 860px) { .off-cards { grid-template-columns: 1fr; } }

/* ---- 转发到微信（话术 + 链接 + 二维码） ---- */
#share-modal .modal-box { width: 600px; }
.share-grid { display: grid; grid-template-columns: 1fr 232px; gap: 18px; }
.share-lb { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.share-left textarea#share-text { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 13.5px; line-height: 1.75; color: var(--ink); font-family: inherit; border: 1px solid var(--line); border-radius: 9px; background: #fdfbf6; resize: vertical; }
.share-left textarea#share-text:focus { outline: none; border-color: var(--gold); background: #fff; }
.share-left .form-row { margin-top: 10px; }
.share-right { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.share-qr { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 8px; box-sizing: border-box; text-align: center; }
.share-qr img, .share-qr svg { width: 100%; height: 100%; display: block; }
.share-right .hint { margin: 0; text-align: center; font-size: 12px; }
.share-dl { width: 200px; padding: 9px 12px; font-size: 13px; }
.share-dl[disabled] { opacity: .6; cursor: default; }
@media (max-width: 720px) {
  .share-grid { grid-template-columns: 1fr; }
  .share-qr { width: 168px; height: 168px; }
  .share-dl { width: 168px; }
}

/* 折叠区（进销存 · 预留） */
.fold { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fdfbf6; overflow: hidden; }
.fold > summary { cursor: pointer; padding: 12px 14px; font-size: 13.5px; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 8px; user-select: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: '▸'; color: var(--gold, #b08a3e); font-size: 12px; transition: transform .15s; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold[open] > summary { border-bottom: 1px solid var(--line); background: #fff; }
.fold-body { padding: 14px; }
.fold .sec-title { margin-top: 4px; }

/* ---------- 响应式：窄屏侧栏转顶部横滑 ---------- */
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 6px; padding: 8px 10px;
    border-right: none; border-bottom: 1px solid var(--line); overflow-x: auto;
  }
  .side-brand { display: none; }
  .side-nav { flex-direction: row; padding: 0; gap: 4px; overflow-x: auto; }
  .nav { flex: 0 0 auto; padding: 9px 12px; }
  .nav span { flex: none; }
  .side-foot { display: none; }
  .panels { padding: 18px 14px 56px; }
  .topbar { padding: 12px 16px; }
  /* 看板：手机端分区概况改单列，「一排」改上下结构（类别栏横过来），卡面一列铺满 */
  .kb-zonecards { grid-template-columns: 1fr; gap: 10px; }
  .kb-zone-hd .z-desc { display: none; }
  .kb-rows { grid-template-columns: 1fr; gap: 10px; }
  .kb-row { flex-direction: column; gap: 10px; padding: 12px; }
  .kb-rail {
    flex: none; flex-direction: row; align-items: center; gap: 8px; justify-content: flex-start;
    padding: 0 0 9px; border-right: none; border-bottom: 1px dashed var(--line);
  }
  .kb-rail .go { margin-left: auto; }
  .kb-rail .n { margin-left: -2px; }
  .kb-grid { grid-template-columns: 1fr; }
  .kb-fields { grid-template-columns: 1fr; }
  .kb-chip { padding: 5px 11px; }
  .kb-chip .c-l { font-size: 12px; }
  .ov-metrics { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ov-metric { padding: 10px 8px; }
  .ov-metric .v { font-size: 19px; }
  .ov-metric .l { font-size: 11px; }
}
