/* ======================================================================
   管理后台 / 会员中心 / 供货中心 共用布局与组件
   与前台共用 app.css 的设计令牌，保证全站视觉一致。
   ====================================================================== */
:root { --sidebar-w: 224px; --admin-top-h: 58px; }

.admin-shell, .member-shell { min-height: 100vh; display: flex; background: var(--bg); }

/* ---------- 侧栏 ---------- */
.sidebar { width: var(--sidebar-w); flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { height: var(--admin-top-h); display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; }
.sidebar-brand .brand-mark { width: 26px; height: 26px; font-size: 14px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-group { margin-bottom: 14px; }
.nav-group-title { padding: 6px 12px; font-size: 11px; font-weight: 600; color: var(--muted-2); letter-spacing: .6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 2px; transition: .15s; }
.nav-link:hover { background: var(--surface-2); }
.nav-link.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.nav-link .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); flex: none; }
.nav-link.active .dot { background: var(--brand); }
.nav-link svg { width: 16px; height: 16px; opacity: .8; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }

/* ---------- 主区 ---------- */
.admin-main, .member-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-top, .member-top { height: var(--admin-top-h); flex: none; display: flex; align-items: center; gap: 14px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.admin-top h1, .member-top h1 { font-size: 16px; font-weight: 700; }
.admin-top .spacer, .member-top .spacer { flex: 1; }
.admin-top .crumb, .member-top .crumb { font-size: 12.5px; color: var(--muted); }
.admin-content, .member-content { padding: 22px 24px 40px; }
.admin-content--narrow { max-width: 760px; }

/* ---------- 卡片 / 统计 ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 18px; overflow: hidden; }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.panel-head h2 { font-size: 14px; font-weight: 700; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 18px; }
.panel-body--flush { padding: 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.metric-label { font-size: 12px; color: var(--muted); }
.metric-value { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.6px; }
.metric.tone-brand .metric-value { color: var(--brand); }
.metric.tone-accent .metric-value { color: var(--accent); }
.metric.tone-green .metric-value { color: var(--success); }
.metric.tone-warn .metric-value { color: var(--warning); }
.metric-note { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 11px 14px; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.table td { padding: 11px 14px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.table tr:hover td { background: var(--surface-2); }
.table .num { font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: 6px; }
.table-empty { padding: 46px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 表单（后台） ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; align-items: center; }
.form-actions .hint { font-size: 12px; color: var(--muted); }

/* ---------- 详情 ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.detail-item { padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; }
.detail-item .label { color: var(--muted); font-size: 12px; margin-bottom: 2px; }

/* ---------- 检查项 ---------- */
.check-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.check-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); flex: none; }
.check-item.off .check-dot { background: var(--warning); }
.check-item strong { font-size: 13px; font-weight: 600; display: block; }
.check-item small { font-size: 11.5px; color: var(--muted); }

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--brand-soft), transparent 45%), var(--bg); }
.auth-card { width: 100%; max-width: 380px; padding: 30px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.auth-card .brand { justify-content: center; margin-bottom: 6px; font-size: 18px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 24px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.auth-links a { color: var(--brand); }

/* ---------- 会员中心（移动优先） ---------- */
.member-shell { flex-direction: column; }
.member-top { position: sticky; }
.member-content { padding: 16px; max-width: 1080px; width: 100%; margin: 0 auto; }
.member-hero { padding: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; gap: 14px; }
.member-avatar { width: 48px; height: 48px; border-radius: 15px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 19px; font-weight: 700; flex: none; }
.member-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.member-quick a { padding: 14px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-align: center; font-size: 12px; color: var(--ink-2); }
.member-quick a b { display: block; font-size: 18px; color: var(--brand); font-weight: 700; }

/* ---------- 底部 Tab（会员/供货移动） ---------- */
.member-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 16px; }
.member-tabbar a { padding: 10px 2px; text-align: center; font-size: 11.5px; color: var(--muted); border-right: 1px solid var(--line-2); }
.member-tabbar a:last-child { border-right: 0; }
.member-tabbar a.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

@media (min-width: 900px) {
  .member-shell { flex-direction: row; }
  .member-shell > .sidebar { display: flex; }
  .member-top { display: none; }
  .member-content { padding: 24px 28px; }
  .member-tabbar { display: none; }
}
@media (max-width: 899px) {
  .sidebar { display: none; }
  .admin-content, .member-content { padding: 16px; }
  .admin-top, .member-top { padding: 0 16px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
}
