/* ==========================================================
   BATHBEND 运营后台 —— 基础样式
   配色沿用小程序：墨绿 + 金，但整体走浅色，长时间看不累
   ========================================================== */

:root {
  --ink: #16211D;
  --ink-2: #5C6A64;
  --ink-3: #97A29C;
  --line: #E5E7E4;
  --line-2: #EFF1EE;
  --bg: #F4F5F3;
  --card: #FFFFFF;
  --brand: #173A31;
  --brand-2: #21604F;
  --gold: #C8A164;
  --danger: #C0392B;
  --danger-bg: #FDF2F0;
  --ok: #2C7A5B;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* ==========================================================
   登录页
   ========================================================== */

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-left {
  background: linear-gradient(150deg, #173A31 0%, #0F2A23 60%, #0B211B 100%);
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-left::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,161,100,.20), transparent 68%);
}

.login-brand {
  font-size: 22px;
  letter-spacing: 3px;
  font-weight: 600;
}

.login-brand span {
  display: block;
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(255,255,255,.55);
  font-weight: 400;
  margin-top: 8px;
}

.login-quote {
  font-size: 26px;
  line-height: 1.55;
  font-weight: 500;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

.login-quote em {
  color: var(--gold);
  font-style: normal;
}

.login-foot {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  position: relative;
  z-index: 1;
}

.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #fff;
}

.login-card {
  width: 100%;
  max-width: 340px;
}

.login-card h1 {
  font-size: 24px;
  margin: 0 0 6px;
  font-weight: 600;
}

.login-card .sub {
  color: var(--ink-3);
  font-size: 13px;
  margin: 0 0 32px;
}

.login-err {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.login-err.show { display: block; }

/* 不是所有提示都是错误：改完密码要告诉用户"去用新密码登录" */
.login-err.ok {
  background: #EDF4EF;
  color: #2F6B4F;
}

.login-tip {
  margin-top: 22px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
  background: #F8F9F7;
  border-radius: 8px;
  padding: 12px 14px;
}

.login-tip b { color: var(--brand); font-weight: 600; }

/* ==========================================================
   表单控件
   ========================================================== */

.field { margin-bottom: 18px; }

.field > label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 7px;
  font-weight: 500;
}

.field > label .req { color: var(--danger); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  height: 40px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.textarea {
  height: auto;
  padding: 10px 12px;
  line-height: 1.65;
  resize: vertical;
  min-height: 96px;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(33,96,79,.10);
}

.input::placeholder, .textarea::placeholder { color: #B7C0BB; }

.hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
  line-height: 1.6;
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* 栏目管理：拖动点 + 名字 + 删除，输入框自己撑满 */
.type-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 2px 4px;
  border-radius: 10px;
  background: var(--card);
}
.type-row .input { flex: 1; min-width: 0; }
.type-row .btn-text { flex: none; }

/* 左边那六个小点：唯一能按住的拖动手柄
   必须 touch-action:none，否则手机上按住一拖，先滚的是抽屉 */
.type-row .drag-handle {
  flex: none;
  width: 22px;
  height: 34px;
  display: grid;
  grid-template-columns: repeat(2, 4px);
  grid-auto-rows: 4px;
  gap: 3px;
  place-content: center;
  border-radius: 6px;
  cursor: grab;
  touch-action: none;
}
.type-row .drag-handle span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #B4B2A9;
}
.type-row .drag-handle:hover { background: var(--line-2); }
.type-row .drag-handle:hover span { background: var(--ink-2); }

/* 正在拖的那一行：抬起来，跟其他行区分开 */
.type-row.dragging {
  position: relative;
  z-index: 5;
  background: var(--card);
  box-shadow: 0 8px 20px rgba(23, 58, 49, 0.16);
}
body.is-dragging,
body.is-dragging .type-row .drag-handle { cursor: grabbing; }
body.is-dragging { user-select: none; -webkit-user-select: none; }

/* 拖过之后提醒「还没保存」 */
.hint.hot { color: var(--brand-2); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}

