/* ════════════════════════════════════════════════════
   学生升学与学业规划管理系统 — Design System v3.0
   ════════════════════════════════════════════════════ */

/* ═══ Design Tokens ═══ */
:root {
  /* Layout */
  --sidebar-width: 246px;  /* #7 略加宽，容纳「申请指挥中心 [申请]」「录取评估库」等长名 */
  --topnav-height: 56px;

  /* Brand */
  --primary:        #2563eb;
  --primary-light:  #dbeafe;
  --primary-dark:   #1d4ed8;
  --primary-glow:   rgba(37, 99, 235, 0.18);

  /* Sidebar */
  --sidebar-bg:     #1e293b;
  --sidebar-hover:  #334155;
  --sidebar-active: #2563eb;

  /* Surfaces */
  --surface-0: #f8fafc;
  --surface-1: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;

  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-tertiary:  #94a3b8;

  /* Borders */
  --border:       #e2e8f0;
  --border-focus: #93c5fd;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.09), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 32px rgba(0,0,0,0.11), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-xl: 0 24px 56px rgba(0,0,0,0.16), 0 8px 16px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 0 3px var(--primary-glow);

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  18px;
  --radius-pill: 999px;

  /* Easing */
  --ease-fast:   120ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-slow:   350ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: 320ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Status */
  --success: #16a34a;
  --warning: #d97706;
  --danger:  #dc2626;
  --info:    #0284c7;
}

/* ═══ Keyframes ═══ */
@keyframes loginFadeUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes modalEnter {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)      scale(1); }
}
/* 确保弹窗始终居中在视窗中（仅在显示时） */
.modal.show { align-items: center; }
.modal-dialog { margin: auto; max-height: 90vh; }
.modal-content { max-height: 90vh; display: flex; flex-direction: column; }
.modal-body { overflow-y: auto; flex: 1 1 auto; }

@keyframes skeleton-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(32px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmerSweep {
  0%   { background-position: -300% center; }
  100% { background-position:  300% center; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50%       { box-shadow: 0 0 0 6px transparent; }
}

@keyframes floatOrb {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-18px) scale(1.04); }
}

@keyframes progressFill {
  from { width: 0; }
}

@keyframes countUp {
  from { opacity: 0.4; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes borderGlow {
  0%, 100% { border-color: var(--primary); box-shadow: 0 0 0 0 var(--primary-glow); }
  50%       { border-color: var(--primary-dark); box-shadow: 0 0 0 4px transparent; }
}

/* ═══ Base ═══ */
* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', '微软雅黑', sans-serif;
  background:
    radial-gradient(ellipse 100% 50% at 90% 5%, rgba(37,99,235,0.045) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 5% 95%, rgba(124,58,237,0.03) 0%, transparent 55%),
    var(--surface-0);
  margin: 0;
  font-size: 14px;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ═══ 登录页（分屏品牌版）═══ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  background: #fff;
}

/* 左：品牌区 */
.login-brand {
  flex: 1 1 46%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3.5rem 3rem;
  color: #fff;
  background:
    radial-gradient(ellipse 90% 60% at 12% 12%, rgba(124,58,237,0.45) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 88% 88%, rgba(14,165,233,0.30) 0%, transparent 60%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #1e3a5f 100%);
}
.login-brand::before { /* 细网格纹理 */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 45% 35%, #000 0%, transparent 78%);
          mask-image: radial-gradient(ellipse 75% 75% at 45% 35%, #000 0%, transparent 78%);
  pointer-events: none;
}
.login-brand > * { position: relative; z-index: 1; }
.brand-top { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary, #2563eb), #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff; box-shadow: 0 8px 24px rgba(37,99,235,0.4);
}
.brand-name { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.02em; }
.brand-hero { max-width: 30rem; }
.brand-hero h1 { font-size: 2rem; line-height: 1.25; font-weight: 800; margin: 0 0 1rem; letter-spacing: -0.01em; }
.brand-hero > p { font-size: 1rem; color: rgba(255,255,255,0.72); line-height: 1.7; margin: 0; }
.brand-feats { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-direction: column; gap: 1.1rem; }
.brand-feats li { display: flex; align-items: flex-start; gap: 0.8rem; }
.brand-feats i { color: #60a5fa; font-size: 1.2rem; margin-top: 0.1rem; flex-shrink: 0; }
.brand-feats b { font-weight: 600; color: #fff; }
.brand-feats small { display: block; color: rgba(255,255,255,0.6); font-size: 0.8rem; margin-top: 0.15rem; }
.brand-foot { font-size: 0.8rem; color: rgba(255,255,255,0.5); }

/* 右：表单区 */
.login-form-side {
  flex: 1 1 54%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  background: #f8fafc;
}
.login-card {
  width: 100%;
  max-width: 400px;
  animation: loginFadeUp 0.5s var(--ease-slow, cubic-bezier(.4,0,.2,1)) both;
}
.lc-head { margin-bottom: 1.75rem; }
.lc-head h2 { font-size: 1.6rem; font-weight: 800; color: #0f172a; margin: 0 0 0.35rem; letter-spacing: -0.01em; }
.lc-head > p { color: #64748b; font-size: 0.92rem; margin: 0; }
.login-field { margin-bottom: 1.05rem; }
.login-field > label { display: block; font-size: 0.82rem; font-weight: 600; color: #334155; margin-bottom: 0.4rem; }
.input-wrap { position: relative; }
.input-wrap > i { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 1rem; pointer-events: none; }
.input-wrap > input {
  width: 100%; height: 46px; padding: 0 0.9rem 0 2.5rem;
  border: 1px solid #e2e8f0; border-radius: 10px; background: #fff;
  font-size: 0.95rem; color: #0f172a;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrap > input::placeholder { color: #cbd5e1; }
.input-wrap > input:focus { outline: none; border-color: var(--primary, #2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.login-row { display: flex; align-items: center; justify-content: space-between; margin: 0.15rem 0 1.25rem; font-size: 0.85rem; }
.login-row label { display: flex; align-items: center; gap: 0.4rem; color: #475569; cursor: pointer; margin: 0; }
.login-row a { color: var(--primary, #2563eb); text-decoration: none; }
.login-row a:hover { text-decoration: underline; }
#forgot-hint { margin: 0 0 1rem; font-size: 0.8rem; color: #1e40af; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 8px; padding: 0.55rem 0.8rem; }
.btn-login {
  width: 100%; height: 48px; border: 0; border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  box-shadow: 0 6px 18px rgba(37,99,235,0.32);
  transition: transform 0.12s, box-shadow 0.15s;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(37,99,235,0.42); }
.btn-login:active { transform: none; }
.lc-foot { margin-top: 1.5rem; text-align: center; font-size: 0.78rem; color: #94a3b8; }

/* 响应式：窄屏叠成单列，品牌区收成顶部条 */
@media (max-width: 860px) {
  .login-wrapper { flex-direction: column; }
  .login-brand { flex: none; padding: 2rem 1.5rem; }
  .login-brand .brand-hero, .login-brand .brand-foot { display: none; }
  .login-form-side { flex: 1; padding: 2.5rem 1.25rem; }
}

/* ═══ 顶部导航 ═══ */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topnav-height);
  background: linear-gradient(90deg, #1a2744 0%, #1e293b 40%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 1000;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 2px 16px rgba(0,0,0,0.3);
  color: #f1f5f9;
}

.top-nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 25%, #7c3aed 75%, transparent 100%);
}

.top-nav span, .top-nav i {
  color: #f1f5f9 !important;
}

/* ═══ 应用布局 ═══ */
.app-body {
  display: flex;
  margin-top: var(--topnav-height);
  min-height: calc(100vh - var(--topnav-height));
}

/* ═══ 侧边栏 ═══ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  height: calc(100vh - var(--topnav-height));
  position: fixed;
  top: var(--topnav-height);
  left: 0;
  transition: width var(--ease-slow);
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 900;
  box-shadow: 2px 0 20px rgba(0,0,0,0.18);
}

/* 侧边栏顶部渐变光 */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(37,99,235,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar.collapsed {
  width: 56px;
}

.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-title {
  display: none;
}

.sidebar-nav {
  padding: 0.75rem 0;
}

.nav-section-title {
  color: #cbd5e1 !important;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 0.625rem 1rem 0.25rem;
  margin-top: 0.375rem;
}

/* 侧边栏导航项（限定在 #sidebar 内，避免污染 Bootstrap tab 的 .nav-item） */
#sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.55rem 1rem;
  color: #94a3b8;
  text-decoration: none;
  transition: background var(--ease-fast), color var(--ease-fast), transform var(--ease-fast);
  font-size: 13.5px;
  border-left: 3px solid transparent;
  position: relative;
}

#sidebar .nav-item:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
  text-decoration: none;
  transform: translateX(2px);
}

#sidebar .nav-item.active {
  background: rgba(37, 99, 235, 0.20);
  color: #93c5fd;
  border-left-color: #60a5fa;
  font-weight: 500;
}

#sidebar .nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #60a5fa, #818cf8);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(96,165,250,0.6);
}

/* Active item glow dot */
#sidebar .nav-item.active::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 6px #60a5fa;
}

.nav-item i {
  font-size: 16px;
  min-width: 20px;
}

/* ═══ 学生生命周期联动视觉 ═══
 * 入学管理 → 学生管理 → 申请指挥中心 → 录取评估库 是同一拨学生不同阶段。
 * 用左侧贯通的 accent 缎带 + 右侧"进校/在校/申请"小标签让人一眼看出是一组流水线。
 */
#sidebar .nav-item.lifecycle-item {
  border-left-color: rgba(165, 28, 48, 0.35); /* ESIC 校园红半透 — 默认就显示 */
}
#sidebar .nav-item.lifecycle-item:hover {
  border-left-color: rgba(165, 28, 48, 0.7);
}
#sidebar .nav-item.lifecycle-item.active {
  border-left-color: #60a5fa; /* 选中时仍走原 active 蓝色 */
}
/* #7 阶段小标签：进校 / 在校 / 申请 — 缩小尺寸 + 允许 nav-item 文字 truncate 后再放标签
   之前标签太大把"申请指挥中心""录取评估库"挤到了截字。现在标签更紧凑，文字优先显示完整。 */
#sidebar .nav-item.lifecycle-item span:first-of-type {
  /* 主名字：允许溢出但 sidebar 自身不裁掉 */
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#sidebar .nav-item.lifecycle-item .lifecycle-stage-tag {
  margin-left: 4px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 1px 4px;
  border-radius: 6px;
  background: rgba(165, 28, 48, 0.18);
  color: #fbb;
  text-transform: none;
  flex-shrink: 0;
  line-height: 1.3;
}
#sidebar .nav-item.lifecycle-item.active .lifecycle-stage-tag {
  background: rgba(96, 165, 250, 0.25);
  color: #c7e0ff;
}
.sidebar.collapsed .nav-item .lifecycle-stage-tag {
  display: none;
}
/* 折叠状态下小箭头连接，让缩到只剩图标时仍然能看出流水线 */
#sidebar .nav-item.lifecycle-mid::before,
#sidebar .nav-item.lifecycle-end::before {
  content: '';
  position: absolute;
  left: 17px;
  top: -3px;
  height: 6px;
  width: 1.5px;
  background: rgba(165, 28, 48, 0.45);
  z-index: 0;
}
/* 分组标题里 lifecycle-section 用红色装饰 */
.nav-section-title.lifecycle-section {
  color: #f1a3ad !important;
  position: relative;
}
.nav-section-title.lifecycle-section::after {
  content: '';
  display: inline-block;
  margin-left: 6px;
  width: 14px;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(165,28,48,0.6), transparent);
  vertical-align: middle;
}

/* ═══ 主内容区 ═══ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 1.5rem;
  transition: margin-left var(--ease-slow);
  max-width: 100%;
  animation: pageFadeIn 0.28s var(--ease-normal) both;
  position: relative;
}

/* 主内容右上角环境光 */
.main-content::after {
  content: '';
  position: fixed;
  top: calc(var(--topnav-height) + 20px);
  right: 0;
  width: 500px; height: 350px;
  background: radial-gradient(ellipse, rgba(37,99,235,0.05) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 14s ease-in-out infinite;
}

.main-content.sidebar-collapsed {
  margin-left: 56px;
}

/* ═══ 页面头部 ═══ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid transparent;
  background-image: linear-gradient(var(--surface-0), var(--surface-0)),
                    linear-gradient(90deg, var(--primary), #7c3aed, transparent);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border-bottom-width: 1px;
  border-bottom-style: solid;
}

.page-header h4 {
  margin: 0;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ═══ 加载动画 ═══ */
.page-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

/* ═══ Skeleton Loading ═══ */
.skeleton {
  background: linear-gradient(
    100deg,
    #f1f5f9 30%,
    #e8edf3 50%,
    #f1f5f9 70%
  );
  background-size: 600px 100%;
  animation: skeleton-shimmer 1.4s infinite ease-in-out;
  border-radius: var(--radius-sm);
}
.skeleton-text  { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; border-radius: 4px; }
.skeleton-card  { height: 120px; border-radius: var(--radius-md); }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }

/* ═══ Empty State ═══ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-tertiary);
  position: relative;
  overflow: hidden;
}

/* 空状态背景装饰圆 */
.empty-state::before {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.04) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.empty-state-icon {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  opacity: 0.35;
  filter: drop-shadow(0 4px 8px rgba(37,99,235,0.12));
  animation: floatOrb 4s ease-in-out infinite;
}
.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}
.empty-state-desc {
  font-size: 13px;
  max-width: 320px;
  line-height: 1.6;
}

/* ═══ 统计卡片 ═══ */
/* ── Stat Card v2: neutral bg + left accent bar ── */
.stat-card {
  border-radius: var(--radius-md);
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: transform var(--ease-normal), box-shadow var(--ease-normal);
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--stat-accent, var(--primary));
}
.stat-card::after { display: none; }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Accent color variants via CSS variable */
.stat-card.accent-primary   { --stat-accent: var(--primary); }
.stat-card.accent-success   { --stat-accent: var(--success); }
.stat-card.accent-danger    { --stat-accent: var(--danger); }
.stat-card.accent-warning   { --stat-accent: var(--warning); }
.stat-card.accent-info      { --stat-accent: var(--info); }

