/* ==========================================================================
   智训云 · 设计系统 v1.0
   - CSS 变量驱动，支持明暗双主题
   - 流式布局，适配 320px ~ 4K
   ========================================================================== */

:root {
  /* 品牌色 */
  --brand: #5b5bd6;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-soft: #eef0ff;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;

  /* 语义色 */
  --success: #10b981;
  --success-soft: #e7f8f1;
  --warn: #f59e0b;
  --warn-soft: #fef5e7;
  --danger: #ef4444;
  --danger-soft: #fdecec;
  --info: #0ea5e9;
  --info-soft: #e8f6fe;

  /* 中性 */
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --surface-3: #f2f4f9;
  --border: #e7e9f2;
  --border-strong: #d7dbe8;
  --text: #0f172a;
  --text-2: #5a6379;
  --text-3: #8b93a7;
  --text-inverse: #ffffff;

  /* 尺寸 */
  --r-xs: 8px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --sidebar-w: 258px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 2px 6px -1px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 6px 20px -6px rgba(16, 24, 40, .12), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 48px -16px rgba(16, 24, 40, .22), 0 8px 16px -8px rgba(16, 24, 40, .1);
  --ring: 0 0 0 3px rgba(91, 91, 214, .16);

  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --brand: #7c7cf0;
  --brand-600: #6366f1;
  --brand-700: #818cf8;
  --brand-soft: #1e2140;
  --accent: #a78bfa;
  --success-soft: #10291f;
  --warn-soft: #2a2110;
  --danger-soft: #2c1416;
  --info-soft: #0d2233;

  --bg: #080b14;
  --surface: #10151f;
  --surface-2: #151b28;
  --surface-3: #1b2231;
  --border: #1e2635;
  --border-strong: #2a3446;
  --text: #e9edf6;
  --text-2: #a0a9be;
  --text-3: #6f7a91;
  --text-inverse: #0b0f18;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, .5);
  --shadow: 0 8px 24px -8px rgba(0, 0, 0, .6);
  --shadow-lg: 0 32px 64px -24px rgba(0, 0, 0, .8);
  --ring: 0 0 0 3px rgba(124, 124, 240, .25);
}

/* ------------------------------- 基础重置 ------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; letter-spacing: -.015em; line-height: 1.3; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

::selection { background: var(--brand); color: #fff; }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

/* ------------------------------- 工具类 ------------------------------- */
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { display: flex; align-items: center; justify-content: center; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 650; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

/* =============================== 登录页 =============================== */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--bg);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(150deg, #1b1b4b 0%, #2b2b7a 38%, #4c3f9e 72%, #6d4bb5 100%);
  color: #fff;
}
.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  pointer-events: none;
}
.auth-brand::before {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #7c6cf5, transparent 68%);
  top: -160px; right: -140px;
  animation: float1 18s ease-in-out infinite;
}
.auth-brand::after {
  width: 460px; height: 460px;
  background: radial-gradient(circle, #22d3ee, transparent 70%);
  bottom: -180px; left: -120px;
  opacity: .35;
  animation: float2 22s ease-in-out infinite;
}
@keyframes float1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-40px,50px)} }
@keyframes float2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(50px,-40px)} }

.auth-brand > * { position: relative; z-index: 1; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .02em;
}
.brand-logo {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}

.auth-headline {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -.02em;
  margin-bottom: 18px;
}
.auth-headline em {
  font-style: normal;
  background: linear-gradient(100deg, #a5f3fc, #c4b5fd 60%, #fbcfe8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-sub {
  font-size: 15px;
  color: rgba(255,255,255,.72);
  max-width: 30em;
  line-height: 1.8;
}
.auth-features {
  display: grid;
  gap: 14px;
  margin-top: 34px;
}
.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: rgba(255,255,255,.86);
}
.auth-feature .tick {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  margin-top: 1px;
}
.auth-foot {
  font-size: 12px;
  color: rgba(255,255,255,.45);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 56px);
}
.auth-card {
  width: 100%;
  max-width: 412px;
  animation: rise .5s var(--ease-out) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.auth-card h2 {
  font-size: 27px;
  letter-spacing: -.02em;
}
.auth-card .sub {
  color: var(--text-2);
  margin-top: 8px;
  margin-bottom: 30px;
  font-size: 14px;
}
.auth-mobile-brand { display: none; }

/* =============================== 表单 =============================== */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
  letter-spacing: .01em;
}
.input, .select, .textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  font-size: 14px;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b93a7' d='M6 8.5L1.5 4l1-1L6 6.5 9.5 3l1 1z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}
.input-icon { position: relative; }
.input-icon .input { padding-left: 40px; }
.input-icon .ico {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  display: grid; place-items: center;
}

