/* 品牌端后台：白底黑字，白色为主 */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #fff; color: #111; }
a { color: #111; text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea { font-size: 14px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; }
button { font-size: 14px; padding: 8px 16px; border: 1px solid #111; background: #fff; color: #111; border-radius: 4px; cursor: pointer; }
button:hover { background: #111; color: #fff; }
button.primary { background: #8B0000; color: #fff; border-color: #8B0000; }
button.primary:hover { background: #6d0000; border-color: #6d0000; }
label { display: block; margin-bottom: 4px; font-weight: 500; }
.form-group { margin-bottom: 16px; }
.page { max-width: 900px; margin: 0 auto; padding: 40px 20px; }
.page h1 { margin: 0 0 24px; font-size: 24px; }
.login-card { max-width: 400px; margin: 60px auto; padding: 32px; border: 1px solid #eee; }
.login-card h1 { margin-top: 0; }
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #fafafa; border-right: 1px solid #eee; padding: 20px 0; }
.sidebar-brand { padding: 0 20px 16px; font-size: 18px; font-weight: 700; letter-spacing: 0.12em; border-bottom: 1px solid #eee; margin-bottom: 8px; }
.sidebar a { display: block; padding: 10px 20px; color: #111; }
.sidebar a:hover { background: #eee; }
.sidebar a.active { background: #fff; border-left: 3px solid #8B0000; margin-left: -3px; font-weight: 600; }
.main { flex: 1; padding: 24px; background: #fff; }
.main h2 { margin: 0 0 20px; font-size: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; }
th { font-weight: 600; background: #fafafa; }
.preview-box { border: 1px solid #eee; border-radius: 8px; padding: 20px; margin-top: 16px; max-width: 360px; background: #fafafa; }
.preview-box .img { width: 100%; aspect-ratio: 3/4; background: #eee; border-radius: 4px; margin-bottom: 12px; }
.preview-box .img img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.preview-box .name { font-weight: 600; margin-bottom: 4px; }
.preview-box .desc { font-size: 13px; color: #666; }
.err { color: #c00; font-size: 13px; margin-top: 4px; }
.muted { color: #666; font-size: 13px; }
.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; padding: 24px; border-radius: 8px; max-width: 420px; width: 90%; }
.modal h3 { margin: 0 0 16px; }
.flex { display: flex; gap: 12px; flex-wrap: wrap; }
.mb { margin-bottom: 16px; }

/* ---------- 数据总览 ---------- */
.analytics-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.analytics-header h2 { margin: 0; }
.period-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.period-btn {
  padding: 6px 14px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.period-btn:hover { border-color: #8B0000; color: #8B0000; }
.period-btn.active {
  background: #8B0000;
  color: #fff;
  border-color: #8B0000;
}
.analytics-desc { margin: 0 0 20px; max-width: 720px; line-height: 1.5; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 16px;
  background: #fafafa;
}
.kpi-card.kpi-warn { border-color: #e8d4d4; background: #fffafa; }
.kpi-label { font-size: 13px; color: #666; margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; color: #111; line-height: 1.2; }
.kpi-hint { font-size: 12px; color: #999; margin-top: 6px; }

.analytics-section { margin-bottom: 28px; }
.analytics-section h3 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }

.bar-chart { max-width: 560px; }
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
}
.bar-date { width: 88px; flex-shrink: 0; color: #666; }
.bar-track {
  flex: 1;
  height: 10px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: #8B0000;
  border-radius: 4px;
  min-width: 2px;
}
.bar-num { width: 28px; text-align: right; color: #333; }

.analytics-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 960px) {
  .analytics-two-col { grid-template-columns: 1fr 1fr; }
}

.footnote { margin-top: 24px; font-size: 12px; line-height: 1.5; }

/* ---------- 公开页（登录 / 入驻申请 / 帮助） ---------- */
body.public-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.public-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 20px;
}
.public-main.form-page { justify-content: flex-start; }
.brand-logo {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin-bottom: 28px;
  color: #111;
}
.login-card {
  max-width: 400px;
  width: 100%;
  padding: 32px;
  border: 1px solid #eee;
  border-radius: 8px;
}
.login-title { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.apply-link { text-align: center; margin-top: 20px; }
.success-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  min-height: 50vh;
}
.success-msg {
  font-size: 18px;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 0 24px;
  color: #111;
}
.site-footer {
  text-align: center;
  padding: 20px 16px 28px;
  margin-top: auto;
  border-top: 1px solid #f0f0f0;
}
.site-footer-line1 { font-size: 14px; margin-bottom: 8px; }
.site-footer-line1 .sep { color: #ccc; margin: 0 6px; }
.site-footer-line2 { font-size: 12px; color: #999; line-height: 1.6; }
body.admin-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.admin-body .admin-layout { flex: 1; }
body.admin-body .site-footer { flex-shrink: 0; }

/* ---------- 帮助中心 FAQ ---------- */
.help-page { max-width: 720px; width: 100%; }
.faq-section { margin-top: 28px; }
.faq-section > h3 { font-size: 16px; margin: 0 0 12px; border-bottom: 1px solid #eee; padding-bottom: 8px; }
.faq-item { margin-bottom: 16px; }
.faq-item h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.faq-item p { margin: 0; font-size: 13px; color: #555; line-height: 1.6; }

/* ---------- 品牌申请审核 ---------- */
.nav-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #c00;
  border-radius: 9px;
  text-align: center;
  vertical-align: middle;
}
.status-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-pending { color: #c00; background: #fff0f0; }
.status-approved { color: #0a7a3e; background: #e8f5ee; }
.status-rejected { color: #666; background: #f0f0f0; }
.status-cell { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
button.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}
.detail-grid { display: grid; gap: 12px; text-align: left; }
.detail-row { border-bottom: 1px solid #f0f0f0; padding-bottom: 8px; }
.detail-row .label { font-size: 12px; color: #888; margin-bottom: 4px; }
.detail-row .value { font-size: 14px; word-break: break-all; }
.detail-row .value a { color: #8B0000; }
