/* ============================================================
   产品检测报告下载门户 —— 全局样式（红白企业风）
   主色：#C8102E
   ============================================================ */

:root {
  --brand: #C8102E;
  --brand-dark: #A00D24;
  --brand-light: #F7D9DE;
  --brand-soft: #FDF2F4;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --text: #1F2329;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --success: #12894B;
  --warning: #B7791F;
  --danger: #C8102E;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --tap: 44px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

/* ------------------------------------------------------------
   hidden 属性全局最高优先级。
   浏览器的 UA 规则 [hidden]{display:none} 与作者样式特异性相同、作者样式优先，
   因此任何组件一旦声明了 display（如 .modal{display:flex}），带 hidden 的元素
   仍会显示出来——曾导致"密码弹窗常驻、点确定无反应"。
   此处用 !important 兜底：只要元素带 hidden，就一定是隐藏的。
   ------------------------------------------------------------ */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }

/* ------------------------- 导航 ------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow);
}
.navbar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar__brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #fff;
  font-weight: 700;
}
.navbar__logo {
  font-size: 20px;
  letter-spacing: 2px;
  border: 2px solid #fff;
  border-radius: 6px;
  padding: 2px 8px;
}
.navbar__title { font-size: 17px; }

.navbar__menu { display: flex; gap: 6px; }
.navbar__menu a {
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}
.navbar__menu a:hover { background: rgba(255, 255, 255, 0.16); }
.navbar__menu a.is-active { background: #fff; color: var(--brand); font-weight: 600; }

.navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: var(--tap);
  height: var(--tap);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 10px;
}
.navbar__toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* ------------------------- 布局 ------------------------- */
.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 16px 40px;
  min-height: calc(100vh - 160px);
}
.page__head { margin-bottom: 16px; }
.page__head h2 { margin: 0 0 4px; font-size: 22px; color: var(--brand); }
.muted { color: var(--text-muted); font-size: 13px; }
.loading, .empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px;
}

/* ------------------------- 卡片 ------------------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  border: 1px solid var(--border);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}
.entry-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 4px solid var(--brand);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.entry-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.entry-card__icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
}
.entry-card h3 { margin: 0; font-size: 18px; }
.entry-card p { margin: 0; color: var(--text-muted); font-size: 14px; flex: 1; }
.entry-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}

/* Banner */
.banner {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px 24px;
  margin-bottom: 8px;
}
.banner h1 { margin: 0 0 8px; font-size: 26px; }
.banner p { margin: 0; opacity: 0.92; }

/* ------------------------- 表单 ------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
input[type="text"], input[type="date"], input[type="password"], select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 15px;
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}
input:disabled, select:disabled { background: #F3F4F6; color: #9CA3AF; cursor: not-allowed; }

.filter {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}
.filter .field { margin-bottom: 0; }
.filter__actions { display: flex; gap: 10px; }

/* ------------------------- 按钮 ------------------------- */
.btn {
  min-height: var(--tap);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn--ghost { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn--ghost:hover:not(:disabled) { background: var(--brand-soft); }
.btn--danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: var(--brand-soft); }
.btn--danger-solid { background: var(--danger); color: #fff; }
.btn--danger-solid:hover:not(:disabled) { background: var(--brand-dark); }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }

/* ------------------------- 表格 ------------------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th, .data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.data-table thead th {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
}
.data-table tbody tr:hover { background: #FAFAFB; }
.data-table .col-file { word-break: break-all; }

/* 行内操作区（下载 / 删除） */
.row-actions { display: inline-flex; gap: 8px; flex-wrap: nowrap; }

/* ------------------------- 批量选择 / 批量删除 ------------------------- */
/* 复选框列：收窄到刚好容纳 input，避免挤压文件名列 */
.data-table .col-select { width: 44px; text-align: center; }
.data-table td:has(> input.js-select) { text-align: center; }
.data-table input.js-select,
.data-table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* 批量操作工具条：贴着表格上沿，"已选 N 项"靠左、按钮靠右 */
.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 10px 14px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.batch-bar__count { color: var(--text-muted); }
.batch-bar__count b { color: var(--brand); font-size: 15px; }

/* 分页控件 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.pager__info { color: var(--text-muted); font-size: 14px; }

/* ------------------------- 标签页 ------------------------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  min-height: var(--tap);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}
.tab.is-active { background: var(--brand); color: #fff; }

/* ------------------------- 上传 ------------------------- */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
}
.file-list .remove { background: none; border: 0; color: var(--brand); cursor: pointer; font-size: 16px; }

