:root {
  --red: #F20C00;
  --red-d: #CF0A00;
  --red-l: #FFF1F0;
  --text: #2D2D2D;
  --text2: #666666;
  --sub: #999999;
  --line: #EEEEEE;
  --bg: #F5F5F5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { cursor: pointer; }
input, select, textarea, button { font-family: inherit; }

/* ---------------- 登录 ---------------- */
.login {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  background-image:
    repeating-linear-gradient(112deg, rgba(255,255,255,.05) 0 28px, rgba(255,255,255,0) 28px 94px),
    radial-gradient(96% 62% at 50% -8%, #2A2A2A 0%, #141414 46%, #070707 100%);
  padding: 40px 20px;
}
.login-card {
  width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.login-logo {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--text);
}
.login-sub {
  font-size: 13px;
  color: var(--sub);
  margin: 8px 0 26px;
}
.login-label {
  display: block;
  font-size: 12px;
  color: var(--text2);
  margin: 16px 0 8px;
}
.login-input {
  width: 100%;
  height: 44px;
  border: 1px solid #E4E6EA;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.login-input:focus { border-color: var(--red); }
.login-hint {
  font-size: 12px;
  color: #BBBBBB;
  margin-top: 6px;
  line-height: 1.6;
}
.login-btn {
  width: 100%;
  margin-top: 24px;
}
.login-err {
  min-height: 20px;
  font-size: 12px;
  color: var(--red);
  margin-top: 10px;
}
.login-demo {
  text-align: center;
  font-size: 12px;
  color: var(--sub);
  margin-top: 6px;
  cursor: pointer;
}
.login-demo:hover { color: var(--red); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  background: #F2F2F2;
  color: var(--text2);
  white-space: nowrap;
}
.btn:hover { opacity: .9; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-d); }
.btn-line { background: #fff; color: var(--red); border: 1px solid #FFD9D6; }
.btn-line:hover { background: var(--red-l); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { color: var(--red); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------- 框架 ---------------- */
.app { display: flex; min-height: 100%; }
.side {
  width: 200px;
  flex: none;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid #F7F7F7;
}
.side-name {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
}
.side-tag {
  display: block;
  font-size: 11px;
  color: var(--sub);
  margin-top: 4px;
  letter-spacing: 1px;
}
.side-nav { padding: 12px 10px; flex: 1; }
.nav-i {
  display: block;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 4px;
  text-decoration: none;
}
.nav-i:hover { background: #F7F8FA; color: var(--text); }
.nav-i.on {
  background: var(--red-l);
  color: var(--red);
  font-weight: 600;
}
.side-foot {
  padding: 14px 20px 20px;
  border-top: 1px solid #F7F7F7;
  font-size: 12px;
}
.side-state { color: #12B76A; margin-bottom: 8px; }
.side-state.off { color: var(--sub); }
.side-out { color: var(--sub); text-decoration: none; }
.side-out:hover { color: var(--red); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 60px;
  flex: none;
  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: 5;
}
.top-t { font-size: 16px; margin: 0; font-weight: 600; }
.pill {
  font-size: 12px;
  color: var(--text2);
  background: #F5F6F8;
  padding: 4px 10px;
  border-radius: 20px;
}
.view { padding: 20px 28px 60px; max-width: 1120px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.card-t {
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  padding-bottom: 12px;
  border-bottom: 1px solid #F5F5F5;
  margin-bottom: 4px;
}
.card-hd .card-t { border: none; padding: 0; margin: 0; }

/* 表单行 */
.row {
  display: flex;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #F8F8F8;
}
.row:last-child { border-bottom: none; }
.row.col { display: block; }
.row-k {
  flex: none;
  width: 132px;
  font-size: 13px;
  color: var(--text2);
}
.row.col .row-k { width: auto; margin-bottom: 6px; }
.row-v { flex: 1; min-width: 0; }
.row input[type="text"],
.row input[type="number"],
.row select,
.row textarea {
  width: 100%;
  border: 1px solid transparent;
  background: #F7F8FA;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.row input:focus, .row select:focus, .row textarea:focus {
  border-color: var(--red);
  background: #fff;
}
.row textarea { min-height: 112px; resize: vertical; line-height: 1.75; }
.row .mini { font-size: 12px; color: #BBBBBB; margin-top: 4px; }
.pick {
  flex: none;
  margin-left: 10px;
  font-size: 12px;
  color: var(--red);
  border: 1px solid #FFD9D6;
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  background: #fff;
  white-space: nowrap;
}
.pick:hover { background: var(--red-l); }

/* 图片 */
.imgs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.thumb {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  background: #F5F6F8 center/cover no-repeat;
  position: relative;
  border: 1px solid #EFF1F4;
}
.thumb .del {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
}
.thumb.add {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sub);
  font-size: 22px;
  cursor: pointer;
  background: #FAFBFC;
  border: 1px dashed #D8DCE2;
}
.thumb.add:hover { border-color: var(--red); color: var(--red); }

/* ---------------- 商品表 ---------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar .grow { flex: 1; }
.search {
  height: 36px;
  width: 260px;
  border: 1px solid #E9EBEF;
  background: #fff;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  outline: none;
}
.search:focus { border-color: var(--red); }
.sel {
  height: 36px;
  border: 1px solid #E9EBEF;
  background: #fff;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--text2);
  outline: none;
}
.count { font-size: 12px; color: var(--sub); margin-bottom: 10px; }

.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--sub);
  padding: 12px 14px;
  background: #FAFBFC;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid #F7F7F7;
  font-size: 13px;
  vertical-align: middle;
}
.table tr:hover td { background: #FCFCFC; }
.t-img {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  background: #F2F3F5 center/cover no-repeat;
  border: 1px solid #EFF1F4;
}
.t-name { font-weight: 500; }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--red-l);
  color: var(--red);
  margin-left: 6px;
  vertical-align: 1px;
}
.badge.gray { background: #F2F2F2; color: var(--sub); }
.t-price { color: var(--red); font-weight: 600; }
.t-acts { white-space: nowrap; }
.t-acts a { color: var(--text2); margin-right: 12px; font-size: 13px; text-decoration: none; }
.t-acts a:hover { color: var(--red); }
.t-acts a.danger:hover { color: #D92D20; }
.empty-line { text-align: center; color: var(--sub); padding: 50px 0; font-size: 13px; }

/* ---------------- 抽屉 ---------------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 40;
  display: flex;
  justify-content: flex-end;
}
.drawer {
  width: 660px;
  max-width: 92vw;
  height: 100%;
  background: #fff;
  overflow: auto;
  padding: 22px 24px 90px;
  position: relative;
}
.drawer-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.drawer-t { font-size: 16px; font-weight: 600; }
.drawer-x {
  font-size: 20px;
  color: var(--sub);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.drawer-x:hover { color: var(--red); }
.drawer-sec {
  font-size: 12px;
  color: var(--sub);
  margin: 18px 0 2px;
  padding-top: 14px;
  border-top: 1px solid #F5F5F5;
}
.drawer-foot {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 660px;
  max-width: 92vw;
  padding: 14px 24px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---------------- 分类 ---------------- */
.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #F8F8F8;
}
.cat-row input {
  border: 1px solid transparent;
  background: #F7F8FA;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  width: 220px;
  outline: none;
}
.cat-row input:focus { border-color: var(--red); background: #fff; }
.cat-n { font-size: 12px; color: var(--sub); width: 80px; }

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 46px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.82);
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 20px;
  z-index: 90;
}
.toast.err { background: rgba(217,45,32,.95); }
.foot-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  position: sticky;
  bottom: 0;
  background: #F5F5F5;
  padding: 14px 0;
  margin-top: 4px;
  border-top: 1px solid #ECECEC;
}
.save-tip { font-size: 12px; color: #BBBBBB; }