/* ============================================================
   主题 A · 简约现代 Minimal  —— OA 办公系统主题模板
   响应式：移动端 / 平板 / 桌面端  自适应
   换肤方式：只改 :root 里的设计令牌即可整体换色
   ============================================================ */

/* ---------- 1. 设计令牌 Design Tokens ---------- */
:root {
  /* 品牌色 */
  --primary: #2563eb;
  --primary-2: #7ba3f7;          /* 浅一档，用于渐变 */
  --primary-hover: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, .10);
  --primary-ring: rgba(37, 99, 235, .22);

  /* 中性色 */
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f8;
  --text: #0f172a;
  --text-2: #526077;
  --text-3: #93a0b4;
  --border: #e7ebf2;
  --border-2: #d8dfe9;

  /* 语义色 */
  --success: #0ea371;   --success-soft: rgba(14, 163, 113, .12);
  --warning: #d99413;   --warning-soft: rgba(217, 148, 19, .14);
  --danger:  #e5484d;   --danger-soft:  rgba(229, 72, 77, .12);
  --info:    #0ea5e9;   --info-soft:    rgba(14, 165, 233, .12);
  --violet:  #7c5cfc;   --violet-soft:  rgba(124, 92, 252, .12);
  --violet-2: #b0a0fd;

  /* 图表色 */
  --c1: #2563eb; --c2: #0ea371; --c3: #d99413; --c4: #7c5cfc; --c5: #e5484d;

  /* 圆角 / 阴影 / 尺寸 */
  --r-xs: 6px; --r-sm: 9px; --r: 13px; --r-lg: 18px; --r-full: 999px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .04);
  --sh-2: 0 4px 14px rgba(15, 23, 42, .06);
  --sh-3: 0 16px 44px rgba(15, 23, 42, .14);
  --sidebar-w: 250px;
  --topbar-h: 66px;
  --gap: 18px;

  --font: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
          system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --tr: .22s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- 2. 深色模式 ---------- */
[data-theme="dark"] {
  --primary: #5b8cff;
  --primary-2: #9ab6ff;
  --primary-hover: #7ba3ff;
  --primary-soft: rgba(91, 140, 255, .16);
  --primary-ring: rgba(91, 140, 255, .30);

  --bg: #0b1018;
  --surface: #131a26;
  --surface-2: #182130;
  --surface-3: #1e2939;
  --text: #e8edf6;
  --text-2: #9aa7bb;
  --text-3: #6b7a90;
  --border: #222d3f;
  --border-2: #2c3950;

  --success: #2dd4a7; --success-soft: rgba(45, 212, 167, .14);
  --warning: #f0b849; --warning-soft: rgba(240, 184, 73, .14);
  --danger:  #ff6b70; --danger-soft:  rgba(255, 107, 112, .14);
  --info:    #38bdf8; --info-soft:    rgba(56, 189, 248, .14);
  --violet:  #a78bfa; --violet-soft:  rgba(167, 139, 250, .14);
  --violet-2: #c9b8ff;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 4px 16px rgba(0, 0, 0, .38);
  --sh-3: 0 18px 48px rgba(0, 0, 0, .55);
}

/* ---------- 3. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--tr), color var(--tr);
}
h1, h2, h3, h4, p, figure { margin: 0; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor;
      stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }

/* 滚动条 */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 4. 布局骨架 ---------- */
.app { min-height: 100vh; }

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--tr);
}

