/* 护肤分销商城 · 管理后台样式（桌面端） */
:root {
  --primary: #e86f8f;
  --primary-light: #fdf0f4;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #2b2f36;
  --text-2: #8a9099;
  --line: #eceef1;
  --red: #e64340;
  --green: #0fa66b;
  --orange: #f08c3c;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; outline: none; }

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

/* 侧边栏 */
.sidebar {
  width: 210px; background: #262a33; color: #c9cdd4; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
}
.sidebar .brand { padding: 18px 20px; font-size: 17px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand small { display: block; font-size: 11px; font-weight: 400; color: #7d838d; margin-top: 2px; }
.sidebar nav { flex: 1; padding: 10px 0; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 20px; font-size: 14px; color: #c9cdd4;
  border-left: 3px solid transparent;
}
.sidebar nav a .ico { font-size: 17px; }
.sidebar nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar nav a.on { background: rgba(232,111,143,.14); color: var(--primary); border-left-color: var(--primary); }
.sidebar .foot { padding: 14px 20px; font-size: 12px; color: #7d838d; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .foot a { color: #aeb4bd; }

/* 主区域 */
.main { flex: 1; min-width: 0; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50;
}
.topbar h1 { font-size: 18px; }
.topbar .right { font-size: 13px; color: var(--text-2); }
.content { padding: 20px 24px 40px; }

/* 统计卡片 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--card); border-radius: 10px; padding: 16px 18px; }
.stat-card .label { font-size: 12px; color: var(--text-2); }
.stat-card .value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.stat-card .value.red { color: var(--red); }
.stat-card .value.primary { color: var(--primary); }

/* 面板 */
.panel { background: var(--card); border-radius: 10px; margin-bottom: 18px; }
.panel .panel-head {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.panel .panel-head h2 { font-size: 15px; }
.panel .panel-body { padding: 16px 18px; }

/* 按钮 */
.btn { height: 34px; padding: 0 16px; border-radius: 6px; font-size: 13px; background: var(--primary); color: #fff; font-weight: 500; }
.btn:hover { opacity: .92; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn.line { background: #fff; border: 1px solid var(--primary); color: var(--primary); }
.btn.danger { background: var(--red); }
.btn.small { height: 28px; padding: 0 12px; font-size: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--text-2); font-weight: 500; background: #fafbfc; }
td.wrap { white-space: normal; min-width: 200px; }
tr:hover td { background: #fafbfc; }
.tag { display: inline-block; font-size: 12px; padding: 1px 9px; border-radius: 4px; background: var(--primary-light); color: var(--primary); }
.tag.gray { background: #f0f1f3; color: var(--text-2); }
.tag.green { background: #e6f7ef; color: var(--green); }
.tag.orange { background: #fdf3e8; color: var(--orange); }
.tag.red { background: #fdeceb; color: var(--red); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 18px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; font-size: 14px; background: #fff;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { min-height: 110px; resize: vertical; }
.field .tip { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal { background: #fff; border-radius: 10px; width: 640px; max-width: 100%; max-height: 90vh; overflow-y: auto; }
.modal .modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal .modal-head h2 { font-size: 16px; }
.modal .modal-head .close { font-size: 20px; color: var(--text-2); }
.modal .modal-body { padding: 20px; }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

.empty { text-align: center; color: var(--text-2); padding: 36px 0; font-size: 13px; }
.pager { display: flex; gap: 6px; justify-content: flex-end; padding: 12px 18px; }
.pager button { min-width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--text-2); background: #fff; }
.pager button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.img-prev { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; background: #f0f1f3; }
.banner-editor { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.banner-editor .row { display: flex; gap: 10px; margin-bottom: 8px; }
.banner-editor .row input { flex: 1; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.banner-editor .row .del { color: var(--red); font-size: 12px; flex-shrink: 0; }
