/* ============================================================
   美刻变身学习平台 · 共享样式（学员端 + 教师端）
   设计基调：暖纸底色 + 鼠尾草绿，柔和有机、治愈系
   ============================================================ */

:root {
  --bg: #F4F2EA;
  --bg-deep: #ECE9DD;
  --surface: #FFFFFF;
  --surface-2: #FAF9F3;
  --ink: #2D3A33;
  --ink-2: #4C5B52;
  --muted: #6B7A70;
  --line: #E3E0D2;
  --line-soft: #EDEBE0;
  --green: #57806A;
  --green-deep: #3E6350;
  --green-mist: #E9F0E8;
  --honey: #C08A38;
  --honey-mist: #F6EDDA;
  --rose: #B85C52;
  --rose-mist: #F5E5E2;
  --sky: #4E7D8C;
  --sky-mist: #E4EEF1;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 28px rgba(62, 82, 70, 0.09);
  --shadow-soft: 0 3px 12px rgba(62, 82, 70, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;

  /* 间距系统（4px 基数） */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-11: 44px;
  --space-12: 48px;

  /* 语义化间距 */
  --gap-xs: var(--space-1);
  --gap-sm: var(--space-2);
  --gap-md: var(--space-3);
  --gap-lg: var(--space-4);
  --gap-xl: var(--space-5);
  --pad-xs: var(--space-1) var(--space-2);
  --pad-sm: var(--space-2) var(--space-3);
  --pad-md: var(--space-3) var(--space-4);
  --pad-lg: var(--space-4) var(--space-5);
  --pad-xl: var(--space-6) var(--space-5);
  --section-y: var(--space-8);
  --card-pad: var(--space-4) var(--space-5);

  /* 动效时长 */
  --dur-fast: 0.15s;
  --dur-base: 0.2s;
  --dur-slow: 0.3s;
  --dur-entrance: 0.25s;
  --dur-exit: 0.18s;

  /* 缓动函数 */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);    /* 标准：状态切换、hover */
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);       /* 减速：入场、展开 */
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);       /* 加速：离场、收起 */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);    /* 弹性：强调性入场 */
  --ease-linear: linear;                                 /* 匀速：旋转等循环动画 */
}

/* 深色模式 */
[data-theme="dark"] {
  --bg: #1A1F1C;
  --bg-deep: #141715;
  --surface: #232A26;
  --surface-2: #1E2420;
  --ink: #E8EDE9;
  --ink-2: #B8C4BC;
  --muted: #8A9990;
  --line: #2E3732;
  --line-soft: #28302B;
  --green: #6BA385;
  --green-deep: #57806A;
  --green-mist: #1E2E25;
  --honey: #D4A24E;
  --honey-mist: #2E2618;
  --rose: #CC7A70;
  --rose-mist: #2E1F1D;
  --sky: #6B9EAD;
  --sky-mist: #1C2A2E;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 3px 12px rgba(0, 0, 0, 0.2);
}

/* 深色模式下的背景光斑调整 */
[data-theme="dark"] body::before {
  background:
    radial-gradient(480px 320px at 110% -60px, rgba(107, 163, 133, 0.08), transparent 70%),
    radial-gradient(420px 300px at -80px 108%, rgba(212, 162, 78, 0.05), transparent 70%);
}

/* 深色模式图片反色优化（可选，对部分图标类图片） */
[data-theme="dark"] img.invert-dark {
  filter: invert(1) hue-rotate(180deg);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 有机纹理背景光斑 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(480px 320px at 110% -60px, rgba(87, 128, 106, 0.10), transparent 70%),
    radial-gradient(420px 300px at -80px 108%, rgba(192, 138, 56, 0.07), transparent 70%);
  z-index: 0;
}

#app { position: relative; z-index: 1; }

/* 防止粘性元素遮挡键盘焦点（WCAG 2.4.11 Focus Not Obscured） */
html {
  scroll-padding-top: 64px;
  scroll-padding-bottom: 80px;
}

@media (min-width: 768px) {
  html { scroll-padding-top: 72px; }
}

button, input, textarea, select { font-family: inherit; font-size: 1rem; color: var(--ink); }
button { cursor: pointer; border: none; background: none; }
a { color: var(--green); text-decoration: none; }

/* ---------------- 键盘可访问性：焦点可见 ---------------- */

/* 移除默认焦点轮廓，改用自定义 focus-ring（仅键盘触发时显示） */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 输入框内 focus 状态增强 */
.input:focus-visible,
textarea.input:focus-visible,
select.input:focus-visible {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(87, 128, 106, 0.18);
}

/* 按钮 focus 状态 */
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(87, 128, 106, 0.25), var(--shadow);
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(87, 128, 106, 0.35), 0 6px 16px rgba(87, 128, 106, 0.28);
}

/* 链接 focus */
a:focus-visible {
  outline-offset: 3px;
}

/* 底部导航项 focus */
.bottom-nav a:focus-visible {
  outline-offset: -2px;
  background: var(--green-mist);
}

/* 选项行 focus */
.option-row:focus-within {
  border-color: var(--green);
  background: var(--green-mist);
}

/* 表格行内操作按钮 focus */
table.data .actions button:focus-visible,
table.data .actions a:focus-visible {
  outline-offset: 2px;
}

/* 分段选项卡按钮 focus */
.seg-tabs button:focus-visible {
  outline-offset: 1px;
}

/* 卡片/列表项可点击时的 focus */
.training-card:focus-visible,
.list-item.clickable:focus-visible,
.chapter-link:focus-visible {
  outline-offset: 2px;
}

/* 弹窗关闭按钮 focus */
.modal-close:focus-visible {
  background: var(--bg-deep);
  outline: none;
}

/* 通知项 focus */
.notif-item:focus-visible {
  outline-offset: 2px;
  border-color: var(--green);
}

/* ---------------- 布局框架 ---------------- */

