/* ==========================================================================
   面渣回收助手 · 管理后台样式
   主色沿用原型 / demo 的 #2563eb；桌面端固定侧边栏，窄屏（≤1024px）转为抽屉
   层级：tokens → 基础 → 布局 → 组件 → 页面 → 响应式
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --c-primary: #2563eb;
  --c-primary-hover: #1d4ed8;
  --c-primary-soft: #eff4ff;
  --c-primary-border: #c7d8fb;

  --c-text: #101828;
  --c-text-sub: #475467;
  --c-text-muted: #98a2b3;

  --c-bg: #f5f7fa;
  --c-surface: #ffffff;
  --c-border: #e6eaf0;
  --c-border-soft: #eef1f6;

  --c-green: #16a34a;
  --c-green-soft: #e9f8ee;
  --c-amber: #d97706;
  --c-amber-soft: #fdf3e3;
  --c-danger: #e11d48;
  --c-danger-soft: #fdeef1;

  --radius-card: 12px;
  --radius-ctl: 8px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 6px 24px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.16);

  --sidebar-w: 216px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 58px;
}

/* ---------- 2. 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3 { font-weight: 600; }

/* 数字等宽，表格与统计不会跳动 */
.dt { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--c-text-muted); }

.icon { flex-shrink: 0; display: block; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
  border-radius: 6px;
}

/* ---------- 3. 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: #0f1729;
  color: #a7b3c9;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  transition: width 0.18s ease;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar-h);
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}
.brand-mark {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--c-primary), #4f8bff);
  color: #fff;
}
.brand-text {
  display: flex; flex-direction: column;
  font-size: 14px; font-weight: 600; color: #fff; letter-spacing: 0.3px;
  line-height: 1.2; white-space: nowrap;
}
.brand-text small { font-size: 11px; font-weight: 400; color: #7f8da8; letter-spacing: 1.5px; }

.nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-ctl);
  font-size: 14px;
  color: #a7b3c9;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.is-active {
  background: rgba(37, 99, 235, 0.22);
  color: #fff;
  box-shadow: inset 2px 0 0 #5b8cff;
}
.nav-icon { opacity: 0.85; }
.nav-item.is-active .nav-icon { opacity: 1; }

.sidebar-foot { padding: 12px 10px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.collapse-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border: none; border-radius: var(--radius-ctl);
  background: transparent; color: #8b98b0; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.collapse-btn:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.main {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  transition: margin-left 0.18s ease;
}

.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 20;
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-text-muted); }
.crumb-current { color: var(--c-text); font-size: 14px; font-weight: 600; }
.crumb-sep { color: #d0d5dd; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content { flex: 1; padding: 22px; max-width: 1280px; width: 100%; }

/* ---------- 4. 账号菜单 ---------- */
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 9px 5px 5px; border: 1px solid transparent; border-radius: 999px;
  background: transparent; cursor: pointer; color: var(--c-text);
}
.user-btn:hover { background: var(--c-bg); border-color: var(--c-border); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c-primary-soft); color: var(--c-primary);
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.user-text { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--c-text-muted); }
.chev { color: var(--c-text-muted); transition: transform 0.15s; }
.user-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 186px; padding: 6px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  z-index: 40;
}
.menu-head {
  padding: 6px 10px 8px; font-size: 11px; color: var(--c-text-muted);
  border-bottom: 1px solid var(--c-border-soft); margin-bottom: 4px;
}
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border: none; border-radius: 7px;
  background: transparent; color: var(--c-text-sub); font-size: 13px;
  cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--c-bg); color: var(--c-text); }
.menu-item.is-danger { color: var(--c-danger); }
.menu-item.is-danger:hover { background: var(--c-danger-soft); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border: 1px solid var(--c-border);
  border-radius: var(--radius-ctl); background: var(--c-surface);
  color: var(--c-text-sub); cursor: pointer;
}
.icon-btn:hover { border-color: var(--c-primary-border); color: var(--c-primary); }
.menu-btn { display: none; }

