/* ============ 智慧餐饮装修后台 ============ */
:root {
  --brand: #AEDE2E;
  --brand-deep: #8FBE1F;
  --brand-dark: #1F2A00;
  --bg: #F2F3F5;
  --panel: #FFFFFF;
  --line: #E8EAED;
  --txt: #1F2329;
  --txt-2: #646A73;
  --txt-3: #9B9EA5;
  --danger: #E5533D;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(31, 42, 0, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--txt);
  font-size: 14px;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ============ 顶栏 ============ */
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  position: relative;
  z-index: 20;
}
/* ⚠️ `flex: 0 0 auto` + `nowrap` 不能省：
   装修视图的右侧动作组多出「撤销 / 套模板 / 导入 / 导出 / 保存并发布」五个按钮，
   顶栏一挤，品牌区就被压成 103px 宽 —— 「智慧餐饮」竖排成三行、logo 顶到边，
   而其它视图完全正常，看起来像「只有装修视图坏了」。
   （2026-10-24 部署到 dining.weimoob.com 后首屏截图发现，本地同样存在） */
.brand {
  display: flex; align-items: center; gap: 8px; font-size: 16px;
  flex: 0 0 auto; white-space: nowrap;
}
.brand-dot {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand-dark); font-size: 14px; font-weight: 800;
}
.brand-sub { color: var(--txt-3); font-size: 12px; margin-left: 2px; }
/* 窄屏先把副标题让出去，保住主标题和页签一行排下（后台按 1280 起屏幕设计） */
@media (max-width: 1280px) { .brand-sub { display: none; } }