.app-frame {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px calc(96px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

.app-frame.no-nav { padding-bottom: 40px; }

/* ---------------- 认证页 ---------------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 20px;
  position: relative;
  z-index: 1;
}

.auth-brand { text-align: center; margin-bottom: 28px; }

.auth-brand svg { width: 64px; height: 64px; display: block; margin: 0 auto 12px; }

.auth-brand h1 { font-size: 1.45rem; letter-spacing: 0.02em; }

.auth-brand p { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}

.auth-card h2 { font-size: 1.12rem; margin-bottom: 18px; }

.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 0.9rem; }

.auth-foot a { font-weight: 600; }

.auth-notice {
  background: var(--honey-mist);
  color: #8A6425;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.86rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ---------------- 表单 ---------------- */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 0.86rem;
  color: var(--ink-2);
  font-weight: 600;
  margin-bottom: 6px;
}

.input, textarea.input, select.input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  transition: border-color var(--dur-base) var(--ease-standard), background var(--dur-base) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard);
  outline: none;
  font-size: 1rem;
}

.input:focus {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(87, 128, 106, 0.12);
}

/* 输入框错误状态 */
.input.is-error {
  border-color: var(--rose);
  background: var(--rose-mist);
}
.input.is-error:focus {
  box-shadow: 0 0 0 3px rgba(184, 92, 82, 0.12);
}

textarea.input { resize: vertical; min-height: 96px; line-height: 1.6; }

.input-hint { font-size: 0.78rem; color: var(--muted); margin-top: 5px; }

.field-error {
  font-size: 0.78rem;
  color: var(--rose);
  margin-top: 6px;
  line-height: 1.4;
  display: none;
  animation: shake 0.35s var(--ease-standard);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.form-error {
  background: var(--rose-mist);
  color: var(--rose);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.86rem;
  margin-bottom: 14px;
  line-height: 1.5;
  word-break: break-all;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  transition: transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard), background var(--dur-base) var(--ease-standard), opacity var(--dur-base) var(--ease-standard);
  user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-block { width: 100%; }

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 16px rgba(87, 128, 106, 0.28);
}

.btn-primary:hover { background: var(--green-deep); }

.btn-ghost {
  background: var(--green-mist);
  color: var(--green-deep);
}

.btn-ghost:hover { background: #DDE9DC; }

.btn-plain {
  background: var(--surface);
  color: var(--ink-2);
  border: 1.5px solid var(--line);
}

.btn-danger-ghost {
  background: var(--rose-mist);
  color: var(--rose);
}

.btn-sm { padding: 7px 13px; font-size: 0.86rem; border-radius: var(--radius-sm); }

.btn-link { color: var(--muted); font-size: 0.86rem; padding: 6px; }

.btn-link.danger { color: var(--rose); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- 卡片与列表 ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-title-row h3 { font-size: 1.02rem; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 2px 12px;
}

.section-head h2 { font-size: 1.05rem; }

.section-head .more { font-size: 0.84rem; color: var(--muted); }

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.list-item:last-child { border-bottom: none; }

.list-item .grow { flex: 1; min-width: 0; }

.list-item .title { font-weight: 600; font-size: 0.96rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list-item .sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

.empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.empty svg { width: 52px; height: 52px; opacity: 0.5; margin-bottom: 10px; }

/* ---------------- 徽章 / 标签 / 状态 ---------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag-green { background: var(--green-mist); color: var(--green-deep); }
.tag-honey { background: var(--honey-mist); color: #8A6425; }
.tag-rose  { background: var(--rose-mist); color: var(--rose); }
.tag-sky   { background: var(--sky-mist); color: var(--sky); }
.tag-gray  { background: var(--bg-deep); color: var(--muted); }

.stat-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; color: var(--ink-2); }

/* ---------------- 学员端：顶部问候 ---------------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #5E8A73 0%, #47705B 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 22px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.hero::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -40px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
}

.hero .hello { font-size: 1.22rem; font-weight: 700; }

.hero .sub { font-size: 0.84rem; opacity: 0.85; margin-top: 4px; }

.hero-stats { display: flex; gap: 18px; margin-top: 16px; position: relative; }

.hero-stats .num { font-size: 1.3rem; font-weight: 700; }

.hero-stats .lab { font-size: 0.74rem; opacity: 0.82; }

.hero-leaf { position: absolute; right: 18px; bottom: 14px; opacity: 0.5; }

/* 通知铃铛 */
.notif-bell {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.18); border-radius: 50%; color: #fff;
  text-decoration: none; transition: background var(--dur-base) var(--ease-standard), transform var(--dur-fast) var(--ease-spring);
}
.notif-bell:hover { background: rgba(255,255,255,0.28); }
.notif-bell:active { transform: scale(0.92); }
.notif-bell svg { width: 20px; height: 20px; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--rose); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #5E8A73; line-height: 1;
}

/* 主题切换按钮 */
.theme-toggle {
  position: absolute; top: 16px; right: 62px; z-index: 2;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.18); border-radius: 50%; color: #fff;
  border: none; cursor: pointer; transition: background 0.2s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.28); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* 通知列表 */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item {
  display: flex; gap: 12px; padding: 14px 14px 14px 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
  position: relative;
}
.notif-item:hover { border-color: var(--green); box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.notif-item.unread { background: var(--green-mist); border-color: var(--green-mist); }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px;
  background: var(--muted);
}
.notif-item.unread .notif-dot { background: var(--green); }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.notif-body { font-size: 13px; color: var(--ink-2); line-height: 1.5; word-break: break-word; }
.notif-time { font-size: 12px; color: var(--muted); margin-top: 6px; }
.notif-link {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; padding: 6px 12px;
  background: var(--green); color: #fff !important;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  text-decoration: none;
}
.notif-link svg { width: 14px; height: 14px; }

/* ---------------- 底部导航（学员端） ---------------- */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: center;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}