/* ---------- 5. 页面标题 ---------- */
.page { display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-title { font-size: 20px; letter-spacing: 0.2px; }
.page-desc { font-size: 13px; color: var(--c-text-sub); margin-top: 3px; }

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 15px;
  border: 1px solid transparent; border-radius: var(--radius-ctl);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  background: var(--c-surface); color: var(--c-text-sub);
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); }
.btn-ghost { border-color: var(--c-border); }
.btn-ghost:not(:disabled):hover { border-color: var(--c-primary-border); color: var(--c-primary); background: var(--c-primary-soft); }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn-danger:not(:disabled):hover { background: #be123c; border-color: #be123c; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; height: 40px; font-size: 15px; }

.btn-icon {
  width: 32px; height: 32px; padding: 0; justify-content: center;
  border-color: transparent; color: var(--c-text-muted); background: transparent;
}
.btn-icon:hover { background: var(--c-primary-soft); color: var(--c-primary); border-color: transparent; }
.btn-icon.is-danger:hover { background: var(--c-danger-soft); color: var(--c-danger); }

/* 按钮里的加载转圈 */
.btn.is-loading .icon-spin { animation: spin 0.8s linear infinite; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.spinner.is-dark { border-color: rgba(16, 24, 40, 0.2); border-top-color: var(--c-text-sub); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 7. 卡片 / 统计 ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-title { font-size: 15px; }
.count-text { font-size: 12.5px; color: var(--c-text-muted); }

.stat-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 10px;
  background: var(--c-primary-soft); color: var(--c-primary);
}
.stat-icon.tone-green { background: var(--c-green-soft); color: var(--c-green); }
.stat-icon.tone-amber { background: var(--c-amber-soft); color: var(--c-amber); }
.stat-value { font-size: 24px; font-weight: 650; letter-spacing: 0.3px; }
.stat-label { font-size: 12.5px; color: var(--c-text-sub); }

.hero { text-align: center; padding: 34px 20px; }
.hero-label { font-size: 13px; color: var(--c-text-sub); }
.hero-line { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 8px 0 6px; }
.hero-value { font-size: 52px; font-weight: 700; color: var(--c-primary); letter-spacing: -0.5px; line-height: 1; }
.hero-unit { font-size: 15px; color: var(--c-text-sub); }
.hero-foot { font-size: 12px; color: var(--c-text-muted); }

/* 快捷入口 */
.quick-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1px solid var(--c-border-soft); border-radius: 10px;
  background: #fcfdff;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.quick-card:hover {
  border-color: var(--c-primary-border);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}
.quick-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 9px;
  background: var(--c-primary-soft); color: var(--c-primary);
}
.quick-text { display: flex; flex-direction: column; min-width: 0; }
.quick-text strong { font-size: 14px; }
.quick-text small { font-size: 12px; color: var(--c-text-muted); }
.quick-arrow { margin-left: auto; color: var(--c-text-muted); }

/* ---------- 8. 工具栏与搜索 ---------- */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.search {
  position: relative; display: flex; align-items: center;
  width: 268px; max-width: 100%;
}
.search-icon {
  position: absolute; left: 11px; color: var(--c-text-muted); pointer-events: none;
}
.search input {
  width: 100%; height: 36px;
  padding: 0 34px 0 34px;
  border: 1px solid var(--c-border); border-radius: var(--radius-ctl);
  font-size: 13.5px; font-family: inherit; color: var(--c-text);
  background: var(--c-surface);
}
.search input::placeholder { color: var(--c-text-muted); }
.search input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 8px; width: 22px; height: 22px;
  display: grid; place-items: center; border: none; border-radius: 50%;
  background: transparent; color: var(--c-text-muted); cursor: pointer;
}
.search-clear:hover { background: var(--c-bg); color: var(--c-text); }

/* ---------- 9. 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
  padding: 11px 12px; text-align: left; font-size: 13.5px;
  border-bottom: 1px solid var(--c-border-soft);
  vertical-align: middle;
}
table.data thead th {
  background: #fafbfd; color: var(--c-text-sub);
  font-size: 12.5px; font-weight: 500;
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #f9fbff; }
table.data td.col-index { width: 56px; color: var(--c-text-muted); font-size: 13px; }
table.data td.col-price { width: 140px; }
table.data th.col-actions, table.data td.col-actions { width: 104px; text-align: right; white-space: nowrap; }
table.data td.col-actions .btn + .btn { margin-left: 4px; }
.cell-name { font-weight: 500; }
.cell-note {
  max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--c-text-sub);
}

.th-sort {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 4px; margin-left: -4px;
  border: none; border-radius: 6px; background: transparent;
  font-size: 12.5px; color: inherit; cursor: pointer;
}
.th-sort:hover { color: var(--c-primary); background: var(--c-primary-soft); }
.sort-icon { opacity: 0.28; transition: opacity 0.15s, transform 0.15s; }
.th-sort.is-asc .sort-icon,
.th-sort.is-desc .sort-icon { opacity: 1; color: var(--c-primary); }
.th-sort.is-desc .sort-icon { transform: rotate(180deg); }

/* 首屏数据到达前的骨架 */
.skeleton-row td { padding: 12px; }
.skeleton {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- 10. 空态 ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 52px 16px; text-align: center;
}
.empty-icon {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 50%; background: var(--c-bg); color: var(--c-text-muted);
}
.empty-text { font-size: 13.5px; color: var(--c-text-muted); }