.btn:hover { border-color: #CFD5D1; background: #FAFBFA; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }

.btn-danger { color: var(--danger); border-color: #EBC9C3; background: #fff; }
.btn-danger:hover { background: var(--danger-bg); }

.btn-lg { height: 44px; width: 100%; font-size: 15px; }

.btn-text {
  border: none;
  background: none;
  color: var(--brand-2);
  cursor: pointer;
  padding: 0 6px;
  height: 28px;
  font-size: 13px;
  border-radius: 6px;
  white-space: nowrap;
}

.btn-text:hover { background: #EDF3F0; }
.btn-text.danger { color: var(--danger); }
.btn-text.danger:hover { background: var(--danger-bg); }

.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ==========================================================
   主框架
   ========================================================== */

.app { display: flex; min-height: 100vh; }

.side {
  width: 232px;
  flex: 0 0 232px;
  background: var(--brand);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand {
  padding: 26px 22px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: relative;
}

.side-brand b {
  font-size: 17px;
  letter-spacing: 2.5px;
  font-weight: 600;
}

.side-brand span {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,.45);
  letter-spacing: 1.5px;
  margin-top: 6px;
}

.side-nav { padding: 14px 12px; flex: 1; overflow-y: auto; }

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: 13.5px;
  margin-bottom: 2px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }

.side-nav a.on {
  background: rgba(255,255,255,.13);
  color: #fff;
  font-weight: 500;
}

.side-nav a i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .55;
  flex: 0 0 6px;
}

.side-nav a.on i { background: var(--gold); opacity: 1; }

.side-nav .grp {
  font-size: 11px;
  color: rgba(255,255,255,.32);
  letter-spacing: 1.2px;
  padding: 16px 12px 8px;
}

.side-foot {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  color: rgba(255,255,255,.55);
  display: flex;
  align-items: center;
  gap: 4px;
}

.side-foot #who {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-foot button {
  background: none;
  border: none;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 5px;
}

.side-foot button:hover { color: #fff; background: rgba(255,255,255,.08); }

/* 演示模式角标：绝对定位，不能用 .side-brand span 那套块级样式 */
.side-brand .demo-flag {
  position: absolute;
  top: 24px;
  right: 16px;
  display: inline-block;
  margin: 0;
  background: rgba(200,161,100,.16);
  color: var(--gold);
  font-size: 10px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
  letter-spacing: .5px;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 68px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; }

.topbar .meta {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 3px;
}

.topbar-actions { display: flex; gap: 10px; align-items: center; }

.view { padding: 24px 28px 60px; }

/* ==========================================================
   概览统计卡
   ========================================================== */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat .k { font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; }

.stat .v { font-size: 28px; font-weight: 600; letter-spacing: -.5px; line-height: 1; }

.stat .v small { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 4px; }

.stat.warn .v { color: var(--danger); }

/* ==========================================================
   卡片 / 表格
   ========================================================== */

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

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}

.card-head h2 { font-size: 14.5px; margin: 0; font-weight: 600; }

.card-head .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }

.filters { display: flex; gap: 10px; align-items: center; }

.filters .input, .filters .select { height: 34px; font-size: 13px; }
.filters .input { width: 200px; }

table { width: 100%; border-collapse: collapse; }

thead th {
  text-align: left;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
  padding: 10px 20px;
  background: #FAFBFA;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}

tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13.5px;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FBFCFB; }

.t-title { font-weight: 500; margin-bottom: 3px; }
.t-sub { font-size: 12px; color: var(--ink-3); }

.thumb {
  width: 52px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: #EDEFEC;
  display: block;
}

.thumb-ph {
  width: 52px;
  height: 36px;
  border-radius: 6px;
  background: #EDEFEC;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #B7C0BB;
  font-size: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 20px;
  background: #F1F4F2;
  color: var(--ink-2);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
}

.badge.on { background: #EDF6F1; color: var(--ok); }
.badge.off { background: #F2F3F2; color: var(--ink-3); }
.badge.soon { background: #FBF5EA; color: #9A7734; }
.badge.expired { background: var(--danger-bg); color: var(--danger); }

.empty {
  padding: 64px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13.5px;
}

.empty b { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 6px; font-weight: 500; }

/* ==========================================================
   抽屉表单
   ========================================================== */

.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(16,28,24,.38);
  z-index: 90;
  animation: fadeIn .18s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 600px;
  max-width: 94vw;
  background: #fff;
  z-index: 91;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(16,28,24,.14);
  animation: slideIn .22s ease-out;
}

/* 结束态必须等于基础态，否则动画被中断时抽屉会停在半透明 */
@keyframes slideIn {
  from { transform: translateX(40px); opacity: .5; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-head h2 { font-size: 16px; margin: 0; font-weight: 600; }

.drawer-close {
  border: none;
  background: none;
  font-size: 20px;
  color: var(--ink-3);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  line-height: 1;
}

.drawer-close:hover { background: #F2F4F2; color: var(--ink); }

.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px 32px; }

.drawer-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #FCFDFC;
}

.sec-title {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 1px;
  font-weight: 600;
  margin: 26px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-2);
}

.sec-title:first-child { margin-top: 0; }

/* 多选 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  background: #fff;
  color: var(--ink-2);
  transition: all .12s;
}

.chip:hover { border-color: #C9D2CD; }

.chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* 开关 */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }

/* .field > label 的 display:block 会盖掉上面的 flex，必须提权重压回来，
   否则开关和文字会竖排 */
.field > label.switch { display: flex; margin-bottom: 0; }

.switch input { display: none; }

.switch .track {
  width: 40px;
  height: 22px;
  border-radius: 22px;
  background: #DDE2DE;
  position: relative;
  transition: background .18s;
  flex: 0 0 40px;
}

.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}

