/* ============================================
   教学反馈助手 — 样式文件
   ============================================ */
/* 不引 Google Fonts：file:// 离线打开会导致字体加载阻塞 */

:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --primary-glow: rgba(79, 70, 229, 0.25);
  --accent: #ec4899;          /* 玫红仅作品牌副色，不与 danger 冲突 */
  --accent-light: #f9a8d4;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-subtle: #f1f5f9;       /* 微弱底色，hover 用 */
  --text-primary: #0f172a;    /* slate-900：标题用更深 */
  --text-body: #1e293b;       /* slate-800：正文用 */
  --text-secondary: #475569;
  --text-muted: #64748b;      /* slate-500：调深一档过 WCAG AA（原 #94a3b8 对比度仅 2.85:1） */
  --border: rgba(15, 23, 42, 0.08);   /* 比原 slate 边框更冷 + 更细 */
  --border-light: rgba(15, 23, 42, 0.04);
  --border-strong: rgba(15, 23, 42, 0.16);  /* hover 时加深 */
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.12);
  --success-text: #047857;    /* emerald-700：浅底上做文字时用，对比度 ≥ 4.5:1 */
  --danger: #dc2626;          /* 危险/扣减独立成 red-600 */
  --danger-light: rgba(220, 38, 38, 0.1);
  --danger-text: #b91c1c;     /* red-700：扣减项数字浅底文字 */
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);
  --warning-text: #b45309;    /* amber-700：浅底上做文字时用 */
  /* 阴影做减法：仅 1px 下沉 + 极淡，去掉多层弥散阴影 */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 12px 32px rgba(15, 23, 42, 0.10);
  --shadow-colored: 0 4px 12px var(--primary-glow);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --transition: 0.18s ease-out;
  --transition-smooth: 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-main);
  color: var(--text-body);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 标题字距收紧（中英文系统字体专业化） */
h1, h2, h3,
.home-hero h2,
.home-stat-value,
.salary-hero-amount,
.fb-card-amount,
.sc-value {
  letter-spacing: -0.02em;
}
.home-stat-value, .home-hero h2 {
  letter-spacing: -0.025em;
}

/* ---- 背景装饰：极淡的静态渐变（不喧宾夺主）---- */
body::before {
  content: '';
  position: fixed;
  top: -300px; right: -300px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.04) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -350px; left: -250px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.03) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* ======== NAVIGATION ======== */
.main-nav {
  position: sticky; top: 16px; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 68px;
  margin: 0 32px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}
.nav-brand {
  display: flex; align-items: center; gap: 12px;
}
.nav-brand .nav-icon {
  font-size: 26px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(79, 70, 229, 0.2));
}
.nav-brand h1 {
  font-size: 19px; font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--primary-dark));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}

.nav-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 18px; font-weight: 700; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.nav-tabs {
  display: flex; gap: 6px;
  background: rgba(241, 245, 249, 0.5);
  padding: 6px; border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}
.nav-tab {
  padding: 8px 22px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: var(--transition-smooth);
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.nav-tab:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.8); }
.nav-tab.active {
  background: white; color: var(--primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

/* ======== MAIN CONTENT ======== */
/* 14 寸 3:2 屏(1680×1120) 是主用户机型,max-width 提到 1320 + padding 略收紧
   留白比例更协调. 16:9 大屏(1920+) 也仍居中不显空旷. */
.main-content {
  max-width: 1600px; margin: 0 auto;
  padding: 24px 48px; position: relative; z-index: 1;
}
.view { display: none; animation: fadeIn 0.3s ease; }
.view.active { display: block; }
.sub-view { display: none; animation: fadeIn 0.3s ease; }
.sub-view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.nav-right { display: flex; align-items: center; gap: 6px; }

/* ======== HOME PAGE ======== */
.home-hero {
  text-align: center;
  padding: 48px 20px 32px;
}
.home-hero h2 {
  font-size: 30px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}
.home-hero p {
  color: var(--text-secondary); font-size: 15px; margin-top: 8px;
}

/* ====== Home cozy hero (奶茶杏色 + 柔和光晕,Gemini 设计) ====== */
.home-hero-cozy {
  position: relative;
  max-width: 1500px;
  margin: 12px auto 28px;
  padding: 64px 80px 56px;
  background: linear-gradient(135deg, #FDFBF7 0%, #F8F3EA 100%);
  border-radius: 28px;
  box-shadow:
    0 20px 40px -16px rgba(212, 196, 179, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.6);
  overflow: hidden;
  text-align: left;
}
/* 右上角柔和暖珊瑚光晕(温暖核心,不抢戏) */
.home-hero-cozy::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(232, 160, 141, 0.18) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
/* 左下角第二个浅杏色光晕加深治愈感 */
.home-hero-cozy::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -40px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(220, 188, 156, 0.14) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.home-hero-cozy h2 {
  position: relative;
  font-family: 'LXGW WenKai', 'Kaiti SC', 'PingFang SC', serif;
  font-size: clamp(34px, 2vw, 44px);
  color: #5C4B43;
  margin: 0 0 20px 0;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.3;
  background: none;
  -webkit-text-fill-color: #5C4B43;
}
/* 标题尾的暖珊瑚小圆点(文艺收尾) */
.home-hero-cozy h2::after {
  content: '';
  display: inline-block;
  width: 9px; height: 9px;
  background-color: #E8A08D;
  border-radius: 50%;
  margin-left: 14px;
  transform: translateY(-8px);
}
.home-encouragement {
  position: relative;
  font-family: 'Plus Jakarta Sans', 'PingFang SC', system-ui, sans-serif;
  font-size: clamp(16px, 1.05vw, 19px);
  font-weight: 400;
  color: #8C7A70;
  margin: 0;
  line-height: 1.7;
  letter-spacing: 0.02em;
}
.home-encouragement-fade {
  animation: heroEncFade 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes heroEncFade {
  from { opacity: 0; transform: translateY(6px); filter: blur(2px); }
  to   { opacity: 1; transform: translateY(0);  filter: blur(0); }
}
@media (max-width: 720px) {
  .home-hero-cozy { padding: 36px 28px 32px; border-radius: 22px; }
  .home-hero-cozy h2 { font-size: 28px; margin-bottom: 12px; }
  .home-encouragement { font-size: 15px; }
}

/* 主页右上角设置按钮(浮动入口,nav 整条隐藏后这里收纳设置) */
.home-corner-btn {
  position: absolute;
  top: 16px; right: 24px;
  width: 40px; height: 40px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  z-index: 50;
  font-family: inherit;
}
.home-corner-btn:hover {
  transform: rotate(60deg);
  background: white;
  box-shadow: var(--shadow-md);
}
.home-corner-logout { right: 76px; }
.home-corner-logout:hover { transform: scale(1.08); color: var(--danger); }
#btn-logout { color: var(--danger-text); }
#btn-logout:hover { background: var(--danger-light); }

/* 家长等零可用模块角色的首页空状态 (显隐由 js/app.js syncHomeByRole 控制) */
.home-empty {
  max-width: 440px;
  margin: 80px auto 0;
  text-align: center;
  padding: 36px 28px;
  animation: heroEncFade 0.5s ease-out both;
}
.home-empty-emoji {
  font-size: 40px;
  margin-bottom: 8px;
  display: inline-block;
}
.home-empty h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.home-empty p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

/* 首次使用 onboarding(填老师姓名) */
.home-onboarding {
  max-width: 440px;
  margin: 60px auto 0;
  text-align: center;
  padding: 36px 28px;
  animation: heroEncFade 0.5s ease-out both;
}
.home-onboarding-emoji {
  font-size: 40px;
  margin-bottom: 8px;
  animation: wave 1.6s ease-in-out infinite;
  transform-origin: 70% 70%;
  display: inline-block;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}
.home-onboarding h2 {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  background: none;
  -webkit-text-fill-color: var(--text-primary);
  margin-bottom: 10px;
}
.home-onboarding > p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 22px;
}
.home-onboarding-form {
  display: flex; gap: 8px;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
}
.home-onboarding-form .form-input {
  flex: 1 1 200px;
  max-width: 240px;
  padding: 11px 14px;
  font-size: 15px;
}
.home-onboarding-form .btn {
  flex-shrink: 0;
  padding: 11px 20px;
}
.home-onboarding-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

/* 主页进入 stagger 动画(hero → cards → stats → recent),每段 0.15s 错开) */
@keyframes homeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
#home-view.view.active .home-hero-cozy { animation: homeIn 0.55s cubic-bezier(0.22,1,0.36,1) both; }
#home-view.view.active .home-cards     { animation: homeIn 0.55s cubic-bezier(0.22,1,0.36,1) 0.10s both; }
#home-view.view.active .home-stats     { animation: homeIn 0.55s cubic-bezier(0.22,1,0.36,1) 0.20s both; }
#home-view.view.active .home-recent    { animation: homeIn 0.55s cubic-bezier(0.22,1,0.36,1) 0.30s both; }
#home-view.view.active .home-corner-btn { animation: homeIn 0.55s ease-out 0.4s both; }

/* 重新触发动画的辅助 class:JS 切换添加/移除会把 animation 重置 */
#home-view.home-replay .home-hero-cozy,
#home-view.home-replay .home-cards,
#home-view.home-replay .home-stats,
#home-view.home-replay .home-recent {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  #home-view.view.active .home-hero-cozy,
  #home-view.view.active .home-cards,
  #home-view.view.active .home-stats,
  #home-view.view.active .home-recent,
  .home-encouragement-fade,
  .home-onboarding,
  .home-onboarding-emoji {
    animation: none !important;
  }
}
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 24px;
  max-width: 1500px;
  margin: 0 auto 32px;
}
.home-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: flex; align-items: center; gap: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}
.home-card::before {
  /* 渐变顶条改成左侧 2px 强调线条，更克制 */
  content: ''; position: absolute; top: 16px; left: 0;
  width: 2px; height: calc(100% - 32px);
  border-radius: 0 2px 2px 0;
  opacity: 0.7;
}
.home-card-salary::before {
  background: var(--success);
}
.home-card-feedback::before {
  background: var(--primary);
}
.home-card-paper::before {
  background: var(--accent);
}
.home-card-students::before {
  background: var(--warning, #f59e0b);
}
.home-card-tiku::before {
  background: #0d9488;
}
.home-card-grade::before {
  background: #7c3aed;
}
.home-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card);
}
.home-card:hover::before { opacity: 1; }
.home-card-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  filter: saturate(0.7) contrast(1.05);
}
.home-card-content { flex: 1; min-width: 0; }
.home-card-content h3 {
  font-size: 18px; font-weight: 700; margin-bottom: 6px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.home-card-content p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.home-card-arrow {
  font-size: 22px; color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}
.home-card:hover .home-card-arrow { color: var(--primary); transform: translateX(4px); }
.home-stats {
  max-width: 1500px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.home-stat {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.home-stat:hover {
  border-color: var(--border-strong);
  background: var(--bg-card);
}
.home-stat-danger:hover { border-color: var(--danger); }
.home-stat:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.home-stat-value {
  font-size: 28px; font-weight: 700; color: var(--primary);
  line-height: 1.1;
}
.home-stat-label {
  font-size: 12px; color: var(--text-secondary); margin-top: 6px;
}
.home-stat-muted .home-stat-value { color: var(--text-tertiary, var(--text-secondary)); }
.home-stat-danger .home-stat-value { color: var(--danger); }
.home-stat-danger { border-color: rgba(239, 68, 68, 0.25); }
.home-stat-danger::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--danger);
}
.home-recent {
  max-width: 1500px;
  margin: 28px auto 0;
}
.home-recent-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}
.home-recent-title {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.home-recent-more {
  appearance: none; background: none; border: none;
  font-size: 12px; color: var(--primary); cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
  font-family: inherit;
}
.home-recent-more:hover { background: var(--primary-glow); }
.home-recent-list {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.home-recent-row {
  appearance: none; background: none; border: none;
  width: 100%;
  display: grid;
  grid-template-columns: 70px 110px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
  text-align: left;
}
.home-recent-row:last-child { border-bottom: none; }
.home-recent-row:hover { background: var(--bg-main); }
.home-recent-date {
  font-size: 12px; color: var(--text-secondary);
  font-weight: 500;
}
.home-recent-date.is-today {
  color: var(--danger); font-weight: 600;
}
.home-recent-time {
  font-size: 12px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.home-recent-name {
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-recent-arrow {
  font-size: 12px; color: var(--primary);
  font-weight: 500;
  opacity: 0; transition: opacity 0.15s ease;
}
.home-recent-row:hover .home-recent-arrow { opacity: 1; }
.home-recent-empty {
  text-align: center;
  padding: 24px 16px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 14px;
}
@media (max-width: 600px) {
  .home-cards { grid-template-columns: 1fr; }
  .home-hero h2 { font-size: 24px; }
  .home-recent-row { grid-template-columns: 60px 90px 1fr; gap: 8px; padding: 10px 12px; }
  .home-recent-arrow { display: none; }
}

/* ======== WEEK NAVIGATOR ======== */
.quick-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
}
.quick-panel:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.quick-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.quick-panel-head h2 {
  font-size: 20px;
  line-height: 1.2;
}
.quick-panel-head p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}
.quick-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.quick-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.quick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-main);
}
.quick-item-main {
  min-width: 0;
}
.quick-item-name {
  font-weight: 700;
  font-size: 14px;
}
.quick-item-meta {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 2px;
}
.quick-empty {
  grid-column: 1 / -1;
  padding: 22px;
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-main);
  border-radius: var(--radius-md);
}