.stat-icon {
  font-size: 1.5rem;
  color: var(--stat-accent, var(--primary));
  opacity: 0.5;
  position: absolute;
  right: 1rem;
  top: 1rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  animation: countUp 0.5s var(--ease-spring) both;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ═══ 卡片样式 ═══ */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--ease-normal), transform var(--ease-normal);
  background: var(--surface-1);
  position: relative;
  overflow: hidden;
}

/* 卡片顶部高光线 */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.9) 50%, transparent 100%);
  pointer-events: none;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  background: var(--surface-0);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  position: relative;
}

/* ═══ 看板卡片 ═══ */
.kanban-card {
  cursor: pointer;
  transition: background var(--ease-fast), border-color var(--ease-fast),
              transform var(--ease-spring), box-shadow var(--ease-fast);
  background: var(--surface-1);
}

.kanban-card:hover {
  background: #f0f9ff;
  border-color: var(--primary) !important;
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 6px 18px rgba(37,99,235,0.16);
}

/* ═══ 头像 ═══ */
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,235,0.35);
}

.avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(37,99,235,0.35);
}

/* ═══ 任务项 ═══ */
.task-item {
  transition: background var(--ease-fast), transform var(--ease-fast);
}

.task-item:hover {
  background: var(--surface-2);
  transform: translateX(2px);
}

.task-overdue {
  border-left: 3px solid var(--danger) !important;
}

/* ═══ 学生卡片 ═══ */
.student-card {
  transition: transform var(--ease-normal), box-shadow var(--ease-normal);
}

.student-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ═══ 表格 ═══ */
.table th {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
  background: var(--surface-0);
  border-bottom: 2px solid var(--border);
  padding: 0.6rem 0.75rem;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
  border-color: var(--border);
  padding: 0.6rem 0.75rem;
}

/* 表格行入场动画（前12条） */
.table tbody tr {
  transition: background var(--ease-fast), transform var(--ease-fast),
              box-shadow var(--ease-fast);
  animation: slideInUp 0.32s var(--ease-normal) both;
}
.table tbody tr:nth-child(1)  { animation-delay: 0ms; }
.table tbody tr:nth-child(2)  { animation-delay: 30ms; }
.table tbody tr:nth-child(3)  { animation-delay: 55ms; }
.table tbody tr:nth-child(4)  { animation-delay: 80ms; }
.table tbody tr:nth-child(5)  { animation-delay: 105ms; }
.table tbody tr:nth-child(6)  { animation-delay: 130ms; }
.table tbody tr:nth-child(7)  { animation-delay: 155ms; }
.table tbody tr:nth-child(8)  { animation-delay: 180ms; }
.table tbody tr:nth-child(9)  { animation-delay: 200ms; }
.table tbody tr:nth-child(10) { animation-delay: 220ms; }
.table tbody tr:nth-child(n+11) { animation-delay: 240ms; }

.table-hover tbody tr:hover {
  background: rgba(37,99,235,0.06);
  box-shadow: inset 3px 0 0 var(--primary);
}

/* ═══ Tab 样式 ═══ */
.nav-tabs {
  --bs-nav-tabs-link-hover-border-color: transparent;
  border-bottom: 2px solid var(--border);
  gap: 2px;
}

.nav-tabs .nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 0.875rem;
  margin-bottom: -2px;
  border-radius: 0;
  background: transparent;
  transition: color 0.15s, border-bottom-color 0.15s;
}

.nav-tabs .nav-link:hover {
  color: var(--primary);
  background: transparent;
  border-color: transparent;
  border-bottom-color: rgba(37, 99, 235, 0.3);
  box-shadow: none;
  isolation: auto;
}
.nav-tabs .nav-link:focus:not(:focus-visible) {
  outline: none;
}
.nav-tabs .nav-link:focus-visible {
  color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: 4px;
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  border-color: transparent;
  border-bottom-color: var(--primary);
  background: transparent;
  font-weight: 600;
}

/* ═══ 模态框 ═══ */
.modal-backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: rgba(15, 23, 42, 0.55);
}

.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.08);
  animation: modalEnter 0.24s var(--ease-spring) both;
  overflow: hidden;
}

/* 模态框顶部彩色光条 */
.modal-content::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  z-index: 1;
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 1.25rem;
  background: var(--surface-0);
  border-radius: 0;
  position: relative;
}

.modal-header .modal-title {
  font-size: 15px;
  font-weight: 700;
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  background: var(--surface-0);
  border-radius: 0;
}

.modal-header .btn-close { filter: none; }

/* ═══ 按钮 ═══ */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13.5px;
  transition: all var(--ease-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: relative;
  overflow: hidden;
}

/* 按钮水波涟漪效果基础层 */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--ease-fast);
}

.btn:hover::after { opacity: 0; }
.btn:active::after { opacity: 1; }

.btn:active {
  transform: translateY(1px) scale(0.98);
}

/* Primary 按钮 */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-color: var(--primary);
  box-shadow: 0 1px 4px rgba(37,99,235,0.3), inset 0 1px 0 rgba(255,255,255,0.12);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2d6ef6 0%, var(--primary) 100%);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(37,99,235,0.42), inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-glow), 0 4px 14px rgba(37,99,235,0.3);
}

/* Primary 按钮光泽扫过动画 */
.btn-primary:hover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255,255,255,0.15) 50%,
    transparent 80%
  );
  background-size: 300% 100%;
  animation: shimmerSweep 0.8s ease once;
  pointer-events: none;
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(37,99,235,0.3);
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #d97706;
  box-shadow: 0 1px 4px rgba(245,158,11,0.3);
}
.btn-warning:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,158,11,0.4);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border-color: #16a34a;
  box-shadow: 0 1px 4px rgba(22,163,74,0.3);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22,163,74,0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
  border-color: #dc2626;
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220,38,38,0.35);
}

.btn-sm {
  font-size: 12.5px;
  padding: 0.3rem 0.65rem;
}

.btn-xs {
  padding: 2px 7px;
  font-size: 11.5px;
  border-radius: 4px;
  line-height: 1.4;
}

/* ═══ 表单控件 ═══ */
.form-control,
.form-select {
  border-color: var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-primary);
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast),
              transform var(--ease-fast);
  background: var(--surface-1);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--surface-1);
  transform: translateY(-1px);
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.form-text {
  font-size: 12px;
  color: var(--text-tertiary);
}

.input-group-text {
  border-color: var(--border);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-secondary);
}

/* ═══ 进度条 ═══ */
.progress {
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.progress-bar {
  transition: width 0.6s var(--ease-normal);
  animation: progressFill 0.6s var(--ease-normal) both;
  position: relative;
}

/* 进度条玻璃高光 */
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: rgba(255,255,255,0.2);
  border-radius: inherit;
}

/* ═══ 徽章 ═══ */
.badge {
  font-weight: 600;
  font-size: 11px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.2px;
}

/* 状态徽章细化 */
.badge.bg-success { box-shadow: 0 1px 4px rgba(22,163,74,0.25); }
.badge.bg-danger  { box-shadow: 0 1px 4px rgba(220,38,38,0.25); }
.badge.bg-warning { box-shadow: 0 1px 4px rgba(217,119,6,0.25); }
.badge.bg-primary { box-shadow: 0 1px 4px rgba(37,99,235,0.25); }
.badge.bg-info    { box-shadow: 0 1px 4px rgba(2,132,199,0.25); }

/* ═══ 告警 ═══ */
.alert {
  border-radius: var(--radius-md);
  font-size: 13.5px;
  border-width: 1px;
  border-left-width: 3px;
  animation: slideInUp 0.25s var(--ease-normal) both;
}

.alert-info    { border-left-color: var(--info); }
.alert-success { border-left-color: var(--success); }
.alert-warning { border-left-color: var(--warning); }
.alert-danger  { border-left-color: var(--danger); }

/* ═══ Toast ═══ */
.toast-container {
  z-index: 9999;
}

.toast {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: none;
  animation: toastSlideIn 0.28s var(--ease-spring) both;
  backdrop-filter: blur(8px);
}

/* ═══ 列表组 ═══ */
.list-group-item {
  border-color: var(--border);
  transition: background var(--ease-fast), transform var(--ease-fast);
}

.list-group-item-action:hover {
  background: var(--surface-2);
  transform: translateX(2px);
}

/* ═══ 响应式 ═══ */
@media (max-width: 992px) {
  .settings-layout { flex-direction: column !important; }
  .settings-nav { width: 100% !important; }
  .settings-nav .nav-pills {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 0.25rem;
    padding-bottom: 0.5rem;
  }
  .settings-nav .nav-pills .nav-link { font-size: .78rem; padding: .35rem .6rem; white-space: nowrap; }
  .settings-nav .nav-pills small,
  .settings-nav .nav-pills hr { display: none !important; }
  .settings-content { min-width: 0; }
}

@media (max-width: 768px) {
  /* ── 侧边栏 ── */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 228px; z-index: 1050;
    height: 100vh !important;
    padding-top: var(--topnav-height);
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar .nav-item span,
  .sidebar .nav-section-title { display: block; }
  .sidebar.collapsed { width: 228px; transform: translateX(-100%); }
  .sidebar.collapsed.mobile-open { transform: translateX(0); }
  .mobile-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    z-index: 1040; display: none;
  }
  .mobile-overlay.show { display: block; }
  .main-content {
    margin-left: 0 !important;
    padding: 0.75rem;
  }
  .main-content.sidebar-collapsed { margin-left: 0 !important; }
  .stat-value { font-size: 1.6rem; }

  /* ── 顶栏 ── */
  .top-nav {
    padding: 0 0.5rem;
    flex-wrap: nowrap !important;
    overflow: hidden;
  }
  .top-nav .d-flex { flex-wrap: nowrap; gap: 6px !important; }
  .top-nav span.fw-bold.fs-5 { font-size: .9rem !important; white-space: nowrap; }
  .top-nav .badge { display: none; }
  .hamburger-btn { display: flex !important; }

  /* ── 页面头 ── */
  .page-header { flex-wrap: wrap; gap: 0.5rem; }
  .page-header h4 { font-size: 1.1rem; }
  .page-header .page-header-actions,
  .page-header .d-flex { width: 100%; flex-wrap: wrap; gap: 0.5rem; }
  .page-header .btn { font-size: .78rem; padding: .3rem .6rem; }

  /* ── 表格响应 ── */
  .table-responsive,
  .table-responsive-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-responsive table,
  .table-responsive-wrapper table { min-width: 600px; }

  /* ── 弹窗 ── */
  .modal-dialog { margin: 0.5rem !important; max-width: calc(100vw - 1rem) !important; }
  .modal-dialog-lg, .modal-dialog.modal-lg,
  .modal-dialog-xl, .modal-dialog.modal-xl { max-width: calc(100vw - 1rem) !important; }
  .modal-body { max-height: 70vh; }

  /* ── 卡片 ── */
  .card-body { padding: 0.75rem; }
  .row.g-3 > [class*="col-md-"],
  .row.g-3 > [class*="col-lg-"] { flex: 0 0 100%; max-width: 100%; }
  .row.g-3 > .col-md-3,
  .row.g-3 > .col-md-4 { flex: 0 0 50%; max-width: 50%; }

  /* ── Master-detail 布局 ── */
  .md-layout { flex-direction: column !important; height: auto !important; }
  .md-list { width: 100% !important; max-height: 40vh; border-right: none !important; border-bottom: 1px solid var(--border); }
  .md-detail { width: 100% !important; }

  /* ── 看板 ── */
  .kanban-board { flex-direction: column; }
  .kanban-col { width: 100% !important; min-width: 0; }

  /* ── 按钮 ── */
  .btn-group { flex-wrap: wrap; }
  .action-icon-btn { min-width: 36px; min-height: 36px; }
  .md-detail .btn { white-space: nowrap; }

  /* ── 工作台模块 ── */
  .md-empty-detail .row { max-width: 100% !important; }
  .md-empty-detail .col-6 { flex: 0 0 100%; max-width: 100%; }

  /* ── Case grid ── */
  .case-grid { grid-template-columns: 1fr !important; }

  /* ── 入学管理 ── */
  .intake-list-panel { width: 100% !important; max-height: 35vh; }
  .intake-detail-panel { width: 100% !important; }

  /* ── 表单 ── */
  .input-group { flex-wrap: wrap; }
  .form-control, .form-select { font-size: 14px; }
}