.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }

.switch span { font-size: 13.5px; color: var(--ink-2); }

/* SKU 子表 */
.sku-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sku-table table { font-size: 13px; }
.sku-table thead th { padding: 8px 10px; }
.sku-table tbody td { padding: 8px 10px; }
.sku-table .input { height: 32px; padding: 0 8px; font-size: 13px; }
.sku-table input[type=color] { padding: 0 3px; cursor: pointer; }
.sku-color-dot {
  width: 14px; height: 14px; border-radius: 50%;
  display: inline-block; vertical-align: -2px; margin-right: 6px;
  border: 1px solid rgba(0,0,0,.08);
}

/* 详情宣传图
   缩略图按 3:4 竖版裁显（宣传图在手机上就是竖的），点不出来大图没关系，
   序号 + 上下移 才是这里真正要干的事 */
.det-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 10px;
}
.det-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #FAFBF9;
}
.det-box {
  height: 104px;
  background: #F0F2EF;
  display: flex;
  align-items: center;
  justify-content: center;
}
.det-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.det-ph {
  font-size: 11px;
  line-height: 1.5;
  color: #9AA19C;
  text-align: center;
}
.det-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 6px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.det-i {
  font-size: 11px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  min-width: 15px;
  text-align: center;
}
.det-b {
  flex: 1;
  height: 22px;
  line-height: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 5px;
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  padding: 0;
}
.det-b:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.det-b:disabled { opacity: .35; cursor: not-allowed; }
.det-b.danger:hover { border-color: #C0392B; color: #C0392B; }
.det-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px 14px;
  font-size: 12.5px;
  color: #9AA19C;
  text-align: center;
  background: #FCFDFB;
}
.det-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.det-add { cursor: pointer; position: relative; overflow: hidden; }
.det-status {
  font-size: 12px;
  color: #8C938E;
  font-variant-numeric: tabular-nums;
}

/* 计算值 */
.calc {
  background: #F6F8F6;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc b { color: var(--brand); font-size: 15px; font-weight: 600; }

/* ===== 用料分组（一个方案可以有多种贴布） =====
   每组一张浅底小卡片：组号 + 移除，两行三列字段，底部一行本组用量。
   边框用虚线以外的方式区分层级——这里用 1px 实线 + 浅底，
   和抽屉的白底拉开，组与组之间不用再加分割线。 */
.mi {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FBFBF8;
  padding: 12px 14px 2px;
  margin-bottom: 10px;
}
.mi-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.mi-no {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-2);
  letter-spacing: .5px;
}
.mi .field { margin-bottom: 12px; }
.mi-calc { margin-bottom: 12px; }

