* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: #f4f4f3;
  color: #262524;
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ============ 登录页 ============ */
.login-page {
  min-height: 100vh;
  background: #1A1A1A;
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  width: 380px;
  background: #fff;
  border-radius: 14px;
  padding: 40px 36px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.login-head { text-align: center; margin-bottom: 28px; }
.login-logo {
  width: 54px; height: 54px; margin: 0 auto 12px;
  background: #E8740C; color: #fff;
  border-radius: 12px; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.login-title { font-size: 21px; font-weight: 700; letter-spacing: 2px; }
.login-sub { font-size: 13px; color: #9A958E; margin-top: 4px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: #55524E; margin-bottom: 6px; font-weight: 500; }
.field input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid #E3E0DA; border-radius: 8px; outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: #E8740C; }
.login-err { color: #D93026; font-size: 13px; min-height: 20px; text-align: center; }
.login-btn {
  width: 100%; height: 44px; margin-top: 4px;
  background: #E8740C; color: #fff; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; letter-spacing: 4px;
}
.login-btn:hover { background: #d06608; }
.login-btn:disabled { background: #c9c5be; }
.login-tip { text-align: center; font-size: 12px; color: #A9A49C; margin-top: 16px; }
.login-footer {
  text-align: center;
  font-size: 12px; color: #A9A49C; margin-top: 18px; letter-spacing: .5px;
}

/* ============ 布局 ============ */
.app { display: flex; min-height: 100vh; }
.side {
  width: 210px; flex: 0 0 210px;
  background: #1A1A1A; color: #fff;
  display: flex; flex-direction: column;
}
.side-head { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid #2C2C2C; }
.side-logo {
  width: 36px; height: 36px; border-radius: 9px;
  background: #E8740C; font-size: 19px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.side-title { font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.side-sub { font-size: 11px; color: #8C8880; margin-top: 2px; }
.menu { flex: 1; padding: 12px 0; }
.menu-item {
  padding: 13px 20px; font-size: 14px; color: #C9C5BE;
  cursor: pointer; display: flex; align-items: center; gap: 10px;
  border-left: 3px solid transparent;
}
.menu-item:hover { background: #242424; color: #fff; }
.menu-item.active { background: #242424; color: #fff; border-left-color: #E8740C; font-weight: 600; }
.mi-icon { font-size: 15px; width: 17px; text-align: center; opacity: .9; }
.side-foot { padding: 14px 16px; border-top: 1px solid #2C2C2C; }
.mode-tag { font-size: 11px; color: #8C8880; margin-bottom: 10px; word-break: break-all; }
.logout-btn {
  width: 100%; height: 34px;
  background: transparent; border: 1px solid #3A3A3A; color: #C9C5BE; border-radius: 7px; font-size: 13px;
}
.logout-btn:hover { border-color: #E8740C; color: #E8740C; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; padding: 18px 26px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #EBE8E2;
}
.topbar h1 { margin: 0; font-size: 19px; font-weight: 700; }
.page-desc { font-size: 12px; color: #9A958E; margin-top: 4px; }
.btn-primary {
  height: 36px; padding: 0 18px;
  background: #E8740C; color: #fff; border: none; border-radius: 7px;
  font-size: 13px; font-weight: 600;
}
.btn-primary:hover { background: #d06608; }
.btn-ghost {
  height: 36px; padding: 0 16px;
  background: #fff; border: 1px solid #E3E0DA; color: #55524E; border-radius: 7px; font-size: 13px;
}
.btn-ghost:hover { border-color: #E8740C; color: #E8740C; }

.toolbar { display: flex; gap: 10px; align-items: center; padding: 16px 26px 0; flex-wrap: wrap; }
.kw {
  width: 240px; height: 36px; padding: 0 12px;
  border: 1px solid #E3E0DA; border-radius: 7px; outline: none; background: #fff;
}
.kw:focus { border-color: #E8740C; }
.sel {
  height: 36px; padding: 0 10px; min-width: 120px;
  border: 1px solid #E3E0DA; border-radius: 7px; background: #fff; outline: none;
}
.count-tag { margin-left: auto; font-size: 12px; color: #9A958E; }

.table-card {
  margin: 16px 26px 26px; background: #fff;
  border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.04); overflow: hidden;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: #FAF9F7; text-align: left; padding: 12px 14px;
  font-size: 12px; font-weight: 600; color: #7A766F;
  border-bottom: 1px solid #EFECE6; white-space: nowrap;
}
td { padding: 12px 14px; border-bottom: 1px solid #F4F2EE; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FBF9F6; }
.thumb {
  width: 46px; height: 46px; border-radius: 7px; object-fit: cover;
  background: #F0EEE9; display: block;
}
.cell-title { font-weight: 600; color: #262524; }
.cell-sub { font-size: 12px; color: #9A958E; margin-top: 3px; }
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; background: #F2EFEA; color: #7A766F; margin-right: 5px;
}
.tag.orange { background: #FFF3E8; color: #E8740C; }
.tag.green { background: #EAF6EE; color: #2E7D46; }
.tag.gray { background: #F2EFEA; color: #A9A49C; }
.ops { white-space: nowrap; }
.link { color: #E8740C; cursor: pointer; font-size: 13px; margin-right: 12px; }
.link.danger { color: #D93026; }
.link:hover { text-decoration: underline; }
.empty { text-align: center; color: #A9A49C; padding: 50px 0; font-size: 13px; }

/* ============ 弹窗 ============ */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 100;
}
.dialog {
  width: 760px; max-width: 100%; background: #fff;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  display: flex; flex-direction: column;
}
.dlg-head {
  padding: 16px 22px; font-size: 16px; font-weight: 700;
  border-bottom: 1px solid #EFECE6;
  display: flex; align-items: center; justify-content: space-between;
}
.dlg-close { font-size: 24px; color: #A9A49C; cursor: pointer; line-height: 1; }
.dlg-close:hover { color: #262524; }
.dlg-body { padding: 20px 22px; max-height: calc(100vh - 220px); overflow-y: auto; }
.dlg-foot {
  padding: 14px 22px; border-top: 1px solid #EFECE6;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.dlg-err { color: #D93026; font-size: 13px; margin-right: auto; }

/* 表单 */
.form-row { display: flex; gap: 14px; margin-bottom: 16px; }
.form-item { flex: 1; min-width: 0; }
.form-item label {
  display: block; font-size: 13px; color: #55524E; margin-bottom: 6px; font-weight: 500;
}
.form-item label .req { color: #D93026; }
.form-item input[type=text],
.form-item input[type=number],
.form-item input[type=date],
.form-item select,
.form-item textarea {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid #E3E0DA; border-radius: 7px; outline: none; background: #fff;
}
.form-item textarea { height: 72px; padding: 9px 11px; line-height: 1.6; resize: vertical; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: #E8740C; }
.hint { font-size: 12px; color: #A9A49C; margin-top: 5px; }

/* 动态列表（颜色/尺寸/厚度/主图） */
.dyn { border: 1px solid #EFECE6; border-radius: 9px; padding: 12px; background: #FBFAF8; }
.dyn-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.dyn-row:last-child { margin-bottom: 0; }
.dyn-row input {
  height: 34px; padding: 0 10px; border: 1px solid #E3E0DA;
  border-radius: 6px; outline: none; background: #fff; flex: 1; min-width: 0;
}
.dyn-row input:focus { border-color: #E8740C; }
.dyn-row .mini-thumb {
  width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: #EFECE6; flex: 0 0 34px;
}
.mini-btn {
  height: 34px; padding: 0 11px; flex: 0 0 auto;
  border: 1px solid #E3E0DA; background: #fff; border-radius: 6px;
  font-size: 13px; color: #55524E;
}
.mini-btn:hover { border-color: #E8740C; color: #E8740C; }
.mini-btn.del { color: #D93026; }
.mini-btn.del:hover { border-color: #D93026; color: #D93026; }
.dyn-add {
  margin-top: 10px; height: 34px; width: 100%;
  border: 1px dashed #D8D4CC; background: #fff; border-radius: 6px;
  font-size: 13px; color: #7A766F;
}
.dyn-add:hover { border-color: #E8740C; color: #E8740C; }

/* 富文本 */
.rte-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px; border: 1px solid #E3E0DA; border-bottom: none;
  border-radius: 7px 7px 0 0; background: #FBFAF8;
}
.rte-bar button {
  height: 30px; padding: 0 11px;
  border: 1px solid #E3E0DA; background: #fff; border-radius: 5px; font-size: 13px; color: #55524E;
}
.rte-bar button:hover { border-color: #E8740C; color: #E8740C; }
.rte {
  min-height: 190px; padding: 12px;
  border: 1px solid #E3E0DA; border-radius: 0 0 7px 7px;
  outline: none; background: #fff; line-height: 1.75;
}
.rte:focus { border-color: #E8740C; }
.rte img { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.rte p { margin: 0 0 10px; }