.bottom-nav-inner { display: flex; width: 100%; max-width: 420px; }

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 2px;
  color: var(--muted);
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.bottom-nav a svg { width: 23px; height: 23px; }

.bottom-nav a.active { color: var(--green-deep); font-weight: 600; }

/* ---------------- 培训卡片 ---------------- */

.training-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 12px;
  transition: transform 0.15s, box-shadow 0.2s;
  display: block;
  color: var(--ink);
}

.training-card:active { transform: scale(0.985); }

.training-card h3 { font-size: 1.05rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

.training-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.progress-track {
  height: 7px;
  background: var(--bg-deep);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6C9A80, var(--green));
  border-radius: 99px;
  transition: width 0.5s var(--ease-decelerate);
}

.progress-row { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 6px; }

/* ---------------- 打卡成功页 ---------------- */

.checkin-result {
  max-width: 420px;
  margin: 0 auto;
  padding: 48px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.checkin-icon {
  width: 92px;
  height: 92px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-mist);
  animation: pop-in var(--dur-slow) var(--ease-spring);
}

.checkin-icon svg { width: 44px; height: 44px; }

.checkin-icon.warn { background: var(--honey-mist); }

.checkin-icon.bad { background: var(--rose-mist); }

@keyframes pop-in {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.checkin-result h2 { text-align: center; font-size: 1.3rem; margin-bottom: 6px; }

.checkin-result .sub { text-align: center; color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }

.checkin-info-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 22px;
}

.checkin-info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.94rem;
}

.checkin-info-row:last-child { border-bottom: none; }

.checkin-info-row .k { color: var(--muted); }

.checkin-info-row .v { font-weight: 600; text-align: right; }

.checkin-info-row .v.time { color: var(--green-deep); font-variant-numeric: tabular-nums; }

/* ---------------- 答题 ---------------- */

.quiz-card { margin-bottom: 14px; }

.quiz-card .q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }

.q-index {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--green-mist);
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.q-title { font-weight: 600; font-size: 0.98rem; line-height: 1.55; margin-bottom: 12px; white-space: pre-wrap; word-break: break-word; }

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  margin-bottom: 9px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.option-row:hover { border-color: #B9CDBD; }

.option-row input[type="radio"] {
  accent-color: var(--green);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.option-row .opt-letter {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--bg-deep);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-row .opt-text { flex: 1; font-size: 0.94rem; word-break: break-word; }

.result-chip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 0.88rem;
  margin-top: 10px;
  line-height: 1.5;
}

.result-chip.good { background: var(--green-mist); color: var(--green-deep); }
.result-chip.bad { background: var(--rose-mist); color: var(--rose); }
.result-chip.wait { background: var(--honey-mist); color: #8A6425; }

.quiz-submit-bar {
  position: sticky;
  bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.quiz-submit-bar .hint { flex: 1; font-size: 0.78rem; color: var(--muted); padding-left: 6px; }

.char-count { text-align: right; font-size: 0.74rem; color: var(--muted); margin-top: 4px; }

/* ---------------- 章节填写表格（学员端） ---------------- */

.form-opts { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }

.form-ro-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.form-ro-row:last-child { border-bottom: none; }

.form-ro-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 3px;
}

.form-ro-value {
  font-size: 0.92rem;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------- 工具表格（学员端） ---------------- */

.tool-table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px 4px;
  -webkit-overflow-scrolling: touch;
}

.tool-table {
  width: 100%;
  min-width: 480px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.tool-table th,
.tool-table td {
  padding: 0;
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.tool-table th:first-child,
.tool-table td:first-child {
  border-left: 1px solid var(--line-soft);
}

.tool-table thead th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--ink-2);
  font-size: 0.82rem;
  white-space: nowrap;
}

.tool-table th:first-child {
  border-top-left-radius: var(--radius-sm);
}

.tool-table th:last-child {
  border-top-right-radius: var(--radius-sm);
}

.tool-table-th-inner {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-table tbody tr:last-child td {
  border-bottom: none;
}

.tool-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius-sm);
}

.tool-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius-sm);
}

.tool-table-cell {
  min-width: 100px;
  max-width: 200px;
}

.tool-table-cell-value {
  display: block;
  padding: 8px 12px;
  color: var(--ink);
  word-break: break-all;
}

.tool-table-formula {
  background: var(--bg-deep);
}

.tool-table-formula .tool-table-cell-value {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  font-style: italic;
}

.tool-table-input {
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  color: var(--ink);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.tool-table-input:focus {
  background: var(--green-mist);
  box-shadow: inset 0 0 0 2px var(--green);
}

select.tool-table-input {
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2387958C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  cursor: pointer;
}

.tool-table-actions {
  min-width: 70px;
  text-align: center;
  background: var(--surface-2);
}

.tool-table-th-actions {
  background: var(--surface-2);
  text-align: center;
  min-width: 70px;
}

.tool-table-add-row {
  margin-top: 10px;
  text-align: center;
}

/* ---------------- 预约考官视频考核 ---------------- */

.exam-time {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}

.exam-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.exam-slots { display: flex; flex-direction: column; }

.exam-slot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

.exam-slot-row:last-child { border-bottom: none; }

.exam-slot-row .grow { flex: 1; min-width: 0; }

.exam-history {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.exam-hist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}

.exam-hist-row .grow { flex: 1; min-width: 0; }

.exam-note {
  font-size: 0.82rem;
  color: var(--ink-2);
  margin-top: 2px;
  word-break: break-word;
}

/* 教师端：时段内的学员预约行 */
.exam-bk-list { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }

.exam-bk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}

.exam-bk-row .grow { flex: 1; min-width: 140px; }


/* ---------------- 教师端 ---------------- */

.admin-shell { max-width: 1020px; margin: 0 auto; padding: 0 16px 60px; position: relative; z-index: 1; }

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 242, 234, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  margin: 0 -16px 20px;
  padding: 10px 16px;
}

