/* 宠医 CHONGYI — 商户后台（店铺运营）
   沿用前台的品牌色与圆角，但信息密度按国内 B2B2C 商户后台（淘宝 / 京东）组织：
   上方状态标签页 → 筛选工具条 → 表格 → 分页。 */

.m-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 4px 18px;
  flex-wrap: wrap;
}
.m-head h1 { font-size: 24px; letter-spacing: -.03em; margin: 2px 0 4px; }
.m-head p { margin: 0; font-size: 13px; color: var(--sub); }
.m-head .m-head-actions { display: flex; gap: 8px; align-items: center; }

.m-card {
  background: var(--solid);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 26px rgba(29, 67, 51, .04);
  overflow: hidden;
}
.m-card + .m-card { margin-top: 18px; }

/* ---------------------------------------------------------------- 状态标签页 */
.m-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  background: linear-gradient(180deg, #FBFDFD, #fff);
}
.m-tab {
  position: relative;
  border: 0;
  background: transparent;
  padding: 10px 14px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sub);
  border-radius: 10px 10px 0 0;
  white-space: nowrap;
  cursor: pointer;
}
.m-tab:hover { color: var(--pine); background: #F3F8F8; }
.m-tab.on { color: var(--pine); }
.m-tab.on::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--pine);
}
.m-tab em {
  font-style: normal;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #8BA2A3;
}