/* 待办清单 (课表页, 手动增删勾选) */
.todo-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}
.todo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.todo-head h2 { font-size: 18px; line-height: 1.2; }
.todo-add {
  display: flex;
  gap: 8px;
  flex: 1 1 260px;
  justify-content: flex-end;
}
.todo-input {
  flex: 1 1 auto;
  max-width: 360px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-main);
  font-size: 14px;
}
.todo-input:focus { outline: none; border-color: var(--primary); }
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}
.todo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-main);
}
.todo-check { width: 17px; height: 17px; flex-shrink: 0; cursor: pointer; }
.todo-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  word-break: break-word;
}
.todo-row.is-done .todo-text { text-decoration: line-through; color: var(--text-secondary); }
.todo-time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.todo-del {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}
.todo-del:hover { color: var(--danger, #e5484d); background: var(--bg-card); }
.todo-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-main);
  border-radius: var(--radius-md);
}
.todo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.todo-stat { color: var(--text-secondary); font-size: 13px; }

.week-navigator {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.week-nav-center {
  text-align: center;
}
.week-nav-center h2 {
  font-size: 20px; font-weight: 700; color: var(--text-primary);
}
.week-nav-center .week-range {
  font-size: 13px; color: var(--text-secondary); margin-top: 2px;
}
.week-nav-btn {
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: white; color: var(--text-secondary);
  font-size: 18px; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.week-nav-btn:hover {
  background: var(--primary); color: white;
  box-shadow: var(--shadow-md);
  transform: scale(1.05);
}

/* ======== WEEK GRID (时段×星期 网格课表) ======== */
/* 行 = 机构作息时段 (8:00-10:00 … 19:30-21:30, 午休/晚饭横条), 列 = 时间 + 周一~周日.
   窄屏不折行 — 整个网格横向滚动, 保持课表形态. */
.week-grid { overflow-x: auto; padding-bottom: 4px; }
.wg-table {
  display: grid;
  grid-template-columns: 84px repeat(7, minmax(118px, 1fr));
  min-width: 940px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
/* 表头: 浅底深字 (饱和色块太重), 今天 = 靛蓝染色 + 底部色条 */
.wg-corner, .wg-day-head {
  background: #f8fafc;
  color: var(--text-secondary);
  text-align: center;
  padding: 8px 4px;
  border-right: 1px solid var(--border-light);
  border-bottom: 2px solid var(--border-light);
}
.wg-corner {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.wg-day-head .day-name { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.wg-day-head .day-date { font-size: 15px; font-weight: 700; margin-top: 1px; color: var(--text-primary); }
.wg-day-head.today {
  background: #eef2ff;
  box-shadow: inset 0 -2px 0 var(--primary);
}
.wg-day-head.today .day-name, .wg-day-head.today .day-date { color: var(--primary); }
.wg-time {
  background: #fafbff;
  color: var(--text-secondary);
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 6px 4px;
  white-space: nowrap;
  border-top: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}
.wg-break {
  grid-column: 1 / -1;
  background: rgba(79, 70, 229, 0.07);
  color: var(--primary);
  text-align: center;
  font-size: 11px; font-weight: 600;
  letter-spacing: 6px;
  text-indent: 6px; /* 抵消最后一个字的 letter-spacing, 视觉居中 */
  padding: 3px 0;
  border-top: 1px solid var(--border-light);
}
.wg-cell {
  background: white;
  border-top: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  padding: 6px;
  min-height: 64px;
}
.wg-cell.today { background: rgba(79, 70, 229, 0.04); }
.wg-cell .schedule-card { margin-bottom: 6px; padding: 7px 9px; }
/* 内容行二选一: 💬已反馈内容(灰) / 🎯计划安排(米黄) */
.schedule-card .sc-content {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  margin: 4px 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.schedule-card .sc-content-plan { background: #fefce8; color: #854d0e; }
.wg-cell .schedule-card:last-of-type { margin-bottom: 4px; }
/* 格子内加课按钮: 平时隐身, 悬停格子时浮现; 触屏 (无 hover) 常显淡色 */
.wg-add {
  display: block;
  width: 100%;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px; line-height: 1.5;
  padding: 1px 0;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition);
}
.wg-cell:hover .wg-add { opacity: 1; }
.wg-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}
@media (hover: none) {
  .wg-add { opacity: 0.5; }
}

/* Schedule cards */
.schedule-card {
  background: var(--bg-card-solid);
  border-radius: var(--radius-md);
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
  cursor: pointer; transition: var(--transition);
  position: relative;
  overflow: hidden;
}
/* 课型染色：左边条 + 同色极浅底，扫一眼分清班型 */
.schedule-card[data-type="oneOnOne"] { border-left-color: #4f46e5; background: #f8f8fe; }
.schedule-card[data-type="trio"]     { border-left-color: #f59e0b; background: #fffaf0; }
.schedule-card[data-type="small"]    { border-left-color: #10b981; background: #f4fcf8; }
.schedule-card.schedule-card-ghost {
  border-left-color: #94a3b8;
  opacity: 0.6;
}
.schedule-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.4));
  opacity: 0; transition: var(--transition-smooth); pointer-events: none;
}
.schedule-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.schedule-card:hover::before { opacity: 1; }
/* 头行: 名字 + 右侧迷你状态徽章 */
.schedule-card .sc-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 6px;
}
.schedule-card .sc-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 2px;
}
.schedule-card .sc-time {
  font-size: 11.5px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.schedule-card .sc-badge {
  display: inline-block; padding: 1px 6px; border-radius: 99px;
  font-size: 10px; font-weight: 600;
  flex-shrink: 0; margin-top: 1px;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
/* 悬停时徽章淡出, 给右上角浮现的 ✏️/✕ 让位 (徽章与图标同占右上角) */
@media (hover: hover) {
  .schedule-card:hover .sc-badge { opacity: 0; }
}
.schedule-card .sc-type-tag {
  display: inline-flex; align-items: center;
  padding: 0 6px; border-radius: 99px;
  font-size: 10px; font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  white-space: nowrap;
}
.schedule-card[data-type="oneOnOne"] .sc-type-tag { color: #4f46e5; }
.schedule-card[data-type="trio"] .sc-type-tag     { color: #b45309; }
.schedule-card[data-type="small"] .sc-type-tag    { color: #047857; }
/* 备课/讲义自查开关: 灰 → 点一下变绿 */
.sc-prep { display: flex; gap: 5px; margin-top: 5px; }
.sc-prep-chip {
  font-size: 10px; line-height: 1.4;
  padding: 2px 6px; border-radius: 8px;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer; user-select: none;
  transition: var(--transition);
  white-space: nowrap;
}
.sc-prep-chip:hover { border-color: var(--primary-light); color: var(--primary); }
.sc-prep-chip.on { background: #f0fdf4; border-color: #86efac; color: #15803d; }
/* 编辑课程 modal 的"换车头"按钮（合班学生行末尾） */
.es-extra-row .es-make-main {
  margin-left: auto;
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  font-family: inherit;
}
.es-extra-row .es-make-main:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* CTA 二次降级(用户确认): 桌面端整个不显示 — 点卡片任意处本就能开反馈,
   窄格子底行 122px 已被备课/讲义开关占满, 悬浮按钮必压住🖨讲义截走点击 */
.sc-actions { display: none; }
.sc-primary {
  padding: 4px 12px;
  border: none;
  border-radius: 99px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
/* 触屏没有 hover、点卡片开反馈不直观: CTA 保留为文档流常驻全宽按钮 */
@media (hover: none) {
  .sc-actions { display: block; margin-top: 6px; }
  .sc-primary { width: 100%; }
}
.sc-badge.done { background: var(--success-light); color: var(--success-text); }
.sc-badge.done.legacy {
  background: rgba(107, 114, 128, 0.15);
  color: #4b5563;
}
.sc-badge.pending { background: var(--warning-light); color: var(--warning-text); }
.sc-badge.partial { background: rgba(99, 102, 241, 0.12); color: var(--primary); }
.schedule-card .sc-delete,
.schedule-card .sc-edit,
.schedule-card .sc-reschedule {
  position: absolute; top: 6px;
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: transparent; color: var(--text-muted);
  font-size: 14px; cursor: pointer; opacity: 0;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
/* 触屏没有 hover: 图标回到半透明常驻可点 (徽章不淡出, 维持原重叠现状) */
@media (hover: none) {
  .schedule-card .sc-delete,
  .schedule-card .sc-edit,
  .schedule-card .sc-reschedule { opacity: 0.45; }
}
.schedule-card .sc-delete { right: 6px; font-size: 15px; }
.schedule-card .sc-edit   { right: 38px; }
.schedule-card .sc-reschedule { right: 70px; font-size: 13px; }
.schedule-card:hover .sc-delete,
.schedule-card:hover .sc-edit,
.schedule-card:hover .sc-reschedule { opacity: 1; }
.schedule-card .sc-delete:hover { background: var(--danger-light); color: var(--danger); }
.schedule-card .sc-edit:hover { background: rgba(99, 102, 241, 0.12); color: var(--primary); }
.schedule-card .sc-reschedule:hover { background: rgba(13, 148, 136, 0.12); color: var(--primary); }

/* ======== 家长月报 (导出卡片) ======== */
.pr-settlement-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-main);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}
.pr-settlement-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--success);
}
.pr-card {
  width: 680px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin: 0 auto;
  font-variant-numeric: tabular-nums;
}
.pr-head { border-bottom: 2px solid var(--primary); padding-bottom: 10px; margin-bottom: 12px; }
.pr-title { font-size: 19px; font-weight: 700; color: var(--text-primary); }
.pr-sub { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.pr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pr-table th {
  text-align: left; font-weight: 600; color: var(--text-secondary);
  padding: 7px 8px; border-bottom: 1px solid var(--border); font-size: 12px;
}
.pr-table td { padding: 7px 8px; border-bottom: 1px solid var(--border-light); color: var(--text-primary); }
.pr-table tfoot td { border-bottom: none; border-top: 2px solid var(--border); font-weight: 700; padding-top: 10px; }
.pr-total { color: var(--primary); font-size: 16px; }
.pr-trial { color: #b45309; background: #fef3c7; border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.pr-content-row td { font-size: 11.5px; color: var(--text-muted); padding: 0 8px 7px; border-bottom: 1px solid var(--border-light); }
.pr-foot { margin-top: 12px; font-size: 11.5px; color: var(--text-muted); line-height: 1.8; }
.pr-warn { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 4px 10px; margin-bottom: 6px; }

/* ======== STUDENTS VIEW ======== */
.students-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.students-header h2 { font-size: 22px; font-weight: 700; }
.students-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.students-section {
  min-width: 0;
}
.students-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--border-light);
}
.students-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.students-section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}
.students-section-count {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}
.students-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.students-section-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 13px;
}
.student-card {
  background: var(--bg-card-solid); border-radius: var(--radius-xl);
  padding: 18px 18px 16px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition-smooth);
  display: flex; flex-direction: column; gap: 12px;
  /* 撑满 grid 行高，配合 footer 的 margin-top:auto 让同行各卡操作条底部对齐 */
  height: 100%;
  position: relative;
  overflow: hidden;
}
.student-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--primary-light);
}
.s-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.s-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 4px;
}
.student-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: white;
  flex-shrink: 0;
  /* 多字时给字一点呼吸空间，不顶到圆边 */
  padding: 0 2px;
  text-align: center;
  letter-spacing: 0;
  line-height: 1;
  /* 阴影让多字头像更立体 */
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), inset 0 -1px 0 rgba(0,0,0,0.06);
}
/* 字号根据头像内容长度自适应——填了多字简称的头像不会溢出圆 */
.student-avatar[data-len="3"] { font-size: 13px; letter-spacing: -0.3px; }
.student-avatar[data-len="4"] { font-size: 11px; letter-spacing: -0.5px; font-weight: 800; }
.student-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.student-info .s-name {
  font-size: 16px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.student-info .s-gender { font-size: 14px; line-height: 1; flex-shrink: 0; }

.fb-sync-content-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.fb-sync-content-row .fb-sync-hint {
  font-size: 12px; color: var(--text-secondary); flex: 1; min-width: 200px;
}

/* 上节反馈摘要折叠卡 */
.fb-last-card {
  margin-bottom: 14px;
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.fb-last-card-head {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: transparent; border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px; color: var(--text-secondary);
  text-align: left;
  transition: background 0.18s ease;
}
.fb-last-card-head:hover { background: rgba(245, 158, 11, 0.08); }
.fb-last-card-head .fb-last-icon { font-size: 14px; line-height: 1; }
.fb-last-card-head .fb-last-title { font-weight: 600; color: var(--text-primary); }
.fb-last-card-head .fb-last-meta { color: var(--text-muted); margin-left: 4px; }
.fb-last-card-head .fb-last-arrow {
  margin-left: auto; font-size: 11px; color: var(--text-muted);
  transition: transform 0.2s ease;
}
.fb-last-card.is-open .fb-last-card-head .fb-last-arrow { transform: rotate(180deg); }
.fb-last-card-body {
  display: none;
  padding: 4px 14px 14px;
  border-top: 1px solid rgba(245, 158, 11, 0.18);
  background: rgba(255, 251, 244, 0.6);
}
.fb-last-card.is-open .fb-last-card-body { display: block; }
.fb-last-section {
  margin-top: 10px;
}
.fb-last-section-h {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.4px; margin-bottom: 4px; text-transform: uppercase;
}
.fb-last-section-body {
  font-size: 13.5px; line-height: 1.6; color: var(--text-primary);
  white-space: pre-wrap; word-break: break-word;
}
.fb-last-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 12px;
}
.fb-last-actions .btn { font-size: 12.5px; padding: 6px 12px; }

.student-card.student-card-graduated {
  opacity: 0.65;
  background: linear-gradient(0deg, rgba(0,0,0,0.02), rgba(0,0,0,0.02)), var(--bg-card);
}
.student-card .s-grad-badge {
  font-size: 14px; line-height: 1;
  margin-left: 4px;
}
.student-info .s-grade {
  font-size: 13px; color: var(--text-secondary); margin-top: 2px;
  /* 单行省略号——长学校名不再把头部撑成多行（全文走 title 悬停）。
     省略号靠父级 .student-info 的 min-width:0 生效 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.s-weak-tags {
  display: flex; flex-wrap: nowrap; gap: 4px; margin-top: 6px;
  overflow: hidden;
}
.s-weak-tag {
  flex-shrink: 0;
  padding: 2px 8px; border-radius: 99px;
  font-size: 11px; line-height: 1.4;
  background: rgba(245,158,11,0.12);
  color: #b45309;
  border: 1px solid rgba(245,158,11,0.25);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}
.s-weak-tag.s-weak-more {
  background: var(--bg-main);
  color: var(--text-secondary);
  border-color: var(--border);
}
.s-notes {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.s-paper-line {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted, #888);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Weak-points tag input (in student modal) */
.weak-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 8px;
  min-height: 0;
}
.weak-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 4px 4px 10px;
  border-radius: 99px;
  background: rgba(245,158,11,0.12);
  color: #b45309;
  border: 1px solid rgba(245,158,11,0.3);
  font-size: 13px; line-height: 1.2;
}
.weak-tag button {
  width: 18px; height: 18px;
  border: none; border-radius: 50%;
  background: transparent;
  color: #b45309;
  cursor: pointer;
  font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.weak-tag button:hover { background: rgba(245,158,11,0.2); }
.student-actions {
  display: flex; gap: 6px;
  flex-shrink: 0;
}
/* 操作按钮底部操作条：吸到卡底右对齐，同行各卡按钮齐平；一条细线与内容隔开 */
.student-actions.s-card-footer {
  margin-top: auto;
  padding-top: 12px;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border-light);
}
.student-actions button {
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: var(--bg-main); color: var(--text-secondary);
  font-size: 14px; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.student-actions button:hover { background: var(--primary-glow); color: var(--primary); }
.student-actions button.del:hover { background: var(--danger-light); color: var(--danger); }

/* ======== HISTORY VIEW ======== */
.history-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.history-header h2 { font-size: 22px; font-weight: 700; }
.history-filter {
  display: flex; gap: 8px; align-items: center;
}
.history-filter select {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; background: white;
  color: var(--text-primary); cursor: pointer;
}
.history-list {
  display: flex; flex-direction: column; gap: 12px;
  max-width: 900px; margin: 0 auto;
}
.history-item {
  background: var(--bg-card-solid); border-radius: var(--radius-xl);
  padding: 20px 24px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer; transition: var(--transition-smooth);
}
.history-item:hover { 
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  border-color: var(--primary-light);
}
.history-item .hi-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.history-item .hi-name { font-size: 16px; font-weight: 600; }
.history-item .hi-date { font-size: 13px; color: var(--text-secondary); }
.history-item .hi-preview {
  font-size: 13px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-item .hi-actions {
  display: flex; gap: 8px; margin-top: 12px;
}

/* ======== BUTTONS ======== */
.btn {
  padding: 12px 24px; border: none; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: var(--transition-smooth); font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  position: relative;
  overflow: hidden;
  justify-content: center;
}
.btn::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.15); opacity: 0; transition: var(--transition);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white; box-shadow: var(--shadow-colored);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px var(--primary-glow); }
.btn-secondary {
  background: white; color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color: var(--primary-light); color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-success {
  background: linear-gradient(135deg, var(--success), #34d399);
  color: white; box-shadow: 0 8px 16px var(--success-light);
}
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 12px 24px var(--success-light); }
.btn-danger {
  background: transparent; color: var(--danger); border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger-light); transform: translateY(-2px); }
