/* ==========================================================================
   课序 · 设计系统
   暖白纸感底 + 深靛蓝侧栏 + 珊瑚橙点缀，圆角与轻阴影营造亲和的专业感。
   ========================================================================== */

:root {
  --bg: #f4f6fc;
  --surface: #ffffff;
  --surface-soft: #f8f9fe;
  --surface-mute: #f1f3fa;
  --ink: #171a2e;
  --ink-2: #3c425d;
  --muted: #7a819c;
  --muted-2: #9aa0b8;
  --line: #e8eaf4;
  --line-strong: #dce0ee;

  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --primary-soft: #eef2ff;
  --coral: #ff7a59;
  --coral-soft: #fff1ec;
  --green: #10b981;
  --green-soft: #e8faf3;
  --teal: #0d9488;
  --teal-soft: #e6f7f5;
  --amber: #f59e0b;
  --amber-soft: #fff7e6;
  --red: #ef4444;
  --red-soft: #fef0f0;
  --blue: #0ea5e9;
  --blue-soft: #eaf6fe;
  --pink: #ec4899;
  --pink-soft: #fdeef6;
  --slate: #64748b;
  --slate-soft: #f1f4f9;

  --sidebar: #13142e;
  --sidebar-2: #1b1a3d;
  --sidebar-line: rgba(148, 155, 204, 0.13);
  --sidebar-text: #a8adce;
  --sidebar-text-strong: #f4f5ff;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-xs: 0 1px 2px rgba(21, 26, 58, 0.04);
  --shadow-sm: 0 1px 2px rgba(21, 26, 58, 0.03), 0 8px 24px -18px rgba(21, 26, 58, 0.24);
  --shadow-md: 0 18px 48px -28px rgba(21, 26, 58, 0.32);
  --shadow-lg: 0 32px 80px -36px rgba(18, 21, 48, 0.45);

  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --sidebar-w: 252px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv02" 1;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 78% -6%, rgba(99, 102, 241, 0.09), transparent 65%),
    radial-gradient(560px 420px at 100% 20%, rgba(255, 122, 89, 0.06), transparent 70%),
    linear-gradient(180deg, #f7f8fd 0%, var(--bg) 40%);
}

h1, h2, h3, h4, p {
  margin: 0;
}

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

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

img, svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(99, 102, 241, 0.18);
}

:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.28);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-thumb {
  background: #cfd4e6;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #b7bed6;
  background-clip: content-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

.icon {
  flex: none;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 3000;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
}

.noscript {
  margin: 40px auto;
  max-width: 520px;
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
}

/* ---------- 启动 / 加载 ---------- */
.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  color: var(--muted);
}
.boot-brand {
  display: flex;
  align-items: center;
  gap: 15px;
}
.boot-brand strong {
  display: block;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.boot-brand span:last-child {
  font-size: 12.5px;
  color: var(--muted);
}
.brand-mark-lg {
  width: 56px;
  height: 56px;
  font-size: 25px;
  border-radius: 17px;
}

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(79, 70, 229, 0.18);
  border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  color: var(--muted);
  font-size: 13.5px;
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 0;
}
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.skeleton {
  display: inline-block;
  border-radius: 9px;
  background: linear-gradient(90deg, #eef1f8 25%, #f8f9fd 37%, #eef1f8 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.sk-avatar { width: 38px; height: 38px; border-radius: 50%; }
.sk-line { flex: 1; height: 13px; max-width: 340px; }
.sk-line.short { flex: 0 0 22%; }
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- 应用框架 ---------- */
.app-root {
  min-height: 100vh;
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 15px 16px;
  overflow-y: auto;
  color: var(--sidebar-text);
  background:
    radial-gradient(340px 260px at 15% 0%, rgba(99, 102, 241, 0.28), transparent 62%),
    radial-gradient(280px 240px at 100% 100%, rgba(255, 122, 89, 0.12), transparent 70%),
    linear-gradient(165deg, var(--sidebar) 0%, var(--sidebar-2) 58%, #171632 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  background-clip: content-box;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--sidebar-line);
}
.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #7c7cf8 0%, #5b5bf0 45%, #ff8a68 130%);
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  letter-spacing: -0.03em;
}
.brand-text {
  min-width: 0;
}
.brand-name {
  display: block;
  color: #fff;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.brand-sub {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: #858bb4;
  text-transform: uppercase;
}
.nav-scroll {
  flex: 1;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}
.nav-group + .nav-group {
  margin-top: 16px;
}
.nav-label {
  padding: 0 12px 7px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #6d739b;
  text-transform: uppercase;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 43px;
  padding: 0 13px;
  margin-bottom: 3px;
  border-radius: 12px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}
.nav-item.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(99, 102, 241, 0.42), rgba(99, 102, 241, 0.12));
  box-shadow: inset 0 0 0 1px rgba(139, 148, 255, 0.22), 0 8px 20px -14px rgba(0, 0, 0, 0.6);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #a5b4fc, #ff9a7c);
  box-shadow: 0 0 12px rgba(165, 180, 252, 0.7);
}
.nav-item .icon {
  color: #8d93bb;
  transition: color 0.18s;
}
.nav-item:hover .icon,
.nav-item.active .icon {
  color: #c7ccff;
}
.nav-item .nav-text {
  flex: 1;
  min-width: 0;
}
.nav-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(255, 122, 89, 0.16);
  color: #ff9f84;
  font-size: 11px;
  font-weight: 700;
}
.sidebar-spacer {
  flex: 0 0 auto;
}
.sidebar-card {
  margin-top: auto;
  padding: 15px;
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.18), rgba(255, 122, 89, 0.08));
  border: 1px solid rgba(139, 148, 255, 0.18);
}
.sidebar-card .sc-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #e8e9ff;
  font-size: 12.5px;
  font-weight: 600;
}
.sidebar-card p {
  margin: 6px 0 10px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #9ba1c8;
}
.sidebar-card .sc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #8b91b9;
}
.sidebar-foot {
  padding-top: 13px;
  border-top: 1px solid var(--sidebar-line);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 12px;
  color: #dfe1f7;
}
.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.05);
}
.sidebar-user .su-meta {
  min-width: 0;
  flex: 1;
}
.sidebar-user .su-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #f0f1ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .su-role {
  display: block;
  font-size: 11px;
  color: #858bb4;
}
.sidebar-user .icon {
  color: #6f759b;
}
.sidebar-close {
  display: none;
}
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  background: rgba(244, 246, 252, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(230, 233, 244, 0.9);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.topbar-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sub {
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.menu-toggle {
  display: none;
}
.menu-toggle.icon-btn {
  display: none;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.topbar-date {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
}
.topbar-date .icon {
  color: var(--muted);
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 26px;
  border-radius: 20px;
  background: var(--green-soft);
  color: #0b7a5c;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.live-pill .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
  animation: pulse 2s infinite;
}
.live-pill.offline {
  background: var(--surface-mute);
  color: var(--muted);
}
.live-pill.offline .live-dot {
  background: var(--muted-2);
  box-shadow: none;
  animation: none;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-2);
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}
.icon-btn:hover {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--primary);
  transform: translateY(-1px);
}
.notif-btn {
  position: relative;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid var(--bg);
}
.user-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  transition: background 0.18s, border-color 0.18s;
}
.user-chip:hover {
  background: #fff;
  border-color: var(--line-strong);
}
.user-chip .uc-meta {
  text-align: left;
  line-height: 1.25;
  display: none;
}
.user-chip .uc-name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip .uc-role {
  display: block;
  font-size: 10px;
  color: var(--muted);
}
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 196px;
  padding: 7px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform-origin: top right;
  animation: popIn 0.16s ease-out;
  z-index: 80;
}
.user-menu-head {
  padding: 9px 11px 11px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 5px;
}
.user-menu-head strong {
  display: block;
  font-size: 13px;
}
.user-menu-head span {
  font-size: 11px;
  color: var(--muted);
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
}
.user-menu-item:hover {
  background: var(--surface-mute);
  color: var(--ink);
}
.user-menu-item.danger {
  color: var(--red);
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(-5px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- 内容区 ---------- */
.view {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 26px 32px 64px;
  animation: viewIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.page-head h1 {
  font-size: clamp(21px, 2vw, 26px);
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.eyebrow {
  margin-bottom: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--primary);
  text-transform: uppercase;
}
.page-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s, transform 0.18s;
  user-select: none;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.5;
  transform: none !important;
}
.btn-primary {
  background: linear-gradient(180deg, #5b53ec, var(--primary));
  color: #fff;
  box-shadow: 0 8px 18px -9px rgba(79, 70, 229, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: transparent;
}
.btn-primary:hover {
  background: linear-gradient(180deg, #625af0, var(--primary-strong));
  box-shadow: 0 10px 22px -9px rgba(79, 70, 229, 0.8);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-2);
}
.btn-ghost:hover {
  background: #fff;
  border-color: var(--line-strong);
}
.btn-soft {
  background: var(--primary-soft);
  color: var(--primary-strong);
  border-color: transparent;
}
.btn-soft:hover {
  background: #e5e9ff;
}
.btn-outline {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink-2);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-danger {
  background: linear-gradient(180deg, #f05a5a, var(--red));
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(239, 68, 68, 0.75);
}
.btn-success {
  background: linear-gradient(180deg, #15c88d, var(--green));
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(16, 185, 129, 0.7);
}
.btn-amber {
  background: linear-gradient(180deg, #ffb02e, var(--amber));
  color: #5b3b00;
}
.btn-sm {
  height: 31px;
  padding: 0 11px;
  font-size: 11.5px;
  border-radius: 9px;
  gap: 5px;
}
.btn-lg {
  height: 46px;
  padding: 0 22px;
  font-size: 14px;
  border-radius: 13px;
}
.btn-block {
  width: 100%;
}
.btn .icon {
  flex: none;
}
.btn-link {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
}
.btn-link:hover {
  color: var(--primary-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-group {
  display: inline-flex;
  gap: 7px;
  flex-wrap: wrap;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card {
  margin-top: 18px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 22px 0;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-body {
  padding: 18px 22px 22px;
}
.card-body.flush {
  padding: 0;
}
.card-body.tight {
  padding: 12px 16px 16px;
}
.card-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ---------- 统计卡片 ---------- */
.tone-primary { --tone: var(--primary); --tone-soft: var(--primary-soft); }
.tone-green { --tone: var(--green); --tone-soft: var(--green-soft); }
.tone-teal { --tone: var(--teal); --tone-soft: var(--teal-soft); }
.tone-amber { --tone: var(--amber); --tone-soft: var(--amber-soft); }
.tone-coral { --tone: var(--coral); --tone-soft: var(--coral-soft); }
.tone-red { --tone: var(--red); --tone-soft: var(--red-soft); }
.tone-blue { --tone: var(--blue); --tone-soft: var(--blue-soft); }
.tone-pink { --tone: var(--pink); --tone-soft: var(--pink-soft); }
.tone-slate { --tone: var(--slate); --tone-soft: var(--slate-soft); }
.stat-card {
  position: relative;
  padding: 18px 19px 16px;
  border-radius: 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-height: 136px;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s, box-shadow 0.22s;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -34px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: var(--tone-soft);
  opacity: 0.72;
  pointer-events: none;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.stat-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--tone-soft);
  color: var(--tone);
}
.stat-value {
  position: relative;
  z-index: 1;
  margin-top: 11px;
  font-size: clamp(24px, 2.3vw, 30px);
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: -0.035em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-unit {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}
.stat-foot {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}
.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
}
.trend.up {
  color: #0b7a5c;
  background: var(--green-soft);
}
.trend.down {
  color: #b42318;
  background: var(--red-soft);
}
.stat-card.tone-coral .stat-value,
.stat-card.tone-primary .stat-value {
  color: var(--ink);
}

/* ---------- 网格工具 ---------- */
.grid {
  display: grid;
  gap: 16px;
}
.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.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)); }
.cols-2-1 { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.cols-1-2 { grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr); }
.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.grow { flex: 1; min-width: 0; }

/* ---------- 徽章 / 标签 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--slate-soft);
  color: var(--slate);
}
.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.badge-green { background: var(--green-soft); color: #0b7a5c; }
.badge-teal { background: var(--teal-soft); color: #0f766e; }
.badge-blue { background: var(--blue-soft); color: #0369a1; }
.badge-amber { background: var(--amber-soft); color: #b45309; }
.badge-red { background: var(--red-soft); color: #b42318; }
.badge-coral { background: var(--coral-soft); color: #c2410c; }
.badge-pink { background: var(--pink-soft); color: #be185d; }
.badge-slate { background: var(--slate-soft); color: #5b667a; }
.badge-primary { background: var(--primary-soft); color: var(--primary-strong); }
.badge-lg {
  padding: 5px 10px;
  border-radius: 9px;
  font-size: 11.5px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-mute);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
}
.tag .tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.tag-warn {
  background: var(--amber-soft);
  color: #b45309;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-mute);
  color: var(--ink-2);
}
.pill-primary { background: var(--primary-soft); color: var(--primary-strong); }
.pill-green { background: var(--green-soft); color: #0b7a5c; }
.pill-amber { background: var(--amber-soft); color: #b45309; }
.pill-red { background: var(--red-soft); color: #b42318; }

/* ---------- 表格 ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
.data-table th {
  padding: 11px 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.data-table th:first-child { border-top-left-radius: 12px; }
.data-table th:last-child { border-top-right-radius: 12px; }
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f0f2f9;
  color: var(--ink-2);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background 0.14s;
}
.data-table tbody tr:hover {
  background: #fafbff;
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.data-table .actions {
  text-align: right;
  white-space: nowrap;
}
.data-table .actions .btn + .btn {
  margin-left: 5px;
}
.cell-main {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.cell-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}
.cell-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.cell-user .cu-meta {
  min-width: 0;
}
.cell-mono {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.table-empty {
  padding: 42px 16px;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.table-foot {
  padding: 13px 18px;
  border-top: 1px solid var(--line);
}

/* ---------- 头像 / 进度 ---------- */
.avatar {
  width: var(--avatar-size, 40px);
  height: var(--avatar-size, 40px);
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--avatar-color, #4f46e5) 13%, white);
  color: var(--avatar-color, #4f46e5);
  font-size: calc(var(--avatar-size, 40px) * 0.38);
  font-weight: 700;
  letter-spacing: 0;
  border: 1px solid color-mix(in srgb, var(--avatar-color, #4f46e5) 18%, white);
  user-select: none;
}
.avatar-stack {
  display: inline-flex;
  align-items: center;
}
.avatar-stack .avatar {
  margin-left: -8px;
  border: 2px solid #fff;
}
.avatar-stack .avatar:first-child {
  margin-left: 0;
}
.avatar-more {
  background: var(--surface-mute);
  color: var(--muted);
  font-size: 10px;
  border-color: #fff;
}
.progress {
  display: inline-block;
  width: 100%;
  height: 7px;
  border-radius: 20px;
  background: var(--surface-mute);
  overflow: hidden;
  vertical-align: middle;
}
.progress-bar {
  display: block;
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #818cf8, var(--primary));
  transition: width 0.5s ease;
}
.progress-green { background: linear-gradient(90deg, #34d399, var(--green)); }
.progress-amber { background: linear-gradient(90deg, #fbbf24, var(--amber)); }
.progress-red { background: linear-gradient(90deg, #f87171, var(--red)); }
.progress-teal { background: linear-gradient(90deg, #2dd4bf, var(--teal)); }
.progress-coral { background: linear-gradient(90deg, #ff9a7c, var(--coral)); }

/* ---------- 表单 ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.field > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.field .req {
  color: var(--coral);
}
.input,
.select,
.textarea {
  width: 100%;
  height: 41px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: #cdd3e6;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.6;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237a819c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 16px;
}
.form-grid .full {
  grid-column: 1 / -1;
}
.field-hint {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
}
.field-error {
  min-height: 16px;
  font-size: 11px;
  font-weight: 500;
  color: var(--red);
}
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .input {
  border-radius: 10px 0 0 10px;
}
.input-group .btn {
  border-radius: 0 10px 10px 0;
  border-left: 0;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}
.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-box .icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
}
.search-box .input {
  width: 232px;
  padding-left: 36px;
  background: var(--surface-soft);
  border-color: transparent;
}
.search-box .input:focus {
  background: #fff;
  border-color: var(--primary);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.toolbar-spacer {
  margin-left: auto;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 500;
  transition: all 0.16s;
}
.filter-chip:hover {
  border-color: var(--line-strong);
}
.filter-chip.active {
  background: var(--primary-soft);
  border-color: #d9ddff;
  color: var(--primary-strong);
}
.toggle {
  position: relative;
  width: 40px;
  height: 23px;
  flex: none;
  border-radius: 20px;
  background: #dfe3ef;
  transition: background 0.2s;
  border: 0;
  padding: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 24, 50, 0.25);
  transition: transform 0.2s;
}
.toggle.on {
  background: var(--primary);
}
.toggle.on::after {
  transform: translateX(17px);
}

/* ---------- 选项卡 / 分段 ---------- */
.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface-mute);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}
.tab:hover {
  color: var(--ink);
}
.tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 24, 50, 0.08);
}
.tab-count {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(100, 116, 139, 0.12);
  font-size: 9.5px;
}
.tab.active .tab-count {
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.segment {
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}
.segment:last-child {
  border-right: 0;
}
.segment.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 600;
}

/* ---------- 提示 / 空状态 ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: #0c4a6e;
  font-size: 11.5px;
  line-height: 1.6;
}
.notice .icon {
  margin-top: 1px;
  flex: none;
}
.notice-warning { background: var(--amber-soft); color: #92400e; }
.notice-danger { background: var(--red-soft); color: #991b1b; }
.notice-success { background: var(--green-soft); color: #065f46; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 230px;
  padding: 38px 24px;
  text-align: center;
}
.empty-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--surface-soft);
  color: var(--muted-2);
  margin-bottom: 6px;
}
.empty-state h3 {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-2);
}
.empty-state p {
  max-width: 360px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
}
.empty-state .btn {
  margin-top: 10px;
}
.empty-state.compact {
  min-height: 150px;
  padding: 24px 16px;
}
.empty-state.compact .empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
}

/* ---------- 列表 / 时间线 ---------- */
.list-reset {
  list-style: none;
  margin: 0;
  padding: 0;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}
.kv-list {
  display: flex;
  flex-direction: column;
}
.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px dashed #eceef7;
  font-size: 12px;
}
.kv-row:last-child {
  border-bottom: 0;
}
.kv-row .k {
  color: var(--muted);
  flex: none;
}
.kv-row .v {
  text-align: right;
  font-weight: 600;
  color: var(--ink-2);
}
.timeline {
  display: flex;
  flex-direction: column;
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 17px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-rail {
  position: relative;
  width: 20px;
  flex: none;
  display: flex;
  justify-content: center;
}
.timeline-rail::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: -17px;
  width: 1px;
  background: #e9ecf6;
}
.timeline-item:last-child .timeline-rail::before {
  display: none;
}
.timeline-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.timeline-dot.green { background: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.timeline-dot.amber { background: var(--amber); box-shadow: 0 0 0 2px var(--amber-soft); }
.timeline-dot.coral { background: var(--coral); box-shadow: 0 0 0 2px var(--coral-soft); }
.timeline-dot.slate { background: var(--muted-2); box-shadow: 0 0 0 2px var(--surface-mute); }
.timeline-body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}
.timeline-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.timeline-meta {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
}
.timeline-time {
  flex: none;
  font-size: 10px;
  color: var(--muted-2);
  white-space: nowrap;
  padding-top: 4px;
}
.session-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}
.session-row:hover {
  border-color: var(--line-strong);
  background: #fcfcff;
}
.session-time {
  flex: none;
  width: 52px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  text-align: right;
}
.session-time strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.session-time span {
  display: block;
  margin-top: 1px;
  font-size: 9.5px;
  color: var(--muted);
}
.session-info {
  flex: 1;
  min-width: 0;
}
.session-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.session-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.session-actions {
  flex: none;
}
.color-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, var(--primary));
  flex: none;
}

/* ---------- 代码 / 打卡码 ---------- */
.code-display {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px dashed #d9ddef;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--primary-strong);
}
.code-display .copy {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 2px;
  display: grid;
  place-items: center;
}

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: auto;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast.leaving {
  opacity: 0;
  transform: translateX(16px);
}
.toast-icon {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--green-soft);
  color: #0b7a5c;
}
.toast-error .toast-icon { background: var(--red-soft); color: #b42318; }
.toast-warning .toast-icon { background: var(--amber-soft); color: #b45309; }
.toast-info .toast-icon { background: var(--blue-soft); color: #0369a1; }
.toast-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 2px;
}
.toast-body strong {
  font-size: 12px;
  font-weight: 650;
}
.toast-body span {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.toast-close {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  padding: 2px;
  display: grid;
  place-items: center;
}

/* ---------- 模态框 ---------- */
#modal-root {
  position: relative;
  z-index: 2000;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 23, 47, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.18s;
}
.modal-overlay.show {
  opacity: 1;
}
.modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 40px 100px -30px rgba(15, 18, 40, 0.55);
  transform: translateY(12px) scale(0.985);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.modal-overlay.show .modal {
  transform: none;
}
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 940px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 23px 15px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.modal-head p {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.modal-close {
  width: 32px;
  height: 32px;
  margin: -4px -4px 0 0;
  border-color: transparent;
  background: transparent;
}
.modal-body {
  padding: 20px 23px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 23px;
  border-top: 1px solid var(--line);
  background: #fcfcff;
}
.confirm-message {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}
.confirm-detail {
  margin-top: 13px;
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--surface-soft);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.page-btns {
  display: flex;
  gap: 6px;
}

/* ---------- 文本工具 ---------- */
.text-muted { color: var(--muted) !important; }
.text-ink { color: var(--ink) !important; }
.text-primary { color: var(--primary) !important; }
.text-green { color: var(--green) !important; }
.text-amber { color: var(--amber) !important; }
.text-red { color: var(--red) !important; }
.text-sm { font-size: 11.5px; }
.text-xs { font-size: 10.5px; }
.text-lg { font-size: 16px; }
.strong { font-weight: 650; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.tnum { font-variant-numeric: tabular-nums; }
.flex-1 { flex: 1; }
.center { text-align: center; }
.right { text-align: right; }
.hide { display: none !important; }

/* ---------- 打印（打卡码贴纸） ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .page-actions, .no-print { display: none !important; }
  .main { margin-left: 0; }
  .view { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-2-1, .cols-1-2 { grid-template-columns: minmax(0, 1fr); }
  .view { padding: 24px 26px 56px; }
  .topbar { padding: 0 26px; }
}

@media (min-width: 1360px) {
  .user-chip .uc-meta { display: block; }
}

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-104%);
    box-shadow: 30px 0 80px -30px rgba(10, 12, 30, 0.7);
  }
  .sidebar.open {
    transform: none;
  }
  .sidebar-close {
    display: grid;
    position: absolute;
    top: 14px;
    right: 12px;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    color: #cfd2ec;
  }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-grid; }
  .menu-toggle.icon-btn { display: inline-grid; }
  .topbar { height: 64px; padding: 0 18px; }
  .topbar-date { display: none; }
  .view { padding: 20px 18px 48px; }
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .page-head { align-items: flex-start; flex-direction: column; gap: 13px; }
  .page-actions { width: 100%; }
  .sidebar-open-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(15, 18, 36, 0.42);
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s;
  }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 720px) {
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 15px; min-height: 122px; border-radius: 16px; }
  .stat-value { font-size: 23px; }
  .stat-icon { width: 29px; height: 29px; }
  .stat-icon .icon { width: 16px; height: 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .full { grid-column: auto; }
  .toasts { top: 10px; right: 10px; left: 10px; width: auto; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: none; max-height: 92vh; border-radius: 22px 22px 0 0; }
  .modal-sm { max-width: none; }
  .modal-head, .modal-body { padding-left: 18px; padding-right: 18px; }
  .modal-foot { padding: 13px 18px calc(13px + env(safe-area-inset-bottom)); }
  .search-box .input { width: 100%; }
  .search-box { flex: 1; min-width: 160px; }
  .table-toolbar { padding: 13px 14px; }
  .topbar-sub { display: none; }
  .page-head h1 { font-size: 21px; }
  .live-pill span:last-child { display: none; }
  .live-pill { padding: 0 9px; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 15px 16px 18px; }
  .data-table th, .data-table td { padding: 11px 12px; }
  .empty-state { min-height: 180px; }
}

@media (max-width: 480px) {
  .grid-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat-card { min-height: 112px; padding: 13px; }
  .stat-value { font-size: 21px; }
  .page-actions .btn { flex: 1; }
  .view { padding: 16px 13px 44px; }
  .topbar { padding: 0 13px; }
  .topbar-title { font-size: 14px; }
  .user-chip .avatar { --avatar-size: 30px !important; }
  .toast { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
