/* ============================================================
   后台样式：登录页 + 管理端 + 商户端
   与前台共用同一套品牌色，但独立文件，避免前台 CSS 越来越臃肿
   ============================================================ */

:root {
  --brand-50: #f4f1f6;
  --brand-100: #e4ddea;
  --brand-300: #a991bc;
  --brand-500: #6a4982;
  --brand-600: #54396a;
  --brand-700: #412c52;
  --brand-900: #26182f;
  --ink: #26212b;
  --ink-2: #5b5462;
  --ink-3: #8b8494;
  --line: #eae4ee;
  --bg: #f7f5f9;
  --ok: #1f7a58;
  --ok-bg: #e6f4ee;
  --warn: #a86413;
  --warn-bg: #fdf2e2;
  --danger: #b23a2c;
  --danger-bg: #fbeceb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }

/* ---------------- 登录页 ---------------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(circle at 15% 20%, rgba(106, 73, 130, .10), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(181, 115, 76, .10), transparent 45%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 40px -28px rgba(38, 24, 47, .28);
}

.auth-logo { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-logo .mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--brand-600); color: #fff;
  display: grid; place-items: center; font-size: 14px;
}
.auth-logo .name { font-size: 15px; font-weight: 500; color: var(--brand-800, #33213f); letter-spacing: .04em; }

.auth-card h1 { font-size: 20px; font-weight: 500; margin: 0 0 6px; }
.auth-sub { font-size: 13px; color: var(--ink-3); margin: 0 0 22px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.field input[type=text], .field input[type=password], .field input[type=tel] {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 9px;
  padding: 0 14px; font-size: 14px; outline: none; background: #fbfafc; color: var(--ink);
  transition: border-color .18s, background .18s;
}
.field input:focus { border-color: var(--brand-300); background: #fff; }

.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-row img {
  width: 108px; height: 42px; border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer; background: #fff; object-fit: cover;
}

.checkline { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); margin: 4px 0 18px; }
.checkline input { margin-top: 3px; }

.btn-primary-lg {
  width: 100%; height: 44px; border: none; border-radius: 9px;
  background: var(--brand-600); color: #fff; font-size: 15px;
}
.btn-primary-lg:hover { background: var(--brand-700); }

.alert-error {
  background: var(--danger-bg); color: var(--danger); border: 1px solid #f2cfcb;
  border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 16px;
}

.auth-foot { font-size: 12.5px; color: var(--ink-3); text-align: center; margin: 18px 0 0; }
.auth-foot a { color: var(--brand-600); }
.auth-foot a:hover { text-decoration: underline; }

/* ---------------- 后台框架 ---------------- */
.console-body { display: flex; min-height: 100vh; }

.console-side {
  width: 208px; flex-shrink: 0; background: #26212b; color: #b8aec4;
  display: flex; flex-direction: column; padding: 20px 0;
  position: sticky; top: 0; height: 100vh;
}
.console-brand {
  display: flex; align-items: center; gap: 8px; padding: 0 20px 20px;
  font-size: 14px; color: #fff; letter-spacing: .03em;
}
.console-brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-300); }
.console-brand small { color: #7d7389; font-size: 11px; margin-left: auto; }

.console-side nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.console-side nav a {
  padding: 10px 12px; border-radius: 8px; font-size: 13.5px; color: #a99fb3;
  display: flex; align-items: center; gap: 8px;
}
.console-side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.console-side nav a.is-active { background: var(--brand-600); color: #fff; }

.console-side-foot {
  margin-top: auto; padding: 16px 20px 0; border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex; flex-direction: column; gap: 8px; font-size: 12.5px;
}
.console-side-foot a { color: #8d8398; }
.console-side-foot a:hover { color: #fff; }

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

.console-top {
  height: 62px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 10;
}
.console-top h2 { font-size: 16px; font-weight: 500; margin: 0; }
.console-user { font-size: 13px; color: var(--ink-2); display: flex; gap: 14px; align-items: center; }
.console-user a { color: var(--ink-3); }
.console-user a:hover { color: var(--brand-600); }

.console-content { padding: 24px 26px 48px; }

/* ---------------- 卡片与统计 ---------------- */
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 20px; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 14px; font-weight: 500; margin: 0; }
.panel-head .hint { font-size: 12.5px; color: var(--ink-3); }
.panel-body { padding: 18px 20px; }
.panel-body.tight { padding: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
}
.stat .k { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.stat .v { font-size: 24px; font-weight: 500; color: var(--brand-700); line-height: 1.2; }
.stat .u { font-size: 12px; color: var(--ink-3); margin-left: 2px; font-weight: 400; }

/* ---------------- 表格 ---------------- */
.table th, .table td {
  padding: 12px 16px; font-size: 13px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th { background: #faf8fb; color: var(--ink-3); font-weight: 400; white-space: nowrap; }
.table tbody tr:hover { background: #fcfbfd; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { color: var(--ink-3); }
.table .strong { color: var(--ink); font-weight: 500; }
.table-wrap { overflow-x: auto; }

.empty-row { padding: 40px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------------- 徽标 ---------------- */
.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-mute { background: #f1eef4; color: var(--ink-2); }

/* ---------------- 表单与按钮 ---------------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=text] {
  height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px;
  font-size: 13px; outline: none; min-width: 220px; background: #fff;
}
.toolbar input:focus { border-color: var(--brand-300); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13px;
}
.btn:hover { border-color: var(--brand-300); color: var(--brand-600); }
.btn-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); color: #fff; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------------- 上传区 ---------------- */
.upload-box {
  border: 1px dashed #cfc4d8; border-radius: 10px; padding: 20px; text-align: center;
  background: #fbfafc; color: var(--ink-3); font-size: 13px;
  transition: border-color .18s, background .18s;
}
.upload-box.is-drag { border-color: var(--brand-500); background: var(--brand-50); }
.upload-box input[type=file] { display: none; }
.upload-box .thumb-preview { max-width: 180px; margin: 12px auto 0; border-radius: 8px; border: 1px solid var(--line); }
.upload-result { font-size: 12.5px; color: var(--ok); margin-top: 10px; word-break: break-all; }
.upload-error { font-size: 12.5px; color: var(--danger); margin-top: 10px; }

.file-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.file-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.file-item .pic { aspect-ratio: 1 / 1; background: #f4f1f0; }
.file-item .pic img { width: 100%; height: 100%; object-fit: cover; }
.file-item .meta { padding: 8px 10px; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.file-item .meta b { display: block; color: var(--ink-2); font-weight: 400; word-break: break-all; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; gap: 8px; justify-content: center; padding: 18px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; font-size: 13px; color: var(--ink-2);
}
.pager a:hover { border-color: var(--brand-300); color: var(--brand-600); }
.pager .is-current { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* ---------------- 会员中心（前台壳） ---------------- */
.profile-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
.profile-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; text-align: center; }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600);
  display: grid; place-items: center; font-size: 24px; margin: 0 auto 12px;
}
.profile-card h3 { font-size: 15px; font-weight: 500; margin: 0 0 4px; }
.profile-card p { font-size: 12.5px; color: var(--ink-3); margin: 0; }
.profile-links { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.profile-links a { font-size: 13px; color: var(--ink-2); padding: 9px 12px; border-radius: 8px; background: #faf8fb; }
.profile-links a:hover { background: var(--brand-50); color: var(--brand-600); }

.info-list { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px 16px; font-size: 13.5px; }
.info-list dt { color: var(--ink-3); }
.info-list dd { margin: 0; color: var(--ink-2); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .file-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .console-body { flex-direction: column; }
  .console-side {
    width: 100%; height: auto; position: static; flex-direction: row; align-items: center;
    padding: 10px 12px; overflow-x: auto;
  }
  .console-brand { padding: 0 12px 0 0; white-space: nowrap; }
  .console-side nav { flex-direction: row; padding: 0; gap: 4px; }
  .console-side nav a { white-space: nowrap; padding: 8px 10px; }
  .console-side-foot { margin: 0 0 0 auto; border: none; padding: 0; flex-direction: row; }
  .console-content { padding: 16px; }
  .console-top { padding: 0 16px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .file-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-card { padding: 24px; }
}

/* ---------------- 上传插槽（入驻申请等表单内） ---------------- */
.upload-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.upload-slot .upload-tip { font-size: 12.5px; color: var(--ink-3); }
.upload-slot .upload-preview img {
  width: 88px; height: 66px; object-fit: cover; border: 1px solid var(--line);
  border-radius: 8px; margin-top: 6px;
}
.upload-slot .upload-preview { flex-basis: 100%; }

/* ---------------- 商品表单 ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .field.full { grid-column: 1 / -1; }
.field textarea {
  width: 100%; min-height: 96px; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 14px; font-size: 14px; outline: none; background: #fbfafc;
  color: var(--ink); font-family: inherit; line-height: 1.7; resize: vertical;
}
.field textarea:focus { border-color: var(--brand-300); background: #fff; }
.field select {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 9px;
  padding: 0 12px; font-size: 14px; background: #fbfafc; color: var(--ink); outline: none;
}
.field select:focus { border-color: var(--brand-300); background: #fff; }

.album-list { display: flex; gap: 10px; flex-wrap: wrap; }
.album-item { position: relative; }
.album-item img { width: 88px; height: 66px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.album-item button {
  position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(38,24,47,.8); color: #fff; font-size: 12px; line-height: 1;
}

/* ---------------- 审核操作 ---------------- */
.audit-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-ok { border-color: #bfe0d2; color: var(--ok); }
.btn-ok:hover { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.btn-no { border-color: #f2cfcb; color: var(--danger); }
.btn-no:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }

.flash { border-radius: 9px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.flash-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #bfe0d2; }
.flash-err { background: var(--danger-bg); color: var(--danger); border: 1px solid #f2cfcb; }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
}