.btn-sm { padding: 8px 18px; font-size: 13px; }

/* ======== MODAL ======== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}
.modal-overlay.active { display: flex; }
.modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%; max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-sm { max-width: 480px; }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1080px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(20px); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}
.modal-header h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
/* 只对 header 的 ✕ 按钮生效；footer 的 .btn.modal-close 走 .btn 样式 */
.modal-close:not(.btn) {
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: var(--bg-main); color: var(--text-secondary);
  font-size: 18px; cursor: pointer; transition: var(--transition-smooth);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:not(.btn):hover { background: var(--danger-light); color: var(--danger); }
.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  display: flex; gap: 12px; justify-content: flex-end;
  border-top: 1px solid var(--border-light);
  background: rgba(248, 250, 252, 0.5);
}

/* ======== FORM ======== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px;
  border: 2px solid var(--border); border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit; color: var(--text-primary);
  background: rgba(255, 255, 255, 0.8); transition: var(--transition-smooth);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary-light);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--primary-glow);
  transform: translateY(-1px);
}
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-input:disabled, .form-select:disabled, .form-textarea:disabled {
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}
.btn.btn-ai-failed {
  background: var(--warning-light);
  color: var(--warning-text);
  border-color: rgba(245, 158, 11, 0.35);
}
.btn.btn-ai-failed:hover {
  background: rgba(245, 158, 11, 0.18);
}
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }

.feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: start;
}
.feedback-layout > :nth-child(2) {
  position: sticky;
  top: 0;
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  align-self: start;
}
.quick-feedback-box {
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: var(--radius-md);
  background: rgba(79, 70, 229, 0.04);
}
.quick-feedback-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.quick-feedback-head strong {
  font-size: 16px;
  color: var(--primary-dark);
}
.quick-feedback-head span {
  color: var(--text-secondary);
  font-size: 13px;
}
.quick-choice-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.quick-choice-row > span {
  width: 44px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}
.quick-choice {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: rgba(255,255,255,0.8);
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.quick-choice:hover {
  background: white;
  border-color: var(--primary-light);
  transform: translateY(-1px);
}
.quick-choice.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-colored);
}
.quick-fill-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* Dynamic list */
.dynamic-list { display: flex; flex-direction: column; gap: 8px; }
.dynamic-item {
  display: flex; gap: 8px; align-items: flex-start;
}
.dynamic-item .form-textarea { flex: 1; }
.dynamic-item .item-remove {
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: var(--bg-main); color: var(--text-muted);
  font-size: 16px; cursor: pointer; transition: var(--transition);
  flex-shrink: 0; margin-top: 4px;
  display: flex; align-items: center; justify-content: center;
}
.dynamic-item .item-remove:hover { background: var(--danger-light); color: var(--danger); }
.add-item-btn {
  display: block; width: 100%;
  padding: 10px 16px; border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm); background: transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  text-align: center;
  cursor: pointer; transition: var(--transition); font-family: inherit;
  margin-top: 4px;
}
.add-item-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,0.04); }