@media (max-width: 480px) {
  .main-content { padding: 0.5rem !important; }
  .stat-value { font-size: 1.3rem; }
  .stat-card { padding: 0.6rem; }
  .row.g-3 > .col-md-3,
  .row.g-3 > .col-6 { flex: 0 0 50%; max-width: 50%; }
  .page-header h4 { font-size: 1rem; }
  .card-header { font-size: .85rem; padding: 0.5rem 0.75rem; }
  .nav-tabs .nav-link { font-size: .78rem; padding: .4rem .5rem; }
  .badge { font-size: .65rem; }
}

/* ── 汉堡菜单按钮 ── */
.hamburger-btn {
  display: none !important;
  align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-primary);
  font-size: 1.4rem; padding: 0.25rem 0.5rem; cursor: pointer;
}

/* ═══ 滚动条 ═══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-pill);
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ═══ 工具类 ═══ */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

code {
  background: var(--surface-2);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 12px;
  color: #e11d48;
}

/* ═══ 打印样式 ═══ */
.print-btn { display: inline-flex; align-items: center; gap: 4px; }

@media print {
  .top-nav, .sidebar, .print-btn, .btn:not(.badge), .modal, .toast-container,
  [data-bs-toggle="tab"], .nav-tabs, .page-header .d-flex > button,
  .page-header .d-flex > a { display: none !important; }
  .main-content { margin-left: 0 !important; padding: 0 !important; }
  .app-body { display: block; }
  body { background: white; font-size: 12px; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  .card::before, .card::after, .modal-content::before { display: none !important; }
  .stat-card { break-inside: avoid; }
  .tab-pane, .tab-content > .tab-pane { display: block !important; opacity: 1 !important; }
  h4, h5, h6 { color: #000 !important; }
  .badge { border: 1px solid #ccc; }
  #print-footer {
    display: block !important; text-align: center; font-size: 11px;
    color: #666; border-top: 1px solid #ccc; padding-top: 6px; margin-top: 24px;
  }
  @page { margin: 1.5cm; }
}
#print-footer { display: none; }

/* ═══ 深色主题 ═══ */
body.dark-mode {
  --surface-0: #0f172a;
  --surface-1: #1e293b;
  --surface-2: #263145;
  --surface-3: #334155;
  --border: #334155;
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary:  #64748b;
  background:
    radial-gradient(ellipse 100% 50% at 90% 5%, rgba(37,99,235,0.08) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 5% 95%, rgba(124,58,237,0.06) 0%, transparent 55%),
    #0f172a !important;
  color: #e2e8f0 !important;
}

body.dark-mode .card             { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-mode .card-header      { background: #263145; border-color: #334155; color: #e2e8f0; }
body.dark-mode .card-body        { color: #e2e8f0; }

/* 深色模式卡片高光线 */
body.dark-mode .card::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
}

body.dark-mode .table {
  --bs-table-bg: #1e293b;
  --bs-table-striped-bg: #263145;
  --bs-table-hover-bg: #2d3a52;
  --bs-table-border-color: #334155;
  color: #e2e8f0;
}
body.dark-mode .table th         { background: #263145; border-color: #334155; }
body.dark-mode .table td         { border-color: #334155; }
body.dark-mode .table-light      { --bs-table-bg: #263145; --bs-table-border-color: #334155; color: #e2e8f0; }
body.dark-mode .table-hover tbody tr:hover { background: rgba(37,99,235,0.08); }

body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .input-group-text { background-color: #0f172a; border-color: #475569; color: #e2e8f0; }

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus { background-color: #0f172a; color: #e2e8f0; box-shadow: 0 0 0 3px rgba(37,99,235,0.25); border-color: var(--primary); transform: translateY(-1px); }

body.dark-mode .form-control::placeholder { color: #4b5563; }
body.dark-mode .form-text         { color: #94a3b8; }
body.dark-mode .form-check-label  { color: #e2e8f0; }
body.dark-mode .form-label        { color: #94a3b8; }

body.dark-mode .modal-content     { background: #1e293b; color: #e2e8f0; }
body.dark-mode .modal-header      { background: #263145; border-color: #334155; }
body.dark-mode .modal-footer      { background: #263145; border-color: #334155; }
body.dark-mode .btn-close         { filter: invert(1); }
body.dark-mode .modal-backdrop    {
  background: rgba(2, 6, 23, 0.72);
}

body.dark-mode .page-header       { border-color: #334155; background-image: linear-gradient(#0f172a, #0f172a), linear-gradient(90deg, var(--primary), #7c3aed, transparent); }
body.dark-mode .page-header h4    { color: #f1f5f9; }

body.dark-mode .nav-tabs           { border-color: #334155; }
body.dark-mode .nav-tabs .nav-link { color: #94a3b8; }
body.dark-mode .nav-tabs .nav-link:hover { background: transparent !important; border: none !important; border-bottom: 2px solid rgba(37,99,235,0.4) !important; }
body.dark-mode .nav-tabs .nav-link.active {
  color: #60a5fa;
  background: #1e293b;
  border-color: #334155 #334155 #1e293b;
  text-shadow: 0 0 20px rgba(96,165,250,0.35);
}

body.dark-mode .alert-info    { background: rgba(37,99,235,0.10);  border-color: rgba(37,99,235,0.3);  color: #93c5fd; }
body.dark-mode .alert-danger  { background: rgba(220,38,38,0.10);  border-color: rgba(220,38,38,0.3);  color: #fca5a5; }
body.dark-mode .alert-warning { background: rgba(234,179,8,0.10);  border-color: rgba(234,179,8,0.3);  color: #fde68a; }
body.dark-mode .alert-success { background: rgba(22,163,74,0.10);  border-color: rgba(22,163,74,0.3);  color: #86efac; }

body.dark-mode .badge.bg-light     { background: #334155 !important; color: #e2e8f0 !important; }
body.dark-mode .text-muted         { color: #94a3b8 !important; }
body.dark-mode .text-dark          { color: #e2e8f0 !important; }
body.dark-mode .border             { border-color: #334155 !important; }
body.dark-mode .border-bottom,
body.dark-mode .border-top         { border-color: #334155 !important; }
body.dark-mode .bg-light           { background: #263145 !important; }
body.dark-mode .bg-white           { background: #1e293b !important; }

body.dark-mode .list-group-item         { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-mode .list-group-item-action:hover { background: #263145; }

body.dark-mode .dropdown-menu     { background: #1e293b; border-color: #334155; box-shadow: var(--shadow-lg); }
body.dark-mode .dropdown-item     { color: #e2e8f0; }
body.dark-mode .dropdown-item:hover { background: #263145; }
body.dark-mode .dropdown-divider  { border-color: #334155; }

body.dark-mode .kanban-card        { background: #1e293b; }
body.dark-mode .kanban-card:hover  { background: #263145; }
body.dark-mode .task-item:hover    { background: #263145; }

body.dark-mode code               { background: #0f172a; color: #f87171; }
body.dark-mode hr                 { border-color: #334155; }
body.dark-mode .progress          { background: #334155; }

body.dark-mode .skeleton {
  background: linear-gradient(
    100deg,
    #263145 30%,
    #2d3a52 50%,
    #263145 70%
  );
  background-size: 600px 100%;
}

body.dark-mode ::-webkit-scrollbar-thumb { background: #475569; }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ═══ 深色主题 — 全面补充 ═══ */

/* ── 全局文字兜底 ── */
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 { color: #f1f5f9; }
body.dark-mode p, body.dark-mode span, body.dark-mode div,
body.dark-mode li, body.dark-mode td, body.dark-mode th,
body.dark-mode label, body.dark-mode legend { color: inherit; }
body.dark-mode small { color: #94a3b8; }
body.dark-mode a:not(.btn):not(.nav-link):not(.dropdown-item) { color: #60a5fa; }

/* ── Badge 深色适配 ── */
body.dark-mode .badge.bg-success   { background: rgba(22,163,74,0.22) !important; color: #86efac !important; }
body.dark-mode .badge.bg-danger    { background: rgba(220,38,38,0.22) !important; color: #fca5a5 !important; }
body.dark-mode .badge.bg-warning   { background: rgba(217,119,6,0.22) !important; color: #fde68a !important; border-color: transparent !important; }
body.dark-mode .badge.bg-primary   { background: rgba(37,99,235,0.22) !important; color: #93c5fd !important; }
body.dark-mode .badge.bg-info      { background: rgba(2,132,199,0.22) !important; color: #7dd3fc !important; }
body.dark-mode .badge.bg-secondary { background: rgba(100,116,139,0.28) !important; color: #cbd5e1 !important; }
body.dark-mode .badge.bg-dark      { background: rgba(100,116,139,0.35) !important; color: #e2e8f0 !important; }

/* ── 软色 Badge ── */
body.dark-mode .badge-soft-primary   { background: rgba(37,99,235,0.15) !important; color: #93c5fd !important; }
body.dark-mode .badge-soft-success   { background: rgba(22,163,74,0.15) !important; color: #86efac !important; }
body.dark-mode .badge-soft-danger    { background: rgba(220,38,38,0.15) !important; color: #fca5a5 !important; }
body.dark-mode .badge-soft-warning   { background: rgba(217,119,6,0.15) !important; color: #fde68a !important; }
body.dark-mode .badge-soft-info      { background: rgba(2,132,199,0.15) !important; color: #7dd3fc !important; }
body.dark-mode .badge-soft-secondary { background: rgba(100,116,139,0.2) !important; color: #94a3b8 !important; }

/* ── 分页 ── */
body.dark-mode .page-link { background: var(--surface-1); border-color: var(--border); color: var(--text-secondary); }
body.dark-mode .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
body.dark-mode .page-item.disabled .page-link { background: var(--surface-0); color: var(--text-tertiary); border-color: var(--border); }

/* ── 面包屑 ── */
body.dark-mode .breadcrumb { background: transparent; }
body.dark-mode .breadcrumb-item a { color: var(--text-secondary); }
body.dark-mode .breadcrumb-item.active { color: var(--text-primary); }
body.dark-mode .breadcrumb-item + .breadcrumb-item::before { color: var(--text-tertiary); }

/* ── 手风琴 ── */
body.dark-mode .accordion-item { background: var(--surface-1); border-color: var(--border); color: var(--text-primary); }
body.dark-mode .accordion-button { background: var(--surface-1); color: var(--text-primary); box-shadow: none; }
body.dark-mode .accordion-button:not(.collapsed) { background: var(--surface-2); color: var(--text-primary); }
body.dark-mode .accordion-button::after { filter: invert(1) brightness(0.8); }
body.dark-mode .accordion-body { background: var(--surface-1); color: var(--text-primary); }

/* ── 侧滑面板 ── */
body.dark-mode .offcanvas { background: var(--surface-1); color: var(--text-primary); border-color: var(--border); }

/* ── 弹出提示 ── */
body.dark-mode .popover { background: var(--surface-1); border-color: var(--border); color: var(--text-primary); }
body.dark-mode .popover-body { color: var(--text-primary); }
body.dark-mode .popover-header { background: var(--surface-2); border-color: var(--border); color: var(--text-primary); }
body.dark-mode .tooltip-inner { background: var(--surface-2); color: var(--text-primary); }

/* ── Nav pills (非 settings 专用) ── */
body.dark-mode .nav-pills .nav-link:not(.active) { color: var(--text-secondary); }
body.dark-mode .nav-pills .nav-link:not(.active):hover { background: var(--surface-2); color: var(--text-primary); }

/* ── 上传区域 ── */
body.dark-mode .upload-area,
body.dark-mode .file-drop-zone,
body.dark-mode [class*="upload"],
body.dark-mode [class*="dropzone"] {
  background: var(--surface-0) !important; border-color: var(--border) !important; color: var(--text-secondary) !important;
}

/* ── 内联背景覆盖 — 常见浅色背景 ── */
body.dark-mode [style*="background:#fafafa"],
body.dark-mode [style*="background: #fafafa"],
body.dark-mode [style*="background:#f8f9fa"],
body.dark-mode [style*="background: #f8f9fa"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background-color:#fafafa"],
body.dark-mode [style*="background-color: #fafafa"],
body.dark-mode [style*="background-color:#f8f9fa"],
body.dark-mode [style*="background-color:#fff"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background-color:#ffffff"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background:#f8fafc"],
body.dark-mode [style*="background: #f8fafc"],
body.dark-mode [style*="background:#f0f4ff"],
body.dark-mode [style*="background: #f0f4ff"],
body.dark-mode [style*="background:#f8fdf8"],
body.dark-mode [style*="background: #f8fdf8"],
body.dark-mode [style*="background:#eff6ff"],
body.dark-mode [style*="background: #eff6ff"] {
  background: var(--surface-1) !important;
  color: var(--text-primary) !important;
}

/* ── 内联背景覆盖 — 浅色警告/错误背景 ── */
body.dark-mode [style*="background:#fef2f2"],
body.dark-mode [style*="background: #fef2f2"],
body.dark-mode [style*="background:#fee2e2"],
body.dark-mode [style*="background: #fee2e2"],
body.dark-mode [style*="background:#fecdd3"] {
  background: rgba(220,38,38,0.12) !important;
  color: #fca5a5 !important;
}
body.dark-mode [style*="background:#fef3c7"],
body.dark-mode [style*="background: #fef3c7"] {
  background: rgba(217,119,6,0.12) !important;
  color: #fde68a !important;
}
body.dark-mode [style*="background:#dcfce7"],
body.dark-mode [style*="background: #dcfce7"] {
  background: rgba(22,163,74,0.12) !important;
  color: #86efac !important;
}

/* ── 内联背景覆盖 — 灰色轨道 / 条纹 ── */
body.dark-mode [style*="background:#e9ecef"],
body.dark-mode [style*="background: #e9ecef"],
body.dark-mode [style*="background-color:#e9ecef"],
body.dark-mode [style*="background:#eee"],
body.dark-mode [style*="background: #eee"],
body.dark-mode [style*="background:#f1f5f9"],
body.dark-mode [style*="background: #f1f5f9"],
body.dark-mode [style*="background-color:#f1f5f9"] {
  background: var(--surface-3) !important;
  color: var(--text-primary) !important;
}

/* ── 文字颜色覆盖 — 深色模式下的黑字 ── */
body.dark-mode [style*="color:#000"],
body.dark-mode [style*="color: #000"],
body.dark-mode [style*="color:black"],
body.dark-mode [style*="color: black"],
body.dark-mode [style*="color:#333"],
body.dark-mode [style*="color: #333"],
body.dark-mode [style*="color:#212529"],
body.dark-mode [style*="color: #212529"],
body.dark-mode [style*="color:#334155"],
body.dark-mode [style*="color: #334155"],
body.dark-mode [style*="color:#1e293b"],
body.dark-mode [style*="color: #1e293b"],
body.dark-mode [style*="color:#475569"],
body.dark-mode [style*="color: #475569"] {
  color: var(--text-primary) !important;
}

/* ── 内联深色文字覆盖 ── */
body.dark-mode [style*="color:#991b1b"] { color: #fca5a5 !important; }
body.dark-mode [style*="color:#92400e"] { color: #fde68a !important; }
body.dark-mode [style*="color:#166534"] { color: #86efac !important; }
body.dark-mode [style*="color:#1d4ed8"] { color: #93c5fd !important; }
body.dark-mode [style*="color:#94a3b8"] { color: #94a3b8 !important; }

/* ── Bootstrap 文本类覆盖 ── */
body.dark-mode .text-body   { color: var(--text-primary) !important; }
body.dark-mode .text-black  { color: var(--text-primary) !important; }
body.dark-mode .text-black-50 { color: var(--text-secondary) !important; }

/* ── 表单额外覆盖 ── */
body.dark-mode .form-floating > label { color: var(--text-tertiary); }
body.dark-mode .form-floating > .form-control:focus ~ label { color: var(--text-secondary); }
body.dark-mode .form-range::-webkit-slider-runnable-track { background: var(--surface-3); }
body.dark-mode .form-range::-webkit-slider-thumb { background: var(--primary); }
body.dark-mode .form-switch .form-check-input { background-color: var(--surface-3); border-color: var(--border); }
body.dark-mode .form-switch .form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
body.dark-mode .form-check-input { background-color: var(--surface-0); border-color: var(--border); }
body.dark-mode .form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* ── Toast / 通知 ── */
body.dark-mode .toast { background: var(--surface-1); color: var(--text-primary); border-color: var(--border); }
body.dark-mode .toast-header { background: var(--surface-2); color: var(--text-primary); border-color: var(--border); }

/* ── 标签页内容区 ── */
body.dark-mode .tab-content { background: transparent; color: var(--text-primary); }
body.dark-mode .tab-pane { color: var(--text-primary); }

/* ── 统计卡片图标 ── */
body.dark-mode .stat-icon { opacity: 0.7; }

/* ── 搜索与筛选栏 ── */
body.dark-mode .filter-bar,
body.dark-mode .search-bar { background: var(--surface-1); border-color: var(--border); }

/* ── 空状态 ── */
body.dark-mode .empty-state-block { color: var(--text-secondary); }
body.dark-mode .empty-state-block i { color: var(--text-tertiary); }

/* ── 进度条 ── */
body.dark-mode .progress-bar-gradient-red { background: linear-gradient(90deg, #dc2626, #f87171); }
body.dark-mode .progress-bar-gradient-blue { background: linear-gradient(90deg, #2563eb, #60a5fa); }
body.dark-mode .progress-bar-gradient-green { background: linear-gradient(90deg, #16a34a, #4ade80); }
body.dark-mode .progress-bar-gradient-yellow { background: linear-gradient(90deg, #d97706, #fbbf24); }

/* ── 边框加强 ── */
body.dark-mode .border-start { border-color: var(--border) !important; }
body.dark-mode .border-end   { border-color: var(--border) !important; }

/* ── Well / 区块背景 ── */
body.dark-mode .well,
body.dark-mode .bg-body-tertiary { background: var(--surface-0) !important; color: var(--text-primary) !important; }

/* ── 工作台项交互 ── */
.workbench-item { cursor: pointer; transition: background var(--ease-fast), transform var(--ease-fast); }
.workbench-item:hover { background: var(--surface-2); transform: translateX(2px); }
body.dark-mode .workbench-item:hover { background: var(--surface-2); }

/* ═══ 主题色 ═══ */
body[data-accent="green"]  {
  --primary: #16a34a; --primary-dark: #15803d; --primary-light: #dcfce7;
  --primary-glow: rgba(22,163,74,0.18); --sidebar-active: #16a34a;
}
body[data-accent="purple"] {
  --primary: #7c3aed; --primary-dark: #6d28d9; --primary-light: #ede9fe;
  --primary-glow: rgba(124,58,237,0.18); --sidebar-active: #7c3aed;
}
body[data-accent="orange"] {
  --primary: #ea580c; --primary-dark: #c2410c; --primary-light: #ffedd5;
  --primary-glow: rgba(234,88,12,0.18); --sidebar-active: #ea580c;
}
body[data-accent="red"]    {
  --primary: #dc2626; --primary-dark: #b91c1c; --primary-light: #fee2e2;
  --primary-glow: rgba(220,38,38,0.18); --sidebar-active: #dc2626;
}
body[data-accent="teal"]   {
  --primary: #0d9488; --primary-dark: #0f766e; --primary-light: #ccfbf1;
  --primary-glow: rgba(13,148,136,0.18); --sidebar-active: #0d9488;
}

/* ═══ 字体大小 ═══ */
body[data-fontsize="small"] { font-size: 12px; }
body[data-fontsize="large"] { font-size: 16px; }

/* ═══ 密度模式 ═══ */
body[data-density="compact"] .card-body          { padding: 0.6rem 0.75rem; }
body[data-density="compact"] .p-3                { padding: 0.5rem !important; }
body[data-density="compact"] .table td,
body[data-density="compact"] .table th           { padding: 0.3rem 0.5rem; }
body[data-density="compact"] .nav-item           { padding: 0.4rem 0.75rem; }

body[data-density="loose"]   .card-body          { padding: 1.5rem; }
body[data-density="loose"]   .table td,
body[data-density="loose"]   .table th           { padding: 0.75rem 1rem; }
body[data-density="loose"]   .nav-item           { padding: 0.8rem 1rem; }

/* ═══ 模板管理 ═══ */
.template-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: box-shadow var(--ease-normal), border-color var(--ease-normal),
              transform var(--ease-normal);
  cursor: default;
}
.template-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.template-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--surface-2);
  font-size: 13px;
  transition: background var(--ease-fast), transform var(--ease-fast);
}
.template-item-row:last-child { border-bottom: none; }
.template-item-row:hover      { background: var(--surface-2); transform: translateX(2px); }
.drag-handle { color: #cbd5e1; cursor: grab; font-size: 16px; }

/* ── Case Detail Card System ── */
.case-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 768px) { .case-grid { grid-template-columns: 1fr; } }

.case-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 48px;
  border-radius: var(--radius-md);
  padding: 4px;
  transition: background var(--ease-fast), outline var(--ease-fast);
}
.case-col.drop-target {
  background: rgba(37,99,235,0.04);
  outline: 2px dashed rgba(37,99,235,0.35);
  outline-offset: 2px;
}

/* Case卡片入场动画 */
.case-card-wrap {
  border-radius: var(--radius-md);
  transition: box-shadow var(--ease-normal), transform var(--ease-normal);
  animation: slideInUp 0.3s var(--ease-normal) both;
}
.case-col > .case-card-wrap:nth-child(1) { animation-delay: 0ms; }
.case-col > .case-card-wrap:nth-child(2) { animation-delay: 60ms; }
.case-col > .case-card-wrap:nth-child(3) { animation-delay: 120ms; }
.case-col > .case-card-wrap:nth-child(4) { animation-delay: 180ms; }
.case-col > .case-card-wrap:nth-child(n+5) { animation-delay: 220ms; }

.case-card-wrap:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.case-card-wrap.is-dragging  { opacity: 0.4; box-shadow: var(--shadow-xl); transform: rotate(1.5deg) scale(1.02); }
.case-card-wrap.drop-before  { border-top: 3px solid var(--primary); }
.case-card-wrap.drop-after   { border-bottom: 3px solid var(--primary); }

.case-card-handle {
  cursor: grab;
  color: #cbd5e1;
  font-size: 1.05rem;
  padding: 0 3px;
  flex-shrink: 0;
  transition: color var(--ease-fast), transform var(--ease-fast);
}
.case-card-handle:hover  { color: var(--primary); transform: scale(1.2); }
.case-card-handle:active { cursor: grabbing; }

.case-card-btn {
  background: none;
  border: none;
  padding: 2px 5px;
  cursor: pointer;
  color: #adb5bd;
  border-radius: 4px;
  font-size: 0.75rem;
  line-height: 1.5;
  transition: color var(--ease-fast), background var(--ease-fast), transform var(--ease-fast);
}
.case-card-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.1);
}
.case-card-body.is-collapsed { display: none; }

.case-locked-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px dashed var(--surface-3);
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  transition: background var(--ease-fast), border-color var(--ease-fast);
}
.case-locked-hint:hover {
  background: var(--primary-light);
  border-color: var(--border-focus);
  color: var(--primary);
}

/* ═══ 时间线节点增强 ═══ */
/* 流程时间线卡片 */
/* 让 dropdown 菜单不受卡片 overflow 裁剪 */
.case-card-body .dropdown-menu, .tab-pane .dropdown-menu { position: fixed !important; z-index: 1060; }

.card .d-flex.overflow-auto {
  scrollbar-width: thin;
}

/* ═══ 数据分析页卡片强化 ═══ */
.col-md-3 .card.text-center,
.col-6.col-md-3 .card.text-center {
  transition: transform var(--ease-spring), box-shadow var(--ease-normal);
  position: relative;
  overflow: hidden;
}
.col-md-3 .card.text-center:hover,
.col-6.col-md-3 .card.text-center:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* 数据卡片左侧装饰条 */
.col-md-3 .card.text-center.border-primary::after { content:''; position:absolute; left:0; top:20%; bottom:20%; width:3px; background:var(--primary); border-radius:0 3px 3px 0; }
.col-md-3 .card.text-center.border-danger::after  { content:''; position:absolute; left:0; top:20%; bottom:20%; width:3px; background:var(--danger); border-radius:0 3px 3px 0; }
.col-md-3 .card.text-center.border-warning::after { content:''; position:absolute; left:0; top:20%; bottom:20%; width:3px; background:#f59e0b; border-radius:0 3px 3px 0; }
.col-md-3 .card.text-center.border-info::after    { content:''; position:absolute; left:0; top:20%; bottom:20%; width:3px; background:var(--info); border-radius:0 3px 3px 0; }
.col-md-3 .card.text-center.border-success::after { content:''; position:absolute; left:0; top:20%; bottom:20%; width:3px; background:var(--success); border-radius:0 3px 3px 0; }

/* 数字大值动画 */
.fs-2.fw-bold, .fs-5.fw-bold {
  animation: countUp 0.5s var(--ease-spring) both;
}

/* ═══ 筛选 Chip 按钮 ═══ */
#intakeFilterBar .btn {
  border-radius: var(--radius-pill);
  transition: all var(--ease-fast), transform var(--ease-spring);
}
#intakeFilterBar .btn:hover {
  transform: translateY(-1px) scale(1.04);
}
#intakeFilterBar .btn:active {
  transform: scale(0.97);
}

/* ═══ 深色模式 Case 卡片 ═══ */
body.dark-mode .case-col.drop-target { background: rgba(37,99,235,0.08); }
body.dark-mode .case-card-btn:hover  { color: #60a5fa; background: rgba(37,99,235,0.15); }
body.dark-mode .case-locked-hint { background: #263145; border-color: #475569; color: #64748b; }
body.dark-mode .case-locked-hint:hover { background: rgba(37,99,235,0.15); border-color: #60a5fa; color: #93c5fd; }

/* 深色模式数据卡片 */
body.dark-mode .col-md-3 .card.text-center { background: #1e293b; }
body.dark-mode .col-6.col-md-3 .card.text-center { background: #1e293b; }

/* 深色模式 - 关闭案例遮罩 */
body.dark-mode .case-card-wrap .card.border-secondary { background: rgba(30,41,59,0.7); }

/* ═══════════════════════════════════════════════════
   D-01  字号工具类
   ═══════════════════════════════════════════════════ */
.text-xs  { font-size: .75rem; }
.text-sm  { font-size: .85rem; }
.text-2xs { font-size: .70rem; }

/* ═══════════════════════════════════════════════════
   D-06  统一页面标题 .page-header
   ═══════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-bottom: .75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.page-header h5,
.page-header h4 {
  margin: 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary, #1e293b);
}
.page-header .page-header-actions {
  margin-left: auto;
  display: flex;
  gap: .4rem;
  align-items: center;
}
body.dark-mode .page-header { border-color: #334155; }
body.dark-mode .page-header h5,
body.dark-mode .page-header h4 { color: #e2e8f0; }

/* ═══════════════════════════════════════════════════
   D-05 / D-08  分组标题 .form-section-title
   ═══════════════════════════════════════════════════ */
.form-section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-secondary, #64748b);
  border-bottom: 1px solid var(--border);
  padding-bottom: .25rem;
  margin-top: 1rem;
  margin-bottom: .6rem;
}

/* ═══════════════════════════════════════════════════
   D-17  文件交换卡片 .fx-record
   ═══════════════════════════════════════════════════ */
.fx-record {
  background: var(--surface-1, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  padding: .6rem .75rem;
  margin-bottom: .5rem;
  transition: box-shadow var(--ease-fast, 150ms);
}
.fx-record:hover { box-shadow: var(--shadow-sm); }
.fx-record-title { font-size: .875rem; font-weight: 500; }
.fx-record-meta  { font-size: .75rem; color: var(--text-secondary, #64748b); }
body.dark-mode .fx-record { background: #1e293b; border-color: #334155; }

/* ═══════════════════════════════════════════════════
   D-02  文件交换操作按钮溢出菜单
   ═══════════════════════════════════════════════════ */
.fx-actions { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.fx-actions .btn { padding: .15rem .4rem; font-size: .75rem; line-height: 1.4; }

/* ═══════════════════════════════════════════════════
   D-09  空状态组件 .empty-state / .empty-state-sm
   ═══════════════════════════════════════════════════ */
.empty-state-sm {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  color: var(--text-secondary, #64748b);
  text-align: center;
}
.empty-state-sm i { font-size: 1.5rem; margin-bottom: .4rem; opacity: .5; }
.empty-state-sm p { margin: 0; font-size: .8rem; }

/* ═══════════════════════════════════════════════════
   D-10  骨架屏 Skeleton loading (如未定义)
   ═══════════════════════════════════════════════════ */
.skeleton-row {
  display: flex; gap: .75rem; align-items: center; padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}
.skeleton-row .skeleton { border-radius: var(--radius-sm, 4px); background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s infinite; }
@keyframes skeleton-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
body.dark-mode .skeleton-row .skeleton { background: linear-gradient(90deg,#334155 25%,#475569 50%,#334155 75%); background-size:200% 100%; animation: skeleton-shimmer 1.4s infinite; }

/* ═══════════════════════════════════════════════════
   D-12  时间线节点
   ═══════════════════════════════════════════════════ */
.timeline-list { list-style: none; padding: 0; margin: 0; }
.timeline-list li {
  display: flex;
  gap: .75rem;
  padding-bottom: 1rem;
  position: relative;
}
.timeline-list li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-node {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
  background: var(--surface-2, #f1f5f9);
  border: 2px solid var(--border);
  color: var(--text-secondary, #64748b);
}
.timeline-node.active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
}
.timeline-node.done {
  background: #dcfce7;
  border-color: #22c55e;
  color: #16a34a;
}
@media (max-width: 576px) {
  .timeline-list li { flex-direction: column; padding-left: 0; }
  .timeline-list li::before { display: none; }
}
body.dark-mode .timeline-node { background: #1e293b; border-color: #475569; color: #94a3b8; }
body.dark-mode .timeline-node.done { background: #14532d; border-color: #22c55e; color: #4ade80; }

/* ═══════════════════════════════════════════════════
   D-20  学生姓名链接悬停提示
   ═══════════════════════════════════════════════════ */
.student-name-link {
  color: var(--primary, #2563eb);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color var(--ease-fast, 150ms);
}
.student-name-link:hover {
  border-bottom-color: var(--primary, #2563eb);
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════
   Overview Grid — 可拖拽卡片布局
   ═══════════════════════════════════════════════════ */
/* ═══ Student Cockpit — Hero Header ═══ */
.stu-hero {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem 1rem;
  margin: -16px -16px 0;
}

/* ═══ 入学线衔接 ribbon（学生详情页顶部） ═══
 * 让"在校学生 ← → 入学手续"双向可视化连接，呼应侧边栏的"学生"分组联动设计 (T-canonical S3-4)
 */
.stu-intake-ribbon {
  background: linear-gradient(95deg, #A51C30 0%, #6e1220 100%);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  margin: -4px -4px 14px;
  box-shadow: 0 2px 6px rgba(165, 28, 48, .25);
}
.stu-intake-ribbon-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.stu-intake-ribbon-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255,255,255,.18);
  padding: 3px 10px;
  border-radius: 12px;
}
.stu-intake-ribbon-meta {
  font-size: 12.5px;
  color: rgba(255,255,255,.85);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stu-intake-ribbon-jump {
  font-size: 11.5px !important;
  padding: 3px 10px !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.45) !important;
}
.stu-intake-ribbon-jump:hover {
  background: rgba(255,255,255,.18) !important;
  border-color: #fff !important;
}
.stu-intake-ribbon-bar {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}
.stu-intake-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  min-width: 48px;
}
.stu-intake-stage-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255,255,255,.18);
  color: rgba(255,255,255,.7);
  border: 1.5px solid rgba(255,255,255,.35);
}
.stu-intake-stage.done .stu-intake-stage-dot {
  background: #fff;
  color: #A51C30;
  border-color: #fff;
}
.stu-intake-stage.current .stu-intake-stage-dot {
  background: #fbbf24;
  color: #6e1220;
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .35);
}
.stu-intake-stage-label {
  font-size: 10px;
  color: rgba(255,255,255,.7);
  white-space: nowrap;
}
.stu-intake-stage.done .stu-intake-stage-label { color: rgba(255,255,255,.95); }
.stu-intake-stage.current .stu-intake-stage-label { color: #fff; font-weight: 700; }
.stu-intake-stage-line {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,.2);
  margin: -16px 2px 0;
  min-width: 12px;
}
.stu-intake-stage-line.done { background: rgba(255,255,255,.7); }
.stu-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}
.stu-hero-identity {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}
.stu-hero-identity h4 { margin: 0; font-weight: 700; font-size: 1.25rem; white-space: nowrap; }
.stu-hero-identity .badge { font-size: .7rem; font-weight: 500; }
.stu-hero-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
/* Stage indicator */
.stu-stage-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: .75rem;
}
.stu-stage-step {
  display: flex;
  align-items: center;
  gap: 0;
}
.stu-stage-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--surface-1);
  color: var(--text-tertiary);
  transition: all var(--ease-normal);
}
.stu-stage-dot.done {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.stu-stage-dot.current {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 79,70,229), .15);
}
.stu-stage-line {
  width: 32px;
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
}
.stu-stage-line.done { background: var(--primary); }
.stu-stage-label {
  font-size: .68rem;
  color: var(--text-tertiary);
  margin-top: 2px;
  text-align: center;
  white-space: nowrap;
}
.stu-stage-label.current { color: var(--primary); font-weight: 600; }
.stu-stage-label.done { color: var(--text-secondary); }
/* Alert strip */
.stu-alert-strip {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.stu-alert-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .7rem;
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 600;
}
.stu-alert-chip.danger { background: #fef2f2; color: #dc2626; }
.stu-alert-chip.warning { background: #fffbeb; color: #d97706; }
.stu-alert-chip.info { background: #eff6ff; color: #2563eb; }
.stu-alert-chip.success { background: #f0fdf4; color: #16a34a; }

/* ═══ Student Cockpit — 2-zone layout ═══ */
.stu-cockpit {
  display: flex;
  gap: 1.5rem;
  padding-top: 1.25rem;
  align-items: flex-start;
}
.stu-main {
  flex: 1;
  min-width: 0;
}
.stu-sidebar {
  width: 320px;
  flex-shrink: 0;
}
@media (max-width: 992px) {
  .stu-cockpit { flex-direction: column; }
  .stu-sidebar { width: 100%; }
}

/* Section titles — uppercase, spaced, muted */
.stu-section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: .625rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.stu-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Main-zone sections — no card shell, clean separation */
.stu-main-section {
  margin-bottom: 1.5rem;
}
.stu-main-section:last-child { margin-bottom: 0; }

/* Task row — compact actionable item */
.stu-task-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  transition: background var(--ease-fast);
}
.stu-task-row:hover { background: var(--surface-2); }
.stu-task-row + .stu-task-row { border-top: 1px solid var(--border); }
.stu-task-title { flex: 1; min-width: 0; font-size: .82rem; }
.stu-task-title.overdue { color: #dc2626; font-weight: 600; }
.stu-task-meta { font-size: .72rem; color: var(--text-tertiary); white-space: nowrap; }

/* Application row */
.stu-app-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
}
.stu-app-row + .stu-app-row { border-top: 1px solid var(--border); }
.stu-app-uni { font-size: .82rem; font-weight: 600; color: var(--text-primary); min-width: 100px; }
.stu-app-dept { flex: 1; font-size: .78rem; color: var(--text-secondary); min-width: 0; }

/* Competitiveness compact bars */
.stu-comp-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
}
.stu-comp-row:last-child { margin-bottom: 0; }
.stu-comp-label { font-size: .75rem; color: var(--text-secondary); width: 48px; flex-shrink: 0; text-align: right; }
.stu-comp-bar { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.stu-comp-fill { height: 100%; border-radius: 3px; transition: width .6s ease; }
.stu-comp-fill.high { background: #16a34a; }
.stu-comp-fill.medium { background: #2563eb; }
.stu-comp-fill.low { background: #d1d5db; }
.stu-comp-pct { font-size: .72rem; font-weight: 600; width: 32px; text-align: right; color: var(--text-secondary); }

/* ═══ Sidebar modules — borderless, compact ═══ */
.stu-sb-module {
  margin-bottom: 1.25rem;
}
.stu-sb-module:last-child { margin-bottom: 0; }
.stu-sb-title {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stu-sb-title i { color: var(--text-tertiary); margin-right: .35rem; }
.stu-sb-btn {
  background: none;
  border: none;
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: .75rem;
  transition: color var(--ease-fast), background var(--ease-fast);
}
.stu-sb-btn:hover { color: var(--primary); background: var(--primary-light); }
/* Sidebar info table — more compact */
.stu-sb-table {
  width: 100%;
  font-size: .8rem;
  border-collapse: collapse;
}
.stu-sb-table th {
  padding: .3rem 0;
  color: var(--text-tertiary);
  font-weight: 500;
  width: 70px;
  vertical-align: top;
}
.stu-sb-table td {
  padding: .3rem 0;
  color: var(--text-primary);
}
.stu-sb-table tr + tr th,
.stu-sb-table tr + tr td { border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
/* Sidebar team row */
.stu-sb-team-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem 0;
}
.stu-sb-team-row + .stu-sb-team-row { border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.stu-sb-team-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .7rem;
  flex-shrink: 0;
}
/* Sidebar target list */
.stu-sb-target {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem 0;
  font-size: .8rem;
}
.stu-sb-target + .stu-sb-target { border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
/* Sidebar assessment */
.stu-sb-assess {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem 0;
  font-size: .8rem;
}
.stu-sb-assess + .stu-sb-assess { border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.stu-sb-assess-score { font-weight: 700; color: var(--primary); font-size: .9rem; }
/* Pending items — consolidated empty state */
.stu-pending-items {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: .75rem;
}
.stu-pending-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .55rem;
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-pill);
  font-size: .72rem;
  color: var(--text-tertiary);
  margin: .15rem;
}

/* Legacy ov- classes kept for other pages */
.ov-card-btn {
  background: none; border: none; padding: 3px 6px; border-radius: 5px;
  color: var(--text-tertiary); cursor: pointer; font-size: .875rem; line-height: 1;
  transition: color var(--ease-fast), background var(--ease-fast);
}
.ov-card-btn:hover { color: var(--primary); background: var(--primary-light); }
.ov-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.5rem; color: var(--text-tertiary); font-size: .8rem; gap: .4rem;
}
.ov-empty i { font-size: 1.5rem; }
.ov-score { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.ov-subject-tag {
  display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: .8rem; color: var(--text-primary);
}
.ov-subject-tag .tag-remove {
  background: none; border: none; padding: 0; color: var(--text-tertiary);
  cursor: pointer; font-size: .7rem; line-height: 1; margin-left: .1rem;
}
.ov-subject-tag .tag-remove:hover { color: #dc2626; }

/* ═══ Intake Master-Detail Layout ═══ */
.intake-master-detail {
  display: flex;
  gap: 0;
  height: calc(100vh - var(--topnav-height) - 24px);
  margin: -12px;
}
.intake-list-panel {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #fafbfc;
}
.intake-list-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.intake-list-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px;
}
.intake-detail-panel {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  background: #fff;
  min-width: 0; /* 防止 flex 子元素撑破 */
}

/* Case card in list */
.case-card {
  padding: 8px 10px;
  margin-bottom: 3px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}
.case-card:hover { background: #eef2ff; border-color: #c7d2fe; }
.case-card.active {
  background: #e0e7ff;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  /* 让 active card 视觉上"延伸到"右侧详情面板 —— 用一根从卡片右边伸到面板边界的连接条
     表示「这张卡 → 这块详情」的对应关系 */
  position: relative;
  z-index: 2;
}
/* active card 右侧的连接箭头：从卡片伸进 list-panel 与 detail-panel 之间的边界，
   然后通过覆盖 list-panel 的 border-right 让卡片视觉上"贯通"到详情面板。
   尺寸按 list-panel border-right=1px 计算。 */
.case-card.active::after {
  content: '';
  position: absolute;
  right: -10px;          /* 卡片右边到 list-panel 内沿的距离 + 1px 边框 */
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-style: solid;
  border-width: 7px 0 7px 9px;
  border-color: transparent transparent transparent var(--primary);
  filter: drop-shadow(1px 0 0 var(--primary));
  pointer-events: none;
}
/* active card 右边一根细线：把它的右边界遮住 list-panel 的边线，让两个面板"接通" */
.case-card.active::before {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 2px;
  background: var(--primary);
  pointer-events: none;
}
/* 详情面板顶端加一条从左侧延伸过来的"接收"线，配合 active card 的箭头形成"流向" */
.intake-detail-panel.has-active-case {
  box-shadow: inset 4px 0 0 0 #e0e7ff;
}
.case-card-main { flex: 1; min-width: 0; }
.case-card-name {
  font-weight: 600; font-size: .85rem; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.case-card-sub {
  font-size: .72rem; color: #94a3b8; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.case-card-meta { font-size: .68rem; color: #94a3b8; margin-top: 3px; }
/* 跳转到在校档案的小箭头按钮 —— 在 case-card 右侧出现，event.stopPropagation 避免触发父卡的 showCaseDetail */
.case-card-jump {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 1.05rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  padding: 0;
}
.case-card-jump:hover {
  background: rgba(165, 28, 48, .12);
  color: #A51C30;
  transform: translateX(2px);
}
.case-card.active .case-card-jump { color: #4338ca; }
.case-card.active .case-card-jump:hover { background: rgba(67, 56, 202, .12); color: #3730a3; }

/* ── Detail header ── */
.case-detail-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
  flex-wrap: nowrap;
}
.case-detail-header--panel {
  margin-bottom: .5rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.case-detail-header .min-width-0 { min-width: 0; }

/* ── Detail inner layout (side-by-side full page / stacked in panel) ── */
.case-detail-inner {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  min-height: 60vh;
}
/* Full-page mode: side panel */
.case-side-fixed { width: 300px; flex-shrink: 0; }
.case-side-card {
  position: sticky; top: 70px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

/* ── Panel-mode: summary strip (replaces side panel) ── */
.case-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.css-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: .75rem;
  white-space: nowrap;
  color: #64748b;
}
.css-chip .badge { font-size: .6rem; padding: 2px 5px; }
/* chip 内 badge 保持原有语义色但降饱和 */
.css-chip-btn {
  background: none; border: none; padding: 0 2px;
  color: #cbd5e1; cursor: pointer; font-size: .68rem;
}
.css-chip-btn:hover { color: #4f46e5; }

/* ═══ Color System Override: Muted Palette ═══ */
/* 所有 badge 在 detail panel 内降为低饱和 */
.intake-detail-panel .badge.bg-primary   { background: #e0e7ff !important; color: #3730a3 !important; }
.intake-detail-panel .badge.bg-success   { background: #dcfce7 !important; color: #166534 !important; }
.intake-detail-panel .badge.bg-warning   { background: #fef3c7 !important; color: #92400e !important; }
.intake-detail-panel .badge.bg-danger    { background: #fee2e2 !important; color: #991b1b !important; }
.intake-detail-panel .badge.bg-info      { background: #e0f2fe !important; color: #075985 !important; }
.intake-detail-panel .badge.bg-secondary { background: #f1f5f9 !important; color: #475569 !important; }
.intake-detail-panel .badge.bg-dark      { background: #e2e8f0 !important; color: #1e293b !important; }
/* 左侧列表 badge 同样降饱和 */
.intake-list-panel .badge.bg-primary   { background: #e0e7ff !important; color: #3730a3 !important; }
.intake-list-panel .badge.bg-success   { background: #dcfce7 !important; color: #166534 !important; }
.intake-list-panel .badge.bg-warning   { background: #fef3c7 !important; color: #92400e !important; }
.intake-list-panel .badge.bg-info      { background: #e0f2fe !important; color: #075985 !important; }
.intake-list-panel .badge.bg-secondary { background: #f1f5f9 !important; color: #475569 !important; }
.intake-list-panel .badge.bg-dark      { background: #e2e8f0 !important; color: #1e293b !important; }
/* 左侧筛选按钮 - 全部中性化 */
.intake-list-header .btn { font-size: .7rem !important; padding: 1px 7px !important;
  background: #fff !important; color: #64748b !important;
  border: 1px solid #e2e8f0 !important; }
.intake-list-header .btn.active-filter {
  background: #4f46e5 !important; color: #fff !important;
  border-color: #4f46e5 !important; }
/* Alert banners 降噪 */
.intake-detail-panel .alert {
  font-size: .8rem; padding: .5rem .75rem;
  background: #f8fafc !important; border: 1px solid #e2e8f0 !important;
  color: #475569 !important; }
.intake-detail-panel .alert .fs-4,
.intake-detail-panel .alert i { font-size: 1rem !important; color: #94a3b8 !important; }
.intake-detail-panel .alert .fw-semibold { color: #334155 !important; }

/* ── Panel-mode: 内容适配 ── */
.intake-detail-panel .card { border-radius: 8px; border-color: #e5e7eb; }
.intake-detail-panel .border.rounded.p-3 { padding: .625rem !important; border-color: #e5e7eb !important; }
.intake-detail-panel .card-body { padding: .625rem .75rem; }
.intake-detail-panel .card-header { padding: .5rem .75rem; }

/* ═══ Next Action Bar ═══ */
.next-action-bar {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  transition: all .15s;
}
.next-action-action {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
}
.next-action-action:hover { background: #e0e7ff; }
.next-action-warn {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
}
.next-action-done {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}
.next-action-muted {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  color: #64748b;
}
body.dark-mode .next-action-action { background: #1e1b4b; border-color: #4338ca; color: #a5b4fc; }
body.dark-mode .next-action-warn { background: #451a03; border-color: #92400e; color: #fcd34d; }
body.dark-mode .next-action-done { background: #052e16; border-color: #166534; color: #86efac; }
body.dark-mode .next-action-muted { background: #1e1e2e; border-color: var(--border); color: #64748b; }

/* ═══ Lightweight Timeline ═══ */
.tl-strip {
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow-x: auto;
}
.tl-step { display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; flex-shrink: 0; z-index: 1;
  border: 2px solid #e2e8f0; background: #fff; color: #94a3b8;
}
.tl-done { background: #dcfce7; border-color: #86efac; color: #166534; }
.tl-current { background: #4f46e5; border-color: #4f46e5; color: #fff;
  box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.tl-future { background: #fff; border-color: #e2e8f0; color: #cbd5e1; }
.tl-clickable { cursor: pointer; padding: 0; }
.tl-clickable:hover { transform: scale(1.1); box-shadow: 0 0 0 3px rgba(79,70,229,.2); }
.tl-line { height: 2px; flex: 1; background: #e5e7eb; min-width: 8px; }
.tl-line-done { background: #86efac; }
.tl-label {
  margin-top: 3px; color: #94a3b8; text-align: center;
  white-space: nowrap; font-size: .65rem;
}
.tl-label-current { color: #4f46e5; font-weight: 600; }
body.dark-mode .tl-strip { background: #1e1e2e; border-color: var(--border); }
body.dark-mode .tl-dot { background: #252538; border-color: #3a3a5a; color: #64748b; }
body.dark-mode .tl-done { background: #14532d; border-color: #22c55e; color: #86efac; }
body.dark-mode .tl-current { background: #4f46e5; border-color: #4f46e5; }
body.dark-mode .tl-line { background: #3a3a5a; }
body.dark-mode .tl-line-done { background: #22c55e; }
body.dark-mode .tl-label { color: #64748b; }
body.dark-mode .tl-label-current { color: #818cf8; }

/* ── 内容区：增强区块结构 ── */
.intake-detail-panel .border.rounded {
  font-size: .85rem;
  background: #fafbfc;
  border-color: #e5e7eb !important;
}
.intake-detail-panel .progress { height: 4px !important; }
.intake-detail-panel h6 { font-size: .85rem; }
.intake-detail-panel table { font-size: .82rem; }
.intake-detail-panel table th,
.intake-detail-panel table td { padding: .35rem .5rem; }
.intake-detail-panel .btn-sm { font-size: .78rem; padding: .2rem .5rem; }
.intake-detail-panel .badge { font-size: .7rem; }

/* 移动端：堆叠布局 */
@media (max-width: 768px) {
  .intake-master-detail { flex-direction: column; height: auto; }
  .intake-list-panel {
    width: 100%; max-height: 40vh;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .case-detail-inner { flex-direction: column; }
  .case-side-fixed { width: 100% !important; }
  /* 移动端 timeline 增大触摸目标 */
  .tl-dot { width: 26px; height: 26px; font-size: .7rem; }
  .tl-label { font-size: .6rem; max-width: 56px; overflow: hidden; text-overflow: ellipsis; }
  .tl-strip { padding: 8px 6px; gap: 2px; }
  /* 入学手续卡片内按钮不换行 (T-canonical S3-4) */
  .intake-detail-panel .btn { white-space: nowrap; }
  /* 材料列表文件名截断 */
  .intake-detail-panel .text-truncate { max-width: 120px; display: inline-block; vertical-align: middle; }
}

/* ═══ Dark mode: Master-Detail ═══ */
body.dark-mode .intake-list-panel { background: #1e1e2e; border-color: var(--border); }
body.dark-mode .intake-list-header { background: #252538; border-color: var(--border); }
body.dark-mode .intake-detail-panel { background: #1a1a2e; }
body.dark-mode .case-detail-header--panel { border-color: var(--border); }
body.dark-mode .case-summary-strip { background: #1e1e2e; border-color: var(--border); }
body.dark-mode .css-chip { background: #252538; border-color: #3a3a5a; color: #e2e8f0; }
body.dark-mode .css-chip-btn { color: #64748b; }
body.dark-mode .case-card:hover { background: #2a2a4a; border-color: #4a4a6a; }
body.dark-mode .case-card.active {
  background: #2e2e5a; border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
body.dark-mode .case-card-name { color: #e2e8f0; }
body.dark-mode .case-card-sub,
body.dark-mode .case-card-meta { color: #64748b; }

/* Scrollbar styling for list panel */
.intake-list-body::-webkit-scrollbar { width: 4px; }
.intake-list-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.intake-list-body::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
body.dark-mode .intake-list-body::-webkit-scrollbar-thumb { background: #475569; }

/* Detail panel: scrollbar */
.intake-detail-panel::-webkit-scrollbar { width: 5px; }
.intake-detail-panel::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
body.dark-mode .intake-detail-panel::-webkit-scrollbar-thumb { background: #475569; }

/* Detail panel smooth transition */
.intake-detail-panel > * { animation: fadeInDetail .2s ease; }
@keyframes fadeInDetail {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   UI 一致性改造 — 全局工具类
   ═══════════════════════════════════════════════════════════════════ */

/* ── 软色徽章（pill 样式）── */
.badge-pill { border-radius: var(--radius-pill); padding: .25em .65em; }
.badge-soft-primary   { background: #dbeafe; color: #1d4ed8; }
.badge-soft-success   { background: #dcfce7; color: #166534; }
.badge-soft-warning   { background: #fef3c7; color: #92400e; }
.badge-soft-danger    { background: #fee2e2; color: #991b1b; }
.badge-soft-info      { background: #e0f2fe; color: #075985; }
.badge-soft-secondary { background: #f1f5f9; color: #475569; }

/* ── 进度条渐变 ── */
/* @deprecated: 用 .ds-progress + .ds-progress--brand   替代 (public/css/components.css §11) */
.progress-bar-gradient-blue    { background: linear-gradient(90deg, #3b82f6, #2563eb) !important; }
/* @deprecated: 用 .ds-progress + .ds-progress--success 替代 */
.progress-bar-gradient-green   { background: linear-gradient(90deg, #4ade80, #16a34a) !important; }
/* @deprecated: 用 .ds-progress + .ds-progress--danger  替代 */
.progress-bar-gradient-red     { background: linear-gradient(90deg, #f87171, #dc2626) !important; }
/* @deprecated: 用 .ds-progress + .ds-progress--warning 替代 */
.progress-bar-gradient-yellow  { background: linear-gradient(90deg, #fbbf24, #d97706) !important; }
/* @deprecated: 用 .ds-progress + .ds-progress--brand   替代 (紫色作 brand 替代) */
.progress-bar-gradient-purple  { background: linear-gradient(90deg, #a78bfa, #7c3aed) !important; }

/* ── 卡片 hover 抬升效果（可选加在交互式卡片上）── */
.card-hover-lift { transition: transform var(--ease-fast), box-shadow var(--ease-fast); }
.card-hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ── 柔和的次要按钮 ── */
.btn-outline-muted {
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: transparent;
  transition: all var(--ease-fast);
}
.btn-outline-muted:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ── 内容区块卡片标题栏 ── */
.content-section-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-secondary);
}
.content-section-header i { font-size: 1rem; opacity: .7; }

/* ── 统一空状态 ── */
.empty-state-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  color: var(--text-tertiary);
  text-align: center;
}
.empty-state-block i { font-size: 2.5rem; margin-bottom: .75rem; opacity: .3; }
.empty-state-block p { margin: 0 0 .5rem; font-size: .875rem; }
.empty-state-block .btn { margin-top: .5rem; }

/* ── 竞争力分数条（渐变色动态）── */
.competitiveness-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
}
.competitiveness-bar .bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width .6s ease;
}
.bar-fill-low    { background: linear-gradient(90deg, #f87171, #ef4444); }
.bar-fill-medium { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.bar-fill-high   { background: linear-gradient(90deg, #4ade80, #22c55e); }


/* ── 操作图标按钮（表格内）── */
.action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: .875rem;
  cursor: pointer;
  transition: all var(--ease-fast);
}
.action-icon-btn:hover { background: var(--primary-light); color: var(--primary); }
.action-icon-btn.danger:hover { background: #fee2e2; color: #dc2626; }

/* ── 筛选标签组 ── */
/* @deprecated: 用 .ds-chip-group 替代 (public/css/components.css §12) */
.filter-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* @deprecated: 用 .ds-chip + .ds-chip--filter 替代 */
.filter-chip {
  padding: .25rem .75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease-fast);
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
/* @deprecated: 用 .ds-chip.ds-chip--active 替代 */
.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── 深色模式: 新工具类适配 ── */
body.dark-mode .badge-soft-primary   { background: rgba(37,99,235,0.2);  color: #93c5fd; }
body.dark-mode .badge-soft-success   { background: rgba(22,163,74,0.2);  color: #86efac; }
body.dark-mode .badge-soft-warning   { background: rgba(217,119,6,0.2);  color: #fcd34d; }
body.dark-mode .badge-soft-danger    { background: rgba(220,38,38,0.2);  color: #fca5a5; }
body.dark-mode .badge-soft-info      { background: rgba(2,132,199,0.2);  color: #7dd3fc; }
body.dark-mode .badge-soft-secondary { background: rgba(100,116,139,0.2); color: #94a3b8; }
body.dark-mode .filter-chip          { background: var(--surface-2); border-color: var(--border); color: var(--text-secondary); }
body.dark-mode .filter-chip.active   { background: var(--primary); border-color: var(--primary); color: #fff; }
body.dark-mode .action-icon-btn      { color: var(--text-secondary); }
body.dark-mode .action-icon-btn:hover { background: rgba(37,99,235,0.15); color: #93c5fd; }
body.dark-mode .action-icon-btn.danger:hover { background: rgba(220,38,38,0.15); color: #fca5a5; }
body.dark-mode .competitiveness-bar  { background: var(--surface-3); }
body.dark-mode .content-section-header { color: var(--text-secondary); border-color: var(--border); }
body.dark-mode .empty-state-block    { color: var(--text-tertiary); }

/* ═══════════════════════════════════════════════════════════════════
   通用 Master-Detail 布局 — 从 Intake Cases 抽象
   ═══════════════════════════════════════════════════════════════════ */
.md-layout {
  display: flex;
  gap: 0;
  height: calc(100vh - var(--topnav-height) - 24px);
  margin: -12px;
}
.md-list {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #fafbfc;
}
.md-list-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.md-list-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px;
}
.md-detail {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  background: #fff;
}
/* List item */
.md-item {
  padding: 10px 12px;
  margin-bottom: 3px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
}
.md-item:hover { background: #eef2ff; border-color: #c7d2fe; }
.md-item.active {
  background: #e0e7ff;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.md-item-name {
  font-weight: 600; font-size: .85rem; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.md-item-sub {
  font-size: .75rem; color: var(--text-tertiary); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.md-item-badge {
  font-size: .7rem; margin-top: 3px;
}
/* Scrollbar */
.md-list-body::-webkit-scrollbar { width: 4px; }
.md-list-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.md-detail::-webkit-scrollbar { width: 5px; }
.md-detail::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
/* Detail placeholder */
.md-empty-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-tertiary);
  min-height: 400px;
}
.md-empty-detail i { font-size: 3rem; opacity: .2; }
.md-empty-detail p { margin-top: .5rem; font-size: .9rem; }
/* Responsive */
@media (max-width: 768px) {
  .md-layout { flex-direction: column; height: auto; }
  .md-list { width: 100%; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--border); }
}
/* Dark mode */
body.dark-mode .md-list { background: #1e1e2e; border-color: var(--border); }
body.dark-mode .md-list-header { background: #252538; border-color: var(--border); }
body.dark-mode .md-detail { background: #1a1a2e; }
body.dark-mode .md-item:hover { background: #2a2a4a; border-color: #4a4a6a; }
body.dark-mode .md-item.active { background: #2e2e5a; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
body.dark-mode .md-item-name { color: #e2e8f0; }
body.dark-mode .md-item-sub { color: #64748b; }
body.dark-mode .md-list-body::-webkit-scrollbar-thumb { background: #475569; }
body.dark-mode .md-detail::-webkit-scrollbar-thumb { background: #475569; }

/* ── Settings vertical nav layout ── */
.settings-layout {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  min-height: calc(100vh - 180px);
}
.settings-nav {
  width: 220px;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: calc(100vh - 160px);
}
.settings-nav .nav-pills {
  flex-wrap: nowrap !important;
}
.settings-nav .nav-pills .nav-link {
  color: var(--text-secondary);
  font-size: .85rem;
  padding: .45rem .75rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
}
.settings-nav .nav-pills .nav-link:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}
.settings-nav .nav-pills .nav-link.active {
  background: var(--primary);
  color: #fff;
}
.settings-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}
body.dark-mode .settings-nav .nav-pills .nav-link { color: var(--text-secondary); }
body.dark-mode .settings-nav .nav-pills .nav-link:hover { background: #2a2a4a; color: var(--text-primary); }
body.dark-mode .settings-nav .nav-pills .nav-link.active { background: var(--primary); color: #fff; }

/* ── Stat Card v2: dark mode ── */
body.dark-mode .stat-card {
  background: var(--surface-1);
  border-color: var(--border);
}
body.dark-mode .stat-value { color: var(--text-primary); }
body.dark-mode .stat-label { color: var(--text-secondary); }

/* ── 快捷关注列表 (Dashboard) ── */
.attention-list { list-style: none; padding: 0; margin: 0; }
.attention-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  transition: background var(--ease-fast);
}
.attention-list li:last-child { border-bottom: none; }
.attention-list li:hover { background: var(--surface-2); }
.attention-list .att-name { font-weight: 600; color: var(--text-primary); }
.attention-list .att-desc { font-size: .75rem; color: var(--text-secondary); margin-top: 2px; }
.attention-list .att-action { flex-shrink: 0; margin-left: 8px; }
body.dark-mode .attention-list li { border-color: var(--border); }
body.dark-mode .attention-list li:hover { background: var(--surface-2); }
body.dark-mode .attention-list .att-name { color: var(--text-primary); }
body.dark-mode .attention-list .att-desc { color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════
   补充暗色模式适配
   ═══════════════════════════════════════════════════════ */

/* ── 登录页 ── */
body.dark-mode .login-card {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
}
body.dark-mode .login-card h2,
body.dark-mode .login-card .title { color: #f1f5f9; }
body.dark-mode .login-card .subtitle,
body.dark-mode .login-card p { color: #94a3b8; }
body.dark-mode .login-card label { color: #cbd5e1; }
body.dark-mode .login-card .form-control {
  background: #0f172a; border-color: #475569; color: #e2e8f0;
}
body.dark-mode .login-card .form-control::placeholder { color: #4b5563; }

/* ── 全局: inline bg-light / alert-light / #f8f9fa 覆盖 ── */
body.dark-mode .bg-light,
body.dark-mode .alert-light {
  background-color: var(--surface-2) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}
body.dark-mode [style*="background:#f8f9fa"],
body.dark-mode [style*="background:#fafafa"],
body.dark-mode [style*="background:#fafbfc"],
body.dark-mode [style*="background:#f8fafc"],
body.dark-mode [style*="background:#f8fdf8"],
body.dark-mode [style*="background: #f8f9fa"],
body.dark-mode [style*="background: #fafafa"] {
  background: var(--surface-2) !important;
  color: var(--text-primary) !important;
}
/* 表格 th 的 inline background */
body.dark-mode th[style*="background:#f8f9fa"] {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}
body.dark-mode td[style*="border:1px solid #dee2e6"] {
  border-color: var(--border) !important;
}

/* ── 入学总览仪表盘: 底部卡片 ── */
body.dark-mode .intake-dash-card,
body.dark-mode .border.rounded.p-3[style*="background"] {
  background: var(--surface-1) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

/* ── 入学手续详情: 材料收集区块 (T-canonical S3-4) ── */
body.dark-mode .intake-detail-panel .border.rounded {
  background: var(--surface-1) !important;
  border-color: var(--border) !important;
}
body.dark-mode .intake-detail-panel .border.rounded p,
body.dark-mode .intake-detail-panel .border.rounded span,
body.dark-mode .intake-detail-panel .border.rounded div { color: var(--text-primary); }
body.dark-mode .intake-detail-panel .text-muted { color: var(--text-secondary) !important; }

/* ── badge bg-light ── */
body.dark-mode .badge.bg-light {
  background: var(--surface-3) !important;
  color: var(--text-primary) !important;
}
body.dark-mode .badge.bg-light.text-dark { color: var(--text-primary) !important; }

/* ── input-group-text inline styles ── */
body.dark-mode [style*="background:#f8fafc"].input-group-text,
body.dark-mode .input-group-text[style] {
  background: var(--surface-0) !important;
  border-color: #475569 !important;
  color: var(--text-secondary) !important;
}

/* ── 文件发送回复区 ── */
body.dark-mode #fxReplyWrap {
  background: var(--surface-1) !important;
  border-color: var(--border) !important;
}

/* ── 移交/只读提示条 ── */
body.dark-mode div[style*="background:#f8fafc"][style*="border-radius"] {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

/* ── 通用 text-dark 在暗色下的修正 ── */
body.dark-mode .text-dark { color: var(--text-primary) !important; }
body.dark-mode .border { border-color: var(--border) !important; }

/* ── 下拉菜单 ── */
body.dark-mode .dropdown-menu {
  background: var(--surface-1); border-color: var(--border); color: var(--text-primary);
}
body.dark-mode .dropdown-item { color: var(--text-primary); }
body.dark-mode .dropdown-item:hover { background: var(--surface-2); }

/* ── popover / tooltip ── */
body.dark-mode .popover { background: var(--surface-1); border-color: var(--border); }
body.dark-mode .popover-body { color: var(--text-primary); }
body.dark-mode .tooltip-inner { background: var(--surface-2); color: var(--text-primary); }

/* ── list-group ── */
body.dark-mode .list-group-item {
  background: var(--surface-1); border-color: var(--border); color: var(--text-primary);
}
body.dark-mode .list-group-item:hover { background: var(--surface-2); }

/* ── accordion ── */
body.dark-mode .accordion-item { background: var(--surface-1); border-color: var(--border); }
body.dark-mode .accordion-button { background: var(--surface-2); color: var(--text-primary); }
body.dark-mode .accordion-button:not(.collapsed) { background: var(--surface-2); color: var(--primary); }
body.dark-mode .accordion-body { background: var(--surface-1); color: var(--text-primary); }

/* ═══════════════════════════════════════════════════
   A11Y-01  全局焦点指示器 (WCAG 2.4.7 Level AA)
   ═══════════════════════════════════════════════════ */
*:focus:not(:focus-visible) { outline: none; }
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}
body.dark-mode *:focus-visible {
  outline-color: #60a5fa;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow), 0 0 0 1px var(--primary);
}
#sidebar .nav-item:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: -2px;
  background: var(--sidebar-hover);
}

/* ═══════════════════════════════════════════════════
   A11Y-02  prefers-reduced-motion (WCAG 2.3.3)
   ═══════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════
   A11Y-03  可点击 div/span 键盘交互
   ═══════════════════════════════════════════════════ */
[role="button"] { cursor: pointer; }
[role="button"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════
   A11Y-04  最小字号约束 — 确保不低于 11px
   ═══════════════════════════════════════════════════ */
.badge { font-size: max(11px, 0.69rem); }
.text-2xs { font-size: max(11px, 0.70rem); }

/* ═══════════════════════════════════════════════════
   R-01  通知面板移动端响应式
   ═══════════════════════════════════════════════════ */
#notif-panel {
  max-width: calc(100vw - 32px);
}
@media (max-width: 480px) {
  #notif-panel {
    width: calc(100vw - 32px) !important;
    right: 16px !important;
    left: 16px !important;
    max-height: 70vh !important;
  }
}

/* ═══════════════════════════════════════════════════
   R-02  搜索输入框移动端自适应
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .page-header input[type="text"],
  .page-header input[type="search"],
  .page-header .form-control,
  .page-header .form-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

/* ═══════════════════════════════════════════════════
   R-03  触摸目标最小 44px (WCAG 2.5.5)
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .action-icon-btn {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  .btn-xs {
    min-height: 36px;
    padding: 6px 10px;
  }
  #notif-bell-btn {
    width: 44px !important;
    height: 44px !important;
  }
}

/* ═══════════════════════════════════════════════════
   R-04  统计卡片中等屏幕适配
   ═══════════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1200px) {
  .stat-card .stat-value { font-size: 1.5rem; }
}

/* ═══════════════════════════════════════════════════
   UX-01  表单实时验证反馈样式
   ═══════════════════════════════════════════════════ */
.form-control.is-invalid-live,
.form-select.is-invalid-live {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}
.form-control.is-invalid-live:focus,
.form-select.is-invalid-live:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.25);
}
.field-error-msg {
  color: var(--danger);
  font-size: 12px;
  margin-top: 2px;
  display: none;
}
.field-error-msg.show { display: block; }

/* ═══════════════════════════════════════════════════
   UX-02  页面错误重试按钮样式
   ═══════════════════════════════════════════════════ */
.error-retry-block {
  text-align: center;
  padding: 2rem;
}
.error-retry-block .alert {
  display: inline-block;
  max-width: 500px;
  text-align: left;
}
.error-retry-block .btn-retry {
  margin-top: 0.75rem;
}

/* ═══════════════════════════════════════════════════
   UX-03  空状态 CTA 按钮
   ═══════════════════════════════════════════════════ */
.empty-state-sm .empty-state-cta {
  margin-top: 0.75rem;
}
.empty-state .empty-state-cta {
  margin-top: 1rem;
}

/* ═══════════════════════════════════════════════════
   UX-04  骨架屏加载样式补充
   ═══════════════════════════════════════════════════ */
.skeleton-stat-card {
  height: 90px;
  border-radius: var(--radius-md);
}
.skeleton-table-row {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.skeleton-table-row .skeleton-cell {
  height: 14px;
  border-radius: 4px;
  flex: 1;
}
.skeleton-table-row .skeleton-cell-sm { flex: 0 0 60px; }
.skeleton-table-row .skeleton-cell-md { flex: 0 0 120px; }

/* ═══════════════════════════════════════════════════
   A11Y-05  深色模式侧边栏对比度增强
   ═══════════════════════════════════════════════════ */
body.dark-mode .nav-section-title { color: #94a3b8 !important; }
body.dark-mode #sidebar .nav-item { color: #cbd5e1; }
body.dark-mode #sidebar .nav-item.active { color: #93c5fd; }

/* ═══════════════════════════════════════════════════
   UX-05  仪表盘 KPI Δ 趋势徽章
   ═══════════════════════════════════════════════════ */
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  line-height: 1;
  margin-top: 4px;
}
.kpi-delta-good {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}
.kpi-delta-bad {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}
.kpi-delta-flat {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-secondary);
}
body.dark-mode .kpi-delta-good { background: rgba(34, 197, 94, 0.18); color: #4ade80; }
body.dark-mode .kpi-delta-bad  { background: rgba(248, 113, 113, 0.18); color: #f87171; }

/* stat-card 内 Δ 徽章定位：不破坏现有布局 */
.stat-card .kpi-delta {
  position: absolute;
  right: 1rem;
  bottom: 0.75rem;
}

/* ═══════════════════════════════════════════════════
   UX-06  Cmd+K 命令面板
   ═══════════════════════════════════════════════════ */
#cmdk-palette[aria-hidden="false"] { display: flex !important; }
#cmdk-palette.cmdk-open { display: flex !important; animation: fadeIn 0.16s ease both; }
.cmdk-panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  animation: modalEnter 0.22s var(--ease-spring) both;
}
#cmdk-input {
  background: transparent !important;
  outline: none !important;
}
#cmdk-input:focus {
  box-shadow: none !important;
  transform: none !important;
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 1px solid var(--border);
  transition: background var(--ease-fast);
  color: var(--text-primary);
  text-align: left;
  width: 100%;
}
.cmdk-item:last-child { border-bottom: none; }
.cmdk-item:hover,
.cmdk-item.cmdk-active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
}
.cmdk-item .cmdk-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}
.cmdk-item.cmdk-active .cmdk-icon { background: var(--primary); color: white; }
.cmdk-item .cmdk-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}
.cmdk-item .cmdk-hint {
  font-size: 11px;
  color: var(--text-tertiary);
}
.cmdk-group-title {
  padding: 6px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--surface-0);
}
kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-secondary);
  box-shadow: 0 1px 0 var(--border);
}
body.dark-mode .cmdk-panel { background: var(--surface-1); }
body.dark-mode kbd {
  background: var(--surface-0);
  border-color: var(--border);
  color: var(--text-secondary);
}

/* ═══ Stat Card Small (课程/选课页) ═══ */
.stat-card-sm {
  background: var(--surface-1, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  padding: .6rem .85rem;
  height: 100%;
}
.stat-card-sm .stat-label-sm {
  font-size: .7rem;
  color: var(--text-tertiary, #6b7280);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: .2rem;
}
.stat-card-sm .stat-value-sm {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
}
body.dark-mode .stat-card-sm { background: var(--surface-1); border-color: var(--border); }

/* ═══ AI 助手 Markdown 渲染样式 ═══
 * 仅作用于 .agent-md 容器内的 markdown 渲染输出。
 * 设计：紧凑、可读，跟聊天气泡 bg-light 协调。
 */
.agent-md { line-height: 1.6; }
.agent-md > *:first-child { margin-top: 0; }
.agent-md > *:last-child  { margin-bottom: 0; }

.agent-md .agent-md-p {
  margin: 0.35em 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-md .agent-md-h {
  font-weight: 700;
  margin: 0.6em 0 0.3em;
  color: #1e293b;
  line-height: 1.35;
}
.agent-md .agent-md-h1 { font-size: 1.15rem; }
.agent-md .agent-md-h2 { font-size: 1.05rem; }
.agent-md .agent-md-h3 { font-size: 0.98rem; }
.agent-md .agent-md-h4 { font-size: 0.92rem; color: #475569; }

.agent-md .agent-md-ul,
.agent-md .agent-md-ol {
  padding-left: 1.5em;
  margin: 0.35em 0;
}
.agent-md .agent-md-ul li,
.agent-md .agent-md-ol li {
  margin: 0.15em 0;
}
.agent-md .agent-md-ul { list-style-type: disc; }
.agent-md .agent-md-ol { list-style-type: decimal; }

.agent-md .agent-md-code {
  background: rgba(165, 28, 48, 0.08);
  color: #A51C30;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", monospace;
  font-size: 0.88em;
}
.agent-md .agent-md-pre {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0.5em 0;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.5;
}
.agent-md .agent-md-pre code {
  background: transparent;
  color: #1e293b;
  padding: 0;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", monospace;
}

.agent-md .agent-md-table {
  border-collapse: collapse;
  margin: 0.5em 0;
  width: 100%;
  font-size: 0.85rem;
}
.agent-md .agent-md-table th,
.agent-md .agent-md-table td {
  border: 1px solid #cbd5e1;
  padding: 5px 9px;
  text-align: left;
  vertical-align: top;
}
.agent-md .agent-md-table th {
  background: #f1f5f9;
  font-weight: 600;
  color: #334155;
}
.agent-md .agent-md-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.agent-md .agent-md-hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 0.7em 0;
}

.agent-md strong { font-weight: 700; color: #1e293b; }
.agent-md em { font-style: italic; }
.agent-md a { color: #A51C30; text-decoration: underline; }
.agent-md a:hover { color: #6e1220; }

/* 深色模式适配 */
body.dark-mode .agent-md .agent-md-h { color: #f1f5f9; }
body.dark-mode .agent-md .agent-md-h4 { color: #cbd5e1; }
body.dark-mode .agent-md .agent-md-pre {
  background: #1e293b; border-color: #334155;
}
body.dark-mode .agent-md .agent-md-pre code { color: #f1f5f9; }
body.dark-mode .agent-md .agent-md-table th { background: #1e293b; color: #cbd5e1; }
body.dark-mode .agent-md .agent-md-table th,
body.dark-mode .agent-md .agent-md-table td { border-color: #334155; }
body.dark-mode .agent-md .agent-md-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
body.dark-mode .agent-md strong { color: #f1f5f9; }
body.dark-mode .agent-md .agent-md-hr { border-top-color: #334155; }

/* -------------------------------------------------------
   S4-2 Reports Center (Sprint 4 Agent S4-2) — all selectors prefixed with .report-
   ------------------------------------------------------- */
.report-page-root { padding: 1rem 1.25rem 2rem; }
.report-page-root.d-none { display: none; }
.report-page-header h4 { color: #0f172a; font-weight: 600; }
.report-card { border: 1px solid #e5e7eb; box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: box-shadow .15s; }
.report-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.report-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.report-card-title { flex: 1; min-width: 0; }
.report-card-title h6 { font-weight: 600; color: #1f2937; line-height: 1.3; }
.report-card-desc { font-size: .75rem; line-height: 1.35; margin-top: 2px; }
.report-csv-btn { font-size: .72rem; padding: 2px 8px; white-space: nowrap; }
.report-filter-row { display: flex; gap: .375rem; margin-top: .5rem; align-items: center; flex-wrap: wrap; }
.report-filter-row .form-select, .report-filter-row .form-control { flex: 1; min-width: 90px; font-size: .82rem; }
.report-load-btn { font-size: .78rem; padding: 3px 10px; }
.report-card-body { min-height: 60px; }
.report-summary { display: flex; flex-wrap: wrap; gap: .75rem; padding: .5rem .25rem; font-size: .78rem; color: #4b5563; border-bottom: 1px dashed #e5e7eb; margin-bottom: .5rem; }
.report-summary b { color: #111827; margin-left: 2px; font-weight: 600; }
.report-table-wrap { max-height: 260px; overflow: auto; }
.report-table { font-size: .78rem; }
.report-table th { background: #f9fafb; font-weight: 600; color: #374151; position: sticky; top: 0; z-index: 1; }
.report-table td { padding: .35rem .5rem; }
.report-stack-bar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; background: #f3f4f6; }
.report-stack-seg { transition: opacity .15s; }
.report-stack-seg:hover { opacity: 0.7; }
.report-legend { display: flex; flex-wrap: wrap; gap: .5rem .75rem; margin-top: .4rem; font-size: .72rem; color: #4b5563; }
.report-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.report-legend-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.report-sm-entity { margin-bottom: .85rem; }
.report-sm-entity:last-child { margin-bottom: 0; }
.report-sm-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .25rem; font-size: .82rem; color: #1f2937; }
.report-page-footer { padding-top: .75rem; border-top: 1px solid #e5e7eb; }

/* dark-mode compatibility */
body.dark-mode .report-card { background: #1e293b; border-color: #334155; }
body.dark-mode .report-card-title h6 { color: #f1f5f9; }
body.dark-mode .report-card-desc { color: #94a3b8; }
body.dark-mode .report-summary { color: #cbd5e1; border-bottom-color: #334155; }
body.dark-mode .report-summary b { color: #f1f5f9; }
body.dark-mode .report-table th { background: #0f172a; color: #cbd5e1; }
body.dark-mode .report-table td { color: #e2e8f0; border-color: #334155; }
body.dark-mode .report-stack-bar { background: #334155; }
body.dark-mode .report-legend { color: #94a3b8; }
body.dark-mode .report-sm-title { color: #e2e8f0; }
body.dark-mode .report-page-footer { border-top-color: #334155; color: #94a3b8; }

/* ═══════════════════════════════════════════════════
   S6-3  A11Y — WCAG 2.1 AA Fixes (Sprint 6)
   – .sr-only / .sr-only-focusable     (Bootstrap-compatible)
   – .skip-link                         (WCAG 2.4.1 Bypass Blocks)
   – Enhanced *:focus-visible ring      (WCAG 2.4.7 Focus Visible)
   ═══════════════════════════════════════════════════ */
/* Screen-reader-only utility (visually hidden, still announced). */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.sr-only-focusable:focus,
.sr-only-focusable:focus-visible,
.sr-only-focusable:active {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
}

/* Skip-to-main link — only visible when focused via keyboard. */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  z-index: 10000;
  background: var(--primary, #2563eb);
  color: #fff;
  padding: 8px 14px;
  border-radius: 0 0 6px 6px;
  font-weight: 600;
  text-decoration: none;
  font-size: var(--font-size-sm, 0.875rem);
  transition: top 0.15s ease-out;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
  color: #fff;
}

/* Stronger keyboard focus ring across the app — 3px @ AAA contrast. */
*:focus-visible {
  outline: 3px solid var(--primary, #2563eb) !important;
  outline-offset: 2px !important;
  border-radius: 3px;
}
body.dark-mode *:focus-visible {
  outline-color: #60a5fa !important;
}
/* :focus-visible inside dialogs uses brand-gold for max contrast on tinted overlays. */
[role="dialog"] *:focus-visible,
.modal *:focus-visible {
  outline-color: #f59e0b !important;
}

/* ════════════════════════════════════════════════════════════
   AF-33: Chart color tokens (consumed by reports.js / analytics)
   Light + dark theme aware; F4 references these via getComputedStyle.
   ════════════════════════════════════════════════════════════ */
:root {
  --chart-axis: #6b7280;
  --chart-text: #111827;
  --chart-series-1: #2563eb;
  --chart-series-2: #16a34a;
  --chart-series-3: #ea580c;
  --chart-series-4: #9333ea;
  --chart-series-5: #d97706;
  --chart-bg: #ffffff;
}
body.dark-mode, [data-theme="dark"] {
  --chart-axis: #9ca3af;
  --chart-text: #e5e7eb;
  --chart-series-1: #60a5fa;
  --chart-series-2: #4ade80;
  --chart-series-3: #fb923c;
  --chart-series-4: #c084fc;
  --chart-series-5: #fbbf24;
  --chart-bg: #1f2937;
}