/* ---------------------------------------------------------------- 工具条 */
.m-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #FCFDFD;
}
.m-toolbar .grow { flex: 1 1 auto; }
.m-toolbar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.m-input,
.m-select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 11px;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
  min-width: 0;
}
.m-input:focus,
.m-select:focus { outline: 2px solid #B9D7D8; outline-offset: 1px; border-color: #9CC3C4; }
.m-input[type="search"] { min-width: 230px; }

.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #EEF3F3;
  color: #2C494A;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s var(--ease), background .18s;
}
.m-btn:hover { background: #E6EFEF; }
.m-btn:active { transform: scale(.98); }
.m-btn.primary { background: var(--darkpine); color: #fff; }
.m-btn.primary:hover { background: #068978; }
.m-btn.ghost { background: #fff; border-color: var(--line); }
.m-btn.danger { background: #fdeceb; color: #94312c; }
.m-btn.sm { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 8px; }
.m-btn:disabled { opacity: .45; cursor: not-allowed; }

.m-count { font-size: 12px; color: var(--sub); }

/* ---------------------------------------------------------------- 表格 */
.m-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.m-table th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--sub);
  font-weight: 800;
  padding: 11px 14px;
  background: #F7FAFA;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.m-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.m-table tr:last-child td { border-bottom: 0; }
.m-table tbody tr:hover td { background: #FBFDFD; }
.m-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-table .check { width: 38px; }
.m-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--pine); }

/* 商品信息单元格：缩略图 + 标题 + 副信息 */
.m-good { display: flex; gap: 11px; align-items: flex-start; }
.m-good .m-thumb {
  width: 54px; height: 54px; flex: 0 0 54px;
  border-radius: 11px; overflow: hidden;
  background: linear-gradient(140deg, #E8F2F2, #ECF0F0);
  display: grid; place-items: center;
  border: 1px solid var(--line);
}
.m-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-thumb span { font-size: 8px; font-weight: 800; color: #4F7576; letter-spacing: .06em; text-align: center; padding: 0 3px; }
.m-good b { display: block; font-size: 13.5px; line-height: 1.45; margin-bottom: 3px; }
.m-good small { display: block; color: var(--sub); font-size: 11.5px; line-height: 1.5; }

.m-price { font-weight: 800; color: #b4451e; font-variant-numeric: tabular-nums; }
.m-muted { color: var(--sub); font-size: 11.5px; }

/* ---------------------------------------------------------------- 徽章 */
.m-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: #EEF2F2;
  color: #4D6263;
  white-space: nowrap;
}
.m-badge.green { background: var(--mint); color: #068978; }
.m-badge.amber { background: #fdf3e7; color: #b45309; }
.m-badge.red { background: #fdeceb; color: #b42318; }
.m-badge.slate { background: #eef1f3; color: #52656f; }
.m-badge.solid { background: #fff1e8; color: #b4451e; }

/* ---------------------------------------------------------------- 操作列 */
.m-row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.m-link {
  border: 0; background: transparent; padding: 0;
  color: var(--pine); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.m-link:hover { text-decoration: underline; }
.m-link.danger { color: #b42318; }
.m-link[disabled] { color: #b9c3be; cursor: not-allowed; text-decoration: none; }

/* ---------------------------------------------------------------- 空态 / 分页 */
.m-empty { padding: 60px 20px; text-align: center; color: var(--sub); }
.m-empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 8px; }
.m-empty .m-btn { margin-top: 14px; }

.m-pager {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.m-pager .info { color: var(--sub); margin-right: auto; }
.m-pager a,
.m-pager span {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #3C595A;
}
.m-pager span.current { background: var(--pine); border-color: var(--pine); color: #fff; font-weight: 800; }
.m-pager span.disabled { opacity: .45; }

/* ---------------------------------------------------------------- 概览卡 */
.m-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.m-stat {
  background: var(--solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 16px;
  box-shadow: 0 8px 26px rgba(29, 67, 51, .04);
}
.m-stat small { display: block; font-size: 11.5px; color: var(--sub); }
.m-stat strong { display: block; font-size: 24px; letter-spacing: -.04em; margin-top: 3px; }
.m-stat .hint { font-size: 11px; color: var(--sub); }
.m-stat.warn { background: #fffdf8; border-color: #f3e2c8; }

.m-todo { display: grid; gap: 10px; }
.m-todo a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 14px;
  background: #FBFDFD; border: 1px solid var(--line);
  font-size: 13px; color: var(--ink);
}
.m-todo a:hover { background: #F3F8F8; }
.m-todo b { margin-left: auto; font-size: 15px; color: #b45309; font-variant-numeric: tabular-nums; }
.m-todo-row {
  display: flex; gap: 8px; align-items: baseline;
  padding: 10px 12px; border-radius: 12px;
  background: #FBFDFD; border: 1px solid var(--line);
  font-size: 12.5px; color: #375556; line-height: 1.6;
}
.m-todo-row b { margin: 0; font-size: 12px; color: var(--pine); }
.m-todo b.zero { color: #9aa8a0; font-weight: 700; }

/* ---------------------------------------------------------------- 发布 / 编辑表单 */
.m-form-section { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.m-form-section:last-of-type { border-bottom: 0; }
.m-form-section > h2 {
  font-size: 14px;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.m-form-section > h2 em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--sub);
  background: #F1F5F5;
  border-radius: 6px;
  padding: 2px 7px;
}
.m-form-section > p.tip { margin: 0 0 16px; font-size: 12px; color: var(--sub); }

.m-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.m-field { display: block; font-size: 12.5px; font-weight: 700; color: #375556; }
.m-field > span { display: block; margin-bottom: 6px; }
.m-field .req { color: #b42318; margin-left: 2px; }
.m-field .help { display: block; margin-top: 5px; font-size: 11px; font-weight: 400; color: var(--sub); }
.m-field input,
.m-field select,
.m-field textarea {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 400;
  background: #fff;
  color: var(--ink);
}
.m-field input:focus,
.m-field select:focus,
.m-field textarea:focus { outline: 2px solid #B9D7D8; outline-offset: 1px; border-color: #9CC3C4; }
.m-field textarea { min-height: 96px; resize: vertical; }
.m-field.span2 { grid-column: 1 / -1; }

.m-inline-price { display: flex; align-items: center; gap: 6px; }
.m-inline-price i { font-style: normal; color: var(--sub); font-weight: 700; }

/* 图片上传：5 个方框，第 1 个是主图 */
.m-uploader { display: flex; flex-direction: column; gap: 10px; }
.m-uploader-slots { display: flex; gap: 12px; flex-wrap: wrap; }
.m-slot {
  position: relative;
  width: 118px; height: 118px;
  border-radius: 14px;
  border: 1px dashed #C9D8D9;
  background: #FBFDFD;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.m-slot:hover { border-color: var(--pine); background: #F3F8F8; }
.m-slot.filled { border-style: solid; border-color: var(--line); background: #fff; cursor: default; }
.m-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-slot .add { text-align: center; color: var(--sub); font-size: 11.5px; line-height: 1.5; }
.m-slot .add b { display: block; font-size: 22px; color: #9FB4B5; line-height: 1; margin-bottom: 4px; }
.m-slot .tag {
  position: absolute; left: 6px; top: 6px;
  background: var(--pine); color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 6px;
}
.m-slot .del {
  position: absolute; right: 6px; top: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(20, 40, 33, .62); color: #fff;
  font-size: 12px; line-height: 1; cursor: pointer;
}
.m-slot .del:hover { background: #b42318; }
.m-slot .move {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex;
  background: rgba(20, 40, 33, .55);
  opacity: 0;
  transition: opacity .18s;
}
.m-slot:hover .move { opacity: 1; }
.m-slot .move button {
  flex: 1; border: 0; background: transparent; color: #fff;
  font-size: 11px; padding: 4px 0; cursor: pointer;
}
.m-slot .move button:hover { background: rgba(255, 255, 255, .16); }
.m-slot.dragging { opacity: .45; }
.m-slot.drop-target { border-color: var(--pine); box-shadow: 0 0 0 3px #D0E5E5; }

.m-uploader-tip { font-size: 11.5px; color: var(--sub); margin: 10px 0 0; line-height: 1.7; }

.m-form-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  background: #FBFDFD;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.m-form-foot .m-count { margin-left: auto; }

@media (max-width: 820px) {
  .m-table thead { display: none; }
  .m-table tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .m-table td { display: block; border: 0; padding: 6px 14px; }
  .m-table td.check { padding-bottom: 0; }
  .m-slot { width: 92px; height: 92px; }
}