.tabs { display: flex; gap: 4px; }
.tab {
  border: none; background: none; padding: 8px 12px;
  font-size: 14px; color: var(--txt-2); border-radius: 8px;
  transition: all .15s;
  /* 加了第 5 个页签（订单）之后顶栏变挤：页签一律不换行，
     宁可让按钮组挤一点，也不要出现「商品管/理」这种断字 */
  white-space: nowrap; flex: 0 0 auto;
}
.tab:hover { background: #F4F7E8; color: var(--txt); }
.tab.is-on { background: #EFF7D6; color: var(--brand-dark); font-weight: 600; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.save-state { font-size: 12px; color: var(--txt-3); margin-right: 6px; }
.save-state.dirty { color: #D97706; }
.save-state.saved { color: #16A34A; }

/* ============ 按钮 ============ */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--txt);
  padding: 7px 14px; border-radius: 8px; font-size: 13px;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand-dark); background: #FBFDF2; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: var(--brand-dark);
  font-weight: 600;
}
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: #FEF2F0; }
.btn-block { width: 100%; margin-top: 8px; }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.icon-btn {
  border: none; background: none; font-size: 15px; color: var(--txt-3);
  padding: 6px; border-radius: 6px;
}
.icon-btn:hover { background: #F2F3F5; color: var(--txt); }

/* ============ 视图容器 ============ */
/* 布局改成「body 一行 flex，视图吃掉剩下的高度」。
   原来写死 `calc(100vh - 56px)`，56px 是顶栏高度 —— 但顶栏上面随时可能多一条
   首次密码提醒条（ADR-060 那条不可关闭的），多出来 36px 就会把视图底部裁掉：
   订单页的分页条正好在底部，被裁掉一截，看起来像「没有分页」。
   用 flex 就不用再关心顶栏有几行。 */
body { display: flex; flex-direction: column; }
.topbar, .firstrun { flex: 0 0 auto; }
.view {
  display: none; flex: 1 1 auto; height: auto; min-height: 0;
}
.view.is-on { display: flex; }

/* ============ 装修三栏 ============ */
#view-diy { overflow: hidden; }

.panel-left {
  width: 240px; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.pl-section { padding: 14px; overflow-y: auto; }
.pl-section.pl-grow { flex: 1; min-height: 0; border-top: 1px solid var(--line); }
.pl-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: baseline; justify-content: space-between; }
.pl-hint { font-size: 11px; color: var(--txt-3); font-weight: 400; }

.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.comp-add {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 12px; color: var(--txt-2); transition: all .15s;
}
.comp-add .ico { font-size: 18px; }
.comp-add:hover { border-color: var(--brand); background: #FBFDF2; color: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow); }

.comp-list { display: flex; flex-direction: column; gap: 4px; }
.comp-item {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 7px 8px; display: flex; align-items: center; gap: 8px;
  cursor: grab; user-select: none; transition: all .15s; font-size: 13px;
}
.comp-item:hover { border-color: var(--brand); }
.comp-item.is-on { border-color: var(--brand); background: #F6FBDF; }
.comp-item.dragging { opacity: .4; border-style: dashed; }
.comp-item.drop-target { border-color: var(--brand-deep); border-top: 2px solid var(--brand-deep); }
.comp-item .ci-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-item .ci-ops { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.comp-item:hover .ci-ops { opacity: 1; }
.ci-op { border: none; background: none; font-size: 12px; color: var(--txt-3); padding: 2px 4px; border-radius: 4px; }
.ci-op:hover { background: #F2F3F5; color: var(--txt); }
.ci-op.off { color: #D97706; }

/* ============ 中栏 · 手机预览 ============ */
.panel-center {
  flex: 1; overflow: auto; display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px; background:
    radial-gradient(circle at 30% 20%, rgba(174,222,46,.06), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(174,222,46,.05), transparent 40%);
}
.phone-wrap { display: flex; justify-content: center; }
.phone {
  width: 375px; min-height: 760px; background: #fff;
  border-radius: 28px; box-shadow: 0 16px 50px rgba(0,0,0,.14), 0 0 0 1px #D6D8DC;
  overflow: hidden; position: relative; display: flex; flex-direction: column;
}
.pv-statusbar {
  height: 40px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; font-size: 13px; font-weight: 700; color: #fff;
  position: relative; z-index: 30; pointer-events: none;
}
.pv-page {
  flex: 1; position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.pv-page-scroll { overflow-y: auto; flex: 1; position: relative; }
.pv-tabbar { position: relative; z-index: 25; }
.pv-homebar {
  height: 22px; background: #fff; display: flex; align-items: flex-end; justify-content: center;
}
.pv-homebar::after {
  content: ""; width: 120px; height: 5px; border-radius: 99px; background: #111; margin-bottom: 7px;
}
.pv-tip { margin-top: 14px; font-size: 12px; color: var(--txt-3); }

/* 预览组件块：可点选 */
.pv-block { position: relative; cursor: pointer; }
.pv-block:hover::after {
  content: ""; position: absolute; inset: 0; border: 1.5px dashed var(--brand-deep); pointer-events: none;
}
.pv-block.is-on { outline: 2px solid var(--brand-deep); outline-offset: -1px; position: relative; }
.pv-block.is-on::before {
  content: attr(data-label);
  position: absolute; top: 0; left: 0; z-index: 40;
  background: var(--brand-deep); color: #fff; font-size: 11px; line-height: 1;
  padding: 3px 7px 3px 5px; border-radius: 0 0 8px 0; pointer-events: none;
}
.pv-block.is-dim { opacity: .35; }

/* 热区可视化 */
.pv-hot-area {
  position: absolute; border: 1.5px dashed rgba(46,116,255,.85); background: rgba(46,116,255,.10);
}

/* ============ 驼式 tabbar（复刻小程序） ============ */
.tabbar { position: relative; padding: 0 12px 7px; }
.tabbar-bg {
  position: absolute; left: 12px; right: 12px; bottom: 7px; height: 54px;
  background: #fff; border-radius: 999px; box-shadow: 0 4px 16px rgba(0,0,0,.10);
}
.tabbar-row { position: relative; display: flex; align-items: flex-end; height: 54px; }
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 54px; position: relative;
}
.tab-icon { width: 23px; height: 23px; background-size: 100% 100%; background-repeat: no-repeat; background-position: center; }
.tab-label { margin-top: 2px; font-size: 10px; color: #9B9EA5; }
.tab-label.is-active { color: #2B2B2B; font-weight: 600; }
.tab-item.is-bump { justify-content: flex-end; padding-bottom: 3px; }
.bump-btn {
  position: absolute; top: -17px; left: 50%; transform: translateX(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: #AEDE2E; border: 4px solid #fff;
  box-shadow: 0 3px 10px rgba(174,222,46,.45);
  display: flex; align-items: center; justify-content: center;
}
.bump-icon { width: 25px; height: 25px; background-size: 100% 100%; background-repeat: no-repeat; background-position: center; }
.bump-label { font-size: 10px; color: #2B2B2B; }

/* ============ 右栏 · 属性面板 ============ */
.panel-right {
  width: 340px; background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.pr-head {
  padding: 14px 16px 10px; font-weight: 700; font-size: 14px;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px;
}
.pr-head .badge {
  font-size: 11px; background: #EFF7D6; color: var(--brand-dark);
  padding: 2px 8px; border-radius: 99px; font-weight: 600;
}
.pr-body { flex: 1; overflow-y: auto; padding: 12px 16px 20px; }
.pr-foot { border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 8px; }

/* 表单组 */
.f-group { margin-bottom: 16px; }
.f-group-title {
  font-size: 12px; font-weight: 700; color: var(--txt-2);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.f-group-title::before { content: ""; width: 3px; height: 12px; background: var(--brand); border-radius: 2px; }

.f-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.f-row > label { width: 72px; flex-shrink: 0; font-size: 12px; color: var(--txt-2); text-align: right; }
.f-row .ctrl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }

.input, .select {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  font-size: 13px; width: 100%; background: #fff; color: var(--txt);
  outline: none; transition: border .15s;
}
.input:focus, .select:focus { border-color: var(--brand-deep); }
.input.num { width: 74px; flex: 0 0 auto; text-align: right; }
.unit { font-size: 11px; color: var(--txt-3); }

textarea.input { resize: vertical; min-height: 60px; line-height: 1.5; }

/* 颜色控件 */
.color-ctrl { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.color-chip {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line);
  flex-shrink: 0; position: relative; overflow: hidden; cursor: pointer;
}
.color-chip input[type=color] {
  position: absolute; inset: -6px; width: 40px; height: 40px; border: none; padding: 0; cursor: pointer; opacity: 0;
}
.color-text { flex: 1; min-width: 0; }

/* 图片控件 */
.img-ctrl { display: flex; gap: 8px; align-items: flex-start; }
.img-thumb {
  width: 64px; height: 64px; border-radius: 8px; border: 1px dashed var(--line);
  background: #F7F8FA center/cover no-repeat; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--txt-3); font-size: 11px;
}
.img-ctrl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.img-btns { display: flex; gap: 6px; }

/* 行列表（图片列表/热区列表/功能列表等） */
.list-ctrl { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.list-item { padding: 10px; background: #fff; border-bottom: 1px solid #F2F3F5; position: relative; }
.list-item:last-child { border-bottom: none; }
.list-item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.list-item-head b { font-size: 12px; color: var(--txt-2); }
.list-item-ops { display: flex; gap: 2px; }
.list-add { display: block; width: 100%; padding: 8px; border: none; background: #FAFBFC; color: var(--txt-2); font-size: 12px; }
.list-add:hover { background: #F2F7E3; color: var(--brand-dark); }

/* 开关 */
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 2; }
.switch .track {
  position: absolute; inset: 0; background: #D5D8DD; border-radius: 99px; transition: background .18s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: left .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { left: 18px; }

/* 滑块 */
.range-ctrl { display: flex; align-items: center; gap: 8px; flex: 1; }
.range-ctrl input[type=range] { flex: 1; accent-color: var(--brand-deep); }
.range-val { width: 44px; text-align: right; font-size: 12px; color: var(--txt-2); flex-shrink: 0; }

/* ============ 装修预览的组件样式（与小程序 diy-render 对齐，1px=1px@375）============ */
.diy-block { position: relative; }

.diy-swiper { width: 100%; position: relative; overflow: hidden; }
.diy-swiper-track { display: flex; transition: transform .4s ease; height: 100%; }
.diy-swiper-item { flex-shrink: 0; width: 100%; height: 100%; }
.diy-swiper-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.diy-swiper-dots { position: absolute; bottom: 6px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; z-index: 5; }
.diy-swiper-dot { width: 5px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.45); }
.diy-swiper-dot.is-on { background: #fff; }

.diy-cube { display: flex; flex-wrap: wrap; width: 100%; }
.diy-cube-item { box-sizing: border-box; }
.diy-cube-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }

.diy-imggroup { width: 100%; }
.diy-imggroup-img { width: 100%; display: block; object-fit: cover; }
.diy-imggroup-img + .diy-imggroup-img { margin-top: 5px; }

.diy-hot { position: relative; width: 100%; }
.diy-hot-img { width: 100%; display: block; }

.diy-caption { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px; }
.diy-caption-main { display: flex; align-items: baseline; flex: 1; min-width: 0; }
.diy-caption-name { line-height: 1.3; }
.diy-caption-desc { margin-left: 6px; line-height: 1.3; }
.diy-caption-more { display: flex; align-items: center; font-size: 12px; color: #9B9EA5; flex-shrink: 0; }
.diy-arrow { font-size: 13px; color: #C4C6CC; margin-left: 3px; }

.diy-notice { display: flex; align-items: center; background: #fff; padding: 9px 10px; border-radius: 8px; }
.diy-notice-icon { font-size: 13px; margin-right: 5px; }
.diy-notice-text { flex: 1; font-size: 12px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.diy-storevalue { display: flex; align-items: center; justify-content: space-between; background: #fff; padding: 14px 12px; border-radius: 8px; }
.diy-sv-left { display: flex; flex-direction: column; }
.diy-sv-label { font-size: 12px; margin-bottom: 4px; }
.diy-sv-num { display: flex; align-items: baseline; }
.diy-sv-sym { font-size: 12px; font-weight: 700; margin-right: 2px; }
.diy-sv-value { font-size: 22px; font-weight: 700; font-family: 'DIN Alternate', sans-serif; line-height: 1; }
.diy-sv-btn { height: 32px; padding: 0 16px; border-radius: 999px; font-size: 13px; display: flex; align-items: center; justify-content: center; font-weight: 600; }

.diy-goods { border-radius: 8px; overflow: hidden; }
.diy-goods-item { display: flex; padding: 10px; background: #fff; }
.diy-goods-item + .diy-goods-item { border-top: 1px solid #F5F5F5; }
.diy-goods-img { width: 90px; height: 90px; border-radius: 6px; flex-shrink: 0; background: #F5F6F7; object-fit: cover; }
.diy-goods-info { flex: 1; min-width: 0; margin-left: 10px; display: flex; flex-direction: column; }
.diy-goods-name { font-size: 15px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diy-goods-desc { margin-top: 3px; font-size: 11px; color: #9B9EA5; line-height: 1.4; height: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diy-goods-bottom { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; }
.diy-goods-price { display: flex; align-items: baseline; }
.diy-sym { font-size: 11px; font-weight: 700; color: #1A1A1A; }
.diy-goods-amount { font-size: 17px; font-weight: 700; font-family: 'DIN Alternate', sans-serif; line-height: 1; }
.price-origin { font-size: 11px; color: #9B9EA5; text-decoration: line-through; margin-left: 4px; }
.diy-goods-add { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #1F2A00; font-size: 17px; font-weight: 700; line-height: 1; flex-shrink: 0; }

.diy-memberinfo { background: linear-gradient(135deg, #AEDE2E 0%, #8FBE1F 100%); border-radius: 12px; padding: 16px 14px 12px; }
.diy-mi-top { display: flex; align-items: center; }
.diy-mi-avatar { width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(255,255,255,.65); flex-shrink: 0; object-fit: cover; background: #fff; }
.diy-mi-info { flex: 1; min-width: 0; margin-left: 10px; }
.diy-mi-name-row { display: flex; align-items: center; }
.diy-mi-name { font-size: 17px; font-weight: 700; color: #1F2A00; }
.diy-mi-level { margin-left: 6px; height: 17px; padding: 0 6px; border-radius: 999px; background: rgba(31,42,0,.16); color: #1F2A00; font-size: 10px; display: flex; align-items: center; }
.diy-mi-phone { margin-top: 3px; font-size: 12px; color: rgba(31,42,0,.6); }
.diy-mi-code { height: 28px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,.9); color: #1F2A00; font-size: 12px; font-weight: 600; display: flex; align-items: center; }
.diy-mi-stats { margin-top: 14px; display: flex; background: rgba(255,255,255,.72); border-radius: 8px; padding: 10px 0; }
.diy-mi-stat { flex: 1; display: flex; flex-direction: column; align-items: center; }
.diy-mi-num { font-size: 16px; font-weight: 700; color: #1F2A00; font-family: 'DIN Alternate', sans-serif; }
.diy-mi-label { margin-top: 2px; font-size: 10px; color: rgba(31,42,0,.6); }

.diy-func { display: flex; flex-wrap: wrap; background: #fff; border-radius: 8px; padding: 12px 0 4px; }
.diy-func-item { width: 25%; display: flex; flex-direction: column; align-items: center; margin-bottom: 12px; }
.diy-func-icon { width: 38px; height: 38px; border-radius: 50%; background: rgba(174,222,46,.14); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.diy-func-label { margin-top: 5px; font-size: 11px; color: #666; }

.diy-stored { background: #fff; border-radius: 8px; padding: 12px; }
.diy-stored-head, .diy-coupon-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; }
.diy-stored-cards { display: flex; margin-top: 9px; }
.diy-stored-card { flex: 1; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; }
.diy-stored-card + .diy-stored-card { margin-left: 8px; }
.diy-stored-title { font-size: 13px; font-weight: 600; }
.diy-stored-desc { margin-top: 3px; font-size: 10px; }
.diy-stored-btn { margin-top: 8px; height: 24px; border-radius: 999px; background: rgba(255,255,255,.85); color: #8A5B00; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; align-self: flex-start; padding: 0 11px; }

.diy-coupon { background: #fff; border-radius: 8px; padding: 12px; }
.diy-coupon-list { margin-top: 9px; }
.diy-coupon-item { display: flex; border-radius: 6px; overflow: hidden; background: #FAFAFA; }
.diy-coupon-item + .diy-coupon-item { margin-top: 6px; }
.diy-coupon-left { width: 75px; display: flex; align-items: baseline; justify-content: center; padding: 9px 0; color: #fff; }
.diy-coupon-amount { font-size: 22px; font-weight: 700; font-family: 'DIN Alternate', sans-serif; line-height: 1; }
.diy-coupon-unit { font-size: 10px; margin-left: 2px; }
.diy-coupon-right { flex: 1; padding: 9px 10px; display: flex; flex-direction: column; justify-content: center; }
.diy-coupon-name { font-size: 13px; font-weight: 600; color: #1A1A1A; }
.diy-coupon-time { margin-top: 3px; font-size: 10px; }

.diy-benefit { background: #fff; border-radius: 8px; padding: 12px; }
.diy-benefit-head { display: flex; align-items: center; justify-content: space-between; }
.diy-benefit-title { font-size: 14px; font-weight: 600; }
.diy-benefit-more { font-size: 11px; color: #9B9EA5; }
.diy-benefit-grid { display: flex; margin-top: 12px; }
.diy-benefit-item { flex: 1; display: flex; flex-direction: column; align-items: center; }
.diy-benefit-icon { font-size: 20px; }
.diy-benefit-label { margin-top: 5px; font-size: 11px; color: #666; }

/* ============ 商品管理 ============ */
#view-goods { display: none; padding: 16px; gap: 16px; overflow: auto; }
#view-goods.is-on { display: flex; }
.goods-layout { flex: 1; display: flex; gap: 16px; min-width: 0; }
.goods-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.goods-toolbar { display: flex; gap: 8px; align-items: center; background: #fff; padding: 12px; border-radius: var(--radius); }
.goods-toolbar .input { width: 180px; }
.goods-toolbar .select { width: 130px; }
.goods-count { margin-left: auto; font-size: 12px; color: var(--txt-3); }
.goods-table-wrap { background: #fff; border-radius: var(--radius); overflow: auto; border: 1px solid var(--line); }
.goods-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.goods-table th {
  text-align: left; padding: 10px 12px; background: #FAFBFC; color: var(--txt-2);
  font-weight: 600; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2;
}
.goods-table td { padding: 10px 12px; border-bottom: 1px solid #F2F3F5; vertical-align: middle; }
.goods-table tr:hover td { background: #FBFDF6; }
.g-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #F5F6F7; }
.g-tags { display: flex; gap: 4px; flex-wrap: wrap; }
/* 「活动价」是一个词：不加 nowrap 会在 70px 的列里被拆成「活动」+「价」两行 */
.g-tag { font-size: 11px; background: #F4F7E8; color: var(--brand-dark); padding: 1px 7px; border-radius: 99px; white-space: nowrap; }
.g-tag.hot { background: #FEF0EC; color: #C2410C; }
.st { font-size: 12px; padding: 2px 10px; border-radius: 99px; display: inline-block; }
.st.on { background: #E8F7E3; color: #15803D; }
.st.off { background: #F2F3F5; color: var(--txt-3); }

.goods-side { width: 260px; flex-shrink: 0; background: #fff; border-radius: var(--radius); padding: 14px; height: fit-content; }
.cat-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.cat-item {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px;
}
.cat-item .ci-emoji { font-size: 16px; }
.cat-item input { border: none; outline: none; flex: 1; min-width: 0; font-size: 13px; background: none; }
.cat-item .ci-id { font-size: 11px; color: var(--txt-3); }

/* 抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.32); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 90; }
.drawer-mask.is-on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: -520px; width: 500px; max-width: 92vw; height: 100vh;
  background: #fff; z-index: 95; display: flex; flex-direction: column;
  transition: right .24s ease; box-shadow: -12px 0 40px rgba(0,0,0,.12);
}
.drawer.is-on { right: 0; }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* 规格编辑 */
.spec-block { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: #FAFBFC; }
.spec-row { display: flex; gap: 6px; margin-bottom: 6px; }
.spec-row .input { flex: 1; }
.spec-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.spec-opt { display: flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: 12px; }
.spec-opt .x { color: var(--txt-3); cursor: pointer; }

/* 加料勾选 */
.addon-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.addon-check { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; user-select: none; }
.addon-check.is-on { border-color: var(--brand-deep); background: #F6FBDF; color: var(--brand-dark); }

/* ============ 门店设置 ============ */
#view-store { display: none; padding: 16px; gap: 16px; overflow: auto; }
#view-store.is-on { display: flex; }
.store-layout { flex: 1; display: flex; gap: 16px; align-items: flex-start; }
.store-form { flex: 1; min-width: 0; background: #fff; border-radius: var(--radius); padding: 20px 24px; }
.store-side { width: 330px; flex-shrink: 0; }
.store-preview { background: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.sp-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.sp-head { display: flex; align-items: center; gap: 10px; }
.sp-logo { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: #F5F6F7; }
.sp-name { font-weight: 700; font-size: 15px; }
.sp-sub { font-size: 12px; color: var(--txt-3); margin-top: 2px; }
.sp-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.sp-row { display: flex; font-size: 12px; color: var(--txt-2); gap: 8px; }
.sp-row b { flex-shrink: 0; width: 60px; font-weight: 500; color: var(--txt-3); }

/* ============ 弹层 ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 100; display: none; align-items: center; justify-content: center; }
.modal-mask.is-on { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 560px; max-width: 94vw; max-height: 84vh;
  display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.2);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }

/* 模板选择卡 */
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tpl-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: all .15s; }
.tpl-card:hover { border-color: var(--brand-deep); box-shadow: var(--shadow); transform: translateY(-2px); }
.tpl-thumb { height: 150px; background: #F7F8FA; overflow: hidden; position: relative; }
.tpl-thumb .mini { width: 100%; transform-origin: top center; pointer-events: none; }
.tpl-info { padding: 10px 12px; }
.tpl-name { font-weight: 700; font-size: 13px; }
.tpl-desc { font-size: 11px; color: var(--txt-3); margin-top: 3px; line-height: 1.5; }

/* 商品选择弹层 */
.pick-goods { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; }
.pick-goods-item {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; cursor: pointer; user-select: none;
}
.pick-goods-item.is-on { border-color: var(--brand-deep); background: #F6FBDF; }
.pick-goods-item img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: #F5F6F7; }
.pg-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-price { font-size: 13px; font-weight: 700; color: #C2410C; }
.pg-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #D5D8DD; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; flex-shrink: 0; }
.pick-goods-item.is-on .pg-check { background: var(--brand); border-color: var(--brand-deep); color: var(--brand-dark); }

/* toast */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-16px);
  background: #1F2329; color: #fff; padding: 10px 22px; border-radius: 99px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #15803D; }
.toast.err { background: #B91C1C; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D5D8DD; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #B8BCC2; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 营销中心 ============ */
.mkt-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 280px;
  gap: 14px;
  padding: 14px;
  height: 100%;
  overflow: hidden;
}
.mkt-nav, .mkt-main, .mkt-side {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-y: auto;
  padding: 16px;
}
.mkt-nav { display: flex; flex-direction: column; }
.mkt-nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 10px 11px; margin-bottom: 6px;
  background: #FAFBFC; border: 1px solid transparent; border-radius: 9px;
  transition: .15s;
}
.mkt-nav-item:hover { background: #F4F8E8; }
.mkt-nav-item.is-on {
  background: #F7FCE8; border-color: var(--brand);
  box-shadow: inset 3px 0 0 var(--brand);
}
.mkt-nav-ico { font-size: 18px; line-height: 1; }
.mkt-nav-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mkt-nav-txt b { font-size: 13px; color: var(--txt); }
.mkt-nav-txt i { font-size: 11px; color: var(--txt-3); font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-planned-tip {
  margin: 16px 0 8px; font-size: 11px; color: var(--txt-3);
  border-top: 1px dashed var(--line); padding-top: 12px;
}
.mkt-nav-planned { display: flex; flex-wrap: wrap; gap: 5px; }
.mkt-chip {
  font-size: 11px; color: var(--txt-2);
  background: #F3F4F6; border: 1px solid var(--line);
  padding: 3px 7px; border-radius: 999px; cursor: default;
}
.mkt-chip:hover { border-color: var(--brand); color: var(--brand-dark); background: #FBFDF2; }

.mkt-main { display: flex; flex-direction: column; }
.mkt-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
}
.mkt-head h2 { font-size: 17px; font-weight: 800; }
.mkt-head p { font-size: 12px; color: var(--txt-3); margin-top: 4px; }
.mkt-body { flex: 1; overflow-y: auto; padding-right: 4px; }
.mkt-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.mkt-hint { font-size: 12px; color: var(--txt-3); }
.mkt-note {
  margin-top: 12px; font-size: 12px; color: var(--txt-2);
  background: #FAFCF3; border: 1px dashed #DCE8B8; border-radius: 8px; padding: 10px 12px;
}
.mkt-empty { padding: 40px; text-align: center; color: var(--txt-3); font-size: 13px; }

/* 优惠券卡片 */
.cp-list { display: flex; flex-direction: column; gap: 10px; }
.cp-card {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--line); border-radius: 11px; overflow: hidden;
  background: #fff;
}
.cp-left {
  width: 108px; flex: 0 0 108px;
  background: var(--cp, #FF6B35); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 14px 6px;
  position: relative;
}
.cp-left::after {
  content: ''; position: absolute; right: -1px; top: 0; bottom: 0;
  border-right: 1px dashed rgba(255,255,255,.55);
}
.cp-left b { font-size: 24px; font-weight: 800; line-height: 1; }
.cp-left b i { font-size: 12px; font-style: normal; margin-left: 2px; }
.cp-left span { font-size: 11px; opacity: .9; }
.cp-mid { flex: 1; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cp-name { font-size: 14px; font-weight: 700; }
.cp-off { font-size: 11px; color: var(--danger); font-style: normal; font-weight: 400; margin-left: 6px; }
.cp-desc { font-size: 12px; color: var(--txt-2); }
.cp-meta { font-size: 11px; color: var(--txt-3); }
.cp-ops { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 10px 12px; }

.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 6px; }

/* 券编辑器 */
.cp-editor {
  margin-top: 14px; border: 1px solid var(--brand); border-radius: 11px;
  background: #FDFFF7; overflow: hidden;
}
.cp-editor-head { padding: 11px 14px; font-weight: 700; font-size: 13px; background: #F7FBE9; border-bottom: 1px solid #E6EFC9; }
.cp-editor-body { padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cp-editor-foot { padding: 11px 14px; border-top: 1px solid #E6EFC9; display: flex; justify-content: flex-end; gap: 8px; }

.fld { display: flex; flex-direction: column; gap: 5px; }
.fld label { font-size: 12px; color: var(--txt-2); }
.fld-tip { font-size: 11px; color: var(--txt-3); }
.input-sm { width: 84px; }
/* 行内窄输入（档位门槛 / 积分值 / 库存 / 限兑份数）。
   `.input` 默认 width:100%，塞进 flex 行里会被压到只剩一两个字宽，
   「积分」这种两字标签就竖着排成两行了。 */
.input-xs { width: 86px; flex: 0 0 auto; text-align: right; }

/* 开关行 */
.sw-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: #FAFBFC; border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 10px;
}
.sw-txt b { font-size: 13px; display: block; }
.sw-txt i { font-size: 11px; color: var(--txt-3); font-style: normal; }
.sw {
  width: 44px; height: 24px; border-radius: 999px; border: none;
  background: #D5D8DE; position: relative; transition: .18s; flex: 0 0 44px;
}
.sw span {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.sw.is-on { background: var(--brand); }
.sw.is-on span { left: 23px; }

/* 规则行 */
.rule-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.rule-row {
  display: flex; align-items: center; gap: 8px;
  background: #FAFBFC; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
  font-size: 13px; color: var(--txt-2);
}
.rule-row .input { width: 90px; }

.mkt-form { display: flex; flex-direction: column; gap: 14px; }
.mkt-form .fld { max-width: 420px; }
.inline { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--txt-2); }
.chk-group { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.chk { font-size: 12px; display: flex; align-items: center; gap: 5px; color: var(--txt-2); }

.mkt-side { display: flex; flex-direction: column; }
.mkt-effect { display: flex; flex-direction: column; gap: 9px; font-size: 12px; color: var(--txt-2); line-height: 1.55; }
.mkt-effect-row { display: flex; gap: 7px; }
.mkt-effect-row span { color: var(--brand-deep); font-weight: 700; }
/* 正文单独一块：flex 容器的裸文本会被拆成多个 flex item，`<b>` 就会跑到另一列去 */
.mkt-effect-txt { flex: 1; min-width: 0; }

/* ============ 营销中心 · 商品级优惠 ============ */
.ip-list { display: flex; flex-direction: column; gap: 10px; }
.ip-card {
  border: 1px solid var(--line); border-radius: 11px;
  background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px;
}
.ip-card.is-off { background: #FAFAFB; opacity: .72; }
.ip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ip-head b { font-size: 14px; color: var(--txt); }
.ip-ops { display: flex; align-items: center; gap: 8px; }
.ip-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--txt-2); }
.ip-line .input { width: auto; }
.ip-line .input-sm { width: 74px; flex: 0 0 74px; text-align: center; }
.ip-name { width: 150px; }
.ip-chks {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  padding: 8px 10px; background: #FAFAFB; border: 1px solid var(--line);
  border-radius: 8px; max-height: 132px; overflow-y: auto;
}
.ip-chks-goods .chk { width: calc(50% - 7px); }
.ip-desc {
  font-size: 12px; color: var(--brand-dark);
  background: #F5FAE6; border-radius: 7px; padding: 6px 10px;
}

/* ============ 营销中心 · 超值换购 ============ */
.ad-card {
  border: 1px solid var(--line); border-radius: 11px;
  background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px;
  border-left: 3px solid #FF8A3D;
}
.ad-card.is-off { background: #FAFAFB; opacity: .72; border-left-color: var(--line); }
.ad-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ad-head b { font-size: 14px; color: var(--txt); }
.ad-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--txt-2); }
.ad-line .input { width: auto; }
.ad-line .input-sm { width: 74px; flex: 0 0 74px; text-align: center; }
.ad-name { width: 100%; }
.ad-pool { display: flex; flex-direction: column; gap: 6px; }
.ad-pool-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--txt-2); font-weight: 600;
}
.ad-chks { max-height: 150px; }
.ad-chks .chk { width: calc(50% - 7px); }
.ad-price { font-style: normal; color: #FF8A3D; font-size: 11px; }
.ad-pool-tip { font-size: 12px; color: var(--txt-3); line-height: 1.5; }
.ad-pool-tip i { font-style: normal; color: var(--brand-dark); }

/* ============ 营销中心 · 兑换码 ============ */
.rc-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; margin-bottom: 12px;
}
.rc-top b { display: block; font-size: 14px; color: var(--txt); }
.rc-top i { display: block; margin-top: 3px; font-size: 12px; font-style: normal; color: var(--txt-3); }

.rc-form {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px 12px; margin-bottom: 12px;
}
.rc-form-title {
  font-size: 13px; font-weight: 600; color: var(--txt);
  margin-bottom: 10px; padding-left: 8px; border-left: 3px solid var(--brand);
}
.rc-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px;
}
.rc-fld { display: flex; flex-direction: column; gap: 5px; }
.rc-fld > span { font-size: 12px; color: var(--txt-2); }
.rc-fld .input, .rc-fld .select { width: 100%; }
.rc-form-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line);
}
.rc-hint { font-size: 12px; color: var(--txt-3); line-height: 1.5; }

.rc-batch {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 15px; margin-bottom: 10px;
}
.rc-b-head { display: flex; align-items: center; gap: 8px; }
.rc-b-head b { font-size: 14px; color: var(--txt); }
.rc-b-stat { margin-left: auto; font-size: 12px; color: var(--txt-2); }
.rc-badge {
  font-size: 11px; font-style: normal; padding: 1px 7px; border-radius: 20px;
  background: #F0F5DF; color: #5C7A00;
}
.rc-badge.is-void, .rc-badge.is-exp { background: #F2F3F5; color: var(--txt-3); }
.rc-badge.is-done { background: #FFF2E8; color: #B45309; }
.rc-b-meta {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  margin-top: 7px; font-size: 12px; color: var(--txt-3);
}
.rc-b-ops { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.rc-codes {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 6px; margin-top: 10px; padding: 10px;
  background: #FAFAFB; border: 1px solid var(--line); border-radius: 8px;
  max-height: 190px; overflow-y: auto;
}
.rc-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; letter-spacing: .4px; text-align: center;
  padding: 4px 2px; border-radius: 5px; background: #fff; border: 1px solid var(--line);
  color: var(--txt); cursor: text; user-select: all;
}
.rc-code.is-used { color: #B9BDC4; text-decoration: line-through; background: transparent; }

.rc-recs {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px; margin-top: 12px;
}
.rc-rec {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; font-size: 12px; color: var(--txt-2);
  border-bottom: 1px dashed var(--line);
}
.rc-rec:last-child { border-bottom: 0; }
.rc-rec-code { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--txt); }
.rc-rec-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-rec-val { color: var(--brand-dark); }
.rc-rec-at { color: var(--txt-3); }

/* ============ 营销中心 · 权益卡 ============ */
.rg-gifts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px dashed #E3E5E9;
  border-radius: 8px;
  background: #FCFCFD;
}
.rg-gift {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--txt-2);
}
.rg-gift .chk { flex: 1; min-width: 0; }
.rg-num { width: 62px; flex: 0 0 62px; text-align: center; }
.rg-num:disabled { background: #F4F5F7; color: #B9BCC2; }
.rg-unit { color: var(--txt-3); font-size: 12px; flex: 0 0 auto; }
.rg-name { flex: 0 0 160px; }
.rg-desc { flex: 1; min-width: 0; }

/* ============ 营销中心 · 邀请有礼 ============ */
.iv-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #FCFDF9;
}
.iv-side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.iv-side-head b { font-size: 13px; color: var(--txt); }
.iv-side-now {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-deep);
  text-align: right;
}
.iv-desc {
  width: 100%;
  min-height: 52px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
.iv-ledger {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.iv-ledger-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.iv-ledger-head b { font-size: 13px; color: var(--txt); }
.iv-ledger-head span { font-size: 12px; color: var(--txt-3); }
.iv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.iv-table th {
  text-align: left;
  font-weight: 500;
  color: var(--txt-3);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.iv-table td {
  padding: 8px;
  border-bottom: 1px solid #F5F6F8;
  color: var(--txt-2);
  vertical-align: top;
}
.iv-table tr:last-child td { border-bottom: none; }
.iv-table code {
  font-size: 12px;
  letter-spacing: .5px;
  color: var(--brand-dark);
  background: #F4F9E6;
  padding: 1px 6px;
  border-radius: 4px;
}
.iv-table th:nth-child(1), .iv-table td:nth-child(1) { width: 74px; }
.iv-who { white-space: nowrap; }
.iv-who span { display: block; font-size: 11px; color: var(--txt-3); white-space: nowrap; }
.iv-rw div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 168px; }
.iv-rw i {
  font-style: normal;
  display: inline-block;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  font-size: 10px;
  color: var(--txt-3);
  background: #F2F3F5;
  border-radius: 3px;
  margin-right: 5px;
}
.iv-when { white-space: nowrap; color: var(--txt-3); }
.iv-over {
  font-style: normal;
  font-size: 11px;
  color: var(--danger);
  background: #FDEEEC;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}
.iv-st {
  white-space: nowrap;
  font-size: 11px;
  color: var(--txt-3);
  background: #F2F3F5;
  border-radius: 4px;
  padding: 1px 7px;
}
.iv-st.is-done { color: #4E7A0B; background: #EFF8DA; }
.iv-ledger-tip { font-size: 11px; color: var(--txt-3); line-height: 1.6; }

/* ============ 营销中心 · 好友价 ============ */
.fp-type {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px; background: #FAFBFC; border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 10px;
}
.fp-type > span:first-child { font-size: 12px; color: var(--txt-2); font-weight: 600; }
/* radio 原生控件在后台里偏小，给一点呼吸感 */
.fp-type .chk { gap: 6px; }

.fp-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; margin-bottom: 8px;
}
.fp-table th {
  text-align: left; font-weight: 600; font-size: 11px; color: var(--txt-3);
  background: #FAFBFC; padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.fp-table td { padding: 8px 10px; border-bottom: 1px solid #F1F2F4; vertical-align: middle; }
.fp-table tr:last-child td { border-bottom: none; }
.fp-table tr.is-bad td { background: #FFF6F5; }
.fp-table .input-sm { width: 78px; }
.fp-origin { color: var(--txt-3); text-decoration: line-through; white-space: nowrap; }
.fp-save { color: #C2410C; font-weight: 700; white-space: nowrap; }
.fp-bad { color: var(--danger); font-style: normal; white-space: nowrap; }
.fp-missing { color: var(--danger); font-style: normal; }

.fp-add { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.fp-add .select { width: 220px; }

.fp-rate { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.fp-rate-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--txt-2); }
.fp-rate-line .select { width: 130px; margin-left: 6px; }

.fp-opts {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px; background: #FAFBFC; border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 10px;
}
.fp-opt { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--txt-2); }
.fp-opt .input-sm { width: 84px; }

/* ---------- 限时免费（第 13 个玩法） ---------- */
/* 时段用一个紧凑的行内布局：这是全面板唯一会被反复增删的字段，行高必须稳 */
.fr-slots { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.fr-slot {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: #FAFBFC;
  border: 1px solid var(--line); border-radius: 10px;
  width: fit-content;
}
.fr-slot .input-sm { width: 110px; }
.fr-to { font-size: 12px; color: var(--txt-2); }

/* 星期多选：七个方块一行，别折行（折行后容易点错） */
.fr-wd { margin-right: 4px; white-space: nowrap; }

/* 今日核销：数据来自服务端台账，拉不到就不渲染（不编数字） */
/* 看板两行固定：第一行是今天的绝对数，第二行是「队伍现状 / 统计口径」。
   原来是 flex 一行左右并排，数据一多左边就被挤成两行、右边也对不齐
   （「过号 1 桌」曾因此掉到第二行开头，看着像另一个指标）。 */
.fr-stat {
  display: block;
  padding: 10px 14px; margin-bottom: 10px;
  background: #FFF6F2; border: 1px solid #FFD6C7; border-radius: 10px;
  font-size: 12px; line-height: 1.75; color: #A93216;
}
.fr-stat > span { display: block; }
.fr-stat b { font-size: 15px; color: #C0392B; }
.fr-stat .fld-tip { margin: 0; }

/* 商品冲突提示：同一件商品既免费又挂在换购/好友价上（引擎会摘掉，运营看不出来） */
.fr-warn {
  margin-top: 10px; padding: 10px 14px;
  background: #FFFBEB; border: 1px solid #FDE68A; border-left: 3px solid #F59E0B;
  border-radius: 8px; font-size: 12px; line-height: 1.7; color: #92400E;
}
.fr-warn b { color: #B45309; }

/* ---------- 裂变抽奖（第 14 个玩法） ---------- */
/* 9 列的奖品表：面板宽度不够时横向滚动，不要压缩输入框（压了就没法填权重） */
/* 奖项卡：一行一个奖项要摆 8 个可编辑字段，主栏只有 ~560px，
   做成表格必然横向滚动（右半截看不见）。所以拆两排 + flex-wrap，
   窄了往下折行，不会有「看不见的列」。 */
.lp-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.lp-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #fff;
}
.lp-item-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.lp-item-top .lp-name { flex: 1; min-width: 0; }
.lp-ico {
  width: 42px; flex: none; text-align: center;
  padding-left: 0; padding-right: 0; font-size: 15px;
}
.lp-type { width: 100px; flex: none; }
/* 面值可能是一个 select + 数字（优惠券），宽度不可控；
   把「已发」放同一行右侧，把权重/总量/每日单独放一行 ——
   两行都是确定性的，不依赖 flex-wrap 的折行结果（折出来经常只剩一个孤立控件）。 */
.lp-item-bot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 11px; color: var(--txt-3);
}
.lp-item-num { display: flex; align-items: center; gap: 18px; margin-top: 8px;
  font-size: 11px; color: var(--txt-3); }
.lp-f { display: inline-flex; align-items: center; gap: 5px; }
.lp-f > i { font-style: normal; white-space: nowrap; }
.lp-f .lp-num { width: 62px; }
/* 数字框的上下箭头在 62px 里要吃掉 16px，三位数就被截成「10(」 */
.lp-num::-webkit-outer-spin-button,
.lp-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.lp-num { -moz-appearance: textfield; }
.lp-val { display: inline-flex; align-items: center; gap: 5px; }
.lp-val .select { width: 104px; }
.lp-unit { font-size: 11px; color: var(--txt-3); white-space: nowrap; }
.lp-pct {
  color: #C2410C; font-weight: 700; white-space: nowrap;
  font-variant-numeric: tabular-nums; min-width: 38px;
}
.lp-issued { white-space: nowrap; color: var(--txt-3); }
.lp-issued b { color: #111; }
.lp-issued i { font-style: normal; font-size: 11px; color: #9A7B3A; }

/* 最近记录：一行一条，别做成表格（字段太少，表格看着更乱） */
.lp-recs {
  margin-bottom: 10px; padding: 10px 14px;
  background: #FAFBFC; border: 1px solid var(--line); border-radius: 10px;
}
.lp-recs-head { font-size: 11px; color: var(--txt-3); margin-bottom: 6px; }
.lp-rec {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--txt-2); line-height: 24px;
}
.lp-rec-at { color: var(--txt-3); font-variant-numeric: tabular-nums; }
.lp-rec-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-rec-name.is-win { color: #C2410C; font-weight: 600; }
.lp-rec-who { color: var(--txt-3); font-size: 11px; }

/* ---------- 取号排队 ---------- */
/* 桌型卡和奖项卡同一个思路：主栏 560px 放不下一行 5 个字段，
   拆两排比横向滚动强（横向滚动时右半截永远看不见）。 */
.tq-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }

.tq-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #fff;
}

.tq-item-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.tq-item-top .tq-name { flex: 1; min-width: 0; }
.tq-seats { width: 92px; flex: none; }
.tq-prefix {
  width: 46px; flex: none; text-align: center;
  padding-left: 0; padding-right: 0; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tq-item-num {
  display: flex; align-items: center; gap: 16px;
  font-size: 11px; color: var(--txt-3);
}
.tq-f { display: inline-flex; align-items: center; gap: 5px; }
.tq-f > i { font-style: normal; white-space: nowrap; }
.tq-num { width: 62px; }
/* 数字框的上下箭头在 62px 里要吃掉 16px，三位数会被截成「10(」 */
.tq-num::-webkit-outer-spin-button,
.tq-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tq-num { -moz-appearance: textfield; }
.tq-unit { font-size: 11px; color: var(--txt-3); white-space: nowrap; }
.tq-eta { margin-left: auto; color: #4F7A00; white-space: nowrap; }
.tq-eta b { color: #2F5A00; }
.tq-time { width: 66px; text-align: center; }

/* 实时队列：一行一个号，右侧三个动作 */
.tq-queue { margin-top: 10px; }

.tq-qhead {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12px; color: var(--txt-2); margin-bottom: 6px;
}

.tq-qrow {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 6px; background: #fff;
}
/* 已叫号：整行换成暖色，店员扫一眼就知道这个号正在门口等人 */
.tq-qrow.is-called { background: #FFF9EC; border-color: #FFD98A; }

.tq-no {
  font-size: 15px; font-weight: 700; color: #1F2328;
  font-variant-numeric: tabular-nums; min-width: 58px;
}
.tq-qrow.is-called .tq-no { color: #D97706; }

.tq-meta { flex: 1; min-width: 0; font-size: 12px; color: var(--txt-2); }
.tq-left { color: #D97706; }

.tq-acts { display: flex; gap: 6px; flex: none; }

/* 最近处理 */
.tq-recs { margin-top: 14px; }

.tq-recs-head {
  font-size: 12px; color: var(--txt-2); font-weight: 600; margin-bottom: 6px;
}

.tq-rec {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0; border-bottom: 1px dashed var(--line);
  font-size: 11px; color: var(--txt-3);
}
.tq-rec:last-child { border-bottom: none; }

.tq-rec-no {
  font-weight: 700; color: #3D4450; min-width: 52px;
  font-variant-numeric: tabular-nums;
}
.tq-rec-meta { flex: 1; min-width: 0; }

.tq-rec-state { white-space: nowrap; }
.tq-rec-state.s-seated { color: #2F7D32; }
.tq-rec-state.s-missed { color: #D97706; }
.tq-rec-state.s-canceled { color: #9AA0A6; }

.tq-rec-note { white-space: nowrap; color: #B0B5BB; }

/* ===== 营销中心 · 广告位（前缀用 av- ：ad- 已经被超值换购占了） ===== */
.av-group {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #FCFCFD;
}

.av-ghead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.av-ghead b { font-size: 13px; color: var(--txt); flex-shrink: 0; }
.av-ghead .fld-tip { margin: 0; flex: 1; min-width: 0; }
.av-ghead .btn { flex-shrink: 0; }

.av-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FFFFFF;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.av-card:last-child { margin-bottom: 0; }

.av-top { display: flex; align-items: flex-start; gap: 12px; }

/* 缩略图按 2:1 —— 首页条出图 750×176，我的页/点单页 750×200，2:1 两边都不算太变形 */
.av-thumb {
  width: 132px;
  height: 66px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px dashed #D3D7DE;
  background: #F6F7F9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  font-size: 11px;
  color: #9AA0A8;
  text-align: center;
  line-height: 1.4;
  transition: border-color .15s;
}
.av-thumb:hover { border-color: #8FBE1F; }
.av-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.av-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.av-jump { display: flex; gap: 8px; }
.av-type { width: 124px; flex-shrink: 0; }
.av-val { flex: 1; min-width: 0; }
.av-noval { font-size: 12px; color: #9AA0A8; line-height: 32px; }

.av-line { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.av-f { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt-2); }
.av-f i { font-style: normal; color: #9096A0; }
.av-line .tq-num { width: 66px; }
.av-time { width: 150px; font-variant-numeric: tabular-nums; }
/* 占位符压浅一点：排期框的 placeholder 是给人看格式的，
   和真实值颜色太像会被误读成「已经填了这个时间」 */
.av-time::placeholder { color: #C6CBD2; }
.av-to { color: #B6BBC3; }
.av-on {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--txt-2);
  cursor: pointer;
}

.av-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #EEF0F3;
  font-size: 11.5px;
  color: #8A9098;
}
.av-stat b { color: #3A4048; font-weight: 600; }

.av-badge {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.av-badge.is-live { background: #EAF7DA; color: #4B7A12; border-color: #CDE8A6; }
.av-badge.is-off { background: #F2F3F5; color: #8A9098; border-color: #E3E5E9; }
.av-badge.is-wait { background: #FFF6E5; color: #A9721A; border-color: #F3E0BB; }

/* ============================================================
   抖音券核销（第 17 个玩法）
   前缀 dy-* —— 与 ad-*（超值换购）、av-*（广告位）都不冲突
   ============================================================ */

/* 顶部：口径 + 开关 */
.dy-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: #F7F8FA;
  border: 1px solid #EBEDF0;
  border-radius: 10px;
}
.dy-top-l b { display: block; font-size: 14px; color: #1F2329; }
.dy-top-l i {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-style: normal;
  color: #8A9098;
  font-variant-numeric: tabular-nums;
}
.dy-top-r { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.dy-flag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.dy-flag.is-ok { background: #EAF7DA; color: #4B7A12; border-color: #CDE8A6; }
.dy-flag.is-bad { background: #FDECEA; color: #C0392B; border-color: #F5C6C0; }

/* 未设口令的横幅 */
.dy-alert {
  padding: 12px 16px;
  margin-bottom: 12px;
  background: #FFFAF0;
  border: 1px solid #F5E3C0;
  border-radius: 10px;
}
.dy-alert-t { font-size: 13px; color: #A9721A; line-height: 1.5; }
.dy-alert-row { display: flex; gap: 8px; margin-top: 10px; }
.dy-alert-row .input { width: 220px; }

/* 子视图导航 */
.dy-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid #EBEDF0;
  padding-bottom: 10px;
}
.dy-nav-item {
  padding: 7px 16px;
  border: 1px solid #E3E5E9;
  background: #FFF;
  border-radius: 8px;
  font-size: 13px;
  color: #5A6068;
  cursor: pointer;
}
.dy-nav-item:hover { border-color: #C9CDD4; }
.dy-nav-item.is-on {
  background: #1F2329;
  border-color: #1F2329;
  color: #FFF;
  font-weight: 600;
}

/* ---------- 核销台 ---------- */
.dy-inrow { display: flex; gap: 8px; align-items: center; }
.dy-code-in {
  flex: 1;
  font-family: Menlo, Consolas, monospace;
  letter-spacing: 1px;
  font-size: 14px;
}
.dy-blank {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: #9AA0A8;
  background: #FAFBFC;
  border: 1px dashed #E3E5E9;
  border-radius: 10px;
  margin-top: 12px;
}

.dy-res {
  margin-top: 14px;
  padding: 16px 18px;
  background: #FAFBFC;
  border: 1px solid #E9EBEF;
  border-radius: 10px;
}
.dy-res.is-bad {
  background: #FDECEA;
  border-color: #F5C6C0;
  color: #C0392B;
  font-size: 13px;
}
/* 已核销：整块降饱和、标题转红，避免被当成「可以核」 */
.dy-res.is-used { background: #FDF4F3; border-color: #F3D6D2; }
.dy-res.is-used .dy-res-h b { color: #C0392B; }

.dy-res-h {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.dy-res-h b { font-size: 14px; color: #1F2329; }
.dy-code-txt {
  padding: 2px 8px;
  background: #EEF0F3;
  border-radius: 5px;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
  color: #5A6068;
  letter-spacing: 1px;
  word-break: break-all;
}

.dy-kv {
  display: flex;
  gap: 12px;
  padding: 5px 0;
  font-size: 13px;
}
.dy-kv span { width: 76px; flex: none; color: #9AA0A8; }
.dy-kv b { color: #33383F; font-weight: 500; }

.dy-tip {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.65;
  color: #8A9098;
}
.dy-tip.is-strong {
  padding: 10px 12px;
  background: #FFFAF0;
  border-left: 3px solid #F0A73A;
  border-radius: 5px;
  color: #A9721A;
}

.dy-warn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #FFF7E6;
  border-left: 3px solid #F0A73A;
  border-radius: 5px;
}
.dy-warn b { font-size: 13px; color: #A9721A; }
.dy-warn i { font-size: 12px; font-style: normal; color: #B5843C; line-height: 1.5; }

.dy-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
}
.dy-fld { display: flex; flex-direction: column; gap: 5px; min-width: 200px; }
.dy-fld.is-sm { min-width: 130px; }
.dy-fld > span { font-size: 12px; color: #8A9098; }
.dy-fld .input, .dy-fld .select { height: 34px; }

/* ---------- 券种 ---------- */
.dy-vlist { display: flex; flex-direction: column; gap: 10px; }
.dy-vcard {
  padding: 14px 16px;
  border: 1px solid #E9EBEF;
  border-radius: 10px;
  background: #FFF;
}
.dy-vcard.is-off { background: #FAFBFC; opacity: 0.72; }
.dy-vhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.dy-vhead b { font-size: 14px; color: #1F2329; }
.dy-vrow { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 8px; }
.dy-vf { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 160px; }
.dy-vf.is-sm { min-width: 110px; flex: 1 1 0; }
.dy-vf.is-wide { flex: 1 1 100%; margin-top: 2px; }
.dy-vf > span { font-size: 12px; color: #8A9098; }
.dy-vf .input { height: 32px; }
.dy-vfoot { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- 记录表 ---------- */
.dy-table {
  border: 1px solid #E9EBEF;
  border-radius: 10px;
  background: #FFF;
  /* 营销中心中间栏在 1440 屏上只有 ~570px，9 列塞不下。
     不压字号也不砍列 —— 让它横滚，窄屏滚一下就能看全，比「操作员」被裁成「操作贝」强。 */
  overflow-x: auto;
}
.dy-tr {
  display: grid;
  grid-template-columns: 78px 68px minmax(90px, 1fr) 70px 54px 68px 56px 66px 56px;
  min-width: 660px;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 12px;
  border-bottom: 1px solid #F2F4F6;
  color: #33383F;
}
.dy-tr:last-child { border-bottom: 0; }
.dy-tr.dy-th {
  background: #F7F8FA;
  font-size: 11px;
  color: #8A9098;
  font-weight: 500;
  white-space: nowrap;
}
.dy-tr.is-rev { background: #FCFCFD; color: #9AA0A8; }
.dy-tr.is-rev .dy-t-amt { text-decoration: line-through; }

.dy-t-time { color: #8A9098; font-variant-numeric: tabular-nums; }
.dy-t-code {
  font-family: Menlo, Consolas, monospace;
  color: #5A6068;
  letter-spacing: 0.5px;
}
.dy-t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dy-t-amt { font-variant-numeric: tabular-nums; font-weight: 500; }
.dy-t-table, .dy-t-op, .dy-t-src { color: #8A9098; }
.dy-t-res { color: #5A6068; }
.dy-t-st { white-space: nowrap; }
.dy-t-ops { text-align: right; white-space: nowrap; }

.dy-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  border: 1px solid transparent;
  white-space: nowrap;
}
.dy-badge.is-ok { background: #EAF7DA; color: #4B7A12; border-color: #CDE8A6; }
.dy-badge.is-rev { background: #F2F3F5; color: #8A9098; border-color: #E3E5E9; }

.dy-tnote {
  padding: 6px 12px 8px 24px;
  font-size: 11px;
  color: #B5843C;
  background: #FFFCF5;
  border-bottom: 1px solid #F2F4F6;
}

/* 撤销展开面板 */
.dy-rv {
  padding: 14px 16px 12px 24px;
  background: #FDF4F3;
  border-bottom: 1px solid #F2F4F6;
}
.dy-rv > b { display: block; font-size: 13px; color: #C0392B; margin-bottom: 10px; }
.dy-rv-why { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.dy-rv-why .chk { font-size: 12px; color: #33383F; }
.dy-rv-note { width: 100%; max-width: 420px; height: 32px; }
.dy-rv-ops { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- 对账 ---------- */
.dy-rec-h { margin-bottom: 10px; }
.dy-rec-h b { display: block; font-size: 14px; color: #1F2329; }
.dy-rec-h i {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-style: normal;
  color: #8A9098;
  line-height: 1.6;
}
.dy-ta {
  width: 100%;
  height: 160px;
  padding: 10px 12px;
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  box-sizing: border-box;
}
.dy-rec-ops { display: flex; gap: 8px; margin-top: 10px; }

.dy-rec-res { margin-top: 16px; }
.dy-rec-num {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.dy-rec-num > div {
  padding: 12px 14px;
  background: #F7F8FA;
  border: 1px solid #EBEDF0;
  border-radius: 9px;
  text-align: center;
}
.dy-rec-num b {
  display: block;
  font-size: 22px;
  color: #1F2329;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.dy-rec-num span { display: block; margin-top: 4px; font-size: 11px; color: #8A9098; }
.dy-rec-num .is-ok { background: #F4FAEC; border-color: #D9EDBE; }
.dy-rec-num .is-ok b { color: #4B7A12; }
.dy-rec-num .is-bad { background: #FDECEA; border-color: #F5C6C0; }
.dy-rec-num .is-bad b { color: #C0392B; }
.dy-rec-num .is-warn { background: #FFFAF0; border-color: #F5E3C0; }
.dy-rec-num .is-warn b { color: #A9721A; }

.dy-rec-tip {
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #F7F8FA;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.8;
  color: #5A6068;
}
.dy-rec-tip b { color: #1F2329; }

/* 对账表只有 5 列，放得下就不横滚 */
.dy-table.is-rec .dy-tr {
  grid-template-columns: 96px minmax(100px, 1fr) 80px 76px 170px;
  min-width: 0;
}

/* ============================================================
   预订座位（第 18 个玩法）—— 前缀 rs-
   ad-* = 超值换购、av-* = 广告位、dy-* = 抖音券、rs-* = 预订
   ============================================================ */

.rs-top {
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FFF7F3 0%, #FFEDE4 100%);
  border: 1px solid #F6D9CB;
  margin-bottom: 12px;
}

.rs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rs-head-l { flex: 1; min-width: 0; }

.rs-title {
  font-size: 15px;
  font-weight: 700;
  color: #1A1A1A;
}

.rs-desc {
  margin-top: 3px;
  font-size: 12px;
  color: #A08D84;
}

.rs-head-r {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.rs-flag {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  background: #F0F1F3;
  color: #8A8F98;
  white-space: nowrap;
}

.rs-flag.is-ok {
  background: #E8F5E9;
  color: #2E7D32;
}

.rs-flag.is-off {
  background: #F5F5F5;
  color: #9B9EA5;
}

.rs-kpis {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.rs-kpis.is-empty {
  font-size: 12px;
  color: #9B9EA5;
  padding: 8px 0;
}

.rs-kpi {
  flex: 1;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
  min-width: 0;
}

.rs-kpi b {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #C0491F;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.rs-kpi i {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-style: normal;
  color: #9B8C83;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rs-kpi.is-rate b { color: #2E7D32; }

/* 警告条 */
.rs-alert {
  display: block;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #FFF8E1;
  border: 1px solid #F3E0A6;
  font-size: 12px;
  line-height: 1.6;
  color: #8A6D1B;
}

.rs-alert.is-off {
  background: #F7F8FA;
  border-color: #E7E9ED;
  color: #7A8494;
}

/* 子视图 */
.rs-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.rs-nav-item {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #E7E9ED;
  background: #fff;
  color: #5A6270;
  font-size: 12.5px;
  cursor: pointer;
}

.rs-nav-item b {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  margin-left: 3px;
  border-radius: 999px;
  background: #E8673C;
  color: #fff;
  font-size: 10px;
  line-height: 15px;
  font-weight: 700;
  text-align: center;
}

.rs-nav-item.is-on {
  background: #E8673C;
  border-color: #E8673C;
  color: #fff;
  font-weight: 600;
}

.rs-nav-item.is-on b {
  background: rgba(255, 255, 255, 0.28);
}

/* 空态 */
.rs-blank {
  padding: 34px 20px;
  border-radius: 10px;
  background: #FAFBFC;
  border: 1px dashed #E3E5E9;
  text-align: center;
  font-size: 12.5px;
  color: #7A8494;
  line-height: 1.75;
}

.rs-blank-s {
  padding: 14px 0;
  font-size: 12px;
  color: #9B9EA5;
  line-height: 1.7;
}

/* 待处理 / 历史表 */
.rs-table {
  overflow-x: auto;
  border: 1px solid #EDEFF2;
  border-radius: 10px;
}

.rs-tr {
  display: grid;
  grid-template-columns: 132px 78px minmax(180px, 1fr) 76px 74px 156px;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid #F2F4F6;
  font-size: 12.5px;
  /* 中间栏在 1440 屏只有 ~570px，6 列塞不下会横向滚动（抖音券 9 列踩过一次） */
  min-width: 720px;
}

.rs-tr:last-child { border-bottom: 0; }

.rs-tr.rs-th {
  background: #F7F8FA;
  font-size: 11.5px;
  color: #8A8F98;
  font-weight: 600;
}

.rs-tr.is-done { background: #FBFDF9; }

.rs-t-when b { color: #1A1A1A; font-weight: 700; }
.rs-t-when i {
  margin-left: 5px;
  font-style: normal;
  font-size: 11px;
  color: #9B9EA5;
  font-variant-numeric: tabular-nums;
}

.rs-live {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #E8F5E9;
  color: #2E7D32;
  font-size: 9.5px;
  line-height: 14px;
}

.rs-t-no {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #5A6270;
  letter-spacing: 0.3px;
}

.rs-t-guest b { color: #1A1A1A; }
.rs-t-guest span { margin-left: 4px; font-size: 11.5px; color: #8A8F98; }
.rs-t-guest i {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 11px;
  color: #7A8494;
  font-variant-numeric: tabular-nums;
}
.rs-t-guest em {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 10.5px;
  color: #B0B3B9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.rs-t-area { color: #5A6270; }

.rs-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  line-height: 16px;
  background: #FFF1E9;
  color: #B4461B;
  white-space: nowrap;
}

.rs-badge.is-ok { background: #E8F5E9; color: #2E7D32; }
.rs-badge.is-off { background: #F2F3F5; color: #8A8F98; }
.rs-badge.is-bad { background: #FDECEA; color: #C62828; }

.rs-t-ops {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  white-space: nowrap;
}

.rs-tip {
  font-size: 11px;
  color: #2E7D32;
}

.rs-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #F7F8FA;
  font-size: 11.5px;
  line-height: 1.75;
  color: #7A8494;
}

/* 历史：上面四个数 */
.rs-rec-stat {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.rs-rec-stat > div {
  flex: 1;
  padding: 9px 10px;
  border-radius: 9px;
  background: #FAFBFC;
  border: 1px solid #EDEFF2;
  text-align: center;
}

.rs-rec-stat b {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #1A1A1A;
  font-variant-numeric: tabular-nums;
}

.rs-rec-stat i {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 11px;
  color: #8A8F98;
}

.rs-rec-tip {
  margin-bottom: 10px;
  font-size: 11px;
  line-height: 1.65;
  color: #9B9EA5;
}

.rs-tr.is-rec {
  grid-template-columns: 118px 74px minmax(150px, 1fr) 76px 128px 96px;
  min-width: 660px;
}

.rs-r-guest i {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  color: #9B9EA5;
}

.rs-r-by i {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 10.5px;
  color: #B0B3B9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.rs-r-at {
  font-size: 11.5px;
  color: #8A8F98;
  font-variant-numeric: tabular-nums;
}

/* 四个列容器只做对齐：网格列宽由 .rs-tr / .rs-tr.is-rec 的 grid-template-columns 管，
   这里补的是「同一声明块里别的列都有、它没有」的那几个 —— 缺了不影响布局，
   但会让下一个人以为这几列是特意不要样式的。 */
.rs-t-st { display: flex; align-items: center; }
.rs-r-when { color: #5A6270; font-variant-numeric: tabular-nums; }
.rs-r-no {
  font-size: 11.5px;
  color: #6B7280;
  font-variant-numeric: tabular-nums;
}
.rs-r-st { display: flex; align-items: center; }

/* 配置：餐段 / 区域卡 */
.rs-sec {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #EDEFF2;
}

.rs-sec-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1A1A1A;
}

.rs-sec-hint {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.7;
  color: #9B9EA5;
}

.rs-card {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #FAFBFC;
  border: 1px solid #EDEFF2;
}

.rs-card:last-child { margin-bottom: 0; }

.rs-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rs-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.rs-c-name { flex: 1; min-width: 120px; font-weight: 600; }
.rs-c-hm { width: 76px; text-align: center; font-variant-numeric: tabular-nums; }
.rs-c-num { width: 64px; text-align: center; }

.rs-f {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.rs-f i {
  font-style: normal;
  font-size: 11.5px;
  color: #7A8494;
  white-space: nowrap;
}

.rs-f-wide { flex: 1; min-width: 160px; }
.rs-f-wide .input { flex: 1; }

.rs-unit {
  font-size: 11.5px;
  color: #9B9EA5;
}

.rs-f-hint {
  font-size: 10.5px;
  color: #B0B3B9;
}

/* 基础设置 */
.rs-base {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.rs-base-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.rs-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #5A6270;
  cursor: pointer;
}

.rs-check input { margin: 0; }

.rs-base-hint {
  font-size: 11px;
  line-height: 1.7;
  color: #9B9EA5;
}

/* 保存区 */
.rs-save {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 4px;
}

.rs-save-tip {
  flex: 1;
  font-size: 11px;
  line-height: 1.6;
  color: #9B9EA5;
}

/* ============================================================
   分销（营销中心第 19 个玩法）
   前缀 dt-*（与 ad-/av-/dy-/rs- 同一套规矩：一个玩法一个前缀，互不嵌套）
   口径：佣金是门店成本，不是给顾客的折扣 —— 所以这里用中性深色 + 少量橙色强调，
   不用优惠券那种「红黄促销色」，避免运营把它当折扣力度来配。
   ============================================================ */

.dt-top {
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #F7F8FA 0%, #EEF1F5 100%);
  border: 1px solid #E6E9EE;
}

.dt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dt-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--txt);
}

.dt-desc {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--txt-2);
  line-height: 1.5;
}

.dt-desc b {
  color: #C0491F;
}

.dt-head-r {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.dt-flag {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.dt-flag.is-ok {
  background: #E8F7EA;
  color: #2E7D46;
}

.dt-flag.is-off {
  background: #F1F2F4;
  color: #8A8F97;
}

.dt-kpis {
  /* 固定 2×2，不跟着容器「塞几格算几格」：四格用 auto-fit 会在中等宽度下变成
     3+1，最后那个「待打款」孤零零挂在左下角，看着像漏了一个。窄了 2×2，
     ≥1400 视口（主体够宽）才铺成一排四格。 */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

@media (min-width: 1400px) {
  .dt-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dt-kpis.is-empty {
  display: block;
  font-size: 12px;
  color: var(--txt-3);
  padding: 8px 0;
}

.dt-kpi {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.86);
  min-width: 0;
}

.dt-kpi b {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #1F2329;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.dt-kpi b .dt-kpi-s {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt-3);
}

.dt-kpi i {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.45;
  color: var(--txt-2);
  /* 这行里常带「另冲回 ¥8」「已付 ¥0」这种关键括号，截掉尾巴等于把最该看的
     信息藏了（曾经用 nowrap+ellipsis，1280 宽下四格里三格都被截）。
     宁可换行：flex 默认 align-items:stretch，四格高度会自动补齐。 */
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ---------- 提示条 ---------- */

.dt-alert {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: #FFF6E8;
  border: 1px solid #F5E0BC;
  font-size: 11.5px;
  line-height: 1.6;
  color: #8A5A12;
}

.dt-alert.is-warn {
  background: #FFF9E6;
  border-color: #F2E3AE;
  color: #7A6414;
}

.dt-alert.is-off {
  background: #F5F6F8;
  border-color: #E6E8EC;
  color: var(--txt-2);
}

/* ---------- 子视图 ---------- */

.dt-nav {
  display: flex;
  gap: 6px;
  margin: 12px 0 10px;
}

.dt-nav-item {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  color: var(--txt-2);
  cursor: pointer;
}

.dt-nav-item.is-on {
  background: #1F2329;
  border-color: #1F2329;
  color: #fff;
  font-weight: 600;
}

.dt-nav-item b {
  display: inline-block;
  min-width: 15px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 8px;
  background: #E5533D;
  color: #fff;
  font-size: 10px;
  line-height: 15px;
  text-align: center;
}

/* ---------- 卡片与表格 ---------- */

.dt-card {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  /* 推广员表有 7 列（含一个 86px 的比例如下拉），1280 视口下主体只有 ~440px 时
     会横向溢出，右侧「冻结/通过」被卡片圆角裁掉 —— 那几个按钮正是唯一能点的东西。
     宁可在卡片里横向滚动，也不能让人点不到。宽屏下不会出现滚动条。 */
  overflow-x: auto;
}

.dt-card-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
}

.dt-card-h i {
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
  color: var(--txt-3);
}

.dt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dt-table th {
  padding: 6px 8px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--txt-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.dt-table td {
  padding: 8px;
  border-bottom: 1px solid #F4F5F7;
  vertical-align: middle;
  color: var(--txt);
}

/* 单人比例下拉：不给固定宽度就会被挤成一个字（原来写的 input-xs 这个类
   在 CSS 里根本不存在，等于没写样式）。86px 刚好放下「跟随 8%」+ 箭头。 */
.dt-t-rate {
  width: 86px;
  min-width: 86px;
  padding: 4px 6px;
  font-size: 11.5px;
  line-height: 1.3;
}

.dt-table tr.is-back td {
  color: var(--txt-3);
}

.dt-table tr.is-back .is-hot {
  color: var(--txt-3);
  text-decoration: line-through;
}

.dt-t-code {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.dt-t-code i,
.dt-t-name i {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 400;
  color: var(--txt-3);
}

.dt-t-when {
  font-size: 11.5px;
  color: var(--txt-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dt-t-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dt-t-num.is-hot {
  font-weight: 700;
  color: #C0491F;
}

.dt-t-ops {
  white-space: nowrap;
  text-align: right;
  /* 表格挤压时操作列最先被压垮：「冲回」被挤成竖排两个字，而那是整行唯一能点的
     东西。width:1% 让浏览器按「内容刚好放得下」给它最小宽度，别再压缩。 */
  width: 1%;
}

.dt-t-ops .btn {
  white-space: nowrap;
}

.dt-t-ops .btn + .btn {
  margin-left: 4px;
}

.dt-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.dt-tag.is-ok {
  background: #E8F7EA;
  color: #2E7D46;
}

.dt-tag.is-wait {
  background: #FFF6E0;
  color: #8A6412;
}

.dt-tag.is-off {
  background: #F1F2F4;
  color: #8A8F97;
}

.dt-why {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-style: normal;
  color: #B4402A;
}

.dt-owed {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-style: normal;
  color: #B4402A;
}

.dt-muted {
  color: var(--txt-3);
}

.dt-empty {
  padding: 22px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--txt-3);
}

/* ---------- 配置表单 ---------- */

.dt-form {
  display: grid;
  /* 按**容器**宽度自适应，不看视口：营销中心是「左导航 + 中主体 + 右说明」三栏，
     1280 视口下主体只有 ~460px，用 media query 判断永远不触发（那一版每格只剩
     222px，说明文字被挤成三行断字）。auto-fit 到 460 就自动变一列。 */
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 10px 16px;
  margin-bottom: 10px;
}

.dt-f {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--txt-2);
}

.dt-f > span {
  flex: 0 0 84px;
  color: var(--txt);
}

.dt-f > i {
  flex: 0 0 100%;
  margin-left: 84px;
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.5;
  color: var(--txt-3);
}

.dt-f > i b {
  color: #C0491F;
}

.dt-f.is-row {
  align-items: center;
}

.dt-f input[type="checkbox"] {
  width: 15px;
  height: 15px;
}

.dt-f .input,
.dt-f textarea.input {
  flex: 1;
  min-width: 0;
}

.dt-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.dt-foot-tip {
  font-size: 10.5px;
  color: var(--txt-3);
}

@media (max-width: 1180px) {
  .dt-form {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   一起点（同桌拼单分账）—— tg-*
   第六套前缀。主色用青绿 #12A594，与分销（橙）区分：
   这两个都在「我的」工具格里，颜色一样连老板自己都分不清。
   ============================================================ */

.tg-top {
  padding: 14px 16px 12px;
  background: linear-gradient(150deg, #F2FBF8 0%, #E9F8F4 100%);
  border: 1px solid #D9EFE9;
  border-radius: 12px;
  margin-bottom: 12px;
}

.tg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.tg-head-l { flex: 1; min-width: 0; }

.tg-title {
  font-size: 15px;
  font-weight: 700;
  color: #123B36;
  margin-bottom: 3px;
}

.tg-desc {
  font-size: 11.5px;
  color: #4E7A72;
  line-height: 1.6;
}

.tg-desc b { color: #0E8A7C; }

.tg-head-r {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.tg-flag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
}

.tg-flag.is-ok { background: #D6EFE8; color: #0E8A7C; }
.tg-flag.is-off { background: #EDEFF1; color: var(--txt-3); }

/* KPI —— 用 grid auto-fit，别用 flex + nowrap：
   营销中心主体在 1280 视口下只有 ~440px，四格挤一排每格 100px，
   「今日结算 · 3 桌」会从词中间断行（分销那边踩过一模一样的问题）。 */
.tg-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.tg-kpis.is-empty {
  font-size: 12px;
  color: var(--txt-3);
  padding: 8px 0;
}

.tg-kpi {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.88);
  min-width: 0;
}

.tg-kpi b {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: #123B36;
  line-height: 1.3;
}

.tg-kpi i {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-style: normal;
  color: var(--txt-2);
  line-height: 1.5;
}

.tg-alert {
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.65;
  background: #FFF8EC;
  color: #8A6414;
  border: 1px solid #F5E3C0;
}

.tg-alert b { color: #B47A18; }

.tg-alert.is-off {
  background: #F5F6F8;
  color: var(--txt-2);
  border-color: var(--line);
}

.tg-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px;
  background: #F4F6F8;
  border-radius: 9px;
  width: fit-content;
}

.tg-nav-item {
  padding: 6px 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: 11.5px;
  color: var(--txt-2);
  cursor: pointer;
}

.tg-nav-item.is-on {
  background: #fff;
  color: #0E8A7C;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}

.tg-nav-item b {
  display: inline-block;
  min-width: 16px;
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 999px;
  background: #12A594;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.tg-card {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
}

.tg-card-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tg-card-h b { font-size: 12.5px; color: var(--txt); }
.tg-card-h span { font-size: 10.5px; color: var(--txt-3); }

.tg-empty {
  padding: 28px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--txt-3);
  line-height: 1.8;
}

.tg-muted { color: var(--txt-3); }

/* ---------- 桌台表格 ---------- */

.tg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.tg-table th {
  padding: 0 8px 7px;
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  color: var(--txt-3);
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.tg-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #F4F5F7;
  vertical-align: middle;
  color: var(--txt);
}

.tg-table tr:last-child td { border-bottom: none; }

.tg-t-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  color: #0E8A7C;
  white-space: nowrap;
}

.tg-t-name { min-width: 90px; }

.tg-t-name i,
.tg-t-people i,
.tg-t-when i {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 10px;
  color: var(--txt-3);
}

.tg-t-people { white-space: nowrap; }

.tg-t-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tg-t-when {
  white-space: nowrap;
  color: var(--txt-2);
  font-size: 10.5px;
}

.tg-t-ops {
  white-space: nowrap;
  text-align: right;
}

.tg-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
}

.tg-tag.is-ok { background: #E4F6F1; color: #0E8A7C; }
.tg-tag.is-wait { background: #FFF4E4; color: #B47A18; }

.tg-foot-tip {
  margin-top: 9px;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--txt-3);
}

.tg-foot-tip code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #F4F6F8;
  font-size: 10px;
  color: #0E8A7C;
}

/* ---------- 账单卡片 ---------- */

.tg-bill {
  padding: 11px 12px;
  margin-bottom: 9px;
  border-radius: 9px;
  background: #FAFCFC;
  border: 1px solid #EDF4F3;
}

.tg-bill:last-child { margin-bottom: 0; }

.tg-bill-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tg-bill-t {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--txt);
}

.tg-bill-a {
  font-size: 15px;
  font-weight: 700;
  color: #123B36;
  font-variant-numeric: tabular-nums;
}

.tg-bill-m {
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--txt-3);
}

.tg-bill-s {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed #E4EDEB;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tg-share {
  padding: 3px 9px;
  border-radius: 999px;
  background: #FFF4E4;
  font-size: 10.5px;
  color: #8A6414;
}

.tg-share b { font-weight: 600; }

.tg-share.is-paid {
  background: #E4F6F1;
  color: #0E8A7C;
}

.tg-bill-w {
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.7;
  color: #B47A18;
}

/* ---------- 规则表单 ----------
   用 auto-fit 按**容器**宽度自适应，不要用 @media 判视口：
   营销中心是「左导航 + 中主体 + 右说明」三栏，1280 视口下主体只有 ~440px，
   @media (max-width:1180px) 永远不会触发（分销那边踩过）。 */

.tg-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
  margin-bottom: 12px;
}

.tg-f {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tg-f label {
  font-size: 10.5px;
  color: var(--txt-2);
  margin-bottom: 4px;
}

.tg-f .input {
  width: 100%;
  box-sizing: border-box;
}

.tg-f-tip {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--txt-3);
}

/* ⚠️ 必须写成 `textarea.tg-area`：上面那条 `textarea.input{min-height:60px}` 是
   元素+类（0,1,1），只写 `.tg-area`（0,1,0）会被它压住，min-height 白设。 */
textarea.tg-area {
  resize: vertical;
  min-height: 88px;
  line-height: 1.6;
  font-family: inherit;
}

/* 说明文案这类长字段占整行，不要挤在 180px 的格子里滚 */
.tg-f.is-wide {
  grid-column: 1 / -1;
}

.tg-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
}

.tg-foot .tg-foot-tip { margin-top: 0; }

/* ---------- 说明 ---------- */

.tg-note {
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--txt-2);
}

.tg-note p {
  margin: 0 0 7px;
}

.tg-note p:last-child { margin-bottom: 0; }

.tg-note b { color: var(--txt); }

/* ============================================================
   活动报名（第 21 个玩法）
   前缀 ac-*，与 ad-/av-/dy-/rs-/dt-/tg- 并列各一套。

   配色用靛蓝 #3A57C9：青绿给了一起点、橙给了分销与广告。
   活动报名是「课程/品鉴」这类偏安静的事，蓝比红更贴，
   也和危险色 --danger 拉开了距离（下架/删除按钮要看得出来是红的）。
   ============================================================ */

.ac-top {
  padding: 14px 16px 12px;
  background: linear-gradient(150deg, #F3F6FF 0%, #EBF0FF 100%);
  border: 1px solid #D9E2FA;
  border-radius: 12px;
  margin-bottom: 12px;
}

.ac-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ac-head-l { flex: 1; min-width: 0; }

.ac-title {
  font-size: 15px;
  font-weight: 700;
  color: #1E2A55;
  margin-bottom: 3px;
}

.ac-desc {
  font-size: 11.5px;
  color: #56638F;
  line-height: 1.6;
}

.ac-desc b { color: #3A57C9; }

.ac-head-r {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.ac-flag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
}

.ac-flag.is-ok { background: #DDE5FF; color: #3A57C9; }
.ac-flag.is-off { background: #EDEFF1; color: var(--txt-3); }

/* KPI 用 grid auto-fit：营销中心主体在 1280 视口下只有 ~440px，
   flex + nowrap 会把「到店率 · 3 到 / 2 未到」从词中间折断。 */
.ac-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ac-kpis.is-empty {
  font-size: 12px;
  color: var(--txt-3);
  padding: 8px 0;
}

.ac-kpi {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.88);
  min-width: 0;
}

.ac-kpi b {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: #1E2A55;
  line-height: 1.3;
}

.ac-kpi i {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-style: normal;
  color: var(--txt-2);
  line-height: 1.5;
}

.ac-alert {
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.65;
  background: #FFF8EC;
  color: #8A6414;
  border: 1px solid #F5E3C0;
}

.ac-alert b { color: #B47A18; }

.ac-alert.is-off {
  background: #F5F6F8;
  color: var(--txt-2);
  border-color: var(--line);
}

.ac-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px;
  background: #F4F6F8;
  border-radius: 9px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.ac-nav-item {
  padding: 6px 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: 11.5px;
  color: var(--txt-2);
  cursor: pointer;
  white-space: nowrap;
}

.ac-nav-item.is-on {
  background: #fff;
  color: #3A57C9;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}

.ac-nav-item b {
  display: inline-block;
  min-width: 16px;
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 999px;
  background: #4C6EF5;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.ac-card {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
}

.ac-card-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ac-card-h b { font-size: 12.5px; color: var(--txt); }
.ac-card-h span { font-size: 10.5px; color: var(--txt-3); }

/* ---------- 筛选条 ---------- */

.ac-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ac-chip {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  color: var(--txt-2);
  cursor: pointer;
}

.ac-chip b {
  margin-left: 3px;
  font-weight: 600;
  color: var(--txt);
}

.ac-chip.is-on {
  border-color: #B9C8F5;
  background: #EFF3FF;
  color: #3A57C9;
}

.ac-chip.is-on b { color: #3A57C9; }

/* ---------- 表格 ---------- */

.ac-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.ac-table th {
  padding: 0 8px 7px;
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  color: var(--txt-3);
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.ac-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #F4F5F7;
  vertical-align: middle;
  color: var(--txt);
}

.ac-table tr:last-child td { border-bottom: none; }

.ac-table.is-compact th { padding-bottom: 6px; }
.ac-table.is-compact td { padding: 6px 6px; }

.ac-t-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: #3A57C9;
  white-space: nowrap;
}

.ac-t-act { min-width: 120px; }

.ac-t-act i,
.ac-t-who i,
.ac-t-st i {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 10px;
  color: var(--txt-3);
}

.ac-t-who { white-space: nowrap; }

.ac-t-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ac-t-st { white-space: nowrap; }

.ac-t-when {
  white-space: nowrap;
  color: var(--txt-2);
  font-size: 10.5px;
}

.ac-t-ops {
  white-space: nowrap;
  text-align: right;
}

/* 场次填席率：数字 + 细进度条 */
.ac-t-fill {
  min-width: 74px;
  white-space: nowrap;
}

.ac-t-fill span {
  font-size: 10.5px;
  color: var(--txt-2);
  font-variant-numeric: tabular-nums;
}

.ac-t-fill span.is-full {
  color: var(--danger);
  font-weight: 600;
}

.ac-bar {
  margin-top: 3px;
  height: 3px;
  border-radius: 2px;
  background: #EEF0F3;
  overflow: hidden;
}

.ac-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: #4C6EF5;
}

/* ---------- 状态徽章 ---------- */

.ac-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
}

.ac-badge.is-booked { background: #EFF3FF; color: #3A57C9; }
.ac-badge.is-checked { background: #E4F6F1; color: #0E8A7C; }
.ac-badge.is-canceled { background: #F1F3F4; color: var(--txt-3); }
.ac-badge.is-expired { background: #FFF1EE; color: var(--danger); }

/* ---------- 空态 / 提示 ---------- */

.ac-empty {
  padding: 34px 16px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--txt-2);
}

.ac-muted { color: var(--txt-3); font-size: 10.5px; }

.ac-foot-tip {
  margin-top: 9px;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--txt-3);
}

.ac-foot-tip code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #F4F6F8;
  font-size: 10px;
  color: #3A57C9;
}

/* ---------- 活动卡片 ---------- */

.ac-act {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #E6E9EF;
  border-radius: 10px;
  background: #FCFDFF;
}

.ac-act-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ac-act-name {
  flex: 1;
  min-width: 140px;
  font-weight: 600;
}

.ac-act-st {
  flex: none;
  width: 88px;
}

/* 字段用 grid auto-fit，不用 @media 判视口：
   营销中心是三栏布局，1280 视口下主体只有 ~440px，媒体查询永远不触发。 */
.ac-act-f {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 10px;
  margin-bottom: 8px;
}

.ac-f {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ac-f > span,
.ac-f > label {
  font-size: 10.5px;
  color: var(--txt-2);
}

.ac-f.is-wide { grid-column: 1 / -1; }

.ac-f-tip {
  font-size: 10px;
  line-height: 1.6;
  color: var(--txt-3);
}

/* ⚠️ 必须写成 textarea.ac-area（0,1,1）才能压过 textarea.input{min-height:60px}（0,1,1 里靠顺序，
   而 .input 的规则在后面时会把高度盖回去 —— 一起点那边踩过，量 DOM 才发现 92px 没生效）。 */
textarea.ac-area {
  min-height: 64px;
  line-height: 1.65;
  font-family: inherit;
  resize: vertical;
}

.ac-slots {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #E6E9EF;
}

.ac-slots-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.ac-slots-h b { font-size: 11.5px; color: var(--txt); }
.ac-slots-h span { font-size: 10.5px; color: var(--txt-3); }

.ac-in-date { width: 128px; }
.ac-in-time { width: 86px; }
.ac-in-num { width: 64px; }

/* ---------- 表单 ---------- */

.ac-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 12px;
}

.ac-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ac-foot .ac-foot-tip { margin-top: 0; }

.ac-dirty {
  font-size: 10.5px;
  color: #B47A18;
  font-weight: 600;
}

/* ---------- 说明 ---------- */

.ac-note {
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--txt-2);
}

.ac-note p { margin: 0 0 7px; }
.ac-note p:last-child { margin-bottom: 0; }
.ac-note b { color: var(--txt); }

/* ============================================================
   AI 发券（第 22 个玩法）
   前缀 ai-*，与 ad-/av-/dy-/rs-/dt-/tg-/ac- 并列各一套。

   ⚠️ 原本用的是 cp-，写完才发现 **券卡片早在第 586 行就占了 cp-**
   （.cp-list / .cp-card / .cp-desc / .cp-editor… 共 144 处）。
   两套 `.cp-card` 会互相污染：券卡片是 `display:flex`，新卡片是块级，
   而且 `.cp-desc` 有两份 font-size 打架。已整体换成 ai-。
   教训：加新玩法前缀前，先 `grep -c '^\.前缀-' admin.css`，别靠肉眼。

   配色用紫罗兰 #5B3FD1：青绿给了一起点、橙给了分销与广告、
   靛蓝给了活动报名。发券是「算法在背后算」的玩法，紫色最贴，
   而且刻意比券卡片的 #9B5BFF 深一档 —— 两者同屏时不会看混。

   ⚠️ 两处与 ac- 同源的坑，一并记在这里：
   ① KPI 和表单都用 grid auto-fit，不用 @media 判视口 ——
      营销中心三栏布局下主体只有 ~440px，媒体查询永不触发。
   ② 表单里的 `<input>` 已经由 `.input` 给了高度，ai-f 只负责排布，
      不再重复设 height，否则两处打架。
   ============================================================ */

.ai-top {
  padding: 14px 16px 12px;
  background: linear-gradient(150deg, #F5F2FF 0%, #EDE8FF 100%);
  border: 1px solid #DED5FA;
  border-radius: 12px;
  margin-bottom: 12px;
}

.ai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ai-head-l { flex: 1; min-width: 0; }

.ai-title {
  font-size: 15px;
  font-weight: 700;
  color: #2A1E55;
  margin-bottom: 3px;
}

.ai-desc {
  font-size: 11.5px;
  color: #5B5280;
  line-height: 1.6;
}

.ai-desc b { color: #5B3FD1; }

.ai-head-r {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.ai-flag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.ai-flag.is-ok { background: #E2DAFF; color: #4A2FB0; }
.ai-flag.is-off { background: #EDEFF1; color: var(--txt-3); }

.ai-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ai-kpis.is-empty {
  font-size: 12px;
  color: var(--txt-3);
  padding: 8px 0;
}

.ai-kpi {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.88);
  min-width: 0;
}

.ai-kpi b {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: #2A1E55;
  line-height: 1.3;
}

.ai-kpi i {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-style: normal;
  color: var(--txt-2);
  line-height: 1.5;
}

.ai-alert {
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.65;
}

.ai-alert b { font-weight: 700; }
.ai-alert.is-warn { background: #FFF8E6; border: 1px solid #FBE2A8; color: #7A5A12; }
.ai-alert.is-warn b { color: #9A6B00; }
.ai-alert.is-off { background: #F5F6F8; border: 1px solid #E4E7EC; color: var(--txt-2); }

.ai-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.ai-nav-item {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  color: var(--txt-2);
  cursor: pointer;
  transition: all 0.15s;
}

.ai-nav-item b {
  font-weight: 700;
  color: var(--txt-3);
  margin-left: 2px;
}

.ai-nav-item:hover { border-color: #C9BAF0; color: #4A2FB0; }

.ai-nav-item.is-on {
  background: #5B3FD1;
  border-color: #5B3FD1;
  color: #fff;
  font-weight: 600;
}

.ai-nav-item.is-on b { color: #D9CCFF; }

/* ---------- 计划卡片 ---------- */

.ai-cards { display: flex; flex-direction: column; gap: 10px; }

.ai-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  overflow: hidden;
}

.ai-card.is-off { opacity: 0.72; background: #FCFCFD; }
.ai-card.is-editing { border-color: #B9A5F0; box-shadow: 0 0 0 3px rgba(91, 63, 209, 0.07); }

.ai-card-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid #F0F1F4;
  background: #FCFCFE;
}

.ai-card-t { flex: 1; min-width: 0; }

.ai-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-card-title {
  margin-top: 3px;
  font-size: 11px;
  color: var(--txt-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-card-ops {
  display: flex;
  gap: 5px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ai-card-body { padding: 10px 13px 12px; }

.ai-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.ai-badge.is-on { background: #E7FAF0; color: #12805A; }
.ai-badge.is-off { background: #EDEFF1; color: var(--txt-3); }
.ai-badge.is-wait { background: #EEF4FF; color: #2C60C4; }
.ai-badge.is-done { background: #F0F1F4; color: var(--txt-2); }
.ai-badge.is-bad { background: #FDECEC; color: #C0392B; }

.ai-row {
  display: flex;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.75;
  padding: 2px 0;
}

.ai-row i {
  flex: none;
  width: 58px;
  font-style: normal;
  color: var(--txt-3);
}

.ai-row b { font-weight: 500; color: var(--txt); min-width: 0; }

.ai-row em {
  margin-left: 8px;
  font-style: normal;
  font-size: 10.5px;
  color: #5B3FD1;
  background: #F3F0FF;
  padding: 1px 7px;
  border-radius: 999px;
}

.ai-award {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 2px 8px;
  border-radius: 6px;
  background: #F5F2FF;
  color: #4A2FB0;
  font-size: 11px;
}

.ai-award.is-gone { background: #FDECEC; color: #C0392B; }

/* ---------- 表单 ---------- */

.ai-form { padding: 12px 13px 14px; }

.ai-f { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }

.ai-f label {
  font-size: 11px;
  color: var(--txt-2);
  font-weight: 500;
}

.ai-f label span {
  margin-left: 5px;
  font-weight: 400;
  color: var(--txt-3);
  font-size: 10.5px;
}

.ai-form-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 14px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px dashed #EEEEF2;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--txt);
}

.ai-form-h:first-child { margin-top: 0; }

.ai-form-h span {
  font-weight: 400;
  font-size: 10.5px;
  color: var(--txt-3);
}

/* grid auto-fit 而不是 @media：主体在 1280 视口下只有 ~440px */
.ai-grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0 10px;
}

.ai-grid3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 0 10px;
}

.ai-radio-row { display: flex; gap: 8px; flex-wrap: wrap; }

.ai-radio {
  flex: 1;
  min-width: 132px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  background: #fff;
}

.ai-radio input { display: none; }
.ai-radio b { font-size: 12px; color: var(--txt); font-weight: 600; }
.ai-radio i { font-size: 10.5px; font-style: normal; color: var(--txt-3); line-height: 1.5; }

.ai-radio.is-on {
  border-color: #7B5BE0;
  background: #F8F5FF;
  box-shadow: inset 0 0 0 1px #7B5BE0;
}

.ai-radio.is-on b { color: #4A2FB0; }

.ai-match {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
  font-size: 11.5px;
  color: var(--txt-2);
}

.ai-sel-sm { width: auto; min-width: 68px; padding-left: 8px; padding-right: 6px; }

.ai-conds { display: flex; flex-direction: column; gap: 6px; }

.ai-cond {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 7px 9px;
  border: 1px solid #EFF0F4;
  border-radius: 8px;
  background: #FBFBFD;
}

.ai-cond-field { flex: 1; min-width: 116px; }
.ai-cond-val { flex: 1; min-width: 84px; }

.ai-cond-unit {
  font-size: 11px;
  color: var(--txt-3);
  flex: none;
  min-width: 12px;
}

.ai-cond-del { flex: none; }
.ai-cond-empty { font-size: 11px; padding: 6px 2px; }

.ai-cond-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.ai-awards { display: flex; flex-direction: column; gap: 6px; }

.ai-award-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 7px 9px;
  border: 1px solid #EFF0F4;
  border-radius: 8px;
  background: #FBFBFD;
}

.ai-award-sel { flex: 1; min-width: 140px; }
.ai-award-qty { width: 64px; flex: none; }
.ai-award-x { font-size: 11px; color: var(--txt-3); flex: none; }

.ai-award-warn {
  flex-basis: 100%;
  font-size: 10.5px;
  color: #C0392B;
}

.ai-form-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #F0F1F4;
  flex-wrap: wrap;
}

.ai-sw {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--txt-2);
  margin-right: auto;
  cursor: pointer;
}

/* ---------- 命中预览 ---------- */

.ai-pv {
  font-size: 11px;
  color: var(--txt-2);
}

.ai-pv b { font-size: 13px; }
.ai-pv.is-hit { color: #12805A; }
.ai-pv.is-hit b { color: #0C6B4A; }
.ai-pv.is-none { color: #C0392B; font-weight: 600; }

.ai-pv-list {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.ai-pv-who {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 9px;
  border-radius: 7px;
  background: #F5F2FF;
  font-size: 11px;
  color: #4A2FB0;
  max-width: 150px;
}

.ai-pv-who i { font-style: normal; font-size: 10px; color: #7E72A8; }
.ai-pv-who em { font-style: normal; font-size: 10px; color: #8B80B0; }

/* ---------- 发券记录 ---------- */

.ai-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 13px;
  border-bottom: 1px solid #F0F1F4;
}

.ai-kw { flex: 1; min-width: 140px; }
.ai-sel { flex: none; width: auto; max-width: 160px; }

.ai-filter-n {
  font-size: 11px;
  color: var(--txt-3);
  flex: none;
}

.ai-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.ai-table th {
  text-align: left;
  padding: 7px 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--txt-3);
  background: #FAFAFC;
  border-bottom: 1px solid #F0F1F4;
  white-space: nowrap;
}

.ai-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #F5F6F8;
  vertical-align: top;
  color: var(--txt);
}

.ai-table tr:last-child td { border-bottom: none; }
.ai-table tr:hover td { background: #FCFCFF; }

.ai-t-title { font-weight: 500; min-width: 120px; }
.ai-t-title i { display: block; font-style: normal; font-size: 10.5px; color: var(--txt-3); margin-top: 2px; }

.ai-t-who { min-width: 96px; }
.ai-t-who i { display: block; font-style: normal; font-size: 10.5px; color: var(--txt-3); margin-top: 2px; }

.ai-t-coupon { color: #4A2FB0; }
.ai-t-num { white-space: nowrap; text-align: right; }
.ai-t-when { white-space: nowrap; color: var(--txt-2); font-size: 11px; }
.ai-t-when i { display: block; font-style: normal; font-size: 10.5px; color: var(--txt-3); margin-top: 2px; }
.ai-t-dev { font-size: 10.5px; color: var(--txt-3); max-width: 120px; word-break: break-all; }
.ai-t-ops { white-space: nowrap; }
.ai-t-tags { max-width: 120px; }

.ai-tag {
  display: inline-block;
  margin: 0 3px 3px 0;
  padding: 1px 6px;
  border-radius: 5px;
  background: #F1F2F5;
  color: var(--txt-2);
  font-size: 10px;
}

/* ---------- 画像台账说明卡 ---------- */

.ai-note {
  margin: 0 0 12px;
  padding: 11px 13px;
  border-radius: 10px;
  background: #FBFAFF;
  border: 1px solid #E9E4FA;
}

.ai-note b {
  display: block;
  font-size: 12px;
  color: #4A2FB0;
  margin-bottom: 6px;
}

.ai-note p {
  font-size: 11px;
  color: var(--txt-2);
  line-height: 1.7;
  margin: 0 0 6px;
}

.ai-note p:last-child { margin-bottom: 0; }
.ai-note b { display: inline; }
.ai-note-warn { color: #9A6B00 !important; }

.ai-newmem {
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px dashed #DCD5F0;
  border-radius: 10px;
  background: #FCFCFF;
}

/* ---------- 底部保存条 ---------- */

.ai-save-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: 10px;
  background: #FFF8E6;
  border: 1px solid #FBE2A8;
}

.ai-save-bar span {
  flex: 1;
  min-width: 120px;
  font-size: 11.5px;
  color: #7A5A12;
  font-weight: 600;
}

/* ---------- 空态与杂项 ---------- */

.ai-empty {
  padding: 34px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--txt-2);
  line-height: 1.9;
}

.ai-empty-act { margin-top: 12px; }

.ai-muted { font-size: 11px; color: var(--txt-3); }
.ai-none { color: #C0392B; }

.ai-foot-tip {
  padding: 9px 13px;
  border-top: 1px solid #F0F1F4;
  font-size: 10.5px;
  color: var(--txt-3);
  line-height: 1.7;
  background: #FCFCFE;
}

.ai-foot-tip b { color: var(--txt-2); }

/* 侧栏底部「原平台插件已全部实现」 */
.mkt-planned-tip.is-done {
  color: #12805A;
  background: #F0FBF6;
  border-radius: 7px;
  padding: 7px 9px;
  margin-top: 10px;
  border: 1px solid #D6F0E4;
}

/* ==================================================================
 * 登录态 UI：账号菜单 / 首次密码提醒 / 改密码弹窗（ADR-060）
 * ------------------------------------------------------------------
 * 前缀 who- / firstrun / pw- ，与已有 24 个玩法前缀都不冲突（加之前都 grep 过）。
 * ⚠️ 别再用 cp- ：它早就被优惠券卡片占了 144 处，AI 发券那轮栽过一次。
 * ================================================================== */

/* ---- 顶栏账号菜单 ---- */
.who { position: relative; margin-left: 4px; }
.who-btn {
  display: flex; align-items: center; gap: 7px;
  padding-left: 6px; padding-right: 9px;
}
.who-av {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand); color: var(--brand-dark);
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.who-name { font-size: 13px; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-caret { font-size: 10px; color: var(--txt-3); margin-left: -1px; }

.who-menu {
  display: none;
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 186px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(31, 42, 0, .14);
}
.who-menu.is-on { display: block; }
.who-head {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px 9px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.who-head b { font-size: 13px; }
.who-head span { font-size: 11px; color: var(--txt-3); }
.who-menu > button {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; font: inherit; font-size: 13px; color: var(--txt);
  background: transparent; border: 0; border-radius: 7px; cursor: pointer;
}
.who-menu > button:hover { background: #F4F6F0; }
.who-menu > button.is-danger:hover { background: #FDF1EF; color: #A6392A; }

/* ---- 首次密码提醒条 ---- */
.firstrun {
  display: flex; align-items: center; gap: 11px;
  margin: 0; padding: 10px 18px;
  background: #FFF8E6; border-bottom: 1px solid #F5E4B8;
  font-size: 12.5px; color: #7A5A12; line-height: 1.5;
}
.firstrun[hidden] { display: none; }
.firstrun-ico { font-size: 15px; flex: none; }
.firstrun-txt { flex: 1; min-width: 0; }
.firstrun-txt b { color: #6B4C08; }
.firstrun-txt code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; background: #fff; border: 1px solid #EEE0BC;
  border-radius: 4px; padding: 0 5px; color: #8A6512;
}

/* ---- 改密码弹窗 ---- */
.pw-form { padding: 2px 2px 4px; }
.pw-row { margin-bottom: 14px; }
.pw-row label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--txt-2); margin-bottom: 6px;
}
.pw-row input {
  width: 100%; height: 38px; padding: 0 11px;
  font: inherit; font-size: 13px; color: var(--txt);
  background: #FAFBFC; border: 1px solid var(--line);
  border-radius: 8px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.pw-row input:focus {
  background: #fff; border-color: var(--brand-deep);
  box-shadow: 0 0 0 3px rgba(174, 222, 46, .2);
}
.pw-tip { font-size: 11.5px; color: var(--txt-3); margin-top: -6px; margin-bottom: 14px; line-height: 1.6; }
.pw-tip code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; background: #F2F3F5; border-radius: 4px;
  padding: 1px 5px; color: var(--txt-2);
}
.pw-err {
  display: none; margin-bottom: 12px; padding: 8px 11px;
  font-size: 12.5px; color: #A6392A;
  background: #FDF1EF; border: 1px solid #F6D6D1; border-radius: 7px;
}
.pw-err.is-on { display: block; }
.pw-foot { display: flex; gap: 9px; justify-content: flex-end; margin-top: 4px; }
.pw-foot .btn { min-width: 84px; }

/* ==================================================================
 * 订单视图（ADMIN ORDERS）
 * ------------------------------------------------------------------
 * 前缀一律 `ord-` / `od-` / `kpi` / `pill` / `mini` / `chip` / `hist`。
 * ⚠️ 改这里之前先 grep：`cp-` 已经被券卡片占了 144 处（AI 发券那轮栽过）。
 * 订单这一屏的取舍：
 *   · 挂单数用橙色、营业额用深色 —— 店里现在要出餐的那个数必须最扎眼；
 *   · 表格行按状态染色（左边界），扫一眼就知道哪几单还压在手里；
 *   · 金额列右对齐 + 等宽数字，方便上下对着看。
 * ================================================================== */
#view-orders {
  padding: 16px; flex-direction: column; overflow: hidden;
  /* 这一屏的局部别名：全局灰阶叫 --txt-3，这里按语义写 --muted 更顺，作用域只在本视图 */
  --muted: var(--txt-3);
}
#view-orders.is-on { display: flex; }

.ord-layout {
  display: flex; flex-direction: column; gap: 14px;
  height: 100%; min-height: 0;
}

.ord-kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 220px;
  gap: 12px; flex: 0 0 auto;
}
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; min-width: 0;
}
.kpi-v { font-size: 26px; font-weight: 700; color: #1F2430; line-height: 1.15; letter-spacing: -.5px; }
.kpi-v.is-money { font-size: 22px; }
.kpi-v.is-warn { color: #E08A00; }
.kpi-k { font-size: 12px; color: var(--muted); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.is-trend { display: flex; flex-direction: column; justify-content: space-between; }
.kpi-bars { display: flex; align-items: flex-end; gap: 6px; height: 52px; }
.kpi-bars .kb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.kpi-bars .kb i { display: block; width: 100%; background: linear-gradient(180deg, #C6E86A, #9FCC22); border-radius: 3px 3px 0 0; }
.kpi-bars .kb span { font-size: 10px; color: var(--muted); }

.ord-main {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.ord-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.ord-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: #4A5160;
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
}
.chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: #1F2A00; font-weight: 600; }
.ord-search {
  flex: 1 1 180px; min-width: 140px; height: 32px; border: 1px solid var(--line);
  border-radius: 8px; padding: 0 10px; font-size: 13px; outline: none; background: #FCFCFD;
}
.ord-search:focus { border-color: var(--brand); background: #fff; }

.ord-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
.ord-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.ord-table thead th {
  position: sticky; top: 0; z-index: 2; background: #FAFBFC; text-align: left;
  font-weight: 600; color: #6B7280; font-size: 12px; padding: 9px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ord-table tbody td { padding: 10px 12px; border-bottom: 1px solid #F2F3F5; vertical-align: middle; white-space: nowrap; }
.ord-table tbody td.ord-goods { white-space: nowrap; }
.ord-table tbody tr { cursor: pointer; }
.ord-table tbody tr:hover { background: #FBFDF5; }
.ord-table tbody tr.st-paid td:first-child { box-shadow: inset 3px 0 0 #E08A00; }
.ord-table tbody tr.st-preparing td:first-child { box-shadow: inset 3px 0 0 #2B6CD9; }
.ord-table tbody tr.st-delivering td:first-child { box-shadow: inset 3px 0 0 #F5A623; }
.ord-table tbody tr.st-canceled { opacity: .55; }
.ord-no { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: #39404F; }
.ord-goods { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ord-money { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: #1F2430; }
.dim { color: var(--muted); font-weight: 400; }
.ord-ops { white-space: nowrap; }
.mini {
  border: 1px solid var(--line); background: #fff; color: #4A5160; border-radius: 6px;
  padding: 4px 9px; font-size: 12px; cursor: pointer; margin-right: 5px;
}
.mini:hover { border-color: var(--brand); color: var(--brand-dark); }
.mini.is-primary { background: var(--brand); border-color: var(--brand); color: #1F2A00; font-weight: 600; }
.mini.is-danger { color: #C0392B; border-color: #F0CFCB; }
.mini.is-danger:hover { background: #FDF1EF; }

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; background: #F0F2F5; color: #5A616E;
}
.pill.p-paid { background: #FFF4E0; color: #A96A00; }
.pill.p-preparing { background: #E8F0FF; color: #2B6CD9; }
.pill.p-delivering { background: #FFF1DA; color: #B97400; }
.pill.p-done { background: #EFF6E4; color: #4F8A1F; }
.pill.p-canceled { background: #F0F2F5; color: #8A9099; }

.ord-empty { padding: 48px 0; text-align: center; color: var(--muted); font-size: 13px; }
.ord-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted);
}
.ord-page { display: flex; gap: 8px; }

/* ---- 详情 / 店员设置弹层 ---- */
.ord-mask {
  position: fixed; inset: 0; background: rgba(16, 20, 28, .38);
  display: flex; align-items: center; justify-content: center; z-index: 60;
}
.ord-mask[hidden] { display: none; }
.ord-sheet {
  width: min(820px, 94vw); max-height: 86vh; background: #fff; border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 18px 50px rgba(15, 20, 30, .22);
}
.ord-sheet.is-narrow { width: min(520px, 94vw); }
.ord-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.ord-sheet-body { padding: 16px 18px 20px; overflow: auto; }

.od-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin-bottom: 14px; }
.od-grid label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.od-grid b { font-size: 13px; font-weight: 600; color: #262B36; }

.od-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; table-layout: fixed; }
.od-table td { padding: 7px 0; border-bottom: 1px dashed #EDEFF2; }
/* 三列固定宽：名称吃掉剩余、数量窄、金额右对齐。
   不固定的话「x3」会飘到弹层正中间（第一版就是这样）。 */
.od-table td:nth-child(1) { width: auto; }
.od-table td:nth-child(2) { width: 64px; text-align: center; color: var(--muted); }
.od-table td:nth-child(3) { width: 110px; }
.od-table td:nth-child(4) { width: 110px; }
.od-table tr.off td { color: #C0392B; font-size: 12.5px; }
.od-table tfoot td { border-bottom: none; padding: 6px 0; }
.od-table tr.total td { border-top: 1px solid var(--line); padding-top: 10px; font-size: 15px; font-weight: 700; }

.od-claimed {
  background: #FAFBFD; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
}
.od-claimed b { font-size: 12px; color: #4A5160; margin-right: 4px; }

.od-hist { margin: 14px 0; font-size: 12.5px; color: #4A5160; }
.hist { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.hist i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }
.hist span { color: var(--muted); font-variant-numeric: tabular-nums; }
.od-ops { display: flex; justify-content: flex-end; gap: 6px; }

/* ---- 店员设置 ---- */
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.65; margin: 0 0 14px; }
.staff-form { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 16px; }
.staff-form label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #4A5160; }
.staff-form label.chk { gap: 7px; }
.staff-form input[type="text"] {
  height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px;
  font-size: 13px; outline: none; min-width: 160px; background: #FCFCFD;
}
.staff-form input[type="text"]:focus { border-color: var(--brand); background: #fff; }
.staff-actions { display: flex; justify-content: flex-end; }

/* ==================================================================
 * 支付与登录（#view-pay）
 * 布局沿用门店设置那一套（左表单 + 右说明），运营不用重新认路。
 * ================================================================== */
#view-pay { display: none; padding: 16px; gap: 16px; overflow: auto; }
#view-pay.is-on { display: flex; }

.pay-layout { flex: 1; display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.pay-form { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.pay-side { width: 340px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 14px; }

.pay-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.pay-h3 {
  font-size: 15px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: baseline; gap: 8px;
}
.pay-h3 small { font-size: 12px; font-weight: 400; color: var(--txt-3); }

/* ---- 状态卡 ---- */
.pay-status {
  background: var(--panel); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); border-left: 4px solid var(--txt-3);
}
.pay-status.is-on { border-left-color: var(--brand-deep); }
.pay-status.is-mock { border-left-color: #D9A400; }
.pay-status.is-off { border-left-color: var(--danger); }

.pay-status-main { display: flex; align-items: flex-start; gap: 12px; }
.pay-status-dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto;
  background: var(--txt-3);
}
.pay-status.is-on .pay-status-dot { background: var(--brand-deep); box-shadow: 0 0 0 4px rgba(143,190,31,.18); }
.pay-status.is-mock .pay-status-dot { background: #D9A400; box-shadow: 0 0 0 4px rgba(217,164,0,.16); }
.pay-status.is-off .pay-status-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(229,83,61,.14); }

.pay-status-title { font-size: 17px; font-weight: 700; }
.pay-status-sub { font-size: 13px; color: var(--txt-2); margin-top: 4px; line-height: 1.6; }

.pay-status-meta { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pay-chip {
  font-size: 12px; color: var(--txt-2); background: #F5F6F7;
  border-radius: 100px; padding: 4px 10px;
}
.pay-chip b { color: var(--txt); font-weight: 700; }
.pay-chip.is-ok { color: var(--brand-dark); background: rgba(174, 222, 46, .22); }

.pay-miss { margin-top: 14px; padding: 12px 14px; background: #FFF7F5; border-radius: 8px; }
.pay-miss b { font-size: 13px; color: var(--danger); }
.pay-miss ul { margin: 6px 0 0 18px; }
.pay-miss li { font-size: 12.5px; color: var(--txt-2); line-height: 1.9; }

/* ---- 表单 ---- */
.pay-f { display: block; margin-bottom: 12px; }
.pay-f > span { display: block; font-size: 13px; color: var(--txt-2); margin-bottom: 6px; }
.pay-f > span small { color: var(--txt-3); font-size: 12px; margin-left: 6px; }
.pay-f input, .pay-f textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font-size: 13px; color: var(--txt); background: #FCFCFD;
  outline: none; transition: border-color .15s, background .15s;
}
.pay-f textarea { resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; line-height: 1.5; }
.pay-f input:focus, .pay-f textarea:focus { border-color: var(--brand-deep); background: #fff; }
/* 已有值的密钥框：用绿底提示「不用重填」 */
.pay-f input.is-set, .pay-f textarea.is-set { background: rgba(174, 222, 46, .10); border-color: rgba(143, 190, 31, .45); }

.pay-note { font-size: 12.5px; color: var(--txt-3); line-height: 1.7; }
.pay-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pay-toggle { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--txt-2); cursor: pointer; }
.pay-toggle input { width: 15px; height: 15px; accent-color: var(--brand-deep); cursor: pointer; }
.pay-actions .btn-primary { margin-left: auto; }

.pay-warn {
  font-size: 12.5px; color: #B26A00; background: #FFF7E6;
  border-radius: 8px; padding: 10px 14px; line-height: 1.7;
}
.pay-warn code { background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---- 会员列表 ---- */
.pay-members { max-height: 320px; overflow: auto; }
.pay-empty { font-size: 13px; color: var(--txt-3); line-height: 1.8; }
.pay-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pay-table th {
  text-align: left; font-weight: 600; color: var(--txt-3);
  padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.pay-table td { padding: 7px 6px; border-bottom: 1px solid #F5F6F7; color: var(--txt-2); }
.pay-table td.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--txt-3); }

/* ---- 说明 ---- */
.pay-help .pay-steps { margin: 0 0 12px 18px; }
.pay-help .pay-steps li { font-size: 13px; color: var(--txt-2); line-height: 1.95; }
.pay-help .pay-steps b { color: var(--txt); }


/* ==================================================================
 * 会员资产（#view-members）
 * ------------------------------------------------------------------
 * 这一屏只回答三个问题：一共欠顾客多少（积分 + 余额）、每个人还剩多少、
 * 谁在什么时候动过。所以版式是「上面一排汇总 → 下面一张明细表」，
 * 不做筛选侧栏 —— 会员数上千之前，一个搜索框就够了。
 * ================================================================== */
#view-members { padding: 16px; flex-direction: column; overflow: hidden; }
#view-members.is-on { display: flex; }

.mb-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }

/* ---- 汇总四卡 ---- */
.mb-sum { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .mb-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.mb-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.mb-card-label { font-size: 12px; color: var(--txt-3); }
.mb-card-num {
  font-size: 25px; font-weight: 700; line-height: 1.3; color: var(--txt);
  letter-spacing: -.4px; font-variant-numeric: tabular-nums;
}
.mb-card-tip { font-size: 11.5px; color: var(--txt-3); line-height: 1.5; }

/* 积分和余额是「欠顾客的」，不是赚到的。用琥珀色画出来提醒运营别当业绩看
   —— 品牌绿在这一屏会读成「涨了」，正好反了（ADR-074）。 */
.mb-card.is-warn { border-color: #F2D7A4; background: linear-gradient(180deg, #FFFCF4, #fff); }
.mb-card.is-warn .mb-card-num { color: #B26A00; }

/* ---- 明细面板 ---- */
.mb-panel {
  flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.mb-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.mb-h3 {
  font-size: 15px; font-weight: 700; min-width: 0;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.mb-h3 small { font-size: 12px; font-weight: 400; color: var(--txt-3); }
.mb-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.mb-search {
  width: 250px; height: 32px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 11px; font-size: 13px; color: var(--txt); background: #FCFCFD; outline: none;
  transition: border-color .15s, background .15s;
}
.mb-search:focus { border-color: var(--brand); background: #fff; }
.mb-search::placeholder { color: var(--txt-3); }

/* 表体自己滚，表头 sticky —— 会员上了几十个之后，
   一滚就找不到列名，运营会开始数第几列是余额 */
.mb-table-wrap { flex: 1; min-height: 0; overflow: auto; }
.mb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mb-table th {
  position: sticky; top: 0; z-index: 1;
  padding: 9px 12px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--txt-3);
  background: #FAFBFC; border-bottom: 1px solid var(--line);
}
.mb-table td { padding: 10px 12px; border-bottom: 1px solid #F5F6F7; color: var(--txt-2); }
.mb-table tbody tr:hover td { background: #FBFDF2; }
.mb-table tbody tr:last-child td { border-bottom: none; }

.mb-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 有资产才加深。一屏全是 0 的时候，加粗只会让表格糊成一片 */
.mb-num.is-on { color: var(--txt); font-weight: 600; }
/* 扣减不涂红：花积分是正常行为，涂红会让「消费」和「出错」长得一样 */
.mb-num.is-off { color: var(--txt-2); }

.mb-id {
  padding: 2px 6px; border-radius: 5px; background: #F4F5F7;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--txt-3);
}
.mb-dim { color: var(--txt-3); font-size: 12.5px; }

.mb-act {
  padding: 3px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--txt-2); font-size: 12px; transition: all .15s;
}
.mb-act:hover { border-color: var(--brand); background: #FBFDF2; color: var(--brand-dark); }
/* 调账是这一屏唯一的写操作，得让它比「流水」显眼一档 */
.mb-act.is-primary { border-color: var(--brand); background: #F3F9E0; color: var(--brand-dark); font-weight: 600; }
.mb-act.is-primary:hover { background: var(--brand); }
.mb-act + .mb-act { margin-left: 6px; }
/* 操作列不许换行：两个按钮并排才 98px，列宽给到 132px 刚刚好。
   不加 nowrap 的话浏览器会在窄 1px 时把第二个按钮挤到下一行，
   整张表的行高跟着翻倍（截图里 6 行就占满一屏）。 */
.mb-ops { white-space: nowrap; }

.mb-empty { padding: 36px 16px; text-align: center; font-size: 13px; color: var(--txt-3); }

/* ---- 弹层 ---- */
.mb-mask {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  background: rgba(16, 20, 28, .38);
}
/* ⚠️ 这一条不能省：上面 .mb-mask 的 display:flex 会盖掉浏览器对 [hidden] 的默认隐藏，
   表现是「弹层关不掉」——订单页的 .ord-mask 踩过一次，别再踩第二遍 */
.mb-mask[hidden] { display: none; }

.mb-dialog {
  width: min(440px, 94vw); max-height: 88vh; overflow: auto;
  padding: 18px 20px; border-radius: 14px; background: #fff;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 18px 50px rgba(15, 20, 30, .22);
}
.mb-dialog-wide { width: min(820px, 94vw); }
.mb-dialog .mb-h3 { gap: 6px; }

/* ---- 调账表单 ---- */
.mb-f { display: flex; flex-direction: column; gap: 6px; }
.mb-f > span { font-size: 12px; font-weight: 600; color: #4A5160; }
.mb-f input[type="text"], .mb-f input[type="number"] {
  height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; color: var(--txt); background: #FCFCFD; outline: none;
  transition: border-color .15s, background .15s;
}
.mb-f input:focus { border-color: var(--brand); background: #fff; }
.mb-f input::placeholder { font-size: 12.5px; color: var(--txt-3); }
.mb-f input[type="number"] { font-variant-numeric: tabular-nums; }

/* 积分 / 余额二选一。选中态挂在 input:checked + em 上，不用 :has()
   —— 门店那台机器上的 Edge 不一定够新，新语法在这里换不来任何收益 */
.mb-kinds { display: flex; gap: 8px; }
.mb-kind { position: relative; cursor: pointer; }
.mb-kind input { position: absolute; width: 0; height: 0; opacity: 0; }
.mb-kind em {
  display: inline-flex; align-items: center; height: 34px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 8px; background: #FCFCFD;
  font-style: normal; font-size: 13px; color: var(--txt-2); transition: all .15s;
}
.mb-kind:hover em { border-color: var(--txt-3); }
.mb-kind input:checked + em {
  border-color: var(--brand-deep); background: #EFF7D6; color: var(--brand-dark); font-weight: 600;
}
.mb-kind input:focus-visible + em { box-shadow: 0 0 0 3px rgba(174, 222, 46, .28); }

.mb-note { font-size: 12.5px; color: var(--txt-3); line-height: 1.55; }
.mb-note.is-err { color: var(--danger); }
/* 没有错误时不留一行空白：弹层高度跟着内容走，不要常年挂着一块空 */
.mb-note:empty { display: none; }
/* 单位。积分不标（类型列已经写明「积分抵现」），余额必须标「元」——
   后台调账这一行可能调的是积分、也可能是余额，光看「-32」分不出是 32 分还是 32 元。 */
.mb-unit { margin-left: 2px; font-style: normal; font-size: 11px; color: var(--txt-3); }
.mb-btns { display: flex; justify-content: flex-end; gap: 8px; }

/* ---- 流水弹层 ---- */
.mb-log { max-height: 58vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.mb-log > p { padding: 18px 14px; margin: 0; }
.mb-table-sm { font-size: 12.5px; }
.mb-table-sm th, .mb-table-sm td { padding: 7px 10px; }

/* ---- 会员等级（ADR-096~099） -------------------------------------
 * 这一块是**配置**，不是账本，所以和下面的资产表在视觉上要分得开：
 * 用琥珀色标题条 + 更紧的行高，眼睛一眼能认出「这块是改规则的地方」。
 * 前缀 `lv-`：加之前 grep 过 admin.css，0 处占用（`ly-` 是会员经营，
 * 两者只差一个字母，改样式时别改串了）。
 * ------------------------------------------------------------------ */
.lv-panel { flex: 0 1 auto; }

.lv-switch {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--txt-2); cursor: pointer; user-select: none;
}
.lv-switch input { width: 15px; height: 15px; accent-color: var(--brand-deep); cursor: pointer; }

.lv-table { overflow: auto; max-height: 292px; }

.lv-row {
  display: grid;
  grid-template-columns: 128px 96px 78px 88px minmax(160px, 1fr) 64px 40px;
  gap: 8px; align-items: center;
  padding: 7px 14px; border-bottom: 1px solid #F5F6F7;
}
.lv-row:last-child { border-bottom: none; }
.lv-row .input {
  width: 100%; height: 30px; font-size: 13px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 7px; background: #FCFCFD; outline: none;
  transition: border-color .15s, background .15s;
}
.lv-row .input:focus { border-color: var(--brand); background: #fff; }
/* 第一档门槛固定 0，标成禁用 —— 但**不能隐藏**：
   隐藏了运营会以为「这一档不用填」，然后去改别的档凑门槛 */
.lv-row .input:disabled { background: #F5F6F7; color: var(--txt-3); cursor: not-allowed; }
.lv-row .lv-name { font-weight: 600; }
.lv-row .lv-need, .lv-row .lv-dis, .lv-row .lv-rate { text-align: right; font-variant-numeric: tabular-nums; }

.lv-thead {
  position: sticky; top: 0; z-index: 1;
  background: #FAFBFC; border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--txt-3);
}
.lv-thead span { padding-left: 2px; }

.lv-count { font-size: 12.5px; color: var(--txt-2); font-variant-numeric: tabular-nums; }
/* 改了门槛还没保存：人数还是按老门槛算的，必须显式标出来，
   否则运营会拿一个「按旧规则统计的人数」去判断新门槛合不合理 */
.lv-count.is-stale { color: var(--txt-3); opacity: .55; text-decoration: line-through; }

.lv-del {
  height: 26px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--txt-3); font-size: 12px; cursor: pointer;
}
.lv-del:hover:not(:disabled) { border-color: #E8B4B4; color: var(--danger); background: #FFF7F7; }
.lv-del:disabled { opacity: .4; cursor: not-allowed; }

.lv-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--line); background: #FCFCFD;
}
.lv-hint { font-size: 11.5px; color: var(--txt-3); line-height: 1.5; }

/* 会员表里的等级标签：不加底色，用一点重量和颜色区分，避免整列变成彩虹 */
.mb-lv { font-size: 12.5px; font-weight: 600; color: #8A6A20; }


/* ==================================================================
 * 数据中心（#view-stats，第 8 视图，ADR-078~083）
 * ------------------------------------------------------------------
 * 这一屏的读者是老板/店长，不是分析师。所以：
 *   · 先给四个数（营业额/单量/客单价/优惠率），细节往下滚；
 *   · 每个数字旁边都能看到它是怎么算的（口径说明不是文档，是这一屏的一部分）；
 *   · 算不准的东西宁可不显示 —— 一个错的数会让整套报表作废。
 * ================================================================== */
#view-stats { flex-direction: column; overflow: hidden; }
#view-stats.is-on { display: flex; }

/* 整屏上下滚：四块内容一屏放不下，硬塞会把趋势图压成一条线 */
.st-wrap {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 14px 18px 40px; display: flex; flex-direction: column; gap: 12px;
}

/* ---- 工具条 ---- */
.st-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.st-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.st-seg-btn {
  height: 32px; padding: 0 14px; border: none; background: transparent;
  font-size: 13px; color: var(--txt-2); cursor: pointer; transition: all .15s;
}
.st-seg-btn + .st-seg-btn { border-left: 1px solid var(--line); }
.st-seg-btn:hover { background: #F7F9F2; color: var(--brand-dark); }
.st-seg-btn.is-on { background: var(--brand); color: var(--brand-dark); font-weight: 600; }

.st-custom { display: flex; align-items: center; gap: 6px; }
.st-day {
  width: 108px; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; color: var(--txt); background: #FCFCFD; outline: none;
  transition: border-color .15s, background .15s;
}
.st-day:focus { border-color: var(--brand); background: #fff; }
.st-day::placeholder { color: var(--txt-3); }
.st-tilde { font-size: 12px; color: var(--txt-3); }
.st-tools { margin-left: auto; display: flex; gap: 8px; }

.st-rangenote { font-size: 12px; color: var(--txt-3); line-height: 1.5; }

/* 台账读不出来：必须显式说，不能安静地画成 0 */
.st-warn {
  padding: 9px 12px; border: 1px solid #F2D7A4; border-radius: 8px;
  background: #FFFCF4; color: #8A5A00; font-size: 12.5px; line-height: 1.6;
}

/* ---- 口径说明（展开在页内，不做弹窗：弹窗要另一套关闭逻辑，而这块内容是"常看"的） ---- */
.st-method {
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px;
  background: #FBFCFA; font-size: 13px; line-height: 1.75; color: var(--txt-2);
}
.st-method[hidden] { display: none; }
.st-method h4 { font-size: 13px; color: var(--txt); margin: 12px 0 3px; }
.st-method h4:first-child { margin-top: 0; }
.st-method p { margin: 0; }
.st-method b { color: var(--txt); }

/* ---- 四卡 ---- */
.st-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .st-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.st-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 15px 13px; min-width: 0;
}
.st-k { display: flex; flex-direction: column; gap: 3px; }
.st-k-label { font-size: 12px; color: var(--txt-3); }
.st-k-num {
  font-size: 25px; font-weight: 700; line-height: 1.28; color: var(--txt);
  letter-spacing: -.5px; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.st-k-foot { min-height: 17px; font-size: 11.5px; color: var(--txt-3); line-height: 1.45; }
.st-k-sub { color: var(--txt-3); }

/* 积分负债 / 余额欠款：琥珀色，别用品牌绿 —— 绿会读成「赚了」，正好反了（ADR-074） */
.st-k.is-warn { border-color: #F2D7A4; background: linear-gradient(180deg, #FFFCF4, #fff); }
.st-k.is-warn .st-k-num { color: #B26A00; }

/* 环比：涨绿跌红。这里不是股票行情（那是红涨绿跌），
   经营数据里"涨"就是好事，用红会让老板以为出事了 */
.st-delta { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-delta.is-up { color: #4E9A2A; }
.st-delta.is-down { color: var(--danger); }
.st-delta.is-flat { color: var(--txt-3); font-weight: 400; }
/* 「无对照」要看起来像"这里没有答案"，不是像"0%" */
.st-delta.is-na { color: var(--txt-3); font-weight: 400; }

/* ---- 两列区 ---- */
.st-2col { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 1180px) { .st-2col { grid-template-columns: minmax(0, 1fr); } }

.st-card-h {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 13.5px; font-weight: 700; color: var(--txt); margin-bottom: 10px;
}
.st-card-sub { font-size: 11.5px; font-weight: 400; color: var(--txt-3); }

.st-h2 {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 8px; font-size: 15px; font-weight: 700; color: var(--txt);
}
.st-h2 span { font-size: 12px; font-weight: 400; color: var(--txt-3); }

.st-foot { font-size: 12px; color: var(--txt-3); line-height: 1.7; padding: 2px 2px 0; }

/* ---- 柱状图（纯 div，零依赖） ---- */
.st-chart { min-width: 0; }
.st-chart-h { font-size: 11.5px; color: var(--txt-3); margin-bottom: 6px; }
.st-chart-sm .st-bars-row { height: 92px; }

/* 柱宽要给上限：7 天数据在 1000px 容器里，flex:1 会让每根 140px 宽，
   看上去是一排色块而不是柱状图。76px 是「一眼能看出高低、又不至于糊成一片」的折中。 */
.st-bars-row {
  display: flex; align-items: flex-end; gap: 5px; height: 152px;
  justify-content: space-around;
}
.st-bar-cell {
  flex: 1 1 0; min-width: 0; max-width: 76px; height: 100%;
  display: flex; flex-direction: column; align-items: center;
}
/* track 要 flex:1 才有确定高度，里面的 fill 用百分比高度才成立 */
.st-bar-track { flex: 1; width: 100%; min-height: 0; display: flex; align-items: flex-end; justify-content: center; }
/* ⚠️ 这里**不能**写 min-height：没营业额的日子高度是 0%，加了 min-height 之后
   会留一条 2px 的绿边，看上去像"那天卖了一点点"。零就是零。
   有值但很小的日子由 JS 保证至少 1.5%，不靠 CSS 兜。 */
.st-bar-fill {
  width: 74%; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #C4E766, #9BCB2E);
  transition: filter .15s;
}
.st-bar-cell:hover .st-bar-fill { filter: brightness(.92); }
.st-bar-fill.is-mem { background: linear-gradient(180deg, #9FC6F0, #5B9BE0); }
.st-bar-x {
  margin-top: 5px; font-size: 10px; color: var(--txt-3); line-height: 1.2;
  white-space: nowrap; height: 12px; overflow: hidden;
}
/* 今天还没过完：斜纹，别让人把"半天"看成"腰斩" */
.st-bar-cell.is-partial .st-bar-fill {
  background-image: repeating-linear-gradient(45deg,
    #AEDE2E 0, #AEDE2E 3px, #D9EFA6 3px, #D9EFA6 6px);
  background-color: #AEDE2E;
}

/* ---- 横条（让利结构 / 品类占比） ---- */
.st-bars { display: flex; flex-direction: column; gap: 8px; }
.st-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.st-line-name {
  width: 72px; flex: 0 0 72px; font-size: 12.5px; color: var(--txt-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.st-line-track { flex: 1; min-width: 0; height: 9px; border-radius: 5px; background: #F2F4F0; overflow: hidden; }
.st-line-fill { height: 100%; border-radius: 5px; background: var(--brand); }
.st-line-fill.is-cat { background: #7FB3E8; }
.st-line-val {
  flex: 0 0 auto; min-width: 74px; text-align: right;
  font-size: 12.5px; color: var(--txt); font-variant-numeric: tabular-nums;
}
.st-line-pct {
  flex: 0 0 42px; text-align: right;
  font-size: 11.5px; color: var(--txt-3); font-variant-numeric: tabular-nums;
}
.st-hint { font-size: 11.5px; color: var(--txt-3); line-height: 1.6; margin-top: 2px; }

/* ---- 表 ---- */
.st-tbl-wrap { max-height: 320px; overflow: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.st-table th {
  position: sticky; top: 0; z-index: 1;
  padding: 7px 9px; text-align: left; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; color: var(--txt-3);
  background: #FAFBFC; border-bottom: 1px solid var(--line);
}
.st-table td { padding: 8px 9px; border-bottom: 1px solid #F5F6F7; color: var(--txt-2); }
.st-table tbody tr:last-child td { border-bottom: none; }
.st-table tbody tr:hover td { background: #FBFDF2; }
.st-r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-nowrap { white-space: nowrap; }
.st-dim { color: var(--txt-3); font-size: 12px; line-height: 1.55; }
.st-rank {
  display: inline-block; width: 17px; height: 17px; margin-right: 7px;
  border-radius: 5px; background: #F2F4F0; color: var(--txt-3);
  font-size: 10.5px; font-weight: 700; text-align: center; line-height: 17px;
}
.st-table tbody tr:nth-child(1) .st-rank { background: #EAF5C8; color: #5C7A0B; }
.st-table tbody tr:nth-child(2) .st-rank { background: #EAF5C8; color: #5C7A0B; }
.st-table tbody tr:nth-child(3) .st-rank { background: #EAF5C8; color: #5C7A0B; }

.st-empty { padding: 26px 8px; text-align: center; font-size: 12.5px; color: var(--txt-3); }
.st-empty-block {
  grid-column: 1 / -1; display: flex; flex-direction: column; gap: 5px;
  padding: 26px 18px; text-align: center;
}
.st-empty-block b { font-size: 14px; color: var(--txt-2); }
.st-empty-block span { font-size: 12.5px; color: var(--txt-3); }

/* ==================================================================
 * 商品体系（规格加价 / 库存 / 排序）· sk-*
 * ------------------------------------------------------------------
 * 前缀登记在 admin_contract.js 的 CSS_PREFIX_OWNERS 里（ADR-086 配套）。
 * 加新面板前先 grep 一遍，撞了不会报错，只会静默串样式。
 * ================================================================== */

/* ---- 商品表：排序按钮 ---- */
.sk-sort-cell { white-space: nowrap; }
.sk-sort {
  display: block;
  width: 24px;
  height: 19px;
  line-height: 17px;
  padding: 0;
  border: 1px solid #D8DAE0;
  background: #fff;
  /* 9px + txt-3 在 1440 屏上几乎看不见，人会以为这列只是装饰 */
  color: var(--txt-2);
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
}
.sk-sort:hover { color: var(--brand-dark); border-color: var(--brand); background: #FBFDF6; }
.sk-sort + .sk-sort { margin-top: 3px; }

/* ---- 商品表：余量三态 ---- */
.sk-none { color: var(--txt-3); font-size: 12px; }
.sk-out {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #FDECEA;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}
.sk-num { font-weight: 600; color: var(--txt); }
.sk-num.is-low { color: #C2410C; }

/* ---- 抽屉：规格模板选择 ---- */
.sk-tpl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 8px;
}

/* ---- 抽屉：单个规格组 ---- */
.sk-group {
  margin: 0 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.sk-group-h {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #F7F8FA;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.sk-req {
  padding: 0 5px;
  border-radius: 3px;
  background: rgba(174, 222, 46, 0.22);
  color: #4E7000;
  font-size: 11px;
}
.sk-group-hint { margin-left: auto; color: var(--txt-3); font-size: 11px; }

.sk-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sk-table th {
  padding: 5px 8px;
  text-align: left;
  font-weight: 500;
  color: var(--txt-3);
  background: #FCFCFD;
  border-bottom: 1px solid #F2F3F5;
}
.sk-table td { padding: 5px 8px; border-bottom: 1px solid #F7F8FA; }
.sk-table tr:last-child td { border-bottom: none; }
.sk-in {
  width: 100%;
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
  text-align: right;
}

/* ---- 侧栏：库存流水入口 ---- */
.sk-ledger-box {
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #FBFCFD;
}
.sk-ledger-hint {
  margin-bottom: 8px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--txt-3);
}

/* ---- 库存流水弹窗 ---- */
.sk-led-tip {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #FBFDF6;
  border: 1px solid #E6EFCF;
  color: var(--txt-2);
  font-size: 12px;
  line-height: 1.6;
}
.sk-led-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.sk-led-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sk-led-table th {
  position: sticky;
  top: 0;
  padding: 7px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--txt-2);
  background: #F7F8FA;
  border-bottom: 1px solid var(--line);
}
.sk-led-table td { padding: 7px 10px; border-bottom: 1px solid #F2F3F5; }
.sk-t { color: var(--txt-3); white-space: nowrap; }
.sk-spec { margin-left: 6px; color: var(--txt-3); font-size: 11px; }
.sk-d.in { color: #1F7A3D; }
.sk-d.out { color: var(--danger); }
.sk-after { color: var(--txt-2); }
.sk-no { color: var(--txt-3); font-family: 'DIN Alternate', -apple-system, sans-serif; }
.sk-empty { padding: 32px; text-align: center; color: var(--txt-3); }

/* 操作列三个按钮：不加 nowrap 时「删除」会被挤成竖排两个字（列宽 176 刚好够） */
#goodsTbody td:last-child { white-space: nowrap; }

/* ================================================================
 * 会员经营三件套：集点卡 / 消费有礼 / 积分商城（ADR-089~094）
 * 前缀 ly- —— 加之前 grep 过 admin.css，0 处占用（st- 是数据中心的）。
 * ================================================================ */

.ly-note {
  background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E;
  border-radius: 8px; padding: 9px 12px; font-size: 12px; line-height: 1.7;
  margin: 10px 0 14px;
}
.ly-note b { color: #78350F; }

/* 保存条：三个页签共用。粘在 content 底部容易盖住表格，所以放流里 */
.ly-save {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #F8FAFC; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; margin: 14px 0;
}
.ly-save-txt { font-size: 12px; color: var(--txt-3); }
.ly-save-txt b { color: #B45309; }

.ly-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; }
.ly-desc { margin-top: 12px; }
.ly-desc label { display: block; font-size: 12px; color: var(--txt-3); margin-bottom: 5px; }

/* 参与范围 */
.ly-scope { margin: 14px 0 4px; }
.ly-scope-title { font-size: 12px; color: var(--txt-2); margin-bottom: 7px; }
.ly-scope-title i { color: var(--txt-3); font-style: normal; margin-left: 6px; }
.ly-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ly-chip {
  border: 1px solid var(--line); background: #fff; color: var(--txt-2);
  border-radius: 99px; padding: 4px 12px; font-size: 12px; cursor: pointer;
  font-family: inherit;
}
.ly-chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ly-empty-inline { font-size: 12px; color: var(--txt-3); }

/* 看板 / 列表 */
.ly-board { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 14px; }
.ly-board-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ly-board-h b { font-size: 13px; color: var(--txt-1); }
.ly-board-h i { font-size: 12px; color: var(--txt-3); font-style: normal; line-height: 1.6; }
.ly-board-h .is-hot { color: #B45309; }
.ly-hint { color: var(--txt-3); }

/* 5 列：顾客 / 进度条 / 章数 / 已兑 / 待领 */
.ly-row {
  display: grid; grid-template-columns: 1.1fr 1.6fr .7fr .7fr .9fr;
  gap: 8px; align-items: center; padding: 7px 4px; font-size: 12px;
  border-bottom: 1px solid #F3F5F8;
}
.ly-row-head { color: var(--txt-3); font-size: 11px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.ly-row:last-child { border-bottom: 0; }
/* 兑换记录是 6 列：时间 / 顾客 / 兑换项 / 扣分 / 状态 / 操作 */
.ly-board-mall .ly-row { grid-template-columns: .8fr .9fr 1.9fr .7fr .8fr .6fr; }

.ly-who { color: var(--txt-2); font-variant-numeric: tabular-nums; }
.ly-num { color: var(--txt-2); font-variant-numeric: tabular-nums; }
.ly-num.is-hot { color: #B45309; font-weight: 600; }
.ly-time { color: var(--txt-3); font-variant-numeric: tabular-nums; }
.ly-title { color: var(--txt-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ly-title code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px;
  background: #F1F5F9; border-radius: 3px; padding: 1px 5px; margin-left: 4px; color: #334155;
}
.ly-act { text-align: right; }

/* 进度条：高度写死，靠 width 表达进度。⚠️ 不加 min-width，零章时不画 */
.ly-bar { height: 6px; background: #EEF1F5; border-radius: 99px; overflow: hidden; }
.ly-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

.ly-empty { font-size: 12px; color: var(--txt-3); padding: 14px 4px; line-height: 1.7; }

/* 周期切换 */
.ly-cycle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; font-size: 12px; }
.ly-cycle > span { color: var(--txt-2); }
.ly-cycle i { color: var(--txt-3); font-style: normal; }
.ly-seg {
  border: 1px solid var(--line); background: #fff; color: var(--txt-2);
  border-radius: 6px; padding: 5px 13px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.ly-seg.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 档位行 */
.ly-tiers { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ly-tier-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #FBFCFE; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
}
.ly-tier-row .inline { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--txt-2); }
/* 档位行挤到 4 列时，flex item 会被压到 1 个字宽 —— 「积分」竖着排成两行。
   标签与输入框都不许收缩，宁可整行换行（`.ly-tier-row` 已经有 flex-wrap） */
.ly-tier-row .inline > span,
.ly-tier-row .inline > input,
.ly-tier-row .inline > select { flex: none; white-space: nowrap; }

/* 兑换项卡片 */
.ly-mall { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ly-mall-row {
  display: grid; grid-template-columns: minmax(160px, 1.6fr) auto auto;
  gap: 10px 14px; align-items: center;
  background: #FBFCFE; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
.ly-mall-row.is-off { opacity: .55; }
.ly-mall-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ly-mall-main .input-title { font-weight: 600; }
.ly-mall-nums { display: flex; gap: 10px; }
.ly-mall-nums label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--txt-3); }
.ly-mall-tail { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
/* 券下拉别用 width:100%（.select 默认）：挤在 flex 行里只剩几十像素，
   「会员 8.8 折券」会被截成「会员 8.8 折」。让它按内容宽，给个下限 */
.ly-mall-tail .select { flex: 0 0 auto; width: auto; min-width: 92px; max-width: 168px; }

/* 状态徽章 */
.ly-badge {
  display: inline-block; font-size: 11px; border-radius: 99px; padding: 1px 9px;
  background: #EEF2FF; color: #4338CA;
}
.ly-badge.is-wait { background: #FEF3C7; color: #92400E; }
.ly-badge.is-done { background: #ECFDF5; color: #047857; }

@media (max-width: 1080px) {
  .ly-mall-row { grid-template-columns: 1fr; }
  .ly-board-mall .ly-row { grid-template-columns: .9fr 1fr 1.4fr .7fr .8fr; }
  .ly-board-mall .ly-row > :last-child { display: none; }
}