.mi-add {
  width: 100%;
  border-style: dashed;
  color: var(--brand-2);
  margin-bottom: 12px;
}
.mi-add:hover { background: #F4F8F5; border-color: rgba(23, 58, 49, .35); }
.mi-add[disabled] { opacity: .5; cursor: not-allowed; }

.calc-all {
  margin-bottom: 18px;
  background: #EFF3EF;
}
.calc-all b { font-size: 16px; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(12px);
  background: #1C2B26;
  color: #fff;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: 80vw;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #8E2E22; }
.toast.ok { background: #1F5145; }

/* dialog */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(16,28,24,.38);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog {
  background: #fff;
  border-radius: 14px;
  padding: 26px 26px 20px;
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(16,28,24,.24);
}

.dialog h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.dialog p { margin: 0 0 22px; font-size: 13.5px; color: var(--ink-2); line-height: 1.65;
  /* 说明类对话框是多行步骤，必须让 \n 真的换行，否则挤成一大坨 */
  white-space: pre-line; max-height: 62vh; overflow-y: auto; }
.dialog-btns { display: flex; justify-content: flex-end; gap: 10px; }

/* 骨架加载 */
.loading { padding: 60px; text-align: center; color: var(--ink-3); font-size: 13px; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .side { width: 190px; flex-basis: 190px; }
}

/* ================= 概览数据卡 ================= */
.card-data { margin-top: 16px; }

/* 7 天柱状：柱子高度按最大值比例，bar-track 撑出可量化的高度基准，
   否则 height:% 会相对整列、把小值也顶得很高 */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 150px;
  padding: 2px 2px 0;
  margin-bottom: 6px;
}

.bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.bar-n {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bar-f {
  width: 100%;
  max-width: 40px;
  min-height: 6px;
  background: var(--brand);
  border-radius: 4px 4px 0 0;
  opacity: .86;
  transition: height .2s ease;
}

.bar-l {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 8px;
}

.top-table { margin-top: 12px; }

/* ================= 表单内「输入框 + 选图上传」 ================= */
/* 封面选择框：一整块可点，16:9 预览 */
.cover-pick {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1.5px dashed rgba(23, 58, 49, 0.26);
  background: #F6F8F6;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cover-pick:hover,
.cover-pick:focus-visible {
  border-color: rgba(23, 58, 49, 0.55);
  background: #EFF4F0;
  outline: none;
}
/* 教学视频封面用 3:4。
 * 素材是 9:16 竖屏视频，但小程序里六处容器都是 3:4 —— 容器跟着 9:16 走，
 * 列表行高会到 267rpx、横滑卡 427rpx，卡变成"长条"，排起来很重。
 * 3:4 只裁上下各 12.5%，主体在中间不受影响。
 * 这里按 3:4 出框，配合 .cp-img 的 object-fit:cover，上传时看到的就是最终展示效果。
 * 宽度 200 × 4/3 ≈ 267px，一屏放得下，又比 186 宽能看清细节。 */
.cover-pick.v {
  max-width: 200px;
  aspect-ratio: 3 / 4;
}
.cover-pick.busy { opacity: 0.6; pointer-events: none; }
.cp-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cp-ph {
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  text-align: center;
}
.cp-plus {
  font-size: 24px;
  line-height: 1;
  color: rgba(23, 58, 49, 0.4);
}
.cp-t { font-size: 13px; font-weight: 700; color: var(--brand); }
.cp-s { font-size: 11px; color: var(--ink-3); line-height: 1.4; }
.cp-input { margin-top: 8px; font-size: 12px; color: var(--ink-2); }

.upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.upload-row .input {
  flex: 1;
  min-width: 0;
}

/* nowrap 很关键：抽屉窄，「选图上传」被折成两行会顶高整行 */
.btn-sm {
  height: 38px;
  padding: 0 12px;
  font-size: 12.5px;
  white-space: nowrap;
  flex: none;
}

.btn-sm:disabled {
  opacity: .6;
  cursor: default;
}

/* <a class="btn"> 用在同一行按钮里（打开云存储），去掉下划线并统一盒模型 */
a.btn {
  text-decoration: none;
  box-sizing: border-box;
}

/* ==================================================================
   品类管理 / 规格说明 / 颜色板
   ------------------------------------------------------------------
   这三块都是「给不写代码的人用的」，所以宁可多占一点地方，也不要
   让人对着 #RRGGBB 或者一行行 JSON 发呆。
   ================================================================== */

/* ---- 品类（一行两段：上面名字，下面上线开关） ---- */
.cat-row { align-items: flex-start; }
.cat-row .drag-handle { margin-top: 11px; }
.cat-main { flex: 1; min-width: 0; }
.cat-line { display: flex; gap: 8px; align-items: center; }
.cat-line .input { flex: 1; min-width: 0; }
.cat-live {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-3); margin-top: 7px; cursor: pointer;
}
.cat-live input { width: 14px; height: 14px; accent-color: #21604F; margin: 0; }

/* ---- 规格卡片：颜色 / 色板 / 价格 / 库存 ---- */
.sku-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}
.sk-hd { display: flex; gap: 8px; align-items: center; }
.sk-hd .input { flex: 1; min-width: 0; height: 34px; font-size: 13px; }
.sk-hd .btn-text { flex: none; }

.sk-colors {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center; margin-top: 11px;
}
/* 17 个点（16 色 + 自定义）必须排进一行：抽屉内容宽 552px，
   25×17 + 6×16 = 521，留 30px 余量。改尺寸前先算一下这行算术。 */
.sk-colors .sc {
  position: relative;
  width: 25px; height: 25px; border-radius: 50%;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
  transition: transform .12s ease;
}
/* 选中的点里打个勾：只靠外圈描边的话，深色点自己也是深色，
   白圈又贴在白底上，一眼扫过去分不出选了哪个 */
.sk-colors .sc.on::after {
  content: '✓';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.65);
}
.sk-colors .sc:hover { transform: scale(1.09); }
.sk-colors .sc.on { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--brand); }

/* 「＋」：色板里没有的颜色，交给系统取色器 */
.sk-colors .sc-custom {
  position: relative;
  width: 25px; height: 25px; border-radius: 50%;
  border: 1px dashed #C3CCC7;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #8A938D; cursor: pointer; overflow: hidden;
}
.sk-colors .sc-custom input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border: none; padding: 0;
}