/* ----- 侧边栏 ----- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: transform var(--tr), background var(--tr);
}
.brand {
  display: flex; align-items: center; gap: 11px;
  height: var(--topbar-h); padding: 0 18px; flex: none;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 36px; height: 36px; flex: none;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .04em;
  box-shadow: 0 6px 16px var(--primary-ring);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text b { font-size: 15px; font-weight: 700; white-space: nowrap; }
.brand-text i { font-style: normal; font-size: 11px; color: var(--text-3); letter-spacing: .06em; }

.nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-label {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  color: var(--text-3); text-transform: uppercase;
  padding: 14px 10px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; margin-bottom: 3px;
  border-radius: var(--r-sm);
  color: var(--text-2); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all var(--tr); position: relative;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active {
  background: var(--primary-soft); color: var(--primary); font-weight: 650;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.nav-item .nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--danger); color: #fff;
}
.nav-item.active .nav-badge { background: var(--primary); }

.sidebar-user {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-top: 1px solid var(--border);
}
.su-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.su-meta b { font-size: 13px; font-weight: 650; }
.su-meta i { font-style: normal; font-size: 11.5px; color: var(--text-3); }

/* ----- 顶部栏 ----- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .topbar { background: color-mix(in srgb, var(--surface) 84%, transparent); }
}
.topbar-title { font-size: 16px; font-weight: 700; white-space: nowrap; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 380px;
  height: 38px; padding: 0 13px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-3);
  transition: box-shadow var(--tr), background var(--tr);
}
.search-box:focus-within { background: var(--surface); box-shadow: 0 0 0 3px var(--primary-ring); }
.search-box input {
  border: 0; background: none; outline: none; width: 100%;
  font-size: 13.5px; color: var(--text);
}
.search-box input::placeholder { color: var(--text-3); }

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

.icon-btn {
  position: relative;
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition: all var(--tr);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.has-dot::after {
  content: ""; position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface);
}

/* ----- 内容区 ----- */
.content { flex: 1; padding: 22px; max-width: 1440px; width: 100%; }
.view { display: none; animation: fadeUp .34s cubic-bezier(.4, 0, .2, 1); }
.view.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.page-head {
  display: flex; align-items: flex-end; gap: 16px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.page-head p { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.page-actions { margin-left: auto; display: flex; gap: 10px; }

/* ---------- 5. 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  padding: 18px;
  transition: box-shadow var(--tr), border-color var(--tr), background var(--tr);
}
.card.hoverable:hover { box-shadow: var(--sh-2); border-color: var(--border-2); }
.card-head {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 15px;
}
.card-head h2, .card-head h3 { margin-right: auto; }
.card-title { display: flex; align-items: center; gap: 8px; }
.card-title .ic { color: var(--primary); }

/* ---------- 6. 栅格 ---------- */
.grid { display: grid; gap: var(--gap); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- 7. 统计卡 ---------- */
.stat { display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
}
.i-blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.i-green  { background: linear-gradient(135deg, #34d399, #0ea371); }
.i-amber  { background: linear-gradient(135deg, #fbbf24, #d99413); }
.i-violet { background: linear-gradient(135deg, #a78bfa, #7c5cfc); }
.i-red    { background: linear-gradient(135deg, #fb7185, #e5484d); }
.stat-num { font-size: 27px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* 迷你柱状 sparkline */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 10px; }
.spark i {
  flex: 1; border-radius: 3px 3px 0 0; min-height: 4px;
  background: var(--primary-soft);
  transition: background var(--tr);
}
.spark i.on { background: var(--primary); }

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
  transition: all var(--tr);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px var(--primary-ring); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { border-color: var(--border-2); color: var(--text-2); background: var(--surface); }
.btn-outline:hover { border-color: var(--text-3); color: var(--text); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---------- 9. 标签 / 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 650; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.b-blue   { background: var(--primary-soft); color: var(--primary); }
.b-green  { background: var(--success-soft); color: var(--success); }
.b-amber  { background: var(--warning-soft); color: var(--warning); }
.b-red    { background: var(--danger-soft);  color: var(--danger); }
.b-gray   { background: var(--surface-3);    color: var(--text-2); }
.b-violet { background: var(--violet-soft);  color: var(--violet); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12.5px; color: var(--text-2);
}

/* 分段控件 */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-3); border-radius: var(--r-sm);
}
.segmented button {
  height: 30px; padding: 0 14px; border-radius: 7px;
  font-size: 13px; font-weight: 550; color: var(--text-2);
  transition: all var(--tr);
}
.segmented button.active {
  background: var(--surface); color: var(--text);
  font-weight: 650; box-shadow: var(--sh-1);
}

/* ---------- 10. 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px -18px; padding: 0 18px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
  text-align: left; font-weight: 600; font-size: 12px;
  letter-spacing: .04em; color: var(--text-3);
  padding: 10px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.table thead th:first-child { border-radius: var(--r-xs) 0 0 var(--r-xs); }
.table thead th:last-child  { border-radius: 0 var(--r-xs) var(--r-xs) 0; }
.table tbody td {
  padding: 13px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--tr); }
.table tbody tr:hover { background: var(--surface-2); }
.table .ta-r { text-align: right; }
.table .strong { font-weight: 650; }
.table .mono { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }

/* ---------- 11. 列表 ---------- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid var(--border);
  transition: background var(--tr);
}
.list-item:last-child { border-bottom: 0; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-main b { display: block; font-size: 13.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-main span { font-size: 12px; color: var(--text-3); }
.li-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ---------- 12. 头像 ---------- */
.avatar {
  width: 36px; height: 36px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  color: #fff; font-size: 13px; font-weight: 650;
}
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 54px; height: 54px; font-size: 19px; }
.avatar.gray { background: var(--surface-3); color: var(--text-2); }

/* ---------- 13. 表单 ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--text-3); }

.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 13px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 13.5px; outline: none;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2393a0b4' stroke-width='1.8' stroke-linecap='round'><path d='M4 6.5l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input-group { display: flex; align-items: center; gap: 8px; }

/* 单选 / 复选 */
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--text-2); cursor: pointer;
  transition: all var(--tr);
}
.radio-row input { display: none; }
.radio-row label:hover { border-color: var(--text-3); }
.radio-row label:has(input:checked) {
  border-color: var(--primary); background: var(--primary-soft);
  color: var(--primary); font-weight: 600;
}
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.check input { display: none; }
.check .box {
  width: 19px; height: 19px; flex: none;
  border: 1.6px solid var(--border-2); border-radius: 6px;
  display: grid; place-items: center; color: transparent;
  transition: all var(--tr);
}
.check input:checked + .box {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.check input:checked + .box::after {
  content: ""; width: 10px; height: 6px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* 开关 */
.switch { position: relative; display: inline-block; width: 44px; height: 25px; flex: none; }
.switch input { display: none; }
.switch .track {
  position: absolute; inset: 0; border-radius: 99px;
  background: var(--border-2); transition: background var(--tr);
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform var(--tr);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(19px); }

.switch-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row .sr-main { flex: 1; }
.switch-row .sr-main b { display: block; font-size: 13.5px; font-weight: 600; }
.switch-row .sr-main span { font-size: 12px; color: var(--text-3); }

/* 上传区 */
.upload {
  display: grid; place-items: center; gap: 6px;
  padding: 26px; text-align: center;
  border: 1.5px dashed var(--border-2); border-radius: var(--r);
  background: var(--surface-2); color: var(--text-3);
  cursor: pointer; transition: all var(--tr);
}
.upload:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.upload b { font-size: 13.5px; font-weight: 600; color: var(--text-2); }

/* ---------- 14. 进度 / 时间线 / 空状态 ---------- */
.progress { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--primary);
  transition: width .6s cubic-bezier(.4, 0, .2, 1); }
.progress.green > i { background: var(--success); }
.progress.amber > i { background: var(--warning); }

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border); border-radius: 2px;
}
.timeline li { position: relative; padding-bottom: 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -22px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--border-2);
}
.timeline li.done::before { border-color: var(--success); background: var(--success); }
.timeline li.now::before  { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline b { display: block; font-size: 13.5px; font-weight: 600; }
.timeline span { font-size: 12px; color: var(--text-3); }

.empty { display: grid; place-items: center; gap: 10px; padding: 46px 20px; text-align: center; color: var(--text-3); }
.empty .ic { width: 40px; height: 40px; stroke-width: 1.2; opacity: .5; }

/* ---------- 15. 图表 ---------- */
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.donut { width: 148px; height: 148px; flex: none; }
.donut .track { stroke: var(--surface-3); }
.donut .val { stroke: var(--primary); transition: stroke-dasharray .8s ease; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-center { position: relative; }
.donut-center .num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 24px; font-weight: 750; letter-spacing: -.02em;
}
.bars { display: flex; align-items: flex-end; gap: 14px; height: 168px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; gap: 8px; height: 100%; }
.bars .bar > i {
  width: 100%; max-width: 34px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  transition: height .7s cubic-bezier(.4, 0, .2, 1);
}
.bars .bar > span { font-size: 11.5px; color: var(--text-3); }
.bars .bar.alt > i { background: linear-gradient(180deg, var(--violet), var(--violet-2)); }

/* ---------- 16. 快捷入口 ---------- */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick a {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 15px 8px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2);
  transition: all var(--tr);
}
.quick a:hover {
  border-color: var(--primary); color: var(--primary);
  transform: translateY(-2px); box-shadow: var(--sh-2);
}
.quick a .ic { width: 22px; height: 22px; }

/* ---------- 17. 日历 ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .cal-head {
  text-align: center; font-size: 12px; font-weight: 600;
  color: var(--text-3); padding: 6px 0;
}
.cal .day {
  aspect-ratio: 1 / 1; min-height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid transparent;
  font-size: 13px; cursor: pointer; transition: all var(--tr);
}
.cal .day:hover { border-color: var(--primary); }
.cal .day.mute { color: var(--text-3); opacity: .45; }
.cal .day.today { border-color: var(--primary); color: var(--primary); font-weight: 700; }
.cal .day.sel { background: var(--primary); color: #fff; font-weight: 700; }
.cal .day .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.cal .day.sel .dot { background: #fff; }

/* ---------- 18. Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 200;
  transform: translate(-50%, 24px);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--r-sm);
  background: var(--text); color: var(--surface);
  font-size: 13.5px; font-weight: 550;
  box-shadow: var(--sh-3);
  opacity: 0; pointer-events: none;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ic { color: var(--success); }

/* ---------- 19. 遮罩 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--tr);
}
.overlay.show { opacity: 1; pointer-events: auto; }

/* ---------- 20. 工具类 ---------- */
.muted { color: var(--text-3); font-size: 12.5px; }
.text-2 { color: var(--text-2); }
.green { color: var(--success); }
.red { color: var(--danger); }
.amber { color: var(--warning); }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.only-mobile { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ============================================================
   21. 响应式适配
   ============================================================ */

/* —— 中屏（平板）—— */
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
}

/* —— 侧边栏抽屉化（平板 / 手机）—— */
@media (max-width: 1023px) {
  .sidebar {
    width: 264px;
    transform: translateX(-100%);
    box-shadow: var(--sh-3);
    border-right: 0;
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .only-mobile { display: grid !important; }
  .content { padding: 18px 16px 28px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar-title { font-size: 15px; }
  .search-box { max-width: none; }
}

/* —— 手机端 —— */
@media (max-width: 700px) {
  body { font-size: 13.5px; }
  h1 { font-size: 19px; }
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 16px 13px 30px; gap: 14px; }
  :root { --gap: 14px; }
  .card { padding: 15px; border-radius: var(--r-sm); }
  .page-head { align-items: flex-start; margin-bottom: 16px; }
  .page-actions { margin-left: 0; width: 100%; }
  .page-actions .btn { flex: 1; }
  .search-box { display: none; }
  .topbar { height: 58px; }
  .brand { height: 58px; }
  .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .quick a { padding: 12px 4px; font-size: 11.5px; gap: 6px; }
  .stat-num { font-size: 23px; }
  .bars { height: 140px; gap: 8px; }
  .table-wrap { margin: 0 -15px -15px; padding: 0 15px; }

  /* 表格 → 卡片式堆叠 */
  .table.responsive thead { display: none; }
  .table.responsive tbody tr {
    display: block; padding: 13px 0;
    border-bottom: 1px solid var(--border);
  }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table.responsive tbody td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; padding: 5px 0; border: 0; text-align: right !important;
  }
  .table.responsive tbody td::before {
    content: attr(data-label);
    flex: none; font-size: 12px; font-weight: 600; color: var(--text-3);
    text-align: left;
  }
  .table.responsive tbody td:first-child {
    padding-bottom: 10px; font-weight: 700;
    justify-content: flex-start; text-align: left !important;
  }
  .table.responsive tbody td:first-child::before { display: none; }
  .table.responsive td .btn { margin-left: auto; }
}

/* —— 小屏微调 —— */
@media (max-width: 420px) {
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .donut-wrap { justify-content: center; }
  .page-actions { flex-direction: column; }
}

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

/* 打印 */
@media print {
  .sidebar, .topbar, .page-actions { display: none !important; }
  .main { margin-left: 0; }
  .card { box-shadow: none; border-color: #ddd; }
}