.result-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.result-list li {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14px;
}
.result-list .is-success { border-color: #B7E1C6; background: #F0FBF4; color: var(--success); }
.result-list .is-failed { border-color: #F3C0C9; background: #FDF2F4; color: var(--danger); }
.result-list .is-duplicated { border-color: #F3DFA8; background: #FEFBF0; color: var(--warning); }

.note {
  background: var(--brand-soft);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}
.form-error { color: var(--danger); font-size: 13px; margin: 8px 0 0; }

/* ------------------------- 模态框 ------------------------- */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
/* 保证 hidden 属性生效（.modal[hidden] 特异性高于 .modal，无需 !important）：
   .modal 的 display:flex 与 UA 的 [hidden]{display:none} 特异性相同、作者样式优先，
   若不显式声明，带 hidden 的模态框仍会显示。此处同时支撑密码模态框与删除二次确认弹窗。 */
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.modal__dialog {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  border-top: 4px solid var(--brand);
}
.modal__title { margin: 0 0 6px; color: var(--brand); font-size: 18px; }
.modal__desc { margin: 0 0 16px; color: var(--text-muted); font-size: 14px; }
.modal__input { margin-bottom: 4px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ------------------------- Toast ------------------------- */
.toast-container {
  position: fixed;
  top: 76px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
}
.toast {
  background: #fff;
  border-left: 4px solid var(--brand);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  min-width: 200px;
  animation: toast-in 0.2s ease;
}
.toast.is-success { border-left-color: var(--success); }
.toast.is-error { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ------------------------- 页脚 ------------------------- */
.footer { background: #fff; border-top: 1px solid var(--border); margin-top: 40px; }
.footer__inner { max-width: var(--maxw); margin: 0 auto; padding: 20px 16px; font-size: 13px; color: var(--text-muted); }
.footer__inner p { margin: 2px 0; }
/* 备案号：比正文更弱化一层，链接随页脚配色 */
.footer__icp { margin-top: 6px; font-size: 12px; }
.footer__icp a { color: var(--text-muted); text-decoration: none; }
.footer__icp a:hover { text-decoration: underline; }

/* ============================================================
   移动端适配 ≤768px
   ============================================================ */
@media (max-width: 768px) {
  /* ---------- 顶部导航：移动端强制单行 ----------
     窄屏下品牌名（7 字）+ 副标题 + 登录 + 注册 + 汉堡若按桌面尺寸排版，
     总宽远超 360px，flex 会把每一块压到换行——顶栏因此变成"四块两行"的
     杂乱状态（logo 高 72px 撑出 60px 的导航条）。
     处理原则：
       1) 副标题「检测报告门户」与下方 banner 主标题重复 → 直接隐藏；
       2) 品牌与操作区都收紧到能一行放下；
       3) 右侧操作区 flex-shrink:0，宁可压缩左侧也不让文字换行。 */
  .navbar__inner { height: 56px; padding: 0 12px; gap: 8px; }
  .navbar__brand { flex: 0 1 auto; min-width: 0; gap: 0; overflow: hidden; }
  .navbar__logo {
    font-size: 16px;
    letter-spacing: 1px;
    padding: 2px 7px;
    border-width: 1.5px;
    border-radius: 7px;
    white-space: nowrap;
    /* 极窄屏（<320px）兜底：宁可省略号，也不撑出导航条 */
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .navbar__title { display: none; }
  .navbar__nav { gap: 10px; flex-shrink: 0; }
  /* 登录 / 注册：单行、不被压缩（.btn--sm 的 44px 最小高度在此显式覆盖） */
  .navbar__account .btn {
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 34px;
    padding: 0 11px;
    font-size: 13px;
  }

  .navbar__toggle {
    display: flex;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 7px;
    gap: 4px;
  }
  .navbar__menu {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--brand-dark);
    flex-direction: column;
    gap: 0;
    padding: 8px;
    display: none;
  }
  .navbar__menu.is-open { display: flex; }
  .navbar__menu a { width: 100%; border-radius: var(--radius-sm); }

  .cards { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  .filter { grid-template-columns: 1fr; }
  .filter__actions { flex-direction: column; }
  .filter__actions .btn { width: 100%; }
  .upload-grid { grid-template-columns: 1fr; }

  /* 首页：banner 与卡片都收紧，让 3 个分类入口在一屏内全部可见 */
  .banner { padding: 16px 16px 14px; margin-bottom: 4px; }
  .banner h1 { font-size: 20px; margin-bottom: 4px; }
  .banner p { font-size: 13px; line-height: 1.5; }

  /* 分类卡：移动端横排（图标 + 标题 + 按钮同行），隐藏描述与工厂标签，节省纵向空间 */
  .entry-card {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
  }
  .entry-card__icon {
    width: 36px; height: 36px; font-size: 18px; border-radius: 8px;
    flex-shrink: 0;
  }
  .entry-card h3 { font-size: 16px; }
  .entry-card p, .entry-card__tags { display: none; }
  .entry-card .btn { width: auto; margin-left: auto; flex-shrink: 0; padding: 6px 14px; }

  /* 报告页描述行：移动端隐藏，只留标题 */
  .page__head .muted { display: none; }
  .page__head { margin-bottom: 10px; }
  .page__head h2 { font-size: 19px; }

  .tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .tab { white-space: nowrap; }

  /* 表格转卡片 */
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table {
    border: 0; box-shadow: none; background: transparent;
  }
  .data-table tbody tr {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    padding: 4px 4px;
  }
  .data-table td {
    border: 0;
    border-bottom: 1px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    text-align: right;
    min-height: var(--tap);
  }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    flex: 0 0 auto;
  }
  /* 小按钮（含列表行内「下载 / 删除」）移动端点击区提升到 ≥44px */
  .btn--sm { min-height: var(--tap); }

  .data-table td .btn { width: auto; min-height: var(--tap); }
  /* 行内操作区：右对齐 + 允许换行，避免 375px 下「下载 + 删除」两按钮横向溢出/挤压 */
  .data-table td .row-actions {
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 8px;
  }

  /* 报告页（内检/外检）移动端精简：默认只展示型号 + 日期 + 操作。
     隐藏文件名/上传时间/大小三列；每条卡片从 6 行降到 3 行，一屏能装 5-6 条。 */
  .data-table td[data-label="文件名"],
  .data-table td[data-label="上传时间"],
  .data-table td[data-label="大小"] {
    display: none;
  }

  /* 选择列：移动端隐藏文字标签，单独显示复选框，避免占一整行 */
  .data-table td[data-label="选择"] {
    padding: 6px 12px;
    border-bottom: 1px dashed var(--border);
    min-height: 0;
  }
  .data-table td[data-label="选择"]::before { content: ""; display: none; }
  .data-table td[data-label="选择"] { justify-content: flex-end; }
}

/* ============================================================
   账号区 / 下拉菜单
   ============================================================ */
.navbar__nav { display: flex; align-items: center; gap: 10px; }
.navbar__account { display: flex; align-items: center; }

.account { position: relative; display: flex; align-items: center; gap: 8px; }

/* 游客态（未登录）：白色描边登录 + 白底红字注册 */
.account--guest .btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
  background: transparent;
}
.account--guest .btn--ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
.account--guest .btn--primary { background: #fff; color: var(--brand); }
.account--guest .btn--primary:hover:not(:disabled) { background: #F7D9DE; }

/* 已登录：用户名按钮（红底导航上的浅色胶囊） */
.account__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap; /* 用户名较长时截断（.account__name 走 ellipsis），绝不换行 */
}
.account__toggle:hover { background: rgba(255, 255, 255, 0.24); }
.account__name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__role {
  font-size: 11px;
  background: #fff;
  color: var(--brand);
  border-radius: 999px;
  padding: 1px 6px;
}
.account__caret { font-size: 11px; opacity: 0.9; }

.account__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 300;
}
.account.is-open .account__menu { display: block; }
.account__menu a,
.account__menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: none;
  border: 0;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.account__menu a:hover,
.account__menu button:hover { background: var(--brand-soft); color: var(--brand); }
.account__menu .is-danger { color: var(--danger); }
.account__meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.account__divider { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* ============================================================
   登录 / 注册页
   ============================================================ */
.auth { display: flex; justify-content: center; padding: 24px 0; }
.auth__card { width: 100%; max-width: 420px; }
.auth__title { margin: 0 0 6px; color: var(--brand); }
.auth__alt { margin: 16px 0 0; font-size: 14px; color: var(--text-muted); text-align: center; }

/* 蜜罐字段：移出可视区、不可聚焦（正常用户不可见；机器人自动填充会被后端拦截） */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ============================================================
   滑块验证
   ============================================================ */
.slider-host { margin-top: 16px; }
.slider { max-width: 100%; }
.slider__track {
  position: relative;
  height: 48px;
  width: 100%;
  background: var(--brand-soft);
  border: 1px solid var(--brand-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.slider__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--brand-light);
}
.slider__target {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border: 2px dashed var(--brand);
  border-radius: 6px;
  box-sizing: border-box;
}
.slider__handle {
  position: absolute;
  top: 2px;
  left: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: grab;
  touch-action: none;
  box-shadow: var(--shadow);
  z-index: 2;
}
.slider.is-dragging .slider__handle { cursor: grabbing; }
.slider__arrow { font-size: 18px; }
.slider__hint { margin: 8px 0 0; font-size: 13px; color: var(--text-muted); }
.slider__hint.is-success { color: var(--success); }
.slider__hint.is-error { color: var(--danger); }

/* ============================================================
   管理后台：统计卡片 / 图表 / 过滤条
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat__num { font-size: 24px; font-weight: 700; color: var(--brand); }
.stat__label { font-size: 13px; color: var(--text-muted); }

.chart-card { margin-bottom: 18px; }
.chart-card h3 { margin: 0 0 12px; font-size: 16px; }
.chart-box { width: 100%; overflow: hidden; }
.chart { width: 100%; height: auto; display: block; }

.admin-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.admin-filter input,
.admin-filter select { width: auto; min-width: 150px; flex: 1 1 150px; }
.admin-filter__actions { display: flex; gap: 8px; }

/* ============================================================
   移动端补充 ≤768px
   ============================================================ */
@media (max-width: 768px) {
  /* 已登录：用户名胶囊同样收紧到与导航条同高，且不被压缩 */
  .navbar__account,
  .account { flex-shrink: 0; }
  .account__toggle { min-height: 34px; padding: 0 10px; font-size: 13px; }
  /* 窄屏下「超管」徽标让位给用户名——否则用户名只能显示到一半（zhousiq…）。
     超管的身份提示在下拉菜单里的「超级后台」入口仍然可见。 */
  .account__role { display: none; }
  .account__name { max-width: 92px; }
  .account__menu { right: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-filter input,
  .admin-filter select { flex-basis: 100%; }
  .admin-filter__actions { width: 100%; }
  .admin-filter__actions .btn { flex: 1; }
}

/* ============================================================
   超窄屏 ≤350px（iPhone SE 1代 / 小屏安卓 / 折叠屏外屏）
   导航条再收一档，保证「品牌 + 登录 + 注册 + 汉堡」仍然一行放下
   ============================================================ */
@media (max-width: 350px) {
  .navbar__inner { padding: 0 10px; gap: 6px; }
  .navbar__logo { font-size: 15px; letter-spacing: 0; padding: 2px 6px; }
  .navbar__account .btn { padding: 0 9px; font-size: 12.5px; }
  .account__toggle { padding: 0 8px; }
  .account__name { max-width: 80px; }
}