.sk-nums {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-top: 11px;
}
.sk-nums label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-3); white-space: nowrap;
}
.sk-nums .input { height: 34px; font-size: 13px; flex: 1; min-width: 0; }

/* ---- 规格说明：一行「名称 + 内容」 ---- */
.sp-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.sp-bar .select { flex: 1; min-width: 0; height: 34px; font-size: 13px; }
.sp-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.sp-row .sp-k { width: 116px; flex: none; height: 34px; font-size: 13px; }
.sp-row .sp-v { flex: 1; min-width: 0; height: 34px; font-size: 13px; }
.sp-row .sp-del {
  flex: none; width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: #F3F5F3; color: #8A938D;
  cursor: pointer; font-size: 15px; line-height: 1;
}
.sp-row .sp-del:hover { background: #FBE9E7; color: #B4453C; }

/* ---- 模板卡片 ---- */
.tpl-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}
.tpl-hd { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.tpl-hd .input { flex: 1; min-width: 0; height: 34px; font-size: 13px; font-weight: 600; }

/* 规格说明行数：套完模板要一眼看见「当前几行」，不然只能靠保存后重开抽屉猜 */
.sp-count { margin: 4px 0 0; min-height: 16px; }
.sp-count.is-ok { color: #21604F; font-weight: 600; }

/* ==================================================================
   订单与发货
   ------------------------------------------------------------------
   状态 tab 用一排胶囊。数字只在 >0 时出现：全是 0 的时候满屏小圈
   反而看不出哪一栏有活要干。
   ================================================================== */
.ochips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px;
}
.ochip {
  position: relative;
  height: 32px; padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px; color: var(--ink-2);
  cursor: pointer;
  transition: all .12s ease;
}
.ochip:hover { border-color: #C3CCC7; color: var(--ink-1); }
.ochip.on {
  background: var(--brand); border-color: var(--brand);
  color: #fff; font-weight: 600;
}
.ochip i {
  font-style: normal;
  margin-left: 6px;
  display: inline-block;
  min-width: 17px; height: 17px; line-height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #EEF2EF;
  color: #21604F;
  font-size: 11px; font-weight: 700; text-align: center;
}
.ochip.on i { background: rgba(255,255,255,.24); color: #fff; }

/* 详情抽屉里的「字段 → 值」一行 */
.kv-row {
  display: flex; gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed #EDF0EE;
  font-size: 13px; line-height: 1.55;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row span {
  flex: none; width: 72px;
  color: var(--ink-3);
}
.kv-row b { font-weight: 600; color: var(--ink-1); min-width: 0; word-break: break-all; }

/* ============ 买家退款申请 ============ */

/* 行内橙标：不做成 badge 那种灰点样式，它要「扎眼」一点 ——
   运营每天扫列表就是为了看有没有这个 */
.rq-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #FDF0E3;
  color: #B4600F;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* chip 用同一个橙色语义，和上面的行内标对得上 */
.ochip.rq { border-color: #EBD3AE; color: #B4600F; }
.ochip.rq:hover { border-color: #D9B077; color: #8E4B0A; }
.ochip.rq.on { background: #B4600F; border-color: #B4600F; color: #fff; }

/* 「发货」被退款申请按住时顶上去的那句话：位置和按钮一样，但明确不是按钮 */
.rq-hold {
  display: inline-block;
  padding: 0 8px;
  line-height: 26px;
  font-size: 12px;
  font-weight: 600;
  color: #B4600F;
  background: #FDF0E3;
  border: 1px solid #EBD3AE;
  border-radius: 6px;
  white-space: nowrap;
}
.ochip.rq.on i { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* 抽屉里的提示条：一段实话，比一行灰色小字更好读 */
.kv-note {
  margin: 8px 0 4px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #FBF6EA;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.65;
}