/* =============================== 按钮 =============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid transparent;
  transition: all .16s var(--ease);
  white-space: nowrap;
  user-select: none;
  position: relative;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-600) 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79,70,229,.3), 0 4px 12px -4px rgba(79,70,229,.5), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 2px 4px rgba(79,70,229,.3), 0 8px 20px -6px rgba(79,70,229,.55), inset 0 1px 0 rgba(255,255,255,.2);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); filter: brightness(.98); }
.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.05); }
.btn-soft { background: var(--brand-soft); color: var(--brand-600); }
.btn-soft:hover:not(:disabled) { background: var(--brand-soft); filter: brightness(.97); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: var(--r-xs); }

.btn .spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-secondary .spinner, .btn-ghost .spinner {
  border-color: var(--border-strong);
  border-top-color: var(--brand);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================== 布局外壳 =============================== */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px 14px;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 20px;
}
.sidebar-brand .mark {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 4px 12px -3px rgba(91,91,214,.5);
  flex: 0 0 auto;
}
.sidebar-brand .name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.sidebar-brand .plan {
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.nav-group { margin-bottom: 6px; }
.nav-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 10px 7px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9.5px 11px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s var(--ease);
  position: relative;
  width: 100%;
  text-align: left;
}
.nav-item svg { flex: 0 0 auto; opacity: .78; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-600);
  font-weight: 650;
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid; place-items: center;
  letter-spacing: 0;
}
.nav-item.active .nav-badge { background: var(--brand); }

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s var(--ease);
  width: 100%;
  text-align: left;
}
.user-chip:hover { background: var(--surface-3); }
.user-chip .meta { min-width: 0; flex: 1; }
.user-chip .nm { font-size: 13px; font-weight: 620; }
.user-chip .rl { font-size: 11.5px; color: var(--text-3); }

/* 主内容 */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px clamp(16px, 2.2vw, 32px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; letter-spacing: -.02em; }
.topbar .crumb { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content {
  padding: clamp(16px, 2.2vw, 32px);
  padding-bottom: 44px;
  width: 100%;
  max-width: 1780px;
  margin: 0 auto;
  animation: fade .3s var(--ease-out);
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all .15s var(--ease);
  position: relative;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--surface);
}

/* 移动端底部导航 */
.tabbar { display: none; }

