/* ===================== 变量与基础 ===================== */
:root{
  --bg: #f5f3ef;
  --bg-soft: #efece6;
  --panel: #ffffff;
  --panel-2: #fbfaf8;
  --line: #e7e3db;
  --line-strong: #d8d3c8;
  --text: #1c1b19;
  --text-2: #6f6a62;
  --text-3: #9b958b;
  --brand: #ff6b3d;
  --brand-strong: #e8501f;
  --brand-soft: #fff1eb;
  --green: #10a86f;
  --green-soft: #e8f8f1;
  --amber: #e08a00;
  --amber-soft: #fdf3e2;
  --blue: #2f7fe0;
  --blue-soft: #ecf3fe;
  --purple: #8256d0;
  --purple-soft: #f3eefc;
  --gray: #9ca3af;
  --gray-soft: #f1f0ed;
  --red: #e0483a;
  --red-soft: #fdeceb;
  --shadow-sm: 0 1px 2px rgba(28,27,25,.05);
  --shadow: 0 1px 2px rgba(28,27,25,.04), 0 10px 28px -16px rgba(28,27,25,.22);
  --shadow-lg: 0 24px 60px -20px rgba(28,27,25,.3);
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}
[data-theme="dark"]{
  --bg: #16151a;
  --bg-soft: #1d1c22;
  --panel: #211f27;
  --panel-2: #26242d;
  --line: #322f3a;
  --line-strong: #423e4c;
  --text: #f2efe9;
  --text-2: #a9a3b2;
  --text-3: #7d778a;
  --brand: #ff7d52;
  --brand-strong: #ff6337;
  --brand-soft: #3a2419;
  --green: #35c48c;
  --green-soft: #16302a;
  --amber: #f0a93c;
  --amber-soft: #352a16;
  --blue: #6ba4f0;
  --blue-soft: #1b2740;
  --purple: #a583e8;
  --purple-soft: #271f3b;
  --gray: #8b8598;
  --gray-soft: #2b2833;
  --red: #f0685a;
  --red-soft: #3b1f1e;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -18px rgba(0,0,0,.7);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.6;
}
h1,h2,h3,h4,p{ margin: 0; }
button{ font-family: inherit; cursor: pointer; }
input, select, textarea{ font-family: inherit; }
::selection{ background: var(--brand); color: #fff; }

/* 滚动条 */
::-webkit-scrollbar{ width: 9px; height: 9px; }
::-webkit-scrollbar-thumb{ background: var(--line-strong); border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track{ background: transparent; }

/* ===================== 布局 ===================== */
.app{ display: flex; height: 100vh; overflow: hidden; }

.sidebar{
  width: 232px;
  flex: 0 0 232px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  gap: 18px;
}
.brand{ display: flex; align-items: center; gap: 10px; padding: 2px 4px 0; }
.brand-mark{
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(140deg, #ff8a5c, #f0491a);
  color: #fff; display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 6px 14px -7px rgba(240,73,26,.55);
}
.brand-mark svg{ width: 20px; height: 20px; }
.brand-mark img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-text{ display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong{ font-size: 15px; letter-spacing: .2px; }
.brand-text span{ font-size: 10.5px; color: var(--text-3); letter-spacing: .9px; text-transform: uppercase; }

.nav{ display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item{
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--r-sm);
  background: transparent; border: 0; color: var(--text-2);
  font-size: 13.5px; font-weight: 500; text-align: left;
  transition: background .15s, color .15s; position: relative;
}
.nav-item svg{ width: 17px; height: 17px; opacity: .85; flex: 0 0 17px; }
.nav-item:hover{ background: var(--bg-soft); color: var(--text); }
.nav-item.is-active{ background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.nav-item.is-active svg{ opacity: 1; }
.nav-badge{
  margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--brand); color: #fff; display: grid; place-items: center;
}

.side-foot{ display: flex; flex-direction: column; gap: 8px; }
.side-tip{
  background: var(--bg-soft); border-radius: var(--r-sm); padding: 10px 11px;
  font-size: 11.5px; color: var(--text-3); line-height: 1.55;
}
.side-tip b{ color: var(--text-2); font-size: 12px; display: block; margin-bottom: 2px; }
.side-mini{
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--text-2); font-size: 12.5px;
}
.side-mini svg{ width: 15px; height: 15px; }
.side-mini:hover{ border-color: var(--line-strong); color: var(--text); }

.main{ flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar{
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 28px 16px; flex: 0 0 auto;
}
.topbar-left h1{ font-size: 21px; font-weight: 700; letter-spacing: -.2px; }
.topbar-left p{ font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.topbar-right{ display: flex; gap: 9px; align-items: center; }

.content{ flex: 1; overflow-y: auto; padding: 4px 28px 40px; }

/* ===================== 按钮 ===================== */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid transparent; font-size: 13px; font-weight: 600;
  transition: .15s; white-space: nowrap;
}
.btn svg{ width: 15px; height: 15px; }
.btn-primary{ background: var(--brand); color: #fff; box-shadow: 0 6px 14px -8px rgba(240,73,26,.9); }
.btn-primary:hover{ background: var(--brand-strong); transform: translateY(-1px); }
.btn-ghost{ background: var(--panel); border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover{ border-color: var(--line-strong); color: var(--text); background: var(--panel-2); }
.btn-danger{ background: var(--red); color: #fff; }
.btn-danger:hover{ filter: brightness(.94); }
.btn-danger-ghost{ background: transparent; color: var(--red); border-color: transparent; }
.btn-danger-ghost:hover{ background: var(--red-soft); }
.btn-sm{ height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-icon span{ display: inline; }
.icon-btn{
  width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent;
  color: var(--text-3); display: grid; place-items: center;
}
.icon-btn svg{ width: 17px; height: 17px; }
.icon-btn:hover{ background: var(--bg-soft); color: var(--text); }

/* ===================== 通用卡片 ===================== */
.card{
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-head{
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 10px; gap: 10px;
}
.card-head h3{ font-size: 14px; font-weight: 700; letter-spacing: -.1px; }
.card-head .sub{ font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.card-body{ padding: 4px 18px 18px; }

/* ===================== 工作台 ===================== */
.kpi-grid{ display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.kpi{
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px 16px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.kpi-label{ font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.kpi-value{ font-size: 25px; font-weight: 700; letter-spacing: -.6px; margin-top: 6px; line-height: 1.15; }
.kpi-value small{ font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 2px; }
.kpi-note{ font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.kpi-accent{ background: linear-gradient(150deg, #ff7d52, #ef4a1b); border-color: transparent; color: #fff; }
.kpi-accent .kpi-label, .kpi-accent .kpi-note, .kpi-accent .kpi-value small{ color: rgba(255,255,255,.82); }
.kpi-accent .kpi-note b{ color: #fff; }

.dash-grid{ display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: 14px; align-items: start; }
.stack{ display: flex; flex-direction: column; gap: 14px; }

/* 提醒条 */
.alert-bar{
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent);
  border-radius: var(--r); margin-bottom: 14px; color: var(--text);
}
.alert-bar .dot{
  width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: 0 0 8px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 20%, transparent);
}
.alert-bar p{ font-size: 12.8px; flex: 1; }
.alert-bar b{ color: var(--amber); }

/* 待办清单 */
.todo-item{
  display: flex; align-items: center; gap: 11px; padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.todo-item:last-child{ border-bottom: 0; }
.tick{
  width: 19px; height: 19px; border-radius: 6px; border: 1.6px solid var(--line-strong);
  flex: 0 0 19px; display: grid; place-items: center; background: transparent; color: transparent;
  transition: .15s;
}
.tick svg{ width: 12px; height: 12px; }
.tick:hover{ border-color: var(--brand); }
.tick.on{ background: var(--green); border-color: var(--green); color: #fff; }
.todo-main{ flex: 1; min-width: 0; }
.todo-main b{ display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-main span{ font-size: 11.5px; color: var(--text-3); }
.todo-amt{ font-size: 13px; font-weight: 700; font-feature-settings: "tnum"; }

/* 时间线 */
.tl{ position: relative; padding-left: 18px; }
.tl::before{ content: ""; position: absolute; left: 4.5px; top: 6px; bottom: 6px; width: 1.5px; background: var(--line); }
.tl-item{ position: relative; padding: 0 0 16px; }
.tl-item:last-child{ padding-bottom: 0; }
.tl-item::before{
  content: ""; position: absolute; left: -17.5px; top: 6px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--panel); border: 2px solid var(--line-strong);
}
.tl-item.now::before{ border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.tl-date{ font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: .3px; }
.tl-title{ font-size: 13px; font-weight: 600; margin-top: 1px; }
.tl-meta{ font-size: 11.5px; color: var(--text-3); }

/* ===================== 优惠券式列表 ===================== */
.filters{ display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.search-box{
  display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; flex: 1; min-width: 180px;
}
.search-box svg{ width: 15px; height: 15px; color: var(--text-3); flex: 0 0 15px; }
.search-box input{ border: 0; outline: 0; background: transparent; font-size: 13px; width: 100%; color: var(--text); }
.filters .btn-fil{ height: 36px; padding: 0 12px; }
.seg{
  display: flex; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 3px; gap: 2px; overflow-x: auto;
}
.seg button{
  border: 0; background: transparent; padding: 0 11px; height: 28px; border-radius: 7px;
  font-size: 12.5px; color: var(--text-2); font-weight: 500; white-space: nowrap;
}
.seg button.on{ background: var(--text); color: var(--panel); font-weight: 600; }
select.plain{
  height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text-2); padding: 0 8px; font-size: 12.5px; outline: 0;
}

.order-list{ display: flex; flex-direction: column; gap: 9px; }
.order{
  display: grid; grid-template-columns: 62px minmax(0,1fr) auto; gap: 4px 14px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: .16s; position: relative; overflow: hidden;
}
.order:hover{ border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.order.is-done{ opacity: .68; }
.order.is-cancel{ opacity: .45; }
.order::before{
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--st, var(--line-strong));
}
.o-date{
  text-align: center; border-right: 1px dashed var(--line); padding-right: 12px;
  grid-row: 1 / span 2; align-self: stretch;
  display: flex; flex-direction: column; justify-content: center;
}
.o-date b{ display: block; font-size: 17px; font-weight: 700; letter-spacing: -.5px; line-height: 1.2; }
.o-date span{ font-size: 10.5px; color: var(--text-3); }
.o-date i{ display: block; font-size: 10px; font-style: normal; color: var(--text-3); margin-top: 2px; }
.o-main{ min-width: 0; }
.o-title{ display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.o-title b{ font-size: 14px; font-weight: 650; }
/* V5.39：店名和星标绑成一个整体（.o-name）。
   星标必须跟着店名跑，不能因为店名长短飘到右边去。 */
.o-name{ display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.o-name b{ min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* V5.37：徽标打包成一组。
   以前每个徽标都是 .o-title 的直接子元素，换行时会「一个徽标掉到下一行」，
   剩下一个孤零零挂着（比如只剩「待回填 1」）。包一层之后，
   要换行就是整组一起下去，不会散。 */
.o-tags{ display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.o-sub{ font-size: 11.8px; color: var(--text-3); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.o-sub em{ font-style: normal; display: inline-flex; align-items: center; gap: 3px; }
.o-right{ text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.o-amt{ font-size: 16px; font-weight: 700; font-feature-settings: "tnum"; letter-spacing: -.3px; }
.o-amt small{ font-size: 11px; font-weight: 500; color: var(--text-3); }

.tag{
  font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
  background: var(--gray-soft); color: var(--gray); white-space: nowrap;
}
.tag.blue{ background: var(--blue-soft); color: var(--blue); }
.tag.purple{ background: var(--purple-soft); color: var(--purple); }
.tag.amber{ background: var(--amber-soft); color: var(--amber); }
.tag.green{ background: var(--green-soft); color: var(--green); }
.tag.gray{ background: var(--gray-soft); color: var(--gray); }
.tag.brand{ background: var(--brand-soft); color: var(--brand-strong); }
.star{ color: var(--amber); display: inline-flex; }
.star svg{ width: 13px; height: 13px; fill: currentColor; stroke: none; }

.empty{
  text-align: center; padding: 54px 20px; color: var(--text-3);
}
.empty svg{ width: 42px; height: 42px; opacity: .35; margin-bottom: 10px; }
.empty b{ display: block; color: var(--text-2); font-size: 14px; margin-bottom: 4px; }
.empty p{ font-size: 12.5px; }

/* ===================== 日历 ===================== */
.cal-head{ display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-title{ font-size: 16px; font-weight: 700; min-width: 120px; }
.cal-grid{ display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.cal-dow{ text-align: center; font-size: 11.5px; color: var(--text-3); font-weight: 600; padding-bottom: 2px; }
.cal-cell{
  min-height: 84px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 11px; padding: 7px 8px; display: flex; flex-direction: column; gap: 3px;
  cursor: pointer; transition: .15s; position: relative; align-items: stretch;
}
.cal-cell:hover{ border-color: var(--brand); }
.cal-cell.other{ opacity: .38; background: transparent; }
.cal-cell.today{ border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.cal-cell .dn{ font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.cal-cell.today .dn{ color: var(--brand-strong); }
.cal-ev{
  font-size: 10.5px; padding: 2px 6px; border-radius: 5px; background: var(--brand-soft);
  color: var(--brand-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 600; width: 100%; border-left: 2px solid currentColor;
}
.cal-ev.paid{ background: var(--green-soft); color: var(--green); }
.cal-ev.done{ background: var(--gray-soft); color: var(--text-3); text-decoration: line-through; }

/* ===================== 统计 ===================== */
.chart-wrap{ padding: 6px 4px 0; }
.bars{ display: flex; align-items: flex-end; gap: 8px; height: 190px; padding: 0 2px; }
.bar-col{ flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar{
  width: 100%; max-width: 46px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 85%, #fff), var(--brand));
  min-height: 3px; position: relative; transition: .2s; cursor: default;
}
.bar:hover{ filter: brightness(1.06); }
.bar.zero{ background: var(--line); }
.bar-val{ font-size: 10px; color: var(--text-3); font-weight: 600; height: 13px; }
.bar-lab{ font-size: 10.5px; color: var(--text-3); }
.bar-col.cur .bar-lab{ color: var(--brand-strong); font-weight: 700; }

.dist-row{ display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.dist-row .nm{ font-size: 12.5px; width: 74px; color: var(--text-2); flex: 0 0 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-track{ flex: 1; height: 8px; border-radius: 5px; background: var(--bg-soft); overflow: hidden; }
.dist-fill{ height: 100%; border-radius: 5px; background: var(--brand); }
.dist-row .vl{ font-size: 12px; font-weight: 600; width: 56px; text-align: right; font-feature-settings: "tnum"; flex: 0 0 56px; }

.rank{ display: flex; flex-direction: column; }
.rank-item{ display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rank-item:last-child{ border: 0; }
.rank-no{
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; background: var(--bg-soft); color: var(--text-3);
}
.rank-item:nth-child(1) .rank-no{ background: var(--brand); color: #fff; }
.rank-item:nth-child(2) .rank-no{ background: var(--amber); color: #fff; }
.rank-item:nth-child(3) .rank-no{ background: var(--purple); color: #fff; }
.rank-nm{ flex: 1; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-vl{ font-size: 13px; font-weight: 700; font-feature-settings: "tnum"; }

/* ===================== 档案 ===================== */
.profile-grid{ display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.pf-head{
  display: flex; align-items: center; gap: 14px; padding: 20px;
  background: linear-gradient(140deg, var(--panel), var(--panel-2));
}
.avatar{
  width: 62px; height: 62px; border-radius: 20px; flex: 0 0 62px;
  background: linear-gradient(150deg, #ff8a5c, #ef4a1b); color: #fff;
  display: grid; place-items: center; font-size: 24px; font-weight: 700;
  box-shadow: 0 10px 20px -12px rgba(239,74,27,.9);
}
.pf-head h2{ font-size: 19px; font-weight: 700; }
.pf-head p{ font-size: 12.5px; color: var(--text-3); }
.pf-stats{ display: flex; gap: 18px; padding: 0 20px 18px; }
.pf-stat b{ font-size: 18px; font-weight: 700; display: block; letter-spacing: -.4px; }
.pf-stat span{ font-size: 11.5px; color: var(--text-3); }

.plat{ display: flex; align-items: flex-start; gap: 11px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.plat:last-child{ border: 0; }
/* V5.15：「编辑」按钮固定一列、顶部对齐。
   以前它跟着每行内容高度走 —— 三个平台放一起，按钮高低不齐，看着像没对齐。 */
.plat-edit{ flex: 0 0 auto; width: 52px; margin-left: auto; }
.plat-ico{
  width: 34px; height: 34px; border-radius: 11px; flex: 0 0 34px; display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 700;
}
.plat-ico.xhs{ background: #ff2e4d; }
.plat-ico.dy{ background: #161823; }
.plat-ico.dp{ background: #ff8a00; }
.plat-main{ flex: 1; min-width: 0; }
.plat-main .pn{ font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
/* V5.16：这两行不再硬断行（break-all 会把 UID 断成孤字、把链接断成三五行）。
   改成一行截断 + 点开展开。 */
.plat-main .pi{
  font-size: 11.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plat-main .pl{
  font-size: 11.5px; color: var(--blue); text-decoration: none;
  min-width: 0; overflow: hidden;
}
.plat-main .pl:hover{ text-decoration: underline; }
/* 短版默认显示，长版点开才显示 */
.plat-main .pl .pl-full{ display: none; }
.plat-main .pl-row.is-open .pl .pl-short{ display: none; }
.plat-main .pl-row.is-open .pl .pl-full{ display: inline; word-break: break-all; }
/* UID 用等宽字体：一串 hex 用比例字体看着参差 */
.plat-main .pi-mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; letter-spacing: .1px;
}
.field-inline{ display: flex; flex-direction: column; gap: 8px; }

/* ===================== 表单 ===================== */
.fgroup{ padding: 2px 0 16px; border-bottom: 1px dashed var(--line); margin-bottom: 16px; }
.fgroup:last-child{ border: 0; margin-bottom: 0; padding-bottom: 0; }
.fgroup-title{
  font-size: 11.5px; font-weight: 700; color: var(--text-3); letter-spacing: .6px;
  text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.fgroup-title::after{ content: ""; flex: 1; height: 1px; background: var(--line); }
.grid-2{ display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.grid-3{ display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.grid-4{ display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.field{ display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field:last-child{ margin-bottom: 0; }
.grid-2 .field, .grid-3 .field, .grid-4 .field{ margin-bottom: 0; }
.field > span{ font-size: 12px; color: var(--text-2); font-weight: 500; }
.field > span i{ color: var(--brand); font-style: normal; }
.field input, .field select, .field textarea{
  width: 100%; border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 9px; padding: 8px 11px; font-size: 13px; color: var(--text);
  outline: 0; transition: .15s; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus{
  border-color: var(--brand); background: var(--panel); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field input::placeholder, .field textarea::placeholder{ color: var(--text-3); }
.input-row{ display: flex; gap: 7px; }
.input-row input{ flex: 1; }
.hint{ font-size: 11px; color: var(--text-3); margin-top: 4px; }

.chip-switch{
  display: inline-flex; align-items: center; gap: 7px; height: 33px; padding: 0 12px 0 8px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--text-2); font-size: 12.5px; font-weight: 500;
}
.chip-switch i{
  width: 26px; height: 15px; border-radius: 10px; background: var(--line-strong);
  position: relative; transition: .18s; flex: 0 0 26px;
}
.chip-switch i::after{
  content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px;
  border-radius: 50%; background: #fff; transition: .18s;
}
.chip-switch[data-on="true"]{ border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.chip-switch[data-on="true"] i{ background: var(--brand); }
.chip-switch[data-on="true"] i::after{ transform: translateX(11px); }
.chip-switch b{ font-weight: 600; }
.switch-row{ display: flex; gap: 8px; flex-wrap: wrap; padding-top: 2px; }

.file-drop{
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 18px; border: 1.5px dashed var(--line-strong); border-radius: var(--r);
  background: var(--panel-2); cursor: pointer; text-align: center; transition: .15s;
}
.file-drop:hover{ border-color: var(--brand); background: var(--brand-soft); }
.file-drop svg{ width: 22px; height: 22px; color: var(--text-3); margin-bottom: 3px; }
.file-drop b{ font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.file-drop em{ font-size: 11px; color: var(--text-3); font-style: normal; }
.file-list{ display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.file-item{
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; font-size: 12px;
}
.file-item svg{ width: 14px; height: 14px; color: var(--text-3); flex: 0 0 14px; }
.file-item .fn{ flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.file-item .fs{ color: var(--text-3); font-size: 11px; }
.file-item button{ border: 0; background: transparent; color: var(--text-3); padding: 2px; display: grid; place-items: center; }
.file-item button:hover{ color: var(--red); }
.file-item button svg{ width: 14px; height: 14px; }

/* ===================== 弹窗 ===================== */
.modal{ position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open{ display: block; }
.modal-backdrop{
  position: absolute; inset: 0; background: rgba(24,22,20,.42);
  backdrop-filter: blur(3px); animation: fade .18s ease;
}
.modal-panel{
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 60px);
  background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: pop .22s cubic-bezier(.2,.9,.3,1.1);
  overflow: hidden;
}
.modal-sm .modal-panel{ width: min(400px, calc(100vw - 32px)); }
.modal-head{
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 20px 12px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.modal-head h2{ font-size: 17px; font-weight: 700; }
.modal-head p{ font-size: 12px; color: var(--text-3); margin-top: 1px; }
.modal-body{ padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot{
  display: flex; align-items: center; gap: 8px; padding: 13px 20px;
  border-top: 1px solid var(--line); background: var(--panel-2); flex: 0 0 auto;
}
.grow{ flex: 1; }
.confirm-text{ font-size: 13px; color: var(--text-2); margin-top: 8px; line-height: 1.65; }
.modal-sm .modal-body h3{ font-size: 16px; font-weight: 700; }

@keyframes fade{ from{ opacity: 0 } }
@keyframes pop{ from{ opacity: 0; transform: translate(-50%, -46%) scale(.97) } }

/* ===================== Toast ===================== */
.toast-wrap{
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  /* V6.9：提示条要压在弹窗之上。原来写 200，而弹窗的 z-index 会随打开次数
     一路涨（modalZ += 10），开到十几次就把提示盖住了 —— 用户只看到「弹窗里
     什么也没发生」。弹窗现在归零在 100~200，提示条固定在 9000，永远在上面。 */
  z-index: 9000; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast{
  background: var(--text); color: var(--panel); padding: 9px 16px; border-radius: 10px;
  font-size: 12.8px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toastIn .22s ease, toastOut .2s ease 2.3s forwards;
  max-width: 78vw;
}
@keyframes toastIn{ from{ opacity: 0; transform: translateY(10px) } }
@keyframes toastOut{ to{ opacity: 0; transform: translateY(-6px) } }

/* ===================== V1.1 新增组件 ===================== */
[hidden]{ display: none !important; }
.tag.red{ background: var(--red-soft); color: var(--red); }
.tag.violet{ background: #f5f0ff; color: #8b5cf6; }
[data-theme="dark"] .tag.violet{ background: #2a2140; color: #b79bf5; }
.tag.cyan{ background: #e8f6fa; color: #0891b2; }
[data-theme="dark"] .tag.cyan{ background: #16333a; color: #4fc3dd; }

.btn-xs{ height: 26px; padding: 0 8px; font-size: 11.5px; border-radius: 7px; font-weight: 500; }

.kpi-toggle{
  margin-left: auto; font-size: 10.5px; font-weight: 500; padding: 1px 6px;
  border-radius: 5px; background: rgba(255,255,255,.22); color: inherit; cursor: pointer;
  border: 0; font-family: inherit;
}
.kpi:not(.kpi-accent) .kpi-toggle{ background: var(--bg-soft); color: var(--text-3); }
.kpi-toggle:hover{ opacity: .8; }

.st-dot{ width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }

.em-red{ color: var(--red); font-style: normal; }
.em-amber{ color: var(--amber); font-style: normal; }

/* 备份提醒 */
.backup-bar{
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 22%, transparent);
  border-radius: var(--r); margin-bottom: 14px;
}
.backup-bar svg{ width: 17px; height: 17px; color: var(--amber); flex: 0 0 17px; }
.backup-bar p{ font-size: 12.5px; flex: 1; color: var(--text-2); }

/* 今日聚焦 */
.focus-card{
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden;
}
.fc-head{ display: flex; align-items: baseline; gap: 8px; padding: 15px 18px 10px; }
.fc-head h3{ font-size: 14px; font-weight: 700; }
.fc-head .sub{ font-size: 11.5px; color: var(--text-3); }
.fc-group{ padding: 4px 18px 12px; }
.fc-group + .fc-group{ border-top: 1px dashed var(--line); padding-top: 10px; }
.fc-tag{
  display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px;
  border-radius: 6px; margin-bottom: 6px; letter-spacing: .3px;
}
.fc-tag.blue{ background: var(--blue-soft); color: var(--blue); }
.fc-tag.purple{ background: var(--purple-soft); color: var(--purple); }
.fc-tag.red{ background: var(--red-soft); color: var(--red); }
.fc-item{ display: flex; align-items: center; gap: 9px; padding: 6px 0; }
.fc-main{ flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fc-main b{ font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-main span{ font-size: 11.5px; color: var(--text-3); }

/* 目标进度 */
.goal-wrap{ padding: 2px 0; }
.goal-top{ display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; }
.goal-top b{ font-size: 14px; color: var(--text); }
.goal-track{ height: 9px; border-radius: 5px; background: var(--bg-soft); overflow: hidden; }
.goal-fill{ height: 100%; border-radius: 5px; background: linear-gradient(90deg, #ff8a5c, #ee4a1b); transition: width .4s ease; }
.goal-note{ font-size: 11.5px; color: var(--text-3); margin-top: 7px; line-height: 1.5; }

/* 订单卡片操作区 */
.o-actions{
  display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-start; margin-top: 7px;
  grid-column: 2 / 4; align-self: end;
}
.o-right{ min-width: 78px; flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 4px; }
.plat-dot{
  width: 16px; height: 16px; border-radius: 5px; display: inline-grid; place-items: center;
  font-size: 9.5px; font-style: normal; color: #fff; font-weight: 700; flex: 0 0 16px;
}
.plat-dot.xhs{ background: #ff2e4d; }
.plat-dot.douyin{ background: #161823; }
.plat-dot.dianping{ background: #ff8a00; }
.plat-dot.wechat{ background: #07c160; }

/* 日历 */
.cal-legend{ display: flex; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-legend span{ display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-3); }
.cal-legend i{ width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.cal-ev{
  background: color-mix(in srgb, var(--c, var(--brand)) 13%, transparent);
  color: var(--c, var(--brand-strong));
  border-left: 2.5px solid var(--c, var(--brand));
  font-size: 10.5px; padding: 2px 5px; border-radius: 4px; width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600;
  cursor: pointer;
}
.cal-ev:hover{ filter: brightness(.96); }
.cal-more{ font-size: 9.5px; color: var(--text-3); padding-left: 3px; }

/* 弹窗扩展 */
.modal-wide{ width: min(720px, calc(100vw - 32px)); }
.modal-head-actions{ display: flex; align-items: center; gap: 6px; }
.modal-visit .modal-panel, .modal-visit.modal-panel{ width: min(440px, calc(100vw - 32px)); }
.modal-visit .modal-body{ padding: 14px 18px; }
.visit-head{ background: linear-gradient(140deg, var(--brand-soft), transparent); }

/* 到店模式 */
.visit-actions{ display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 9px; margin-bottom: 14px; }
.visit-actions > :only-child{ grid-column: 1 / -1; }
.visit-big{
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r);
  text-align: left; text-decoration: none; color: var(--text); overflow: hidden;
}
.visit-big:hover{ border-color: var(--brand); }
.visit-big svg{ width: 17px; height: 17px; color: var(--brand); margin-bottom: 3px; }
.visit-big b{ font-size: 13px; font-weight: 650; }
.visit-big span{ font-size: 11px; color: var(--text-3); line-height: 1.4; width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.visit-block{ margin-bottom: 16px; }
.vb-title{ font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; display: flex; align-items: center; gap: 8px; }
.vb-title .btn{ margin-left: auto; }
.vb-line{ display: flex; gap: 10px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.vb-line:last-child{ border: 0; }
.vb-line span{ color: var(--text-3); width: 40px; flex: 0 0 40px; font-size: 11.5px; }
.vb-line b{ font-weight: 600; word-break: break-all; }
.vb-line.warn b{ color: var(--red); }
.vb-text{ font-size: 12.8px; color: var(--text-2); line-height: 1.7; }
.visit-check{
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 6px; text-align: left; font-size: 13px; color: var(--text);
}
.visit-check:hover{ border-color: var(--brand); }
.visit-check i{
  width: 21px; height: 21px; border-radius: 7px; border: 1.6px solid var(--line-strong);
  flex: 0 0 21px; display: grid; place-items: center; color: transparent; transition: .15s;
}
.visit-check i svg{ width: 13px; height: 13px; }
.visit-check.on{ background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.visit-check.on i{ background: var(--green); border-color: var(--green); color: #fff; }
.visit-check.on span{ text-decoration: line-through; color: var(--text-3); }
.visit-files{ display: flex; flex-wrap: wrap; gap: 7px; }
/* ---- V5.16：BF 文件列表（独立窗口里用） ---- */
.visit-files .vf-item{
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 11px; white-space: normal; text-align: left; cursor: pointer;
}
.visit-files .vf-item .vf-txt{ display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.visit-files .vf-item .vf-txt b{
  font-size: 12.5px; font-weight: 650; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.visit-files .vf-item .vf-txt em{ font-style: normal; font-size: 10.5px; color: var(--text-3); }
.visit-files .vf-item .vf-go{
  flex: 0 0 auto; font-size: 11.5px; color: var(--brand); font-weight: 700;
}

/* ---- V5.16：数据库状态行 ---- */
.db-state{
  padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.6;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2);
}
.db-state.is-ok{ background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); color: var(--green); font-weight: 600; }
.db-state.is-bad{ background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, transparent); color: var(--amber); font-weight: 600; }

/* ---- V5.16：PR 回填链接清单 ---- */
/* V5.37：重排了一遍。
   原来一张卡里挤着「类型标签 + 标题 + 链接 + 四个 chip 按钮 + 时间」，
   手机上四个 chip 一换行就成了按钮堆。现在分三层：
     标题行（标题 + 改） / 链接行 / 状态行（标记 + 删除）
   删掉类型标签和自动回填之后，信息密度刚好。 */
.pb-list{ display: flex; flex-direction: column; gap: 10px; }
.pb-row{
  position: relative; padding: 13px 14px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.pb-row.is-done{ border-color: color-mix(in srgb, var(--green) 30%, transparent); background: var(--green-soft); }
.pb-head{ display: flex; align-items: flex-start; gap: 10px; }
.pb-label{
  flex: 1 1 auto; min-width: 0;
  font-size: 13.5px; font-weight: 700; line-height: 1.45; color: var(--text);
  word-break: break-word;
}
.pb-edit{
  flex: 0 0 auto; height: 24px; padding: 0 10px; border-radius: 7px;
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 600; line-height: 1;
  color: var(--text-2); -webkit-appearance: none; appearance: none;
}
.pb-edit:active{ background: var(--bg-soft); }
.pb-url{
  /* V5.41：腾讯文档那种链接 60+ 字符，两行会剩一两个字符挂在第二行。
     改成单行省略（省掉 https:// 前缀后多数能完整显示），完整地址在 title 里。 */
  display: block; margin-top: 7px; font-size: 12px; color: var(--blue);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none; line-height: 1.6;
}
.pb-url:hover{ text-decoration: underline; }
.pb-none{ display: block; margin-top: 7px; font-style: normal; font-size: 12px; color: var(--text-3); }
.pb-note{ margin-top: 7px; font-size: 11.5px; color: var(--text-3); line-height: 1.55; }
/* 状态行：左边主操作，右边删除压到最右；上面一条虚线把「内容」和「操作」分开 */
.pb-foot{
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line);
}
.pb-toggle{
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 13px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1;
  color: var(--text-2); -webkit-appearance: none; appearance: none;
}
.pb-toggle:active{ transform: scale(.97); }
.pb-toggle svg{ width: 13px; height: 13px; flex: 0 0 13px; }
.pb-toggle.is-on{
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green) 32%, transparent);
  color: var(--green);
}
.pb-del{
  flex: 0 0 auto; height: 28px; padding: 0 8px; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-3);
  -webkit-appearance: none; appearance: none;
}
.pb-del:active, .pb-del:hover{ color: var(--red, #E5453B); }
.pb-empty{
  padding: 22px 14px; text-align: center; font-size: 12px; line-height: 1.7;
  color: var(--text-3); border: 1px dashed var(--line); border-radius: 12px;
}
.chip-mini.is-danger{ color: var(--red, #E5453B); }

/* V5.19：「已隐藏」折叠页里的每一行 */
.hid-list{ display: flex; flex-direction: column; gap: 8px; }
.hid-row{
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.hid-main{ flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hid-main b{ font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hid-main em{ font-style: normal; font-size: 11px; color: var(--text-3); }
.hid-row .chip-mini{ flex: 0 0 auto; }
.vf-item{
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2);
  font-size: 11.5px; color: var(--blue); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 表单新增 */
.brand-hint{
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px;
  padding: 8px 11px; background: var(--amber-soft); border-radius: 9px; font-size: 12px; color: var(--text-2);
}
.clash-box{
  background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 22%, transparent);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}
.clash-head{ font-size: 12px; font-weight: 700; color: var(--amber); margin-bottom: 6px; }
.clash-row{ display: flex; align-items: center; gap: 9px; font-size: 12px; padding: 4px 0; }
.clash-time{ font-weight: 700; color: var(--text-2); flex: 0 0 52px; }
.clash-name{ font-weight: 600; flex: 0 0 auto; }
.clash-addr{ color: var(--text-3); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.money-preview{
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  background: var(--bg-soft); border-radius: 10px; padding: 9px 12px; margin: 10px 0;
}
.mp-item{ font-size: 11.5px; color: var(--text-3); display: flex; align-items: baseline; gap: 5px; }
.mp-item + .mp-item{ padding-left: 8px; border-left: 1px solid var(--line); }
.mp-item b{ font-size: 14px; color: var(--text); font-feature-settings: "tnum"; }
.mp-item b.warn{ color: var(--amber); }
.mp-note{ font-size: 11px; color: var(--amber); width: 100%; }

.check-inline{ display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.check-inline input{ width: 15px; height: 15px; accent-color: var(--brand); }

.chip-group{ display: flex; gap: 7px; flex-wrap: wrap; }
.chip-plat{
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 6px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2);
  font-size: 12.5px; color: var(--text-2);
}
.chip-plat i{
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  background: var(--line); color: var(--text-3); font-style: normal; font-size: 10.5px; font-weight: 700;
}
.chip-plat.on{ border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.chip-plat.on i{ background: var(--brand); color: #fff; }

.checklist{ display: flex; flex-direction: column; gap: 5px; }
.check-item{
  display: flex; align-items: center; gap: 9px; padding: 7px 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; font-size: 12.5px;
}
.ci-box{
  width: 19px; height: 19px; border-radius: 6px; border: 1.6px solid var(--line-strong);
  background: transparent; flex: 0 0 19px; display: grid; place-items: center; color: transparent; padding: 0;
}
.ci-box svg{ width: 11px; height: 11px; }
.ci-box.on{ background: var(--green); border-color: var(--green); color: #fff; }
.check-item span{ flex: 1; }
.check-item span.ci-done{ text-decoration: line-through; color: var(--text-3); }
.ci-del{ border: 0; background: transparent; color: var(--text-3); padding: 2px; display: grid; place-items: center; border-radius: 5px; }
.ci-del svg{ width: 13px; height: 13px; }
.ci-del:hover{ color: var(--red); background: var(--red-soft); }
.quick-check{ display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick-check button{
  font-size: 11px; padding: 3px 9px; border-radius: 20px; border: 1px dashed var(--line-strong);
  background: transparent; color: var(--text-3);
}
.quick-check button:hover{ border-color: var(--brand); color: var(--brand-strong); border-style: solid; }

.fold{ border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; background: var(--panel-2); overflow: hidden; }
.fold summary{
  padding: 11px 14px; font-size: 13px; font-weight: 600; cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 8px; color: var(--text-2);
}
.fold summary::-webkit-details-marker{ display: none; }
.fold summary::after{ content: "+"; margin-left: auto; color: var(--text-3); font-size: 15px; font-weight: 400; }
.fold[open] summary::after{ content: "−"; }
.fold summary span{ font-size: 11px; font-weight: 400; color: var(--text-3); }
.fold-body{ padding: 4px 14px 14px; background: var(--panel); }

.post-row{ border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; margin-bottom: 8px; background: var(--panel-2); }
.post-top{ display: flex; gap: 7px; align-items: center; margin-bottom: 7px; }
.post-top select{ height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; padding: 0 6px; color: var(--text-2); }
.post-top input{ flex: 1; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); padding: 0 10px; font-size: 12px; color: var(--text); outline: 0; min-width: 0; }
.post-nums{ display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 7px; }
.post-nums label{ display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; color: var(--text-3); }
.post-nums input{ height: 30px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); padding: 0 8px; font-size: 12px; color: var(--text); outline: 0; width: 100%; }

.paste-area{
  width: 100%; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px;
  padding: 11px 12px; font-size: 13px; line-height: 1.7; color: var(--text); outline: 0; resize: vertical;
}
.paste-area:focus{ border-color: var(--brand); background: var(--panel); box-shadow: 0 0 0 3px var(--brand-soft); }

/* 报价长图 */
.quote-body{ display: flex; justify-content: center; background: var(--bg-soft); }
#quoteCanvas{ width: 100%; max-width: 340px; height: auto; border-radius: 12px; box-shadow: var(--shadow); display: block; }

/* 稿件长图（V2.9） */
.draft-body{ background: var(--bg-soft); }
.draft-preview{ display: flex; flex-direction: column; align-items: center; gap: 10px; }
.draft-img{
  width: 100%; max-width: 420px; height: auto; display: block;
  border-radius: 12px; box-shadow: var(--shadow);
  background: #fff;
}
.draft-meta{ margin: 0; font-size: 11.5px; color: var(--text-3); text-align: center; }
.draft-loading{ margin: 28px 0; font-size: 13px; color: var(--text-3); }
.draft-hint{ margin: 12px 0 0; text-align: left; }

/* 浮层菜单 */
.popmenu{
  position: fixed; z-index: 300; min-width: 148px; padding: 5px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  box-shadow: var(--shadow-lg); animation: pop .14s ease;
}
.pm-item{
  display: block; width: 100%; text-align: left; padding: 8px 11px; border: 0; background: transparent;
  border-radius: 7px; font-size: 12.8px; color: var(--text-2);
}
.pm-item:hover{ background: var(--bg-soft); color: var(--text); }
.pm-danger{ color: var(--red); }
.pm-div{ height: 1px; background: var(--line); margin: 4px 6px; }

/* 品牌关系 */
.brand-row{ display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.brand-row:last-child{ border: 0; }
.br-main{ flex: 1; min-width: 0; display: flex; flex-direction: column; }
.br-main b{ font-size: 13px; font-weight: 600; }
.br-main span{ font-size: 11.5px; color: var(--text-3); }

@media (max-width: 860px){
  .focus-card{ margin-bottom: 11px; }
  .fc-item{ flex-wrap: wrap; }
  .fc-main{ flex: 1 1 100%; }
  .fc-item .btn{ flex: 0 0 auto; }
  .o-actions{ justify-content: flex-start; grid-column: 1 / -1; }
  .o-date{ grid-row: auto; align-self: center; }
  .visit-actions{ grid-template-columns: minmax(0,1fr); }
  .post-nums{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .backup-bar{ flex-wrap: wrap; }
  .backup-bar p{ flex: 1 1 100%; }
  .money-preview{ gap: 6px; }
  .modal-panel.modal-visit{ width: 100vw; max-height: 92vh; border-radius: 18px 18px 0 0; top: auto; left: 0; bottom: 0; transform: none; }
}

/* ===================== 报名表导入 ===================== */
.em-src{ color: var(--text-3); }
.em-src::before{ content: '↳'; opacity: .6; margin-right: 2px; }

.imp-drop{
  border: 1.5px dashed var(--line-strong, var(--line)); border-radius: 12px;
  padding: 10px; background: var(--panel-2); transition: .15s;
}
.imp-drop.is-over{ border-color: var(--brand); background: var(--brand-soft); }
.imp-drop .paste-area{ background: var(--panel); }
.imp-drop-foot{ display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.imp-drop-foot .hint{ margin: 0; }

.imp-tip{
  margin-top: 12px; padding: 11px 13px; border-radius: 10px;
  background: var(--brand-soft); border: 1px solid rgba(0,0,0,.03);
}
.imp-tip b{ font-size: 12.5px; color: var(--brand-strong); display: block; margin-bottom: 4px; }
.imp-tip p{ font-size: 11.5px; line-height: 1.75; color: var(--text-2); margin: 0 0 4px; }
.imp-tip p:last-child{ margin-bottom: 0; }

.imp-head{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.imp-head .hint{ margin: 0; flex: 1 1 100%; }

.imp-map{ display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.imp-map .field{ margin-bottom: 0; }
.imp-map .field select{ font-size: 12.5px; padding: 8px 9px; }

.imp-sum{
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 0 10px; border-top: 1px dashed var(--line); margin-top: 4px;
}
.imp-sum b{ font-size: 13.5px; }

.imp-table-wrap{ overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.imp-table{ width: 100%; border-collapse: collapse; font-size: 11.8px; min-width: 620px; }
.imp-table th{
  text-align: left; font-weight: 600; font-size: 11px; color: var(--text-3);
  padding: 7px 9px; background: var(--bg-soft); white-space: nowrap;
}
.imp-table td{ padding: 7px 9px; border-top: 1px solid var(--line); vertical-align: top; }
.imp-table tr.is-bad td{ background: rgba(224,64,64,.05); }
.imp-table .t-main{ font-weight: 600; }
.imp-table .t-sub{ color: var(--text-2); max-width: 230px; }

/* ===================== 响应式 ===================== */
@media (max-width: 1080px){
  .kpi-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dash-grid{ grid-template-columns: minmax(0,1fr); }
  .profile-grid{ grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 860px){
  .sidebar{
    position: fixed; bottom: 0; left: 0; right: 0; width: 100%; flex: none;
    height: auto; flex-direction: row; align-items: center; z-index: 60;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0;
    border-top: 1px solid var(--line); gap: 0; background: var(--panel);
  }
  .brand, .side-foot{ display: none; }
  .nav{ flex-direction: row; justify-content: space-around; width: 100%; gap: 0; }
  .nav-item{
    flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 10px; flex: 1;
    align-items: center; border-radius: 10px;
  }
  .nav-item svg{ width: 19px; height: 19px; }
  .nav-item.is-active{ background: transparent; color: var(--brand-strong); }
  .nav-badge{ position: absolute; top: 2px; right: 50%; margin-right: -18px; }
  .app{ height: auto; min-height: 100vh; overflow: visible; }
  .main{ min-height: 100vh; }
  /* 底部留够「导航 + 悬浮按钮」两层的高度，否则最后一屏的内容会被「＋ 记一单」压住 */
  .content{ padding: 4px 14px calc(158px + env(safe-area-inset-bottom)); overflow: visible; }
  /* 兜底：手机端任何一处内容撑宽都不许把整页顶出屏幕（顶出去浏览器会把整页缩小，看着就是「排版乱了」） */
  html, body{ overflow-x: clip; max-width: 100%; }
  .topbar{ padding: 14px 14px 10px; }
  .topbar-left h1{ font-size: 18px; }
  .kpi-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .kpi-value{ font-size: 21px; }
  .order{ grid-template-columns: 54px minmax(0,1fr); gap: 11px; }
  .o-right{ grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; border-top: 1px dashed var(--line); padding-top: 8px; }
  .grid-2, .grid-3, .grid-4{ grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .cal-grid{ gap: 4px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-cell{ min-height: 64px; min-width: 0; padding: 5px 3px; border-radius: 8px; gap: 2px; }
  .cal-cell .dn{ font-size: 10.5px; }
  .cal-ev{ font-size: 8.5px; padding: 1px 2px; max-width: 100%; border-left-width: 2px; letter-spacing: -.2px; }
  /* 档案头部：手机端按钮独占一行，避免昵称被挤成竖排折行 */
  .pf-head{ flex-wrap: wrap; padding: 16px; gap: 12px; align-items: center; }
  .pf-head .avatar{ width: 52px; height: 52px; flex: 0 0 52px; border-radius: 16px; font-size: 20px; }
  .pf-head h2{ font-size: 17px; line-height: 1.35; word-break: break-word; }
  .pf-head p{ font-size: 12px; line-height: 1.5; }
  .pf-head::after{ content: ''; flex: 0 0 100%; order: 4; height: 0; }
  .pf-head > .btn{ flex: 1 1 0; order: 5; min-width: 0; padding: 0 10px; }
  .pf-stats{ display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px 8px; padding: 2px 16px 16px; }
  .pf-stat b{ font-size: 16px; }
  .pf-stat span{ font-size: 11px; }
  .modal-panel{ width: 100vw; max-height: 92vh; border-radius: 18px 18px 0 0; top: auto; left: 0; bottom: 0; transform: none; }
  .modal.open .modal-panel{ animation: sheet .24s ease; }
  @keyframes sheet{ from{ transform: translateY(30px); opacity: .6 } }
  .bars{ height: 150px; gap: 4px; }
  .filters{ gap: 7px; }
  .imp-map{ grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .imp-table{ min-width: 520px; }
}
@media (max-width: 520px){
  .grid-2, .grid-3, .grid-4{ grid-template-columns: minmax(0,1fr); }
  .pf-stats{ gap: 12px 8px; }
  .imp-map{ grid-template-columns: minmax(0,1fr); }
}

/* ============================================================
   V1.4 · 手机端单手体验重塑（<= 768px）
   ============================================================ */

/* ---------- 悬浮新建按钮 FAB ---------- */
#fabBtn{
  position: fixed; right: 16px; z-index: 55; display: none;
  width: 56px; height: 56px; border-radius: 18px; border: 0;
  background: var(--brand); color: #fff;
  align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(239,74,27,.65);
  transition: transform .16s;
}
#fabBtn:active{ transform: scale(.94); }
#fabBtn svg{ width: 26px; height: 26px; }

/* ---------- 动作表（··· 更多） ---------- */
.sheet-list{ display: flex; flex-direction: column; gap: 2px; }
.sheet-item{
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 6px; border: 0; background: transparent; cursor: pointer;
  font-size: 15px; color: var(--text); text-align: left; border-radius: 10px;
}
.sheet-item:hover{ background: var(--bg-soft); }
.sheet-item svg{ width: 18px; height: 18px; color: var(--text-3); flex: 0 0 18px; }
.sheet-item.danger{ color: var(--red); }
.sheet-item.danger svg{ color: var(--red); }
.sheet-sep{ height: 1px; background: var(--line); margin: 6px 0; }

/* ---------- 撤回浮条 ---------- */
.undo-bar{
  position: fixed; left: 50%; transform: translateX(-50%) translateY(16px);
  bottom: calc(84px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px; z-index: 90;
  padding: 11px 14px 11px 18px; border-radius: 14px;
  background: #1b1d22; color: #fff; font-size: 13px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: .2s;
  max-width: calc(100vw - 32px);
}
.undo-bar.show{ opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.undo-bar button{
  border: 0; background: rgba(255,255,255,.16); color: #fff;
  padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}

/* ---------- 打卡 / 回填徽标 ---------- */
/* V5.16：改成 <button> 了（要能点开补打卡），把浏览器默认按钮样式抹掉。
   V5.37：基础样式挪到 .collect-badge 上，不再只挂在 button.collect-badge。
   原因：「待回填 n」以前是个 <span>，拿不到这套样式 ——
   没有底色、字号还比「已打卡」大一截，两个徽标并排看着像两套设计。
   现在不管 <span> 还是 <button>，字体、字重、高度、圆角完全一致。 */
.collect-badge{
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border: 0; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 1;
  font-family: inherit; white-space: nowrap;
  background: var(--amber-soft, #fff4e0); color: var(--amber, #b26a00);
}
button.collect-badge{ cursor: pointer; -webkit-appearance: none; appearance: none; }
button.collect-badge:active{ transform: scale(.94); }
.collect-badge.done{ background: var(--green-soft, #e8f7ee); color: var(--green, #1a7f45); }
.collect-row{ display: flex; flex-wrap: wrap; gap: 8px; }
.collect-plat{
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--panel);
  font-size: 14px; color: var(--text-2); cursor: pointer;
}
.collect-plat.on{ border-color: var(--green, #1a7f45); background: var(--green-soft, #e8f7ee); color: var(--green, #1a7f45); }
.collect-plat b{ font-weight: 600; }

/* ---------- 快速新建抽屉 ---------- */
.qc-field{ margin-bottom: 14px; }
.qc-field > span{ display: block; font-size: 12.5px; color: var(--text-3); margin-bottom: 7px; }
.qc-chips{ display: flex; gap: 8px; flex-wrap: wrap; }
.qc-chip{
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text-2); font-size: 13.5px; cursor: pointer;
}
.qc-chip.on{ border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.qc-input{
  width: 100%; height: 46px; padding: 0 13px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 16px;
}
.qc-paste{
  display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 0 13px;
  border: 1px dashed var(--line); border-radius: 11px; background: var(--bg-soft);
  color: var(--text-2); font-size: 13.5px; cursor: pointer; margin-bottom: 16px;
}
.qc-paste svg{ width: 16px; height: 16px; }

/* 店名联想下拉 */
.shop-sug{
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 8;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 34px -16px rgba(0,0,0,.28); overflow: hidden; max-height: 260px; overflow-y: auto;
}
.shop-sug button{
  display: block; width: 100%; text-align: left; padding: 11px 13px; border: 0;
  background: transparent; cursor: pointer; border-bottom: 1px solid var(--line);
}
.shop-sug button:last-child{ border-bottom: 0; }
.shop-sug button:hover, .shop-sug button.on{ background: var(--brand-soft); }
.shop-sug b{ display: block; font-size: 14px; font-weight: 650; color: var(--text); }
.shop-sug span{ display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.qc-wrap{ position: relative; }

/* 品牌分组 / 多分店选择 */
.shop-sug{ max-height: 302px; }
.shop-sug mark{ background: var(--brand-soft); color: var(--brand-strong); border-radius: 3px; padding: 0 1px; font-weight: 700; }
.sug-group{
  display: flex; align-items: baseline; gap: 6px; padding: 9px 13px 7px;
  background: var(--bg-soft); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2;
}
.sug-group b{ font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.sug-group i{ font-style: normal; font-size: 11px; color: var(--text-3); }
.sug-item{ position: relative; }
.sug-item .sug-line{ display: flex; align-items: center; gap: 6px; }
.sug-item .sug-t{ font-size: 14px; font-weight: 650; color: var(--text); }
.sug-item .sug-m{ font-size: 12px; color: var(--text-2); margin-top: 3px; }
.sug-item .sug-s{ font-size: 11px; color: var(--text-3); margin-top: 1px; }
.sug-item.is-branch{ padding-left: 26px; }
.sug-item.is-branch::before{
  content: ''; position: absolute; left: 14px; top: 17px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong, #cfc9c0);
}
.sug-tag{
  font-style: normal; font-size: 10px; line-height: 1.5; padding: 0 5px; border-radius: 5px;
  background: var(--bg-soft); color: var(--text-3); border: 1px solid var(--line); font-weight: 500;
}
.sug-del{ position: absolute; right: 10px; top: 10px; font-size: 11px; color: var(--text-3); padding: 2px 5px; }
.sug-del:hover{ color: var(--red); }
.sug-empty{ padding: 15px 14px; }
.sug-empty b{ display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.sug-empty span{ display: block; font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.55; }
.shop-sug .sug-add{
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--bg-soft); border-top: 1px solid var(--line);
  position: sticky; bottom: 0; z-index: 3;
  box-shadow: 0 -8px 14px -10px rgba(0,0,0,.22);
}
.shop-sug .sug-add span{ font-size: 13px; color: var(--brand-strong); font-weight: 600; margin: 0; }
.shop-sug .sug-add i{ font-style: normal; font-size: 11px; color: var(--text-3); }
.sa-hint{ font-size: 11.5px; color: var(--text-3); margin-top: 6px; line-height: 1.55; }

/* 地图取地址 */
.sug-map-head{
  display: flex; align-items: baseline; gap: 6px; padding: 9px 13px 7px;
  background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.sug-map-head b{ font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.sug-map-head i{ font-style: normal; font-size: 11px; color: var(--text-3); }
.shop-sug .sug-map{
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: transparent; border-top: 1px dashed var(--line);
}
.shop-sug .sug-map span{ font-size: 13px; color: var(--brand-strong); font-weight: 600; margin: 0; }
.shop-sug .sug-map i{ font-style: normal; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.sug-item.is-map{ padding-left: 26px; }
.sug-item.is-map::before{
  content: ''; position: absolute; left: 14px; top: 17px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--brand);
}
.sug-tag.tag-map{ color: var(--brand-strong); border-color: var(--brand-soft); background: var(--brand-soft); }

/* 地图 Key 弹窗 */
.mk-status{ font-style: normal; font-size: 11px; color: var(--text-3); margin-left: 6px; }
.mk-help-toggle{
  border: 0; background: transparent; padding: 0; font-size: 12px;
  color: var(--brand-strong); cursor: pointer; margin-bottom: 10px;
}
.mk-help{ background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 4px; }
.mk-help p{ font-size: 12px; color: var(--text-2); line-height: 1.7; margin: 0 0 4px; }
.mk-help p b{ color: var(--text); }
.mk-note{ font-size: 11.5px; color: var(--text-3); line-height: 1.6; margin: 8px 0 0; }
.mk-help .mk-note{ border-top: 1px dashed var(--line); padding-top: 9px; margin-top: 10px; }

/* ---------- 日历：圆点 + 当日议程 ---------- */
.cal-dots{ display: none; }
.cal-agenda{ display: none; }
.agenda-head{
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 0 10px; font-size: 13px; color: var(--text-3);
}
.agenda-head b{ font-size: 15px; color: var(--text); font-weight: 650; }
.agenda-item{
  display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.agenda-item:last-child{ border-bottom: 0; }
.agenda-time{
  flex: 0 0 52px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.agenda-time.is-tbd{ font-weight: 500; letter-spacing: .3px; opacity: .75; }
.agenda-main{ flex: 1; min-width: 0; }
.agenda-main b{ display: block; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-main span{ display: block; font-size: 12px; color: var(--text-3); margin-top: 3px; }
.agenda-btns{ display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.agenda-empty{ text-align: center; padding: 22px 12px; color: var(--text-3); font-size: 13px; }

@media (max-width: 768px){
  /* 基础规范：防 iOS 聚焦放大 + 触控热区 */
  input, select, textarea{ font-size: var(--fs-form, 15px) !important; }
  .btn{ min-height: 44px; }
  .btn-sm, .btn-xs{ min-height: 38px; }
  .icon-btn{ min-width: 44px; min-height: 44px; }
  .nav-item{ min-height: 46px; }
  .seg button{ min-height: 40px; }
  .chip-plat, .chip-switch, .quick-check button{ min-height: 40px; }

  /* 抽屉：拖拽把手 + 吸底操作栏 + 防穿透 */
  .modal-body{ overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  body.locked{ overflow: hidden; }
  .modal-panel{ max-height: 94dvh; position: relative; }
  .modal-panel::before{
    content: ''; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
    width: 36px; height: 4px; border-radius: 3px; background: var(--line); z-index: 3;
  }
  .modal-head{ padding-top: 18px; }
  .modal-foot{
    position: sticky; bottom: 0; background: var(--panel);
    border-top: 1px solid var(--line); z-index: 2;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .modal-body{ padding-bottom: 12px; }

  /* 底部导航：4 个一级入口 */
  .nav-item[data-page="reminders"], .nav-item[data-page="stats"]{ display: none; }

  /* FAB */
  #fabBtn{ display: flex; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .content{ padding-bottom: calc(112px + env(safe-area-inset-bottom)); }

  /* 筛选：两行铺开，一眼看全（不再横滑）
     第 1 行搜索框独占，第 2 行月份 + 导出 + 导入报名表 */
  .filters{ flex-wrap: wrap; overflow: visible; gap: 8px; padding-bottom: 0; }
  .filters .search-box{ flex: 1 0 100%; height: 40px; }
  .filters select.plain{ flex: 1 1 auto; min-width: 0; }
  .filters .btn-fil{ flex: 0 0 auto; }
  .filters .search-box, .filters select.plain, .filters .btn-fil{ height: 40px; min-height: 40px; }
  /* 状态筛选：5 项等分，数字跟着标签走，永远一行不裁切 */
  .seg{ overflow: visible; }
  .seg-stats{
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px;
    padding: 3px; margin-bottom: 12px !important;
  }
  .seg-stats button{
    min-width: 0; height: 40px; padding: 0 2px; font-size: 12px;
    display: flex; align-items: center; justify-content: center; gap: 3px;
  }
  .seg-stats button .sn{ font-size: 11.5px; font-weight: 800; opacity: .8; }
  .seg-stats button.on .sn{ opacity: 1; }
  .seg button{ flex: 0 0 auto; white-space: nowrap; height: 38px; padding: 0 14px; }

  /* 订单卡片：三层 + 左侧色条 */
  .order{
    display: flex; flex-direction: column; gap: 0;
    padding: 13px 14px 12px 15px; position: relative;
  }
  .order::before{
    content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--st, var(--line));
  }
  .o-date{ display: none; }
  /* V5.39：版式固定成两行，不再由内容宽度决定换不换行。
     上一版是 flex-wrap 自动折行：徽标组 flex-basis 就是内容宽度，
     而 flex 的换行判定发生在收缩之前 —— 于是「店名 + 星标 + 拖拽点 + 徽标」的裸宽一旦超过卡片宽度，
     徽标整组就被挤到第二行。结果同一个列表里出现两种版式：
       店名短的（小叫天）徽标挤在第一行，店名长的（南越花市）徽标掉到第二行。
     看着像 bug，其实是宽度算出来的偶然。
     现在：第一行 = 店名(+星标) + 拖拽点，第二行 = 徽标组。
     .o-name 用 flex-basis 0，不管店名多长都不会把拖拽点挤下去（店名自己省略号收）。
     所有卡片高度一致。 */
  .o-title{ display: flex; align-items: center; gap: 6px; flex-wrap: wrap; row-gap: 4px; }
  .o-name{ flex: 1 1 0; min-width: 0; gap: 6px; }
  /* 字号写在 .o-title b 上：提醒页的 .o-title 里也有 <b>，但没有 .o-name 包裹 */
  .o-title b{ font-size: 16px; font-weight: 650; }
  .o-name .star{ flex: 0 0 auto; }
  /* 拖拽点留在第一行最右 */
  .o-title .card-grip-inline{ order: 1; flex: 0 0 auto; margin-left: auto; }
  /* 徽标组独占第二行：flex-basis 100% 必然换行，order 排在拖拽点之后 */
  .o-tags{ flex: 1 1 100%; order: 2; flex-wrap: wrap; row-gap: 4px; }
  /* 一条徽标都没有时不留空行 */
  .o-tags:empty{ display: none; }
  /* 徽标统一 20px 高：纯中文和「12/03 结」这种数字混排的行高差 1px，
     徽标行就被撑高 1px，整张卡跟着高 1px —— 一排卡片看着就参差不齐。 */
  .o-tags > .tag{ height: 20px; padding: 0 8px; display: inline-flex; align-items: center; line-height: 1; }
  .o-title .tag{ flex: 0 0 auto; }
  .o-title .plat-dot{ display: none; }
  .o-sub{ margin-top: 6px; gap: 0 10px; font-size: 12.5px; }
  .o-sub em{ display: inline; }
  .o-right{
    display: flex; align-items: baseline; gap: 8px;
    min-width: 0; margin-top: 8px; padding: 0; border: 0;
  }
  .o-amt{ font-size: 17px; font-weight: 700; }
  .o-amt small{ font-size: 11px; }
  .o-actions{
    display: flex; gap: 8px; margin-top: 11px; flex-wrap: nowrap;
    border-top: 1px dashed var(--line); padding-top: 10px;
  }
  .o-actions .btn{
    flex: 1 1 0; min-width: 0; height: 40px; padding: 0 8px; font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .o-actions .btn-more{ flex: 0 0 44px; padding: 0; }
  .o-actions .btn-primary{ background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
  /* 触屏上 :hover 会「粘住」：这个按钮的文字色就是 --brand-strong，
     hover 又把底色改成 --brand-strong，红字压红底 → 看着像一块没有字的红条 */
  .o-actions .btn-primary:hover,
  .o-actions .btn-primary:focus{ background: var(--brand-soft); color: var(--brand-strong); }
  .o-actions .btn-primary:active{ background: var(--brand-soft); color: var(--brand-strong); filter: brightness(.96); }

  /* 日历：圆点月历 + 当日议程 */
  .cal-cell{ min-height: 58px; padding: 4px 2px; align-items: center; justify-content: flex-start; gap: 4px; }
  .cal-cell .dn{ font-size: 12.5px; }
  .cal-evs{ display: none; }
  .cal-dots{ display: flex; gap: 3px; align-items: center; justify-content: center; flex-wrap: wrap; height: 6px; }
  .cal-dots i{ width: 5px; height: 5px; border-radius: 50%; background: var(--c); display: block; }
  .cal-cell.sel{ background: var(--brand-soft); border-color: var(--brand); }
  .cal-cell.today .dn{ background: var(--brand); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
  .cal-agenda{ display: block; margin-top: 4px; }
  .cal-legend{ font-size: 11px; }

  /* 到店模式：全屏单手作业台 */
  .modal-panel.modal-visit{
    height: 100dvh; max-height: 100dvh; border-radius: 0;
    top: 0; left: 0; bottom: 0; width: 100vw;
  }
  .modal-visit .modal-head{ padding-top: calc(14px + env(safe-area-inset-top)); }
  .modal-visit .modal-body{ padding: 0 14px 20px; }
  .visit-actions{ grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
  .visit-big{ min-height: 64px; padding: 12px; }
  .visit-big b{ font-size: 15px; }
  .visit-check{ min-height: 56px; padding: 14px 4px; font-size: 15px; }
  .visit-check i{ width: 26px; height: 26px; flex: 0 0 26px; }

  /* 导入预览：宽表转卡片 */
  .imp-wrap{ overflow-x: auto; }
}

@media (max-width: 768px){
  /* 卡片头在窄屏允许换行，避免右侧统计文字被顶出屏幕 */
  .card-head{ flex-wrap: wrap; gap: 6px 10px; }
  .card-head .sub{ white-space: normal; }
  .cal-head{ flex-wrap: wrap; gap: 8px; }
  .cal-title{ min-width: 0; font-size: 15px; }
}

/* ---------- 导入预览：窄屏改卡片 ---------- */
.imp-cards{ display: none; }
.imp-card{
  border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; background: var(--panel);
}
.imp-card.is-bad{ border-color: var(--red); background: var(--red-soft); }
.imp-card-top{ display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.imp-card-top b{ font-size: 14.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-card-meta{ font-size: 12.5px; color: var(--text-2); margin-top: 5px; font-variant-numeric: tabular-nums; }
.imp-card-sub{ font-size: 12px; color: var(--text-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 640px){
  .imp-table-wrap{ display: none; }
  .imp-cards{ display: flex; flex-direction: column; gap: 8px; }
}

/* 手机端联想下拉：给足高度，别让地图结果只露两行 */
@media (max-width: 768px){
  .shop-sug{ max-height: min(52vh, 420px); scroll-padding-bottom: 46px; }
  .shop-sug .sug-item{ padding: 11px 12px; }
  .shop-sug .sug-m{ font-size: 11.5px; line-height: 1.45; }
}

/* 小屏（320~360）：月份独占一行，导出 / 导入报名表各占一半，
   状态筛选字号收一档 —— 三行铺开，一句话都不用横滑 */
@media (max-width: 360px){
  .filters select.plain{ flex: 1 0 100%; }
  .filters .btn-fil{ flex: 1 1 0; padding: 0 8px; }
  .seg-stats button{ font-size: 11px; gap: 2px; padding: 0 1px; }
  .seg-stats button .sn{ font-size: 10.5px; }
}

/* 地图 Key 自检结果 */
.sug-diag{
  padding: 10px 13px; background: var(--bg-soft); border-bottom: 1px solid var(--line);
}
.sug-diag .dq{
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 12px; line-height: 1.9; flex-wrap: wrap;
}
.sug-diag .dq i{ font-style: normal; color: var(--text-3); flex: 0 0 auto; }
.sug-diag .dq b{
  font-weight: 700; font-size: 12px; flex: 1 1 0; min-width: 0;
  text-align: right; word-break: break-word; overflow-wrap: anywhere;
}
.sug-diag .dq b.ok{ color: var(--ok, #0a7d32); }
.sug-diag .dq b.bad{ color: var(--danger, #c0392b); }
.sug-diag .dq-note{
  margin-top: 6px; font-size: 11.5px; line-height: 1.6; color: var(--text-2);
}

/* ============================================================
   登录页 / 找回密码（V5.16 起；V5.23 按参考图重做）
   ------------------------------------------------------------
   参考图给的是「整页」而不是「一张卡片」：
     居中的方形 logo → 标题 → 一句副标题 → 两个输入框 →
     「保持登录 + 忘记密码」一行 → 一颗大红色登录按钮。
   所以这里把旧的选项卡、卡片边框、阴影全去掉，手机上是整页，
   宽屏才把内容收进一张安静的白卡片（不然一列控件悬在空页里很散）。
   ============================================================ */
html.lg-locked, html.lg-locked body{ overflow: hidden; }

.login-gate{
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
  background: var(--bg);
  overflow-y: auto;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .22s ease, visibility .22s;
}
.login-gate.is-on{ opacity: 1; visibility: visible; pointer-events: auto; }

.lg-card{
  width: 100%; max-width: 376px;
  display: flex; flex-direction: column;
  transform: translateY(10px);
  transition: transform .26s cubic-bezier(.2,.8,.3,1);
}
.login-gate.is-on .lg-card{ transform: none; }

/* 品牌：方形色块 + 一个「达」字，跟参考图一致 */
.lg-logo{
  display: block; width: 64px; height: 64px; margin: 0 auto; border-radius: 18px;
  object-fit: cover;
  background: linear-gradient(158deg, #F0603C 0%, #D93B2B 100%);
  box-shadow: 0 14px 26px -14px rgba(217,59,43,.95);
}
.lg-h1{
  margin: 18px 0 0; text-align: center;
  font-size: 24px; font-weight: 800; letter-spacing: -.4px; color: var(--text);
}
.lg-sub{
  margin: 7px 0 28px; text-align: center;
  font-size: 13px; color: var(--text-2); letter-spacing: .3px;
}

/* 表单 */
.lg-form{ display: flex; flex-direction: column; gap: 12px; }
/* 找回密码第二步用 hidden 藏起来；.lg-form 的 display:flex 会盖掉
   浏览器默认的 [hidden]{display:none}，这里补一条 */
.lg-form[hidden]{ display: none !important; }
.lg-box{
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 9px 14px 10px;
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 12px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.lg-box.is-hidden{ display: none; }
.lg-box:focus-within{ border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lg-box .lb{
  display: flex; align-items: baseline; gap: 6px;
  font-size: 11px; line-height: 1.3; color: var(--text-3);
}
.lg-box .lb i{ font-style: normal; font-size: 10.5px; }
.lg-box input{
  width: 100%; height: 24px; padding: 0; border: 0; outline: 0;
  background: transparent; font-family: inherit;
  font-size: 15px; color: var(--text); letter-spacing: .1px;
}
.lg-box input::placeholder{ color: var(--text-3); font-size: 14px; }
.lg-box.has-btn input{ padding-right: 62px; }
.lg-eye{
  position: absolute; right: 6px; bottom: 5px;
  height: 30px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2);
  font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.lg-eye:hover{ background: var(--bg-soft); color: var(--text); }

/* 「保持登录 + 忘记密码」 */
.lg-row{
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 3px 1px 5px;
}
.lg-check{
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none;
}
.lg-check input{ position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.lg-tick{
  flex: none; width: 17px; height: 17px; border-radius: 5px;
  border: 1.5px solid var(--line-strong); background: var(--panel);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.lg-tick svg{ width: 11px; height: 11px; color: #fff; opacity: 0; transform: scale(.6); transition: .15s; }
.lg-check input:checked + .lg-tick{ background: var(--brand); border-color: var(--brand); }
.lg-check input:checked + .lg-tick svg{ opacity: 1; transform: scale(1); }
.lg-check input:focus-visible + .lg-tick{ box-shadow: 0 0 0 3px var(--brand-soft); }

.lg-forgot{
  border: 0; background: transparent; padding: 4px 2px;
  font-family: inherit; font-size: 12.5px; color: var(--text-3);
  cursor: pointer; border-radius: 6px;
}
.lg-forgot:hover{ color: var(--brand); }

/* 报错 */
.lg-err{
  font-size: 12px; color: var(--red); line-height: 1.6;
  background: var(--red-soft); border-radius: 9px;
  padding: 0 12px; max-height: 0; overflow: hidden;
  opacity: 0; transition: max-height .2s, padding .2s, opacity .2s;
}
.lg-err.is-on{ padding: 8px 12px; max-height: 90px; opacity: 1; }

.lg-submit{
  width: 100%; height: 48px; margin-top: 2px;
  border: 0; border-radius: 12px; background: var(--brand); color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 700; letter-spacing: .5px;
  box-shadow: 0 12px 22px -14px rgba(217,59,43,.95);
  transition: background .15s, transform .1s, box-shadow .15s;
}
.lg-submit:hover{ background: var(--brand-strong); }
.lg-submit:active{ transform: translateY(1px); }
.lg-submit:disabled{ opacity: .62; transform: none; box-shadow: none; cursor: default; }

.lg-switch{
  margin: 16px 0 0; text-align: center;
  font-size: 12.5px; color: var(--text-3);
}
.lg-switch-btn{
  border: 0; background: transparent; padding: 2px 4px;
  font-family: inherit; font-size: 12.5px; font-weight: 650;
  color: var(--brand); cursor: pointer;
}
.lg-switch-btn:hover{ text-decoration: underline; }

.lg-tip{
  margin: 10px 0 0; font-size: 11.5px; color: var(--text-3);
  line-height: 1.7; text-align: center;
}
.lg-tip:empty{ display: none; }

/* 宽屏：整页太空，把内容收进一张安静的白卡片 */
@media (min-width: 720px){
  .lg-card{
    max-width: 392px; padding: 34px 32px 28px;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 24px; box-shadow: var(--shadow-lg);
  }
}

/* 手机上：整页，从偏上的位置开始，别顶到状态栏也别沉到底 */
@media (max-width: 719px){
  .login-gate{
    align-items: flex-start;
    padding: calc(9vh + env(safe-area-inset-top)) 22px 24px;
  }
  .lg-sub{ margin-bottom: 24px; }
}

/* ---------------- 找回密码：占位弹窗 ---------------- */
.lg-fp{
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, visibility .2s;
}
.lg-fp.is-on{ opacity: 1; visibility: visible; pointer-events: auto; }
.fp-mask{ position: absolute; inset: 0; background: rgba(32,24,18,.46); }
.fp-card{
  position: relative; width: 100%; max-width: 380px;
  max-height: calc(100vh - 36px); overflow-y: auto;
  padding: 20px 20px 18px;
  background: var(--panel); border-radius: 20px;
  box-shadow: 0 26px 62px -26px rgba(45,28,16,.55);
  transform: translateY(10px) scale(.985);
  transition: transform .22s cubic-bezier(.2,.8,.3,1);
}
.lg-fp.is-on .fp-card{ transform: none; }
.fp-top{ display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fp-top h2{ font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.fp-x{
  flex: none; width: 30px; height: 30px; border: 0; border-radius: 9px;
  background: var(--bg-soft); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.fp-x svg{ width: 14px; height: 14px; }
.fp-x:hover{ background: var(--line); color: var(--text); }
.fp-sub{ margin: 7px 0 12px; font-size: 12px; color: var(--text-2); line-height: 1.65; }

.fp-steps{ display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.fp-dot{
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--bg-soft); color: var(--text-3); border: 1px solid var(--line);
  transition: .16s;
}
.fp-dot.is-on{ background: var(--brand); border-color: var(--brand); color: #fff; }
.fp-steps i{ flex: 1; height: 1px; background: var(--line); }

.fp-banner{
  margin: 0 0 12px; padding: 8px 10px;
  font-size: 11.5px; line-height: 1.65; color: #8A5A12;
  background: var(--amber-soft); border: 1px solid rgba(217,119,6,.28);
  border-radius: 10px;
}
[data-theme="dark"] .fp-banner{ color: #F3C98A; }

.fp-send{
  position: absolute; right: 6px; bottom: 6px;
  height: 30px; padding: 0 10px; border-radius: 8px;
  border: 1px solid rgba(232,93,74,.45); background: var(--brand-soft);
  color: var(--brand); font-family: inherit; font-size: 11.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.fp-send:disabled{
  border-color: var(--line-strong); background: var(--bg-soft);
  color: var(--text-3); cursor: default;
}
.fp-back{
  width: 100%; height: 38px; margin-top: 6px;
  border: 0; background: transparent; color: var(--text-3);
  font-family: inherit; font-size: 12.5px; cursor: pointer; border-radius: 9px;
}
.fp-back:hover{ background: var(--bg-soft); color: var(--text-2); }
.fp-done{ margin: 12px 0 2px; font-size: 12px; color: var(--text-2); line-height: 1.7; }

/* 设置页「账号与登录」里的账号列表 */
.auth-users:empty{ display: none; }
.auth-users{ display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.au-row{
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  padding: 8px 11px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 9px;
}
.au-row b{ font-size: 12.5px; font-weight: 700; }
.au-row span{ font-size: 11px; color: var(--text-3); }

/* V5.17：空的「成片整理」容器要彻底藏掉。
   .media-tools 自带虚线边框 + 背景 + 内边距，只清 innerHTML 会剩一个
   看着像「能装东西」的空框（用户截图里红框那个）。 */
.media-tools[hidden]{ display: none !important; }
/* 空网格也别留 margin —— 那 10px 的上边距看起来就是一个空条 */
.media-grid:empty{ display: none !important; }

/* V5.17：设置页「我的出稿规则」里的「内置风格指引」开关。
   标题和开关同一行（跟别的设置项一样靠右），
   说明文字单独一行 —— 挤在一行里会把按钮顶到下面去，看着跟别的行不齐。 */
.ai-rules .pref-row.is-inset{
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
}
.ai-rules .pref-row.is-inset .pref-lab{ flex: 1 1 auto; }
.ai-rules .pref-row.is-inset .cp-types{ flex: 0 0 auto; margin-top: 0; }
/* 说明文字跟在开关下面，但缩进对齐标题 */
.ai-rules .fold-tip.is-inline{ margin-top: 7px; }

/* ---------------- 首屏遮罩 ----------------
   放在 <body> 最前面，纯 CSS 就能盖住整页，不等任何脚本。
   logo 用的是同一套图标，撤走时淡出，不会闪一下白。 */
.boot-veil{
  position: fixed; inset: 0; z-index: 9998;
  display: grid; place-items: center; align-content: center; gap: 14px;
  background: var(--bg);
  transition: opacity .22s ease;
}
.boot-veil img{
  width: 64px; height: 64px; border-radius: 18px; display: block;
  box-shadow: 0 16px 30px -18px rgba(217,59,43,.9);
}
.boot-veil p{
  margin: 0; font-size: 12.5px; color: var(--text-3); letter-spacing: .6px;
}
.boot-veil.is-out{ opacity: 0; pointer-events: none; }