.admin-topbar-inner {
  max-width: 1020px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.02rem; }

.admin-logo svg { width: 26px; height: 26px; }

.admin-logo .role-tag { font-size: 0.7rem; background: var(--green-mist); color: var(--green-deep); padding: 2px 8px; border-radius: 99px; font-weight: 600; }

.admin-nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }

.admin-nav a {
  padding: 7px 14px;
  border-radius: 99px;
  color: var(--ink-2);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.admin-nav a.active { background: var(--green); color: #fff; }

.admin-user { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--muted); }

.admin-theme-toggle { display: flex; align-items: center; margin-left: 8px; }
.admin-theme-toggle .theme-toggle {
  position: static;
  width: 32px; height: 32px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.admin-theme-toggle .theme-toggle:hover {
  background: var(--green-mist);
  color: var(--green-deep);
  border-color: var(--green-mist);
}
.admin-theme-toggle .theme-toggle svg { width: 16px; height: 16px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.stat-card .num { font-size: 1.5rem; font-weight: 700; color: var(--green-deep); font-variant-numeric: tabular-nums; }

.stat-card .num.honey { color: var(--honey); }
.stat-card .num.rose { color: var(--rose); }

.stat-card .lab { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* 分段选项卡 */
.seg-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-deep);
  border-radius: 99px;
  padding: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.seg-tabs button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.seg-tabs button.active { background: var(--surface); color: var(--green-deep); box-shadow: var(--shadow-soft); }

.seg-tabs button .dot {
  display: inline-block;
  min-width: 17px;
  height: 17px;
  line-height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--rose);
  color: #fff;
  font-size: 0.7rem;
  margin-left: 4px;
}

/* ---------- 快捷入口 ---------- */
.quick-entry {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.q-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.15s;
}

.q-entry:active {
  transform: scale(0.97);
  background: var(--bg-deep);
}

.q-entry.q-entry-dim {
  opacity: 0.5;
}

.q-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 1.1rem;
}

.q-icon svg {
  width: 20px;
  height: 20px;
}

.q-entry-team .q-icon { background: linear-gradient(135deg, #5B8FB9, #3A5F8A); }
.q-entry-score .q-icon { background: linear-gradient(135deg, #E8A93C, #C08A38); }
.q-entry-badge .q-icon { background: linear-gradient(135deg, #9B59B6, #6C3483); }
.q-entry-att .q-icon { background: linear-gradient(135deg, #57806A, #3E5C4A); }

.q-body {
  flex: 1;
  min-width: 0;
}

.q-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.q-sub {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-arrow {
  color: var(--muted);
  flex-shrink: 0;
  opacity: 0.6;
}

.q-arrow svg {
  width: 16px;
  height: 16px;
}

/* ---------- 徽章墙 ---------- */
.badge-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.badge-scroll::-webkit-scrollbar {
  display: none;
}

.badge-card {
  flex-shrink: 0;
  width: 86px;
  text-align: center;
  padding: 10px 6px;
  background: var(--bg-deep);
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
}

.badge-card.earned {
  background: linear-gradient(135deg, rgba(232, 169, 60, 0.1), rgba(192, 138, 56, 0.08));
  border-color: rgba(192, 138, 56, 0.3);
}

.badge-card.locked {
  opacity: 0.45;
  filter: grayscale(1);
}

.badge-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--honey);
}

.badge-icon svg {
  width: 36px;
  height: 36px;
}

.badge-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-date {
  font-size: 0.68rem;
  color: var(--muted);
}

.badge-card.earned .badge-date {
  color: var(--honey);
}

/* ---------- 战队卡片 ---------- */
.team-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--green-mist), rgba(87, 128, 106, 0.08));
  border: 1px solid rgba(87, 128, 106, 0.2);
  border-radius: var(--radius-md);
  padding: 14px;
}

.team-flag {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--green-deep);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.team-flag svg {
  width: 24px;
  height: 24px;
}

.team-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--green-deep);
  margin-bottom: 2px;
}

.team-slogan {
  font-size: 0.84rem;
  color: var(--ink-2);
  margin-bottom: 6px;
  font-style: italic;
}

.team-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.76rem;
  color: var(--muted);
}

.team-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.team-meta svg {
  width: 14px;
  height: 14px;
}

/* ---------- 考勤详情 ---------- */
.att-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  text-align: center;
}

/* 表格 */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 560px;
}

table.data th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

table.data tr:last-child td { border-bottom: none; }

table.data .actions { display: flex; gap: 6px; flex-wrap: wrap; }

table.data td.num { font-variant-numeric: tabular-nums; }

/* 批量选择 */
table.data th:first-child,
table.data td:first-child {
  width: 40px;
  padding-left: 14px;
  padding-right: 0;
}
.batch-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--green);
}
.batch-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--green-mist);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.batch-bar .batch-count {
  font-size: 0.88rem;
  color: var(--green-deep);
  font-weight: 600;
}
.batch-bar .batch-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.batch-bar.hidden { display: none; }

/* 场次卡片 */
.session-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.session-card:last-child { border-bottom: none; }

.session-card .s-info { flex: 1; min-width: 160px; }

.session-card .s-title { font-weight: 600; }

.session-card .s-sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* 题目卡片 */
.question-item { border-bottom: 1px solid var(--line-soft); padding: 14px 0; }

.question-item:last-child { border-bottom: none; }

.question-item .q-line { display: flex; gap: 8px; align-items: flex-start; }

.question-item .opts { margin: 8px 0 0 34px; font-size: 0.86rem; color: var(--ink-2); }

.question-item .opts .right { color: var(--green-deep); font-weight: 700; }

/* 评分卡片 */
.grade-card { margin-bottom: 12px; }

.grade-card .g-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }

.grade-card .g-answer {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.grade-form { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }

.grade-form .score-input { width: 92px; flex-shrink: 0; }

.grade-form .feedback-input { flex: 1; min-width: 200px; }

/* 工具行 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

.toolbar .spacer { flex: 1; }

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inline-form .field { margin-bottom: 0; flex: 1; min-width: 140px; }

.inline-form .btn { flex-shrink: 0; }

/* ---------------- 弹窗 ---------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 58, 51, 0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in var(--dur-base) var(--ease-decelerate);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px;
  animation: slide-up var(--dur-entrance) var(--ease-spring);
}

@keyframes slide-up {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal h3 { font-size: 1.08rem; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.modal .modal-close {
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px;
  border-radius: 8px;
}

.modal .modal-close:hover { color: var(--ink); }

.modal-actions { display: flex; gap: 10px; margin-top: 18px; }

.modal-actions .btn { flex: 1; }

/* 二维码弹窗 */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 4px;
}

.qr-box .qr-canvas {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.qr-box img, .qr-box canvas { display: block; }

.qr-url {
  width: 100%;
  margin-top: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--ink-2);
  word-break: break-all;
  text-align: center;
}

.qr-tip { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.6; }

/* ---------------- Toast ---------------- */

#toast-wrap {
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(45, 58, 51, 0.92);
  color: #fff;
  padding: 11px 20px;
  border-radius: 99px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  max-width: 86vw;
  opacity: 0;
  transform: translateY(-12px) scale(0.95);
  transition: opacity var(--dur-entrance) var(--ease-spring), transform var(--dur-entrance) var(--ease-spring);
}

.toast.show { opacity: 1; transform: translateY(0) scale(1); }

.toast.success { background: rgba(62, 99, 80, 0.95); }

.toast.error { background: rgba(150, 68, 60, 0.95); }

/* ---------------- 加载 ---------------- */

.loading {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.loading .spin {
  width: 30px;
  height: 30px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}

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

.skeleton {
  background: linear-gradient(90deg, var(--bg-deep) 25%, #F1EEE3 50%, var(--bg-deep) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------- 打印（二维码） ---------------- */

@media print {
  body * { visibility: hidden; }
  .qr-print-area, .qr-print-area * { visibility: visible; }
  .qr-print-area {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 40px;
  }
  .qr-print-area .qr-canvas { border: 2px solid #333; padding: 20px; }
  .qr-print-area h2 { font-size: 22px; margin-bottom: 6px; }
  .qr-print-area p { font-size: 14px; color: #333; }
}

/* ---------------- 响应式 ---------------- */

@media (min-width: 768px) {
  .app-frame { padding-top: 32px; }
  .stat-grid { grid-template-columns: repeat(5, 1fr); }
  .admin-shell { padding: 0 24px 80px; }
  .admin-topbar { margin: 0 -24px 24px; padding: 12px 24px; }
  .db-stats { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1440px) {
  .app-frame { padding-top: 48px; }
  .admin-shell { padding: 0 32px 100px; }
}

@media (max-width: 374px) {
  .hero-stats { gap: 12px; }
  .btn { padding: 11px 16px; }
}

/* ---------------- 题目批量导入 ---------------- */

.import-steps {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.84rem;
  color: var(--ink-2);
  line-height: 1.9;
  margin-bottom: 14px;
}

.import-steps a { font-weight: 600; }

.file-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color 0.2s, background 0.2s;
}

.file-drop:hover { border-color: var(--green); background: var(--green-mist); }

.file-drop svg { width: 26px; height: 26px; color: var(--green); flex-shrink: 0; }

.file-drop b { display: block; font-size: 0.92rem; color: var(--ink); }

.file-drop span { display: block; font-size: 0.78rem; color: var(--muted); }

.imp-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.84rem;
  margin: 14px 0 8px;
}

.imp-list {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
}

.imp-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.84rem;
}

.imp-row:last-child { border-bottom: none; }

.imp-row .no {
  flex-shrink: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--muted);
  width: 26px;
}

.imp-row .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.imp-row .why { flex-shrink: 0; font-size: 0.76rem; color: var(--rose); max-width: 46%; }

.imp-note { font-size: 0.78rem; color: var(--muted); margin-top: 8px; }

.tag-violet { background: #f3e8ff; color: #7c3aed; }

/* 智能识别模式的行样式 */
.smart-row {
  flex-wrap: wrap;
  gap: 8px;
}
.smart-type-select {
  flex-shrink: 0;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.78rem;
  color: var(--sky);
  cursor: pointer;
}
.smart-type-select:focus {
  outline: none;
  border-color: var(--sky);
}
.smart-req {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  color: var(--muted);
  cursor: pointer;
}
.smart-req input {
  margin: 0;
  cursor: pointer;
}
.smart-row .why {
  color: var(--muted);
  max-width: 100%;
  font-size: 0.72rem;
  flex-basis: 100%;
  padding-left: 34px;
}

/* 工作表选择器 */
.sheet-select-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 14px;
  margin-bottom: 8px;
}
.sheet-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.sheet-tab {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 0.8rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.sheet-tab:hover {
  border-color: var(--sky);
  color: var(--sky);
}
.sheet-tab.active {
  background: var(--sky);
  color: #fff;
  border-color: var(--sky);
}

/* 导入面板（内嵌在设计器弹窗里） */
.form-import-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.form-import-panel-inner {
  background: var(--bg);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* 工具表格导入：额外编辑区占满整行 */
.ttimp-extra {
  flex-basis: 100%;
}
.ttimp-extra .input {
  width: 100%;
  box-sizing: border-box;
}

.ai-prompt {
  width: 100%;
  height: 320px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 12px 14px;
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--ink);
  font-family: var(--font);
  resize: vertical;
}

.ai-prompt:focus {
  outline: none;
  border-color: var(--green);
  background: var(--surface);
}

/* ---------------- 章节课程（学员端） ---------------- */

.chapter-link {
  display: block;
  color: inherit;
}

.list-item.clickable { cursor: pointer; }

.list-item.locked { opacity: 0.62; }

.list-item.locked .title { color: var(--muted); }

.ch-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ch-head-title {
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.ch-video-wrap video {
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
  background: #101410;
}

/* 防快进播放器：无原生控件 + 自定义控制条 */
.vp {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #101410;
}

.vp video {
  display: block;
  width: 100%;
  border-radius: 0;
}

.vp-big {
  position: absolute;
  top: 0;
  left: 0;
  right: 62px;
  bottom: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
}

.vp-big span {
  font-size: 2.4rem;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.vp-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(16, 20, 16, 0.92);
  color: #F4F2EA;
}

.vp-btn {
  color: #F4F2EA;
  font-size: 0.95rem;
  padding: 2px 6px;
  min-width: 30px;
}

.vp-speed {
  border: 1px solid rgba(244, 242, 234, 0.4);
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 3px 10px;
  flex-shrink: 0;
}

.vp-time {
  font-size: 0.78rem;
  color: rgba(244, 242, 234, 0.85);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.vp-prog {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(244, 242, 234, 0.25);
  overflow: hidden;
}

.vp-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--green);
  transition: width 0.4s linear;
}

/* 视频防录屏水印 */
.wm-tile {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background-size: 260px 150px;
  opacity: 1;
}

.wm-time {
  position: absolute;
  pointer-events: none;
  z-index: 4;
  color: rgba(255, 255, 255, 0.25);
  font-size: 12px;
  font-family: -apple-system, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: right 0.6s ease, bottom 0.6s ease;
}

.ch-video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #101410;
}

.ch-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ch-reader-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ch-content {
  font-size: 0.94rem;
  line-height: 1.9;
  color: var(--ink-2);
}

.ch-para {
  padding: 6px 10px;
  margin: 0 0 6px;
  border-radius: var(--radius-sm);
  transition: background 0.3s;
}

.ch-para:last-child { margin-bottom: 0; }

.ch-para.reading {
  background: var(--green-mist);
  color: var(--green-deep);
}

.ch-passed {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 2px;
}

.ch-passed svg { width: 44px; height: 44px; flex-shrink: 0; }

.ch-passed-title { font-weight: 700; color: var(--green-deep); font-size: 1rem; }

.ch-passed .sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

.ch-pass-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.ch-pass-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.88rem;
  color: var(--ink-2);
}

.ch-pass-row.done { color: var(--green-deep); background: var(--green-mist); }

.ch-pass-dot {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.ch-pass-row.done .ch-pass-dot {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

/* ---------------- 数据看板（教师端） ---------------- */

.db-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.db-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.db-stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  word-break: break-all;
}

.db-stat-num.green { color: var(--green); }
.db-stat-num.honey { color: var(--honey); }
.db-stat-num.rose { color: var(--rose); }

.db-stat-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
}

.legend-row {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.legend-row .legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
}

.tag-xs {
  font-size: 0.68rem;
  padding: 1px 6px;
  font-weight: 500;
}

.db-funnel {
  padding: 8px 0 4px;
}

.db-exam-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.db-exam-card {
  text-align: center;
  padding: 16px 8px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
}

.db-exam-num {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.db-exam-num.green { color: var(--green); }
.db-exam-num.honey { color: var(--honey); }
.db-exam-num.rose { color: var(--rose); }

.db-exam-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.db-empty {
  text-align: center;
  padding: 48px 20px;
}

.db-empty svg {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  opacity: 0.5;
}

/* ---------------- 结业证书 ---------------- */

.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  font-size: 0.86rem;
  color: var(--ink-2);
  font-weight: 500;
  margin-bottom: 6px;
}

.form-row .req {
  color: var(--rose);
  margin-left: 2px;
}

.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  background: var(--surface);
  color: var(--ink);
  box-sizing: border-box;
}