/* =============================== 卡片 =============================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card-pad { padding: clamp(16px, 1.6vw, 22px); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px clamp(16px, 1.6vw, 22px);
  border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 14.5px; }
.card-head .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.card-body { padding: clamp(16px, 1.6vw, 22px); }
.card-hover { transition: all .2s var(--ease); }
.card-hover:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

/* 统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: all .2s var(--ease);
}
.stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--brand-soft);
  opacity: .55;
}
.stat .ico {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  margin-bottom: 14px;
  position: relative; z-index: 1;
}
.stat .label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.stat .value {
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  position: relative; z-index: 1;
}
.stat .foot { font-size: 11.5px; color: var(--text-3); margin-top: 6px; position: relative; z-index: 1; }
.stat-accent-1 .ico { background: var(--brand-soft); color: var(--brand-600); }
.stat-accent-1::after { background: var(--brand-soft); }
.stat-accent-2 .ico { background: var(--success-soft); color: var(--success); }
.stat-accent-2::after { background: var(--success-soft); }
.stat-accent-3 .ico { background: var(--warn-soft); color: var(--warn); }
.stat-accent-3::after { background: var(--warn-soft); }
.stat-accent-4 .ico { background: var(--info-soft); color: var(--info); }
.stat-accent-4::after { background: var(--info-soft); }

/* =============================== 头像 / 标签 / 徽章 =============================== */
.avatar {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px;
  font-weight: 650;
  color: #fff;
  letter-spacing: .02em;
  background: var(--brand);
  user-select: none;
  overflow: hidden;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; border-radius: 22px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -9px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tag-neutral { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.tag-brand { background: var(--brand-soft); color: var(--brand-600); }
.tag-success { background: var(--success-soft); color: #0a8a5f; }
.tag-warn { background: var(--warn-soft); color: #a86300; }
.tag-danger { background: var(--danger-soft); color: #c92a2a; }
.tag-info { background: var(--info-soft); color: #0b7fb0; }
[data-theme="dark"] .tag-success { color: #4ade80; }
[data-theme="dark"] .tag-warn { color: #fbbf24; }
[data-theme="dark"] .tag-danger { color: #f87171; }
[data-theme="dark"] .tag-info { color: #38bdf8; }

.dot-live {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  70% { box-shadow: 0 0 0 7px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* =============================== 表格 =============================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
table.tbl th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 11px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.tbl td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .13s var(--ease); }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl .num { font-variant-numeric: tabular-nums; }
table.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* 进度条 */
.progress {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  min-width: 60px;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width .5s var(--ease-out);
}
.progress.sm { height: 4px; }
.progress.success > i { background: linear-gradient(90deg, #10b981, #34d399); }
.progress.warn > i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* =============================== 弹层 =============================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 12, 22, .48);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn .18s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  animation: pop .24s var(--ease-out);
  border: 1px solid var(--border);
}
.modal.wide { max-width: 760px; }
.modal.xwide { max-width: 1080px; }
@keyframes pop {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-head h3 { font-size: 16px; flex: 1; }
.modal-body { padding: 22px; overflow: auto; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--surface-2);
}

/* Toast */
.toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  animation: slideIn .28s var(--ease-out);
  border-left: 3px solid var(--brand);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast .t-ico { flex: 0 0 auto; margin-top: 1px; }
.toast.success .t-ico { color: var(--success); }
.toast.error .t-ico { color: var(--danger); }
.toast.warn .t-ico { color: var(--warn); }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-title { font-weight: 620; }
.toast .t-msg { color: var(--text-2); font-size: 12.5px; margin-top: 1px; }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(24px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.toast.out { animation: slideOut .2s var(--ease) forwards; }
@keyframes slideOut { to { opacity: 0; transform: translateX(24px); } }

/* 下拉菜单 */
.dropdown {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
  animation: pop .16s var(--ease-out);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--r-xs);
  font-size: 13.5px;
  color: var(--text-2);
  width: 100%;
  text-align: left;
  transition: background .13s;
}
.dropdown-item:hover { background: var(--surface-3); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown-head { padding: 9px 11px; font-size: 12px; color: var(--text-3); }

/* =============================== 断点：登录 / 骨架 =============================== */
@media (max-width: 1023px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .tabbar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px) saturate(1.5);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-3);
    border-radius: var(--r-xs);
    transition: color .15s;
    max-width: 96px;
  }
  .tab.active { color: var(--brand-600); }
  .tab .tab-ico { position: relative; }
  .tab .nav-badge {
    position: absolute; top: -5px; right: -9px;
    min-width: 16px; height: 16px; font-size: 9.5px;
  }
  .content { padding-bottom: 92px; }
  .topbar { padding: 11px 16px; }
  .topbar h1 { font-size: 17px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-brand { display: flex; margin-bottom: 28px; }
}

@media (max-width: 767px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat .ico { width: 30px; height: 30px; margin-bottom: 10px; }
  .stat .value { font-size: 22px; }
  .modal { max-width: 100%; border-radius: var(--r-lg); }
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal { max-height: 92vh; }
  .toasts { top: 10px; right: 10px; left: 10px; max-width: none; }
  table.tbl th, table.tbl td { padding: 10px 12px; }
}

@media (min-width: 1920px) {
  :root { --sidebar-w: 280px; }
  body { font-size: 14.5px; }
}

@media (min-width: 2560px) {
  .content { max-width: 2100px; }
  body { font-size: 15px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