/* ---------- 11. 权限列表 ---------- */
.perm-list { display: flex; flex-direction: column; }
.perm-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--c-border-soft);
}
.perm-row:last-child { border-bottom: none; padding-bottom: 0; }
.perm-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.perm-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; color: var(--c-text-muted);
  background: var(--c-bg); padding: 1px 6px; border-radius: 5px;
}

.badge {
  display: inline-flex; align-items: center;
  padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; line-height: 1.7; font-weight: 500;
}
.badge-warn { background: var(--c-amber-soft); color: var(--c-amber); }

/* 开关 */
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #cfd6e0; border-radius: 999px;
  transition: background 0.2s;
}
.slider::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.24);
  transition: transform 0.2s;
}
.switch input:checked + .slider { background: var(--c-primary); }
.switch input:checked + .slider::after { transform: translateX(20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); }
.switch input:disabled + .slider { opacity: 0.55; cursor: progress; }
.switch.is-pending .slider { background: #b9c6dd; }

/* ---------- 12. 说明块 ---------- */
.note {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 12px 14px; border-radius: 10px;
  background: #fffbeb; border: 1px solid #fbe3b4;
  color: #8a5a06; font-size: 13px; line-height: 1.6;
}
.note .icon { margin-top: 2px; }

.tip-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tip-list li { display: flex; gap: 9px; font-size: 13px; color: var(--c-text-sub); line-height: 1.6; }
.tip-list .icon { margin-top: 3px; color: var(--c-text-muted); }

.foot-hint { font-size: 12.5px; color: var(--c-text-muted); text-align: center; }

/* ---------- 13. 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 24, 40, 0.42);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.dialog {
  width: 460px; max-width: 100%;
  max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--c-surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  animation: rise 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }

.dialog-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--c-border-soft);
  font-size: 15px; font-weight: 600;
}
.dialog-head .icon-close {
  margin-left: auto; width: 28px; height: 28px;
  display: grid; place-items: center; border: none; border-radius: 7px;
  background: transparent; color: var(--c-text-muted); cursor: pointer;
}
.dialog-head .icon-close:hover { background: var(--c-bg); color: var(--c-text); }
.dialog-body { padding: 18px 20px; }
.dialog-text { font-size: 14px; color: var(--c-text-sub); line-height: 1.65; }
.dialog-text strong { color: var(--c-text); }
.dialog-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--c-border-soft);
  background: #fcfdff; border-radius: 0 0 14px 14px;
}

/* ---------- 14. 表单 ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--c-text-sub); margin-bottom: 6px; }
.field-wrap { position: relative; display: flex; align-items: center; }
.field-wrap .field-icon { position: absolute; left: 11px; color: var(--c-text-muted); pointer-events: none; }
.field input, .field textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--c-border); border-radius: var(--radius-ctl);
  font-size: 14px; font-family: inherit; color: var(--c-text); background: var(--c-surface);
}
.field-wrap input { padding-left: 34px; }
.field-wrap input.has-action { padding-right: 38px; }
.field textarea { resize: vertical; min-height: 74px; line-height: 1.55; }
.field input::placeholder, .field textarea::placeholder { color: var(--c-text-muted); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.field input.is-invalid, .field textarea.is-invalid { border-color: var(--c-danger); }
.field-action {
  position: absolute; right: 6px; width: 28px; height: 28px;
  display: grid; place-items: center; border: none; border-radius: 6px;
  background: transparent; color: var(--c-text-muted); cursor: pointer;
}
.field-action:hover { background: var(--c-bg); color: var(--c-text); }
.field-hint { font-size: 12px; color: var(--c-amber); margin-top: 5px; }
.field-foot { font-size: 12px; color: var(--c-text-muted); margin-top: 5px; }

.form-error { min-height: 18px; font-size: 12.5px; color: var(--c-danger); margin-bottom: 6px; }

/* ---------- 15. 提示条 ---------- */
.toast-wrap {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 200; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 999px;
  background: #1d2939; color: #fff; font-size: 13.5px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.toast.is-out { opacity: 0; transform: translateY(-6px); transition: opacity 0.18s, transform 0.18s; }
.toast .icon { flex-shrink: 0; }
.toast-ok .icon { color: #4ade80; }
.toast-err { background: #b42318; }
.toast-err .icon { color: #fecdd3; }
.toast-info .icon { color: #93c5fd; }

/* ---------- 16. 登录页 ---------- */
.login-page {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(760px 380px at 12% -10%, #dbe7ff 0%, rgba(219, 231, 255, 0) 62%),
    radial-gradient(680px 340px at 96% 108%, #e4f4ea 0%, rgba(228, 244, 234, 0) 60%),
    var(--c-bg);
}
.login-card {
  width: 396px; max-width: 100%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  padding: 34px 32px 26px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.09);
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 24px; }
.login-brand .brand-mark { width: 42px; height: 42px; border-radius: 12px; margin-bottom: 6px; }
.login-title { font-size: 20px; letter-spacing: 1px; }
.login-sub { font-size: 12.5px; color: var(--c-text-muted); letter-spacing: 2px; }
.login-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--c-text-muted); }

/* 后台 404：回显用户访问的路径，方便自查拼写 */
.notfound-path {
  padding: 9px 12px; margin-bottom: 12px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; color: var(--c-text);
  text-align: center; word-break: break-all;
}
.notfound-tip {
  margin-bottom: 18px; text-align: center;
  font-size: 13px; line-height: 1.6; color: var(--c-text-muted);
}

.alert {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: 9px; margin-bottom: 14px;
  font-size: 13px; line-height: 1.5;
}
.alert-error { background: var(--c-danger-soft); color: var(--c-danger); }

/* ---------- 17. 侧边栏收起态 ---------- */
.app.is-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.app.is-collapsed .main { margin-left: var(--sidebar-w-collapsed); }
.app.is-collapsed .brand-text,
.app.is-collapsed .nav-label,
.app.is-collapsed .collapse-btn span { display: none; }
.app.is-collapsed .brand,
.app.is-collapsed .nav-item,
.app.is-collapsed .collapse-btn { justify-content: center; padding-left: 0; padding-right: 0; }
.app.is-collapsed .nav-item.is-active { box-shadow: inset 2px 0 0 #5b8cff; }

.drawer-mask { display: none; }

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

@media (max-width: 1024px) {
  .sidebar {
    width: 248px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 10px 40px rgba(16, 24, 40, 0.28);
  }
  .app.is-drawer-open .sidebar { transform: none; }
  /* 抽屉模式下忽略收起态，始终显示完整菜单 */
  .app.is-collapsed .sidebar { width: 248px; }
  .app.is-collapsed .sidebar .brand-text { display: flex; }
  .app.is-collapsed .sidebar .nav-label { display: inline; }
  .app.is-collapsed .sidebar .collapse-btn span { display: inline; }
  .app.is-collapsed .sidebar .brand,
  .app.is-collapsed .sidebar .nav-item,
  .app.is-collapsed .sidebar .collapse-btn { justify-content: flex-start; padding-left: 12px; padding-right: 12px; }
  .app.is-collapsed .sidebar .brand { padding-left: 18px; }
  .main, .app.is-collapsed .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .sidebar-foot { display: none; }

  .drawer-mask {
    display: block; position: fixed; inset: 0; z-index: 25;
    background: rgba(16, 24, 40, 0.4);
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  .app.is-drawer-open .drawer-mask { opacity: 1; pointer-events: auto; }
}

@media (max-width: 720px) {
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .btn { width: 100%; justify-content: center; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .search { width: 100%; }
  .toolbar { align-items: stretch; }
  .toolbar .count-text { margin-left: auto; }
  .crumb-root, .crumb-sep { display: none; }
  .user-text { display: none; }
  .hero-value { font-size: 42px; }
  .cell-note { max-width: 160px; }
}