.form-row input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-mist);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.form-actions .hint {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Switch 开关 */
.switch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch-label input[type="checkbox"] {
  display: none;
}

.switch-track {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--line);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}

.switch-label input:checked + .switch-track {
  background: var(--green);
}

.switch-label input:checked + .switch-track .switch-thumb {
  transform: translateX(20px);
}

.switch-text {
  font-size: 0.9rem;
  color: var(--ink-2);
  font-weight: 500;
}

.mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

/* 学员端证书卡片 */
.cert-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.15s;
}

.cert-card:last-child {
  border-bottom: none;
}

.cert-card:active {
  background: var(--surface-2);
}

.cert-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--honey-mist), var(--green-mist));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--honey);
}

.cert-card-icon svg {
  width: 22px;
  height: 22px;
}

.cert-card-info {
  flex: 1;
  min-width: 0;
}

.cert-card-title {
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cert-card-no {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  margin-bottom: 2px;
}

.cert-card-date {
  font-size: 0.76rem;
  color: var(--muted);
}

.cert-card-action {
  font-size: 0.82rem;
  color: var(--green);
  font-weight: 500;
  flex-shrink: 0;
}

/* 证书弹层 */
.cert-modal {
  text-align: center;
}

.cert-modal-loading {
  padding: 40px 0;
}

#cert-canvas {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.cert-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

@media (min-width: 768px) {
  .cert-card:hover {
    background: var(--surface-2);
  }
}

/* ---------------- 学员进度矩阵（教师端） ---------------- */

.mx-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  -webkit-overflow-scrolling: touch;
}

.mx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 520px;
}