/* 合班反馈：学生切换 tab */
.fb-student-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.fb-student-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.fb-student-tab:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.04);
}
.fb-student-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
.fb-student-tab .fb-student-tab-status {
  font-size: 11px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--warning-light);
  color: var(--warning-text);
}
.fb-student-tab.has-feedback .fb-student-tab-status {
  background: var(--success-light);
  color: var(--success-text);
}
.fb-student-tab.active .fb-student-tab-status {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.fb-student-tabs-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Quick-select chips */
.chip-group {
  display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px;
  max-height: 36px; overflow: hidden;
  padding: 4px 2px;
  transition: max-height 0.25s ease;
}
.chip-group.expanded { max-height: 600px; overflow: visible; }
.chip-group-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 0 8px; margin: 0; border: none; background: transparent;
  color: var(--primary); font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.chip-group-toggle:hover { text-decoration: underline; }
.chip-group-toggle::before { content: '▾'; transition: transform 0.2s; display: inline-block; }
.chip-group-toggle.is-expanded::before { transform: rotate(180deg); }
.chip {
  padding: 4px 10px; border: 1px solid var(--border);
  border-radius: 99px; background: white;
  font-size: 11px; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition); font-family: inherit;
  white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,0.04); }
.chip:active { transform: scale(0.95); background: rgba(99,102,241,0.1); }

/* ======== FEEDBACK PREVIEW ======== */
.feedback-preview-section {
  margin-top: 20px; padding-top: 20px;
  border-top: 2px dashed var(--border);
}
.feedback-preview-section h4 {
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.preview-bubble {
  background: #f0f9eb; border-radius: var(--radius-md);
  padding: 20px 24px;
  font-size: 14px; line-height: 1.8; color: var(--text-primary);
  white-space: pre-wrap; word-break: break-word;
  max-height: 400px; overflow-y: auto;
  border: 1px solid #d9f0c8;
  transition: border-color .15s ease, background-color .15s ease;
}
.preview-bubble[contenteditable] { cursor: text; }
.preview-bubble[contenteditable]:hover { border-color: #b8de98; }
.preview-bubble[contenteditable]:focus {
  outline: none;
  border-color: var(--primary, #4caf50);
  background: #fafffa;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
}
.preview-bubble[contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  font-style: italic;
  pointer-events: none;
}
.preview-actions {
  display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap;
}
.copy-success {
  color: var(--success-text); font-size: 13px; font-weight: 500;
  opacity: 0; transition: opacity 0.3s;
}
.copy-success.show { opacity: 1; }

/* ======== EMPTY STATE ======== */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state p { font-size: 15px; margin-bottom: 20px; }

/* ======== RESPONSIVE ======== */
@media (max-width: 900px) {
  .main-nav { padding: 0 16px; flex-direction: column; height: auto; padding: 12px 16px; gap: 8px; }
  .main-content { padding: 16px; }
  .feedback-layout { grid-template-columns: 1fr; }
  .quick-panel-head { align-items: flex-start; flex-direction: column; }
  .quick-actions { width: 100%; }
  .quick-actions .btn { flex: 1; justify-content: center; }
}
@media (max-width: 600px) {
  .nav-tabs { width: 100%; }
  .nav-tab { flex: 1; text-align: center; font-size: 13px; padding: 8px 12px; }
  .modal { border-radius: var(--radius-lg); }
  .modal-body { padding: 16px 20px; }
  .form-row { flex-direction: column; }
  .quick-fill-actions,
  .preview-actions,
  .modal-footer { flex-direction: column; }
  .quick-fill-actions .btn,
  .preview-actions .btn,
  .modal-footer .btn { justify-content: center; width: 100%; }
}

/* ======== SALARY VIEW ======== */
/* 工资快照 banner (M2 H8): 历史月有快照时显示 */
.salary-snapshot-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fbbf24;
  border-radius: var(--radius-lg);
  font-size: 0.9em;
  color: #78350f;
}
.salary-snapshot-banner .salary-snapshot-label { flex: 1; line-height: 1.5; }
/* 解锁编辑态: 蓝底色暗示"临时可编辑" */
.salary-snapshot-banner.salary-snapshot-banner-edit {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
  color: #1e3a8a;
}
/* 存档失败态: 红底色警告 */
.salary-snapshot-banner.salary-snapshot-banner-warn {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #ef4444;
  color: #7f1d1d;
}

.salary-hero {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 48px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.salary-hero::before {
  content: '';
  position: absolute;
  top: -60%; left: -20%;
  width: 140%; height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(79,70,229,0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(16,185,129,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.salary-hero-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
}
.salary-month-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.salary-month-label {
  text-align: center;
  min-width: 140px;
}
.salary-month-label h2 {
  font-size: 22px;
  font-weight: 700;
}
.salary-month-label p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.salary-take-home {
  position: relative;
}
.salary-take-home-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.salary-take-home-amount {
  font-size: clamp(48px, 3.5vw, 60px);
  font-weight: 700;
  letter-spacing: -1.5px;
  color: var(--success);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.salary-take-home-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}
.salary-take-home-done {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--success);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* Breakdown cards */
.salary-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.salary-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}
.salary-card::after {
  /* 顶条改成 2px 纯色（去渐变），保留正/扣项色彩区分 */
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--success);
  opacity: 0.7;
}
.salary-card-deduct::after {
  background: var(--danger);
}
.salary-card:hover {
  border-color: var(--border-strong);
}
.salary-card:hover::after { opacity: 1; }
.salary-card-icon {
  font-size: 18px;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  filter: saturate(0.7) contrast(1.05);
}
.salary-card-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.salary-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.salary-card-deduct .salary-card-value { color: var(--danger); }
.salary-card-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Params panel */
.salary-params {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.salary-params-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
#salary-params-v2 .salary-params-cols {
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.8fr);
  align-items: start;
}
.salary-params-col { min-width: 0; }
.salary-params-h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.salary-monthly-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.salary-bonus-row {
  margin: 4px 0 0;
}
.salary-bonus-row .form-label {
  font-size: 12px;
  margin-bottom: 6px;
}
.salary-bonus-row .form-input {
  padding: 10px 14px;
  font-size: 14px;
}
.salary-params-col .form-group { margin-bottom: 14px; }
.salary-params-col .form-group:last-child { margin-bottom: 0; }
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.salary-referral-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.salary-referral-toolbar span {
  font-size: 12px;
  color: var(--text-muted);
}
.salary-referral-draft {
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-main);
}
.salary-referral-draft-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 96px 96px;
  gap: 10px;
  align-items: end;
}
.salary-referral-subject-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.salary-referral-subject-picker button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: white;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.salary-referral-subject-picker button.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.18);
}
.salary-referral-draft-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.salary-referral-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.salary-referral-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.4fr) minmax(120px, 1.2fr) 72px 82px;
  grid-template-areas:
    "student subject lessons rate"
    "settled settled amount delete";
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-main);
}
.salary-referral-row .ref-student { grid-area: student; }
.salary-referral-row .ref-subject { grid-area: subject; }
.salary-referral-row .ref-lessons { grid-area: lessons; }
.salary-referral-row .ref-rate { grid-area: rate; }
.salary-referral-field label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.salary-referral-field .form-input {
  padding: 8px 10px;
  font-size: 13px;
  border-width: 1px;
}
.salary-referral-number .form-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.salary-referral-settled {
  grid-area: settled;
  justify-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.salary-referral-settled input {
  width: 14px;
  height: 14px;
  accent-color: var(--success);
}
.salary-referral-amount {
  grid-area: amount;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--text-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.salary-referral-del {
  grid-area: delete;
  width: 32px;
  height: 34px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.salary-referral-del:hover:not(:disabled) {
  background: var(--danger-light);
  color: var(--danger);
}
.salary-referral-del:disabled,
.salary-referral-settled:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}
.salary-referral-empty,
.salary-referral-legacy {
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 13px;
}
.salary-referral-legacy {
  border-style: solid;
  background: rgba(245, 158, 11, 0.09);
  color: var(--warning-text);
  margin-bottom: 8px;
}
.salary-trial-toggle {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  transition: var(--transition);
}
.salary-trial-toggle input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 3px;
  width: 16px; height: 16px;
  accent-color: var(--warning);
  cursor: pointer;
}
.salary-trial-toggle strong { color: var(--text-primary); margin-right: 4px; }
.salary-trial-toggle:hover { background: rgba(245, 158, 11, 0.15); }
.salary-researcher-toggle {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.25);
}
.salary-researcher-toggle input[type="checkbox"] { accent-color: var(--primary); }
.salary-researcher-toggle:hover { background: rgba(79, 70, 229, 0.13); }
.salary-trial-toggle.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
@media (max-width: 720px) {
  .salary-params { padding: 20px; }
  .salary-params-cols { grid-template-columns: 1fr; gap: 24px; }
  #salary-params-v2 .salary-params-cols { grid-template-columns: 1fr; }
  .salary-referral-draft-grid { grid-template-columns: 1fr 1fr; }
  .salary-referral-draft-grid .salary-referral-field:first-child { grid-column: 1 / -1; }
  .salary-referral-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "student subject"
      "lessons rate"
      "settled settled"
      "amount delete";
  }
  .salary-referral-settled,
  .salary-referral-amount,
  .salary-referral-del {
    justify-content: flex-start;
    width: 100%;
  }
}