.mx-table th {
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.mx-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.mx-table tbody tr:last-child td { border-bottom: none; }

.mx-name {
  font-weight: 600;
  position: sticky;
  left: 0;
  background: var(--surface);
  white-space: nowrap;
  border-right: 1px solid var(--line-soft);
}

.mx-ch-title {
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mx-ch-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
}

.mx-cell { white-space: nowrap; }

.mx-bits {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ---------------- 可访问性：减少动效偏好 ---------------- */

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

  /* 骨架屏直接显示静态背景，不闪烁 */
  .skeleton {
    animation: none;
    background: var(--bg-deep);
  }

  /* 打卡成功图标直接显示，不弹入 */
  .checkin-icon {
    animation: none;
  }

  /* 弹窗直接显示，不滑入 */
  .modal {
    animation: none;
  }

  .modal-overlay {
    animation: none;
  }

  /* Toast 直接显示 */
  .toast {
    transition: none;
    opacity: 1;
    transform: none;
  }

  /* 视频播放器进度条无过渡 */
  .vp-fill {
    transition: none;
  }

  /* 进度条填充无过渡 */
  .progress-fill {
    transition: none;
  }
}

/* ============================================================
   第二期：PK 与激励体系
   ============================================================ */

/* ---------- 龙虎榜 / 领奖台 ---------- */

.ranking-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  padding: 20px 10px 10px;
  margin-bottom: 16px;
}

.podium-item {
  flex: 1;
  max-width: 140px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.podium-item.rank-1 { order: 2; }
.podium-item.rank-2 { order: 1; }
.podium-item.rank-3 { order: 3; }

.podium-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  box-shadow: var(--shadow-soft);
}

.podium-item.rank-1 .podium-avatar {
  width: 76px;
  height: 76px;
  font-size: 1.7rem;
}

.ranking-medal-gold .podium-avatar {
  background: linear-gradient(135deg, #FFD93D, #F5A623, #C08A38);
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.35);
}

.ranking-medal-silver .podium-avatar {
  background: linear-gradient(135deg, #E8E8E8, #B8B8B8, #8A8A8A);
  box-shadow: 0 4px 16px rgba(180, 180, 180, 0.3);
}

.ranking-medal-bronze .podium-avatar {
  background: linear-gradient(135deg, #E8B88A, #CD7F32, #A0522D);
  box-shadow: 0 4px 16px rgba(205, 127, 50, 0.3);
}

.podium-medal {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.podium-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.podium-team {
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.podium-score {
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ranking-medal-gold .podium-score { color: #C08A38; }
.ranking-medal-silver .podium-score { color: #8A8A8A; }
.ranking-medal-bronze .podium-score { color: #CD7F32; }

.podium-platform {
  width: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-top: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
  padding: 10px 0;
}

.podium-item.rank-1 .podium-platform {
  height: 64px;
  background: linear-gradient(180deg, #F5A623, #C08A38);
}

.podium-item.rank-2 .podium-platform {
  height: 48px;
  background: linear-gradient(180deg, #B8B8B8, #8A8A8A);
}

.podium-item.rank-3 .podium-platform {
  height: 36px;
  background: linear-gradient(180deg, #CD7F32, #A0522D);
}

/* 排名列表 */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
}

.ranking-row.is-me {
  background: var(--green-mist);
  border-color: rgba(87, 128, 106, 0.25);
}

.ranking-rank {
  width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.ranking-row.top-1 .ranking-rank { color: #C08A38; }
.ranking-row.top-2 .ranking-rank { color: #8A8A8A; }
.ranking-row.top-3 .ranking-rank { color: #CD7F32; }

.ranking-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-mist);
  color: var(--green-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ranking-info {
  flex: 1;
  min-width: 0;
}

.ranking-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.ranking-sub {
  font-size: 0.76rem;
  color: var(--muted);
}

.ranking-score-right {
  text-align: right;
  flex-shrink: 0;
}

.ranking-score-num {
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--green-deep);
}

.ranking-gap {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.ranking-my-sticky {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border: 1.5px solid var(--green);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 8px;
  box-shadow: var(--shadow-soft);
  z-index: 2;
}

.ranking-expand-btn {
  display: block;
  width: 100%;
  padding: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  background: transparent;
}

.ranking-expand-btn:hover {
  color: var(--green);
  border-color: var(--green);
}

/* ---------- 战队排名卡片 ---------- */

.team-ranking-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  margin-bottom: 10px;
}

.team-ranking-card.top-1 {
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.12), rgba(245, 166, 35, 0.08));
  border-color: rgba(245, 166, 35, 0.3);
}

.team-ranking-card.top-2 {
  background: linear-gradient(135deg, rgba(200, 200, 200, 0.12), rgba(150, 150, 150, 0.08));
  border-color: rgba(150, 150, 150, 0.25);
}

.team-ranking-card.top-3 {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.12), rgba(160, 82, 45, 0.08));
  border-color: rgba(205, 127, 50, 0.25);
}

.team-rank-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
  background: var(--bg-deep);
  color: var(--muted);
}

.team-ranking-card.top-1 .team-rank-badge {
  background: linear-gradient(135deg, #FFD93D, #F5A623);
  color: #fff;
}

.team-ranking-card.top-2 .team-rank-badge {
  background: linear-gradient(135deg, #E0E0E0, #9A9A9A);
  color: #fff;
}

.team-ranking-card.top-3 .team-rank-badge {
  background: linear-gradient(135deg, #E8B88A, #CD7F32);
  color: #fff;
}

.team-ranking-flag {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.team-ranking-info {
  flex: 1;
  min-width: 0;
}

.team-ranking-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.team-ranking-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.team-ranking-score {
  text-align: right;
  flex-shrink: 0;
}

.team-ranking-score .num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--green-deep);
  font-variant-numeric: tabular-nums;
}

.team-ranking-score .lab {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ---------- PK 金卡片 ---------- */

.pk-fund-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
}

.pk-fund-card.highlight {
  background: linear-gradient(135deg, rgba(192, 138, 56, 0.1), rgba(192, 138, 56, 0.04));
  border-color: rgba(192, 138, 56, 0.3);
}

.pk-fund-amount {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--honey);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.pk-fund-amount .yuan {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  margin-right: 2px;
}

.pk-fund-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 8px;
}

.pk-fund-status.paid {
  background: var(--green-mist);
  color: var(--green-deep);
}

.pk-fund-status.unpaid {
  background: var(--rose-mist);
  color: var(--rose);
}

.pk-fund-status.refunded {
  background: var(--sky-mist);
  color: var(--sky);
}

.pk-fund-status.confiscated {
  background: var(--bg-deep);
  color: var(--muted);
}

.pk-fund-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-soft);
}

.pk-fund-stat {
  text-align: center;
}

.pk-fund-stat .num {
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.pk-fund-stat .num.green { color: var(--green-deep); }
.pk-fund-stat .num.rose { color: var(--rose); }
.pk-fund-stat .num.honey { color: var(--honey); }

.pk-fund-stat .lab {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 2px;
}

/* PK 金学员列表 */
.pk-fund-list .list-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.pk-fund-list .list-item:last-child {
  border-bottom: none;
}

.pk-fund-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pk-fund-row .pk-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.pk-fund-row .pk-team {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.pk-fund-row .pk-amount {
  font-weight: 700;
  color: var(--honey);
  font-variant-numeric: tabular-nums;
}

/* ---------- 结算卡片 ---------- */

.settlement-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
}

.settlement-card .settle-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.settlement-card .settle-period {
  font-weight: 700;
  font-size: 0.95rem;
}

.settlement-card .settle-date {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.settle-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-soft);
}

.settle-stat {
  text-align: center;
}

.settle-stat .num {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.settle-stat .num.green { color: var(--green-deep); }
.settle-stat .num.rose { color: var(--rose); }
.settle-stat .num.honey { color: var(--honey); }
.settle-stat .num.sky { color: var(--sky); }

.settle-stat .lab {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}

.settle-big-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #B85C52, #8B3A32);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(184, 92, 82, 0.3);
  transition: all 0.15s;
}

.settle-big-btn:active {
  transform: scale(0.98);
}

.settle-big-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settle-detail-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-soft);
}

.settle-detail-title {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--ink-2);
}

.settle-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.86rem;
}

.settle-detail-row .name {
  color: var(--ink-2);
}

.settle-detail-row .amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.settle-detail-row .amount.plus { color: var(--green-deep); }
.settle-detail-row .amount.minus { color: var(--rose); }

.settle-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-weight: 700;
}

/* ---------- 荣誉徽章大卡片 ---------- */

.honor-badge-large {
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.15), rgba(245, 166, 35, 0.08));
  border: 1px solid rgba(245, 166, 35, 0.35);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: center;
  margin-bottom: 12px;
}

.honor-badge-large .honor-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.honor-badge-large .honor-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.honor-badge-large .honor-desc {
  font-size: 0.78rem;
  color: var(--muted);
}

.honor-badge-large .honor-date {
  font-size: 0.74rem;
  color: var(--honey);
  margin-top: 8px;
  font-weight: 600;
}

.honor-badge-large.locked {
  opacity: 0.4;
  filter: grayscale(0.8);
  background: var(--surface-2);
  border-color: var(--line-soft);
}

.honor-group-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-2);
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.honor-group-title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--honey);
  border-radius: 2px;
}

/* ---------- 补课申请按钮 ---------- */

.makeup-request-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--sky-mist);
  color: var(--sky);
  border: none;
  cursor: pointer;
}

.makeup-request-btn:hover {
  background: var(--sky);
  color: #fff;
}

.makeup-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 500;
}

.makeup-status.pending {
  background: var(--honey-mist);
  color: var(--honey);
}

.makeup-status.approved {
  background: var(--green-mist);
  color: var(--green-deep);
}

.makeup-status.rejected {
  background: var(--rose-mist);
  color: var(--rose);
}

/* ---------- 补考按钮 ---------- */

.retake-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  background: linear-gradient(135deg, #E8A93C, #C08A38);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(192, 138, 56, 0.3);
}

.retake-btn:active {
  transform: scale(0.97);
}

.retake-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.retake-count {
  font-size: 0.74rem;
  color: var(--muted);
  margin-left: 6px;
}

/* ---------- 筛选工具栏 ---------- */

.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-bar select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  background: var(--surface);
  color: var(--ink);
}

.filter-bar .spacer {
  flex: 1;
}

/* ---------- 批量操作栏 ---------- */

.batch-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.batch-bar .selected-count {
  font-size: 0.82rem;
  color: var(--muted);
}

.batch-bar .spacer { flex: 1; }

/* ---------- 明细行内操作 ---------- */

.row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ---------- 变身基金提示 ---------- */

.fund-hint {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.5;
  padding: 8px 10px;
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

/* ---------- 期数选择器 ---------- */

.period-selector {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}

.period-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}

.period-chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ---------- 复选框表格行 ---------- */

.check-col {
  width: 32px;
  flex-shrink: 0;
}

.check-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ---------- 深色模式适配 ---------- */

[data-theme="dark"] .ranking-row {
  background: var(--surface-2);
}

[data-theme="dark"] .ranking-row.is-me {
  background: var(--green-mist);
}

[data-theme="dark"] .team-ranking-card {
  background: var(--surface-2);
}

[data-theme="dark"] .pk-fund-card {
  background: var(--surface);
}

[data-theme="dark"] .settlement-card {
  background: var(--surface);
}

[data-theme="dark"] .honor-badge-large {
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.1), rgba(245, 166, 35, 0.05));
}

[data-theme="dark"] .honor-badge-large.locked {
  background: var(--surface-2);
}

[data-theme="dark"] .batch-bar {
  background: var(--surface-2);
}

[data-theme="dark"] .fund-hint {
  background: var(--surface-2);
}

[data-theme="dark"] .period-chip {
  background: var(--surface-2);
  border-color: var(--line);
}

/* ---------- 响应式 ---------- */

@media (min-width: 768px) {
  .ranking-podium {
    gap: 24px;
  }

  .podium-item {
    max-width: 180px;
  }

  .pk-fund-stats {
    grid-template-columns: repeat(5, 1fr);
  }

  .settle-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}