/* Lesson table */
.salary-lessons {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.salary-lessons-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.salary-lessons-header h3 {
  font-size: 16px;
  font-weight: 700;
}
.salary-lesson-count {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  background: var(--bg-main);
  padding: 4px 14px;
  border-radius: 99px;
}
.salary-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-main);
}
.salary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums; /* 数字定宽，方便竖向对齐 */
}
.salary-table thead {
  background: var(--bg-main);
}
.salary-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.salary-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}
.salary-table tbody tr {
  transition: background 0.15s;
}
.salary-table tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.5);
}
.salary-table tbody tr:hover td {
  background: rgba(99, 102, 241, 0.05);
}
/* 表格内编辑控件：默认像静态文本，hover/focus 才显露可编辑 */
.salary-table select,
.salary-table input[type="number"] {
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: transparent;
  color: var(--text-primary);
  transition: var(--transition);
  min-width: 60px;
}
.salary-table select { cursor: pointer; }
.salary-table tr:hover select,
.salary-table tr:hover input[type="number"] {
  border-color: var(--border);
  background: white;
}
.salary-table select:focus,
.salary-table input[type="number"]:focus {
  outline: none;
  border-color: var(--primary-light);
  background: white;
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.salary-table tbody tr.salary-row-uncertain td {
  background: rgba(245, 158, 11, 0.07) !important;
}
.salary-table tbody tr.salary-row-uncertain:nth-child(even) td {
  background: rgba(245, 158, 11, 0.11) !important;
}
.salary-table tbody tr.salary-row-uncertain:hover td {
  background: rgba(245, 158, 11, 0.16) !important;
}
.grade-uncertain {
  color: var(--warning-text);
  font-weight: 600;
  cursor: pointer;
}
.grade-uncertain:hover {
  text-decoration: underline;
}
.grade-uncertain-mark {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: var(--warning-light);
  color: var(--warning-text);
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.grade-empty {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
}
.salary-table .fee-cell {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* 试听课工资行：金色背景 + 0 元 */
.salary-table tbody tr.salary-row-trial td {
  background: rgba(254, 243, 199, 0.55) !important;
  color: var(--text-secondary);
}
.salary-table tbody tr.salary-row-trial:hover td {
  background: rgba(253, 230, 138, 0.6) !important;
}
.salary-table tbody tr.salary-row-trial-mixed td {
  background: rgba(254, 243, 199, 0.28) !important;
}
.salary-table tbody tr.salary-row-trial-mixed:hover td {
  background: rgba(253, 230, 138, 0.4) !important;
}
.salary-table .fee-trial-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(217, 119, 6, 0.15);
  color: #b45309;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid rgba(217, 119, 6, 0.32);
  vertical-align: 1px;
}
.salary-table .fee-trial-tag.fee-trial-mixed {
  background: rgba(217, 119, 6, 0.08);
  font-weight: 500;
}
.salary-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.salary-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.salary-empty p {
  font-size: 15px;
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .salary-breakdown { grid-template-columns: repeat(2, 1fr); }
  .salary-take-home-amount { font-size: 40px; }
}
@media (max-width: 600px) {
  .salary-breakdown { grid-template-columns: 1fr 1fr; }
  .salary-take-home-amount { font-size: 32px; }
  .salary-hero { padding: 20px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: var(--radius-md);
  background: var(--text-primary); color: white;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 999; opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-8px); }
.toast.toast-with-action {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 14px;
  padding: 12px 16px 12px 20px;
}
.toast-action {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  color: white;
  font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.toast-action:hover { background: rgba(255,255,255,0.32); }

/* Copy schedule modal */
.cs-mode-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.cs-mode-row:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.cs-mode-row input[type="radio"] { margin: 0; }
.cs-mode-row span { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.cs-muted { color: var(--text-muted); font-weight: normal; }
.cs-count-input {
  width: 60px; padding: 4px 8px; text-align: center;
  display: inline-block;
}
.cs-target-list {
  max-height: 240px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 4px;
}
.cs-target-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.cs-target-row:hover { background: var(--bg-subtle); }
.cs-target-row + .cs-target-row { margin-top: 2px; }
.cs-target-row input[type="checkbox"] { margin-right: 10px; }
.cs-target-row-main { display: flex; align-items: center; flex: 1; font-size: 14px; }
.cs-target-row-meta { font-size: 12px; color: var(--text-muted); }
.cs-target-row-meta.has-existing { color: var(--warning-text); }

/* ============================================
   移动端基础修复 + 无障碍偏好
   ============================================ */
@media (max-width: 600px) {
  .main-nav {
    margin: 8px 12px;
    padding: 0 12px;
    height: auto;
    min-height: 56px;
    border-radius: var(--radius-md);
  }
  .main-content { padding: 16px 12px; }
  .nav-tab { min-height: 44px; padding: 8px 14px; }
  .nav-brand h1 { font-size: 16px; }
  .modal-overlay { padding: 8px; }
  .modal {
    max-height: 92dvh;
    border-radius: var(--radius-md);
  }
  .modal-body { padding: 16px 18px; }
  .modal-footer { padding: 12px 16px; }
  .home-card { padding: 20px; gap: 12px; }
  .home-card-icon { width: 56px; height: 56px; font-size: 32px; }
  .salary-hero { padding: 16px; }
  .salary-take-home-amount { font-size: 36px; letter-spacing: -1px; }
  .toast {
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}

/* iOS Safari / 旧 Android backdrop-filter 不支持时降级为不透明背景 */
@supports not (backdrop-filter: blur(10px)) {
  .main-nav { background: rgba(255, 255, 255, 0.95); }
}

/* 尊重操作系统"减少动画"偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 键盘焦点环（鼠标点不显示，Tab 才显示） */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ====== 成绩曲线 modal ====== */
/* s-score-btn 跟 student-actions 其他按钮同风格圆形,带 count badge 浮在右上 */
.student-actions .s-score-btn {
  position: relative;
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: var(--bg-main);
  color: var(--text-secondary);
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  padding: 0;
}
.student-actions .s-score-btn:hover {
  background: var(--primary-glow);
  color: var(--primary);
}
.student-actions .s-score-btn .s-score-count {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--bg-card-solid);
}
.s-focus {
  display: inline-flex; align-items: center;
  align-self: flex-start;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(79, 70, 229, 0.18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.s-birthday {
  display: inline-flex; align-items: center; gap: 4px;
  align-self: flex-start;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.s-birthday.is-soon {
  color: #b85587;
  font-weight: 500;
}
.s-birthday.is-today {
  padding: 4px 10px;
  border-radius: 99px;
  background: linear-gradient(135deg, rgba(232, 160, 141, 0.18), rgba(184, 85, 135, 0.15));
  color: #b85587;
  font-weight: 600;
  border: 1px solid rgba(232, 160, 141, 0.4);
  animation: birthdayPulse 2s ease-in-out infinite;
}
@keyframes birthdayPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}

.sh-form {
  background: var(--bg-main);
  padding: 14px;
  border-radius: var(--radius-md);
}
.sh-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.sh-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sh-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.sh-chip:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}
.sh-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.sh-chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin-bottom: 14px;
  position: relative;
  min-height: 200px;
}
.sh-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
#sh-chart .sh-axis-line { stroke: var(--border-strong); stroke-width: 1; }
#sh-chart .sh-grid-line { stroke: var(--border-light); stroke-width: 1; stroke-dasharray: 3 3; }
#sh-chart .sh-axis-label { fill: var(--text-muted); font-size: 11px; }
#sh-chart .sh-line { fill: none; stroke: var(--primary); stroke-width: 2; }
#sh-chart .sh-pt { fill: var(--primary); stroke: #fff; stroke-width: 1.5; cursor: pointer; }
#sh-chart .sh-pt-label { font-size: 11px; fill: var(--text-secondary); text-anchor: middle; }
#sh-chart .sh-pt-month { font-size: 10px; fill: var(--text-muted); text-anchor: middle; }
#sh-chart .sh-pt:hover { r: 6; fill: var(--primary-dark); }
.sh-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sh-list-count {
  font-size: 12px;
  color: var(--text-muted);
}
.sh-row {
  display: grid;
  grid-template-columns: 70px 84px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  background: var(--bg-card);
  font-size: 14px;
}
.sh-row:hover { border-color: var(--border-strong); }
.sh-row .sh-row-type {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-glow);
  color: var(--primary-dark);
  text-align: center;
  font-weight: 500;
}
.sh-row .sh-row-date { color: var(--text-secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.sh-row .sh-row-score {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.sh-row .sh-row-score-pct {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}
.sh-row .sh-row-note {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sh-row .sh-row-actions {
  display: flex;
  gap: 4px;
}
.sh-row .sh-row-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
}
.sh-row .sh-row-actions button:hover { background: var(--bg-main); color: var(--text-primary); }
.sh-row .sh-row-actions .sh-del:hover { color: var(--danger); }
.sh-empty-row {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}
@media (max-width: 640px) {
  .sh-row {
    grid-template-columns: 70px 1fr auto;
    grid-auto-rows: auto;
  }
  .sh-row .sh-row-date { grid-column: 1; }
  .sh-row .sh-row-type { grid-column: 1; }
  .sh-row .sh-row-score { grid-column: 2; min-width: 0; overflow: hidden; }
  .sh-row .sh-row-actions { grid-column: 3; grid-row: 1 / span 2; }
  .sh-row .sh-row-note { grid-column: 1 / span 2; }
  .sh-form-actions .btn { flex: 1 1 auto; justify-content: center; }
  .sh-form-actions #sh-edit-hint { flex: 1 0 100%; }
}

/* ============================================
   登录覆盖层
   ============================================ */
body.auth-locked { overflow: hidden; }
body.auth-locked .main-nav,
body.auth-locked .main-content { filter: blur(4px); pointer-events: none; user-select: none; }

.auth-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  padding: 32px 28px;
  width: 100%; max-width: 360px;
  display: flex; flex-direction: column; gap: 12px;
}
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.auth-brand h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.auth-icon { font-size: 28px; }
.auth-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.auth-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}
.auth-input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-body);
}
.auth-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.auth-error {
  font-size: 13px;
  background: var(--danger-light);
  color: var(--danger-text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.auth-card .btn { margin-top: 8px; padding: 11px; font-size: 14px; }
.auth-foot {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 6px 0 0;
  word-break: break-all;
}

/* ============================================
   试卷分析 (paper-app)
   ============================================ */
.paper-panel {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
}
.paper-config-advanced { margin: 0 24px 12px; }
.paper-config-advanced > summary {
  cursor: pointer; color: var(--text-muted, #888); font-size: 12px;
  padding: 4px 0; user-select: none; list-style: none;
}
.paper-config-advanced > summary::-webkit-details-marker { display: none; }
.paper-config-advanced[open] > summary { color: var(--text-primary, #333); margin-bottom: 8px; }
.paper-config {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.paper-config label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}
.paper-config input {
  flex: 1 1 280px;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: inherit;
}
.paper-config input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.btn.btn-sm { padding: 6px 12px; font-size: 12px; }
.paper-health-status {
  font-size: 12px;
  color: var(--text-muted);
}
.paper-health-status.is-checking { color: var(--text-muted); }
.paper-health-status.is-ok { color: var(--success-text); }
.paper-health-status.is-bad { color: var(--danger-text); }

.paper-meta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.paper-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.paper-meta-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.paper-meta-row select,
.paper-meta-row input {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-body);
}
.paper-meta-row select { min-width: 160px; }
.paper-meta-row input[type="text"] { flex: 1 1 220px; min-width: 180px; }
.paper-meta-row input[type="date"] { font-family: inherit; }
.paper-meta-row select:focus,
.paper-meta-row input:focus {
  outline: none;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
}
.paper-meta-hint {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1 1 auto;
}

.paper-uploads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.paper-upload-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
/* 作业批改：作业题目清单（批改前给老师过目 + 拼批改指令的数据源）。复用 paper 视觉色板。 */
.grade-q-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 360px; overflow-y: auto;
  margin-top: 6px;
}
.grade-q-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-subtle, #f9fafb);
}
.grade-q-no {
  flex: 0 0 auto;
  font-size: 12px; font-weight: 700;
  color: #7c3aed;
  background: rgba(124, 58, 237, .1);
  padding: 2px 8px; border-radius: 999px;
  white-space: nowrap;
}
.grade-q-main { flex: 1 1 auto; min-width: 0; }
.grade-q-stem { font-size: 14px; color: var(--text-primary); line-height: 1.5; }
.grade-q-ans { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.grade-q-ans b { color: var(--text-primary); }
.grade-push-bar { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border, #e0e0e0); }
.grade-free-row { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 6px; }
.grade-free-row input, .grade-free-row textarea { font: inherit; padding: 5px 7px; border: 1px solid var(--border, #ddd); border-radius: 6px; box-sizing: border-box; }
.grade-free-row .grade-free-label { width: 72px; flex: none; }
.grade-free-row .grade-free-stem, .grade-free-row .grade-free-ans { flex: 1 1 0; min-width: 0; resize: vertical; }
.grade-free-row .grade-free-kp { width: 130px; flex: none; }
.grade-free-del { flex: none; background: none; border: none; color: var(--text-muted, #999); cursor: pointer; font-size: 15px; padding: 4px 6px; line-height: 1.8; }
.grade-free-del:hover { color: #c0392b; }
.tk-type-free { display: inline-block; background: #ede9fe; color: #6d28d9; border-radius: 4px; padding: 0 6px; font-size: 11px; vertical-align: middle; }

.paper-upload-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.paper-upload-head h3 {
  font-size: 16px; font-weight: 700; margin: 0;
  color: var(--text-primary);
}
.paper-upload-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
}
.paper-upload-tag-required {
  background: var(--danger-light);
  color: var(--danger-text);
}
.paper-upload-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.paper-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  transition: var(--transition);
}
.paper-dropzone:hover, .paper-dropzone.is-drag {
  border-color: var(--accent);
  background: rgba(236, 72, 153, 0.04);
  color: var(--text-primary);
}
.paper-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.paper-preview-grid:empty { margin-top: 0; }
.paper-thumb {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  aspect-ratio: 1 / 1.1;
}
.paper-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.paper-thumb-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.66);
  color: #fff;
  font-size: 10px;
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.paper-thumb-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%; border: 0;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.paper-thumb-del:hover { background: var(--danger); }

.paper-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.paper-show-debug {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  margin-left: 8px;
}
.paper-show-debug input { margin: 0; }

/* 已批改模式开关 (v3.63): 按老师红笔标记统计, 不让 AI 重判 */
.paper-marked-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 auto 16px;
  max-width: 760px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}
.paper-marked-toggle input { margin: 2px 0 0; flex: 0 0 auto; }
.paper-marked-toggle-text { display: flex; flex-direction: column; gap: 4px; }
.paper-marked-toggle-text b { font-size: 13.5px; color: var(--text); }
.paper-marked-toggle-text small { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.paper-history {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 8px;
}
.paper-history > summary {
  cursor: pointer;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
}
.paper-history > summary:hover { background: var(--bg-subtle); }
.paper-history[open] > summary { border-bottom: 1px solid var(--border-light); }
.paper-history-list {
  display: flex;
  flex-direction: column;
}
.paper-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
}
.paper-history-item:last-child { border-bottom: 0; }
.paper-history-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
}
.paper-history-name {
  font-weight: 600;
  color: var(--text-primary);
}
.paper-history-meta {
  color: var(--text-muted);
  font-size: 12px;
  display: inline-flex; gap: 6px;
}
.paper-history-rate {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.paper-history-rate.paper-rate-good { color: var(--success-text); }
.paper-history-rate.paper-rate-mid  { color: var(--warning-text); }
.paper-history-rate.paper-rate-bad  { color: var(--danger-text); }
.paper-history-count {
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.paper-history-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.paper-history-del { color: var(--danger-text) !important; }

.paper-history-banner {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary-dark);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 13px;
  border-left: 3px solid var(--primary);
}

.paper-saved-banner {
  background: var(--success-light);
  color: var(--success-text);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 13px;
}
.paper-partial-banner {
  background: var(--warning-light);
  color: var(--warning-text);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 13px;
}

.paper-progress {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-body);
}
.paper-progress.is-error {
  border-left-color: var(--danger);
  background: var(--danger-light);
  color: var(--danger-text);
}

.paper-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.paper-summary-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.paper-summary h3 { margin: 0; font-size: 18px; }
.paper-summary-stat {
  display: flex; align-items: baseline; gap: 8px;
}
.paper-rate {
  font-size: 32px; font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.paper-rate-good { color: var(--success-text); }
.paper-rate-mid  { color: var(--warning-text); }
.paper-rate-bad  { color: var(--danger-text); }
.paper-rate-label { font-size: 13px; color: var(--text-muted); }
.paper-summary-comment {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.7;
  margin: 0 0 10px;
}
.paper-weak {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.paper-weak > span:first-child { font-weight: 600; margin-right: 4px; }
.paper-tag {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.paper-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.paper-q {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-muted);
  border-radius: var(--radius-md);
  padding: 14px 20px;
}
.paper-q.is-correct { border-left-color: var(--success); }
.paper-q.is-wrong   { border-left-color: var(--danger); }
.paper-q.is-low-conf { background: #fff8e1; }
.paper-q.is-editing { background: #f0f7ff; border-left-color: var(--primary); }
.paper-q-edit-btn {
  margin-left: auto; font-size: 12px; cursor: pointer;
  padding: 2px 8px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-card); color: var(--text-secondary);
}
.paper-q-edit-btn:hover { background: var(--bg-subtle); }
.paper-q-edit, .paper-summary-edit {
  display: flex; flex-direction: column; gap: 8px; padding: 8px 0;
}
.paper-q-edit label, .paper-summary-edit label {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 12px; color: var(--text-muted, #888);
}
.paper-q-edit textarea, .paper-q-edit input[type="text"],
.paper-summary-edit textarea, .paper-summary-edit input[type="text"] {
  width: 100%; box-sizing: border-box;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px;
  font: 13px/1.5 inherit; resize: vertical;
}
.paper-q-edit-row {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.paper-q-edit-row label { flex-direction: row; gap: 6px; align-items: center; }
.paper-q-edit-correct input { width: auto !important; }
.paper-q-edit-actions { display: flex; gap: 8px; margin-top: 4px; }
.paper-q-conf {
  font-size: 12px; color: var(--text-muted, #888);
  padding: 2px 8px; border-radius: 10px; background: var(--bg-subtle, #f0f0f0);
  margin-left: auto;
}
.paper-q-conf.is-low { background: #ffe082; color: #6b3a00; font-weight: 600; }
.paper-q-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 14px;
}
.paper-q.is-correct .paper-q-status { color: var(--success-text); }
.paper-q.is-wrong   .paper-q-status { color: var(--danger-text); }
.paper-q-body p {
  font-size: 14px;
  line-height: 1.65;
  margin: 4px 0;
  color: var(--text-body);
}
.paper-q-body p b { color: var(--text-primary); margin-right: 4px; }
.paper-q-solution {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 6px !important;
}
.paper-q-kps {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 8px 0;
}
.paper-q-comment {
  background: var(--warning-light);
  color: var(--warning-text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 8px !important;
  font-size: 13px;
}
/* v3.60 作业批改预览态：逐题改对错 + 评语编辑 */
.grade-edit-toggle {
  margin-left: auto;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-body);
  border-radius: var(--radius-sm);
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
}
.grade-edit-toggle:hover { background: var(--bg-hover, var(--bg-subtle)); border-color: var(--text-muted); }
.grade-q-comment-edit { margin-top: 8px; }
.grade-q-comment-lbl { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 3px; }
.grade-edit-comment {
  background: var(--warning-light);
  color: var(--warning-text);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  min-height: 1.6em;
  line-height: 1.6;
  outline: none;
}
.grade-edit-comment:focus { border-style: solid; border-color: var(--accent, var(--text-muted)); }
.grade-edit-comment:empty::before { content: attr(data-ph); color: var(--text-muted); opacity: .8; }
.grade-q-nostem { color: var(--text-muted); font-style: italic; font-size: 13px; }
.paper-raw {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow: auto;
}
.paper-rerun {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
}

/* === 举一反三 === */
.paper-practice {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 20px; margin-top: 20px;
}
.paper-practice-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.paper-practice-head h3 { margin: 0; font-size: 16px; }
.paper-practice-meta { font-size: 12px; color: var(--text-muted, #888); }
.paper-practice-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.paper-practice-status { font-size: 12px; color: var(--text-muted, #888); }
.paper-practice-footer {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-light);
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.paper-export-bar {
  margin-top: 16px; padding: 14px 16px;
  background: linear-gradient(135deg, #f4ecff 0%, #eaf3fb 100%);
  border: 1px solid var(--border-light); border-radius: var(--radius-md);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.paper-export-hint { font-size: 12px; color: var(--text-muted, #888); }
.paper-export-bar .btn:disabled,
.paper-practice-footer .btn:disabled,
.paper-action-bar .btn:disabled { opacity: 0.55; cursor: not-allowed; }
.paper-action-bar .btn:disabled[data-busy="1"] { cursor: progress; }

/* === 总览下方一站式动作区 (生成变式 + 三档 PDF) === */
.paper-action-bar {
  margin: 14px 0 18px;
  background: linear-gradient(135deg, #f4ecff 0%, #eaf3fb 100%);
  border: 1px solid var(--border-light); border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.paper-action-bar .paper-action-group {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.paper-action-bar .paper-action-group + .paper-action-group {
  padding-top: 12px; border-top: 1px dashed var(--border-light);
}
.paper-action-label {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  margin-right: 4px;
}
.paper-action-hint { font-size: 12px; color: var(--text-muted, #888); }

/* === 一键到底悬浮按钮 (仅试卷分析页可见) === */
.scroll-to-bottom-fab {
  position: fixed; right: 20px; bottom: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  display: none; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; z-index: 100;
  transition: transform 0.15s, box-shadow 0.15s;
  color: var(--text-primary);
}
.scroll-to-bottom-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.scroll-to-bottom-fab.is-visible { display: flex; }
.practice-item {
  border: 1px solid var(--border-light); border-radius: 6px; padding: 12px 14px;
  margin-bottom: 10px; background: var(--bg-subtle, #fafafa);
}
.practice-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 12px; color: var(--text-muted, #888); }
.practice-no { font-weight: 600; color: var(--text-primary); }
.practice-difficulty, .practice-src { padding: 2px 8px; background: var(--bg-card); border-radius: 10px; }
.practice-stem { margin: 6px 0 8px; line-height: 1.6; }
/* 题干里的图占位提示 (OCR 图占位符渲染) */
.stem-fig {
  display: inline-block;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-main);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 1px 8px;
  margin: 2px 0;
}
.practice-kps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.practice-intent { font-size: 12px; color: #6b3a00; background: #fff3cd; padding: 4px 8px; border-radius: 4px; margin-bottom: 6px; }
.practice-answer summary { cursor: pointer; padding: 4px 0; font-size: 13px; color: var(--text-secondary); user-select: none; }
.practice-answer-body { padding: 6px 0; }
.practice-solution { line-height: 1.7; margin-top: 4px; }

/* 变式题收藏按钮 + 学生变式题库面板 */
.practice-star {
  margin-left: auto; padding: 3px 10px; font-size: 12px; line-height: 1.4;
  border: 1px solid var(--border, #ddd); background: var(--bg-card, #fff);
  color: var(--text-secondary, #666); border-radius: 12px; cursor: pointer;
  transition: all 0.15s ease;
}
.practice-star:hover { border-color: #f5a623; color: #b86500; background: #fff7e6; }
.practice-star.is-saved {
  border-color: #f5a623; color: #b86500; background: #fff7e6; font-weight: 600;
}
.practice-star.is-saved:hover { background: #ffeac2; }
.practice-star.is-disabled {
  opacity: 0.5; cursor: not-allowed; background: var(--bg-subtle, #f5f5f5);
}
.practice-star.is-disabled:hover { border-color: var(--border, #ddd); color: var(--text-secondary, #666); background: var(--bg-subtle, #f5f5f5); }
.practice-saved { background: #fffbf0; border-color: #f5cf81; }
#paper-saved-variants { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px 12px; }
#paper-saved-variants > summary { cursor: pointer; font-size: 13px; padding: 4px 0; color: var(--text-secondary); }
#paper-saved-variants[open] > summary { font-weight: 600; color: var(--text-primary); }
#paper-saved-variants-list { padding-top: 8px; max-height: 480px; overflow-y: auto; }

/* === 打印 === */
#print-area { display: none; }
@media print {
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block !important; padding: 0; max-width: 100%; }
  #print-area h1 { font-size: 22px; margin: 0 0 6px; }
  #print-area .print-meta { font-size: 12px; color: #555; margin-bottom: 16px; border-bottom: 1px solid #ddd; padding-bottom: 8px; }
  #print-area .print-q { margin-bottom: 18px; page-break-inside: avoid; }
  #print-area .print-q-head { display: flex; gap: 10px; font-size: 12px; color: #555; margin-bottom: 6px; }
  #print-area .print-q-no { font-weight: 700; color: #000; }
  #print-area .print-q-stem { line-height: 1.7; margin-bottom: 8px; }
  #print-area .print-q-blank { min-height: 140px; border: 1px dashed #aaa; border-radius: 4px; }
  #print-area .print-q-intent { font-size: 11px; color: #6b3a00; margin: 4px 0 8px; }
  #print-area .print-q-answer { margin: 6px 0; }
  #print-area .print-q-solution { line-height: 1.7; margin-top: 4px; padding-left: 6px; border-left: 2px solid #888; }
  /* KaTeX 公式打印保持 */
  #print-area .katex { font-size: 1em; }
  /* 综合报告: 试卷分析部分 */
  #print-area .print-section { margin-bottom: 22px; }
  #print-area .print-section h2 { font-size: 16px; margin: 18px 0 10px; padding-bottom: 4px; border-bottom: 1.5px solid #333; }
  #print-area .print-section h3 { font-size: 14px; margin: 12px 0 6px; }
  #print-area .print-summary { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 10px; }
  #print-area .print-rate { font-size: 24px; font-weight: 700; padding: 2px 12px; border-radius: 4px; }
  #print-area .print-rate-good { color: #1a7a3a; background: #e6f4ea; }
  #print-area .print-rate-mid { color: #8a5a00; background: #fff3cd; }
  #print-area .print-rate-bad { color: #a0312b; background: #fdecea; }
  #print-area .print-rate-label { font-size: 12px; color: #555; }
  #print-area .print-weak, #print-area .print-overall { font-size: 12px; margin: 6px 0; line-height: 1.6; }
  #print-area .print-wrong-q {
    border-left: 3px solid #d33; padding: 6px 0 6px 10px; margin: 8px 0; page-break-inside: avoid; font-size: 12px;
  }
  #print-area .print-wrong-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; font-size: 11px; color: #555; }
  #print-area .print-wrong-no { font-weight: 700; color: #000; }
  #print-area .print-wrong-row { line-height: 1.6; margin: 2px 0; }
  #print-area .print-wrong-sol { padding-left: 6px; border-left: 2px solid #888; margin-top: 4px; }
  #print-area .print-wrong-cmt { color: #6b3a00; font-style: italic; }
  #print-area .print-allcorrect { font-size: 14px; color: #1a7a3a; }
  @page { margin: 18mm 14mm 18mm 14mm; }
}
.paper-rerun > summary {
  cursor: pointer; padding: 10px 16px; font-size: 13px;
  color: var(--text-secondary); user-select: none;
}
.paper-rerun > summary:hover { background: var(--bg-subtle); }
.paper-rerun-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.paper-rerun-body label { font-size: 12px; color: var(--text-muted, #666); margin-top: 4px; }
.paper-rerun-body textarea {
  width: 100%; box-sizing: border-box;
  font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-subtle, #fafafa); resize: vertical;
}
.paper-rerun-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.paper-rerun-status { font-size: 12px; color: var(--text-muted, #888); }
.paper-debug-group {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 16px;
}
.paper-debug {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.paper-debug summary {
  cursor: pointer;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
}
.paper-debug summary:hover { background: var(--bg-subtle); }
.paper-debug[open] summary { border-bottom: 1px solid var(--border-light); }
.paper-debug pre {
  margin: 0;
  border-radius: 0;
  border: 0;
  max-height: 360px;
}

@media (max-width: 768px) {
  .paper-panel { padding: 0 16px; }
  .paper-uploads { grid-template-columns: 1fr; }
  .paper-summary-head { flex-direction: column; align-items: flex-start; }
}


/* ============ 导入课表预览交互（批量设置 + 异常行内改） ============ */
.imp-batch-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg-main); border-radius: var(--radius-md);
  padding: 10px 12px; margin-bottom: 10px; font-size: 13px;
}
.imp-batch-bar label { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.imp-batch-bar select { font-size: 13px; padding: 2px 6px; max-width: 130px; }
.imp-table select { font-size: 12px; padding: 2px 4px; max-width: 140px; }
.imp-table td.imp-warn { background: rgba(245, 158, 11, 0.18); }
.imp-table td.imp-auto { background: rgba(59, 130, 246, 0.14); }
.imp-table td.imp-new { background: rgba(16, 185, 129, 0.12); }
.imp-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.imp-chip {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--bg-main); border: 1px solid var(--border);
  border-radius: 10px; padding: 1px 6px; font-size: 12px; margin: 1px 3px 1px 0;
}
.imp-chip a { cursor: pointer; color: var(--text-muted); font-weight: bold; padding: 0 2px; }
.imp-chip a:hover { color: var(--danger); }
.imp-chip-bad { background: rgba(239, 68, 68, 0.15); border-color: var(--danger); }
.imp-padd { width: 48px; }

/* ============ 课表导出干净版 (给自己看上课时间: 名+时间+内容+班型色条) ============ */
.wg-export-clean .sc-badge,
.wg-export-clean .sc-actions,
.wg-export-clean .sc-edit,
.wg-export-clean .sc-delete,
.wg-export-clean .sc-reschedule,
.wg-export-clean .wg-add,
.wg-export-clean .sc-prep,
.wg-export-clean .sc-type-tag { display: none !important; }
.wg-export-clean .schedule-card { box-shadow: none; }
.wg-export-clean.wg-table { box-shadow: none; }

/* ===== 题库（tiku，阶段甲: 浏览）===== */
.tiku-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px; margin-bottom: 14px;
}
.tiku-toolbar .form-select, .tiku-toolbar .form-input { width: auto; min-width: 112px; }
.tc-ahead-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; color: var(--text-secondary); font-size: 13px;
}
.tiku-muted { color: var(--text-muted); font-size: 13px; margin: -6px 0 12px; }
.tiku-count { color: var(--text-muted); font-size: 13px; margin-left: auto; }
.tiku-layout { display: grid; grid-template-columns: 330px 1fr; gap: 14px; align-items: start; }
.tiku-list { max-height: 72vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.tiku-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 12px; cursor: pointer;
}
.tiku-item:hover { border-color: var(--primary-light); }
.tiku-item.active { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.tiku-item-head { font-weight: 600; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.tiku-item-brief { font-size: 13px; color: var(--text-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiku-more-btn { display: block; width: 100%; margin-top: 6px; padding: 9px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px dashed var(--border); border-radius: var(--radius-md); background: var(--bg-subtle, var(--bg-card)); color: var(--text-secondary); }
.tiku-more-btn:hover { border-color: var(--primary); color: var(--primary); }
.tiku-more-btn:disabled { cursor: default; opacity: .6; }
.tiku-preview {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; min-height: 220px;
}
.tiku-empty { color: var(--text-muted); }
.tiku-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tiku-badge {
  font-size: 12px; padding: 2px 10px; border-radius: 999px;
  background: rgba(13, 148, 136, 0.12); color: #0d9488;
}
.tiku-section-title { font-weight: 700; margin: 14px 0 6px; }
.tiku-section-body { line-height: 1.7; word-break: break-word; }
.tiku-section-body .tk-img-link {
  display: block;
  width: 100%;
  margin: 8px auto;
  text-decoration: none;
  cursor: zoom-in;
}
.tiku-section-body .tk-img-link + .tk-img-link { margin-top: 4px; }
.tiku-section-body img {
  display: block;
  width: auto;
  height: auto;
  max-width: 72%;
  max-height: 360px;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 8px;
}
@media (max-width: 900px) {
  .tiku-layout { grid-template-columns: 1fr; }
}

/* ── 题库·上课模式（浏览/上课 标签 + 一屏一题）── */
.tiku-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tiku-tab {
  border: 1px solid var(--border); background: var(--bg-subtle); color: var(--text-secondary);
  padding: 7px 18px; border-radius: 10px; font-size: 14px; cursor: pointer;
  transition: var(--transition, all .15s ease);
}
.tiku-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.tc-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.tc-bar #tc-progress { font-size: 14px; color: var(--text-secondary); flex: 1; }
.tc-student-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.tc-hint {
  background: var(--warning-light, #fef3c7); color: var(--warning-text, #92400e);
  padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 10px;
}
.tc-question { max-height: none; position: relative; }   /* v3.51 起手写蒙层改挂在每张图(.tc-fig)上, 不再盖 #tc-question */
.tc-question .tiku-section-body { font-size: 17px; line-height: 1.9; }
.tc-question .tiku-section-body img { max-width: 82%; max-height: 460px; }
.tc-question details { margin-top: 14px; }
.tc-question summary { cursor: pointer; color: var(--text-secondary); font-size: 13px; }
.tc-judge { display: flex; gap: 14px; margin-top: 16px; }
.tc-btn {
  flex: 1; padding: 16px 0; font-size: 20px; font-weight: 700; border-radius: 12px;
  border: none; cursor: pointer; transition: var(--transition, all .15s ease);
}
.tc-btn:disabled { opacity: .5; cursor: default; }
.tc-btn-right { background: var(--success-light, #dcfce7); color: var(--success-text, #166534); }
.tc-btn-right:hover:not(:disabled) { background: #bbf7d0; }
.tc-btn-wrong { background: var(--danger-light, #fee2e2); color: var(--danger, #b91c1c); }
.tc-btn-wrong:hover:not(:disabled) { background: #fecaca; }
.tc-btn-skip { flex: 0 0 auto; padding: 16px 18px; font-size: 16px; font-weight: 600; background: var(--bg-tertiary, #f1f5f9); color: var(--text-secondary, #475569); }
.tc-btn-skip:hover:not(:disabled) { background: #e2e8f0; }
.tc-exhausted { text-align: center; padding: 24px; color: var(--text-secondary); }
.tc-error-item { cursor: pointer; margin-top: 8px; }
#tc-summary h3 { margin-bottom: 10px; }

/* ③ 上课手写作答 */
.tc-answer-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
/* hidden 属性压不住 display:flex/inline-flex，须显式声明：作答区门控(v3.50)开关 + 本版隐藏 📷 按钮(v3.51) */
.tc-answer-bar[hidden], .tc-answer-btn[hidden], .tc-answer-draw-tools[hidden], .tc-answer-preview[hidden] { display: none; }
.tc-answer-btn-on { background: var(--primary, #0d9488); color: #fff; border-color: transparent; }
.tc-answer-btn {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  padding: 9px 14px; font-size: 14px; font-weight: 600; border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0); background: var(--bg-card, #fff); color: var(--text, #1e293b);
}
.tc-answer-btn:hover { background: var(--bg-tertiary, #f1f5f9); }
.tc-answer-hint { font-size: 12px; color: var(--text-secondary, #64748b); }
/* ③ 原题图分开 (v3.51): 每张题图独立成块、紧贴图; 手写蒙层 per-figure 绝对盖满图，只能在图上写 */
.tc-fig { position: relative; display: block; width: max-content; max-width: 100%; margin: 10px auto; }
.tc-fig img { max-width: 100%; max-height: 460px; display: block; }
/* 蒙层严格 = 图的显示框; 虚线框提示「可写区=这张图」(图外写不了) */
.tc-fig-canvas {
  /* left/top/width/height 由 tcSizeFig 按图显示框设(不用 inset:0, 否则盖满更宽的锚框=在图边上画) */
  position: absolute; z-index: 5; touch-action: none; background: transparent; cursor: crosshair;
  outline: 2px dashed var(--primary, #0d9488); outline-offset: -2px;
}
/* 错题本回看: 原题按写时宽度重渲 + 笔迹 PNG 等比叠加 (tcFitAnswerStage 设宽/缩放/高) */
/* 边框放外层 stage; inner 必须无边框, 否则 border-box 下内容宽比写时少 2px → 笔迹错位 */
.tc-answer-stage { position: relative; overflow: hidden; margin-top: 6px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.tc-answer-stage-inner {
  position: relative; box-sizing: border-box;
  padding: 18px; padding-bottom: 360px; min-height: 220px;
  background: var(--bg-card);
  transform-origin: top left;
}
.tc-answer-overlay-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: fill; pointer-events: none;
}
.tc-answer-draw-tools { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tc-answer-tool {
  padding: 7px 12px; font-size: 13px; font-weight: 600; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border, #e2e8f0); background: var(--bg-card, #fff); color: var(--text-secondary, #475569);
}
.tc-answer-tool:hover { background: var(--bg-tertiary, #f1f5f9); }
.tc-answer-tool-primary { background: var(--success-light, #dcfce7); color: var(--success-text, #166534); border-color: transparent; }
.tc-answer-preview { margin-top: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tc-answer-img { max-width: 82%; max-height: 460px; border-radius: 8px; border: 1px solid var(--border, #e2e8f0); }
.tc-answer-preview .tc-answer-img { max-height: 200px; }
.tc-answer-clear {
  padding: 5px 10px; font-size: 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border, #e2e8f0); background: var(--bg-card, #fff); color: var(--danger, #e5484d);
}

/* 上课·一键改年级 (v3.52) */
.tc-regrade-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tc-regrade-bar[hidden], .tc-regrade-panel[hidden] { display: none; }
.tc-regrade-panel { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary, #475569); }
.tc-regrade-panel select { padding: 5px 8px; font-size: 13px; border-radius: 8px; border: 1px solid var(--border, #e2e8f0); background: var(--bg-card, #fff); }

/* ── 题库·题篮 / 组卷 / 作业（v3.24）── */
.tk-basket-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; }
.tiku-tab.active .tk-basket-count { background: #fff; color: var(--primary); }
.tk-add { float: right; margin-left: 8px; border: 1px solid var(--border); background: var(--bg-subtle); color: var(--text-secondary); font-size: 11px; padding: 1px 8px; border-radius: 999px; cursor: pointer; }
.tk-add:hover { border-color: var(--primary); color: var(--primary); }
.tk-add.in { background: rgba(13, 148, 136, 0.12); color: #0d9488; border-color: transparent; }
.tiku-badges .tk-add { float: none; margin-left: 2px; }
.tk-quality-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 11px;
  font-weight: 600;
}
.tk-quality-tools {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 2px;
}
.tk-quality-reason {
  min-width: 104px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 0 8px;
}
.tk-quality-save,
.tk-quality-clear {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
}
.tk-quality-tools.flagged .tk-quality-reason,
.tk-quality-tools.flagged .tk-quality-save {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}
.tk-quality-clear:hover,
.tk-quality-save:hover { border-color: var(--primary); color: var(--primary); }
.tk-paper-toolbar { align-items: center; }
.tk-paper-name { min-width: 260px; flex: 1 1 280px; }
.tk-smart-box { background: linear-gradient(180deg, #fff, #fbfcff); }
.tk-smart-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(132px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.tk-smart-grid-cat { grid-template-columns: repeat(3, minmax(132px, 1fr)); margin-top: -2px; }
.tk-smart-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 112px)) auto;
  gap: 8px;
  align-items: end;
}
.tk-smart-counts label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.tk-smart-counts .form-input { min-width: 0; padding: 8px 10px; }
.tk-smart-box .tiku-muted { margin: 8px 0 0; }
.tk-smart-avail { color: var(--text-secondary, #475569); font-weight: 600; }
.tk-quality-box { padding-bottom: 10px; }
.tk-quality-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tk-quality-list .tiku-empty { margin: 0; }
.tk-quality-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-md);
  background: #fffaf4;
  padding: 4px 7px;
  font-size: 12px;
}
.tk-quality-id { font-weight: 700; color: var(--text-body); }
.tk-quality-reason-text { color: #c2410c; }
.tk-basket-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; }
.tk-basket-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.tk-basket-summary span {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}
.tk-basket-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .75fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}
.tk-basket-list-panel { min-width: 0; }
.tk-basket-list { display: flex; flex-direction: column; gap: 6px; max-height: 58vh; overflow-y: auto; padding-right: 2px; }
.tk-basket-item {
  display: grid;
  grid-template-columns: 24px 28px minmax(150px, 1fr) minmax(180px, 1.45fr) auto;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
}
.tk-basket-item:hover { border-color: var(--primary-light); }
.tk-basket-item.active { border-color: var(--primary); box-shadow: var(--shadow-sm); background: #f8fffd; }
.tk-basket-select { display: inline-flex; align-items: center; justify-content: center; }
.tk-basket-check { width: 16px; height: 16px; accent-color: var(--primary); }
.tk-basket-no { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-subtle); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.tk-basket-meta { color: var(--text-secondary); font-size: 12px; display: flex; flex-wrap: wrap; gap: 5px 8px; min-width: 0; }
.tk-basket-meta b { color: var(--text-body); font-size: 13px; }
.tk-basket-meta span { white-space: nowrap; }
.tk-basket-brief { min-width: 0; color: var(--text-body); line-height: 1.45; word-break: break-word; }
.tk-basket-ops { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.tk-bop { border: 1px solid var(--border); background: var(--bg-subtle); border-radius: 6px; cursor: pointer; font-size: 12px; padding: 2px 8px; color: var(--text-secondary); }
.tk-bop:hover { border-color: var(--primary); color: var(--primary); }
.tk-basket-view { background: rgba(13, 148, 136, 0.10); color: #0d9488; border-color: rgba(13, 148, 136, 0.20); }
.tk-basket-preview {
  position: sticky;
  top: 12px;
  max-height: 58vh;
  overflow-y: auto;
}
.tk-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.tk-preview-head .tk-box-head { margin-bottom: 0; }
.tk-basket-preview .tiku-section-body img { max-width: 72%; max-height: 360px; }
.tk-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 14px; }
.tk-box-head { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.tk-assign-students { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tk-stu { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; padding: 3px 0; }
.tk-assign-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.tk-assign-item:last-child { border-bottom: none; }
.tk-assign-del { margin-left: auto; }
.tk-ap { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--bg-subtle); color: var(--text-secondary); margin: 1px 4px 1px 0; }
.tk-ap.done { background: var(--success-light, #dcfce7); color: var(--success-text, #166534); }
.tk-assign-progress { flex-basis: 100%; }
#tc-hw-list .tc-hw-start { margin-left: auto; }
.s-hw-count { display: inline-flex; align-items: center; justify-content: center; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: #f59e0b; color: #fff; font-size: 10px; font-weight: 700; margin-left: 2px; vertical-align: top; }
@media (max-width: 900px) {
  .tk-smart-grid,
  .tk-smart-counts { grid-template-columns: 1fr 1fr; }
  .tk-smart-counts #tk-smart-generate { grid-column: 1 / -1; }
  .tk-basket-workbench { grid-template-columns: 1fr; }
  .tk-basket-preview { position: static; max-height: none; }
  .tk-basket-item { grid-template-columns: 24px 28px 1fr; }
  .tk-basket-brief,
  .tk-basket-ops { grid-column: 3; }
}

/* ====== 排课弹窗页签 / 快速排课表单 / 工具栏更多菜单 ====== */
.sched-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sched-tab {
  border: none;
  background: none;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.sched-tab:hover { color: var(--text-secondary); }
.sched-tab.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

/* 每周哪几天 — 多选 chip */
.qs-weekdays { display: flex; flex-wrap: wrap; gap: 8px; }
.qs-wd {
  min-width: 40px;
  padding: 7px 0;
  flex: 1;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all .12s;
}
.qs-wd:hover { border-color: var(--primary-light); }
.qs-wd.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* 工具栏「⋯ 更多」下拉 */
.sched-more { position: relative; display: inline-block; }
.sched-more-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 50;
}
.sched-more-menu.open { display: block; }
.sched-more-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}
.sched-more-item:hover { background: var(--bg-main); }
.sched-more-danger { color: var(--danger); }

/* ====== 本地离线版 (Electron) 门控 ======
   auth.js detectLocalMode() 探到 local_mode 后给 <html> 加 .qh-local。
   下列入口分散在「保留模块」内、不走 MODULE_ROLES 卡片显隐, 故在此用 CSS 即时隐藏:
   AI润色按钮 / 课表读图OCR行 / AI接口设置块 / 家长分享🔗 / 自由题作业创建区。
   CSS 对「元素渲染早于异步 local_mode 探测」的竞态即时生效, 比纯 JS 判据更稳。 */
html.qh-local #btn-ai-fb,
html.qh-local #import-ocr-row,
html.qh-local #ai-settings-group,
html.qh-local .s-share-btn,
html.qh-local #grade-free-create-box { display: none !important; }
/* 学生卡「📝N张试卷」概览仍展示历史, 但本地版不导向已砍的试卷分析页 → 去掉可点 */
html.qh-local .s-paper-line { pointer-events: none; cursor: default; }

/* ====== 学生档案文件夹联动: 入口/设置只在本地离线版(.qh-local)出现 ====== */
.qh-local-only { display: none !important; }
html.qh-local #archive-settings-group { display: block !important; }
html.qh-local #btn-pr-archive { display: inline-flex !important; }
#archive-settings-divider { display: none; }
html.qh-local #archive-settings-divider { display: block; }

/* 档案 modal: 左文件树 + 右 markdown */
#sa-layout { display: flex; gap: 12px; min-height: 320px; max-height: 60vh; }
#sa-tree { width: 220px; flex: none; overflow: auto; border-right: 1px solid var(--border); padding-right: 8px; }
#sa-content { flex: 1; overflow: auto; padding-left: 4px; }
.sa-cat-title { font-weight: 600; font-size: 13px; margin: 10px 0 4px; color: var(--text-secondary); }
.sa-file { display: block; width: 100%; text-align: left; background: none; border: none; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-primary); }
.sa-file:hover { background: var(--bg-main); }
.sa-file.active { background: var(--primary); color: #fff; }
.sa-empty, .sa-loading { color: var(--text-muted); font-size: 13px; padding: 16px; text-align: center; }
.sa-md { font-size: 14px; }
.sa-md h1 { font-size: 18px; margin: 12px 0 8px; }
.sa-md h2 { font-size: 16px; margin: 12px 0 6px; }
.sa-md h3 { font-size: 14px; margin: 10px 0 4px; }
.sa-md ul { margin: 4px 0 8px 18px; }
.sa-md li { margin: 2px 0; }
.sa-md p { margin: 6px 0; line-height: 1.6; }
.sa-md table { border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.sa-md th, .sa-md td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; }
.sa-md code { background: var(--bg-main); padding: 1px 4px; border-radius: 4px; }
@media (max-width: 640px) { #sa-layout { flex-direction: column; } #sa-tree { width: auto; border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 8px; } }
