/* ============================================================
   智慧教学系统 · 视觉系统
   设计语言：温润科技感的教育平台 —— 深色品牌侧栏 + 分层留白画布，
   青为主色，靛/紫/珊瑚/琥珀为模块辅色，统一的柔和分层阴影与一次入场动效。
   ============================================================ */
:root {
  /* 画布与表面 */
  --canvas: #eef2f8;
  --canvas-2: #e7edf6;
  --surface: #ffffff;
  --surface-sunk: #f5f7fb;
  --border: #e6ebf3;
  --border-strong: #d8e0ec;

  /* 文本 */
  --ink: #16223c;      /* 标题 */
  --text: #2c3a56;     /* 正文 */
  --muted: #6d7b96;    /* 次要（白底 ≥4.5:1） */
  --faint: #9aa6be;

  /* 品牌与辅色 */
  --primary: #10b5a3;
  --primary-2: #0c9c8c;
  --primary-ink: #087b6f;
  --indigo: #5b6cff;
  --violet: #8b5cf6;
  --coral: #ff6a5a;
  --amber: #f5a524;
  --rose: #f0568f;

  /* 侧栏 */
  --nav-bg-1: #121a2e;
  --nav-bg-2: #0b1220;
  --nav-text: #aab6d0;

  /* 分层阴影（都有偏移+柔化，非纯色光晕） */
  --sh-1: 0 1px 2px rgba(16,24,40,.05);
  --sh-2: 0 1px 2px rgba(16,24,40,.04), 0 10px 26px -14px rgba(16,24,40,.22);
  --sh-3: 0 2px 6px rgba(16,24,40,.06), 0 22px 48px -20px rgba(16,24,40,.30);
  --sh-primary: 0 6px 18px -6px rgba(16,181,163,.5);

  --radius: 16px;
  --radius-sm: 11px;
  --ease: cubic-bezier(.22,.61,.36,1);

  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; color: var(--text); }
body {
  background:
    radial-gradient(1200px 700px at 82% -8%, rgba(91,108,255,.10), transparent 60%),
    radial-gradient(1000px 620px at -6% 108%, rgba(16,181,163,.12), transparent 55%),
    linear-gradient(180deg, var(--canvas), var(--canvas-2));
  background-attachment: fixed;
}
button { font-family: inherit; cursor: pointer; }
h2 { margin: 0; font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.muted { color: var(--muted); font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.small { font-size: 12px; }

/* ---------- Layout ---------- */
#app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 240px; flex-shrink: 0; display: flex; flex-direction: column;
  color: var(--nav-text);
  background:
    radial-gradient(600px 300px at 20% -6%, rgba(16,181,163,.18), transparent 60%),
    linear-gradient(185deg, var(--nav-bg-1), var(--nav-bg-2));
  border-right: 1px solid rgba(255,255,255,.05);
  position: relative;
}
.sidebar::after { /* 细微右缘高光 */
  content: ""; position: absolute; top: 0; right: 0; width: 1px; height: 100%;
  background: linear-gradient(180deg, rgba(16,181,163,.4), transparent 40%);
}
.brand { display: flex; flex-direction: column; gap: 12px; padding: 24px 20px 16px; }
.school-logo { width: 100%; max-width: 198px; height: auto; opacity: .97; user-select: none; -webkit-user-drag: none; }
.brand-sys { display: flex; flex-direction: column; gap: 3px; padding: 12px 4px 0; border-top: 1px solid rgba(255,255,255,.08); }
.brand-name { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: 3px; }
.brand-sub { font-size: 9px; letter-spacing: 1.5px; color: #6f7d9c; text-transform: uppercase; }

.nav { flex: 1; padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 13px; padding: 11px 14px; border: none;
  background: transparent; color: #9fabc8; border-radius: 11px; font-size: 14px;
  text-align: left; position: relative; transition: color .18s var(--ease), background .18s var(--ease);
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  color: #fff; background: linear-gradient(120deg, var(--primary), var(--primary-2));
  box-shadow: var(--sh-primary);
}
.nav-item.active::before { /* 左侧发光小标 */
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: #4fe0cf; box-shadow: 0 0 12px #35d1bf;
}
.nav-ico { font-size: 17px; width: 22px; text-align: center; filter: saturate(1.1); }
.sidebar-foot { padding: 16px 20px; }
.foot-copy { font-size: 11px; color: #55627e; line-height: 1.6; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; background: rgba(255,255,255,.72); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border); z-index: 20;
}
.topbar-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.secure-tag {
  font-size: 12px; color: var(--primary-ink); background: rgba(16,181,163,.12);
  padding: 6px 12px; border-radius: 20px; font-weight: 600; border: 1px solid rgba(16,181,163,.2);
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.u-avatar { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; display: grid; place-items: center; font-weight: 700; box-shadow: 0 4px 12px -3px rgba(91,108,255,.5); }
.u-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.u-role { font-size: 11px; }
.content { flex: 1; overflow-y: auto; padding: 26px 30px 70px; }

/* 一次性入场动效（切换视图时重放，反馈更灵动） */
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.content > * { animation: viewIn .42s var(--ease) both; }
.content > *:nth-child(1) { animation-delay: 0s; }
.content > *:nth-child(2) { animation-delay: .05s; }
.content > *:nth-child(3) { animation-delay: .10s; }
.content > *:nth-child(4) { animation-delay: .15s; }
.content > *:nth-child(5) { animation-delay: .20s; }
@media (prefers-reduced-motion: reduce) { .content > * { animation: none; } }

/* ---------- Common ---------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h2 { white-space: nowrap; }
.page-head > .grow { min-width: 260px; }
.page-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-left: auto; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--sh-2); padding: 20px; margin-bottom: 18px;
}
.panel-title {
  font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.panel-title::before { /* 渐变短标记（信号motif，非card border-left） */
  content: ""; width: 16px; height: 4px; border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--indigo)); flex-shrink: 0;
}
.sub-section { margin-top: 20px; }
.sub-title { font-weight: 700; font-size: 14px; color: var(--ink); margin: 22px 0 13px; }
.field-label { font-size: 13px; font-weight: 600; margin: 13px 0 6px; color: #3c4a68; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .emoji { font-size: 34px; opacity: .85; }
.empty.small { padding: 26px; font-size: 13px; }

/* 按钮 */
.btn {
  border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font-size: 13px;
  font-weight: 600; transition: transform .15s var(--ease), box-shadow .18s var(--ease), background .18s, border-color .18s, color .18s;
  background: #eef1f7; color: #3b4763;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(120deg, var(--primary), var(--primary-2)); color: #fff;
  box-shadow: var(--sh-primary); border-color: transparent;
}
.btn-primary:hover { box-shadow: 0 10px 24px -6px rgba(16,181,163,.62); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: #3b4763; box-shadow: var(--sh-1); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-ink); background: rgba(16,181,163,.05); }
.btn-ghost.on { border-color: var(--primary); color: var(--primary-ink); background: rgba(16,181,163,.1); }
.btn-danger { background: linear-gradient(120deg, #ff6a5a, #ef4d63); color: #fff; box-shadow: 0 6px 16px -5px rgba(239,77,99,.5); }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -5px rgba(239,77,99,.6); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-sm { padding: 7px 13px; font-size: 12px; }
.btn-xs { padding: 5px 11px; font-size: 12px; border-radius: 8px; }

.inp {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border-strong); border-radius: 10px;
  font-size: 13px; outline: none; background: #fbfcfe; color: var(--text); transition: border-color .16s, box-shadow .16s, background .16s;
}
.inp:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(16,181,163,.14); }
.chip { border: 1px solid var(--border-strong); background: var(--surface); color: #55607a; padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; transition: .16s; box-shadow: var(--sh-1); }
.chip:hover { border-color: var(--primary); color: var(--primary-ink); }
.chip.active { background: linear-gradient(120deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; box-shadow: var(--sh-primary); }
.tag-mini { font-size: 11px; background: #eef1f7; padding: 3px 9px; border-radius: 6px; color: #6d7b96; font-weight: 600; }
.tag-mini.green { background: rgba(16,181,163,.13); color: var(--primary-ink); }
.res-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; letter-spacing: .3px; }

/* ---------- Toast ---------- */
#toast-wrap { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 11px; background: rgba(22,34,60,.96); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 13px; box-shadow: var(--sh-3); opacity: 0; transform: translateY(-14px) scale(.98); transition: .3s var(--ease); backdrop-filter: blur(8px); }
.toast.show { opacity: 1; transform: none; }
.toast-ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.toast-success .toast-ico { background: var(--primary); }
.toast-error .toast-ico { background: var(--coral); }
.toast-info .toast-ico { background: var(--indigo); }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(14,20,36,.55); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 900; opacity: 0; transition: .22s; padding: 20px; }
.modal-overlay.show { opacity: 1; }
.modal { background: var(--surface); border-radius: 18px; max-width: 94vw; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--sh-3); transform: translateY(12px) scale(.97); transition: .24s var(--ease); border: 1px solid var(--border); }
.modal-overlay.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 22px; border-bottom: 1px solid var(--border); }
.modal-x { border: none; background: transparent; font-size: 15px; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; transition: .15s; }
.modal-x:hover { background: #f0f2f7; color: var(--ink); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-body p { margin-top: 0; }
.modal-foot { padding: 15px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-sunk); }

/* ---------- Stats ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 6px; }
.stat-card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--sh-2); overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat-card::before { /* 顶部渐变高光条 */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--indigo)); opacity: .9;
}
.stat-card::after { /* 角落柔光 */
  content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(91,108,255,.10), transparent 70%);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: #55607a; margin-top: 7px; font-weight: 500; }
.stat-sub { margin-top: 3px; }

/* ---------- Dashboard ---------- */
.entry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.entry-card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; align-items: center; gap: 18px; box-shadow: var(--sh-2);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; overflow: hidden;
}
.entry-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 60%, rgba(16,181,163,.06)); opacity: 0; transition: opacity .2s; }
.entry-card:hover { transform: translateY(-3px); border-color: rgba(16,181,163,.4); box-shadow: var(--sh-3); }
.entry-card:hover::after { opacity: 1; }
.entry-card:hover .entry-arrow { transform: translateX(4px); color: var(--primary); }
.entry-ico { width: 54px; height: 54px; border-radius: 15px; background: linear-gradient(135deg, rgba(16,181,163,.16), rgba(91,108,255,.16)); display: grid; place-items: center; font-size: 26px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(16,181,163,.14); }
.entry-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; color: var(--ink); }
.entry-arrow { color: var(--faint); font-size: 20px; transition: transform .2s var(--ease), color .2s; }
.activity-log { padding: 6px 20px; }
.activity-item { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid #f1f3f8; font-size: 13px; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; box-shadow: 0 0 0 4px rgba(16,181,163,.13); }

/* ---------- Course ---------- */
.course-badge { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; flex-shrink: 0; box-shadow: var(--sh-2); }
.course-badge.sm { width: 26px; height: 26px; font-size: 11px; border-radius: 8px; }
.course-switch { border: 1px solid var(--border-strong); border-radius: 9px; padding: 6px 11px; font-size: 13px; background: #fff; color: #3b4763; font-weight: 500; }
.course-body { display: grid; grid-template-columns: 328px 1fr; gap: 18px; align-items: start; }
.chapter-panel { padding: 18px; }
.chapter-list { display: flex; flex-direction: column; gap: 6px; }
.chapter-item { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 12px; border: 1px solid transparent; transition: .16s var(--ease); }
.chapter-item:hover { background: var(--surface-sunk); }
.chapter-item.active { background: linear-gradient(120deg, rgba(16,181,163,.1), rgba(91,108,255,.06)); border-color: rgba(16,181,163,.3); }
.chapter-idx { width: 28px; height: 28px; border-radius: 9px; background: #eef1f7; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #55607a; flex-shrink: 0; transition: .16s; }
.chapter-item.active .chapter-idx { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: var(--sh-primary); }
.chapter-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.chapter-sub { font-size: 11px; }
.icon-btn { border: none; background: transparent; color: var(--faint); width: 28px; height: 28px; border-radius: 8px; font-size: 13px; transition: .15s; }
.icon-btn:hover { background: #eceff5; color: var(--ink); }
.chapter-add { width: 100%; margin-top: 10px; padding: 11px; border: 1.5px dashed var(--border-strong); background: var(--surface-sunk); border-radius: 11px; color: var(--primary-ink); font-size: 13px; font-weight: 600; transition: .16s; }
.chapter-add:hover { border-color: var(--primary); background: rgba(16,181,163,.06); }

.chapter-detail { padding: 22px; min-height: 420px; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.slot-card { display: flex; align-items: center; gap: 14px; padding: 15px 17px; border-radius: 13px; background: linear-gradient(120deg, rgba(240,86,143,.09), rgba(91,108,255,.07)); border: 1px solid rgba(240,86,143,.2); margin-bottom: 16px; }
.slot-ico { font-size: 27px; }
.slot-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 14px; }
.res-card { border: 1px solid var(--border); border-radius: 13px; overflow: hidden; background: #fff; transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s; box-shadow: var(--sh-1); }
.res-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--border-strong); }
.res-thumb { height: 104px; display: grid; place-items: center; overflow: hidden; position: relative; }
.res-thumb img { width: 100%; height: 100%; object-fit: cover; }
.res-ico { font-size: 36px; }
.res-ico.sm { font-size: 18px; }
.res-info { padding: 11px 13px 4px; }
.res-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-line { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.res-actions { display: flex; gap: 6px; padding: 9px 13px 13px; }
.task-list { display: flex; flex-direction: column; gap: 9px; }
.task-item { display: flex; align-items: center; gap: 13px; padding: 12px 15px; border: 1px solid var(--border); border-radius: 11px; font-size: 13px; background: #fff; transition: .16s; }
.task-item:hover { border-color: var(--border-strong); box-shadow: var(--sh-1); }
.task-ico { font-size: 17px; }

.kind-tabs { display: flex; gap: 10px; margin: 8px 0 12px; }
.kind-tab { display: flex; align-items: center; gap: 6px; padding: 9px 15px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 13px; cursor: pointer; transition: .15s; }
.kind-tab:has(input:checked) { border-color: var(--primary); background: rgba(16,181,163,.07); color: var(--primary-ink); font-weight: 600; }
.drop-zone { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 24px; text-align: center; color: var(--muted); font-size: 13px; background: var(--surface-sunk); }
.drop-zone .inp { margin-top: 12px; }
.model-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.model-chip { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 13px; cursor: pointer; transition: .15s; }
.model-chip:hover { border-color: var(--primary); }
.model-chip.sel { border-color: var(--primary); background: rgba(16,181,163,.09); box-shadow: var(--sh-primary); }
.viewer-fmt { background: linear-gradient(135deg, #16223c, #24344f); color: #4fe0cf; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; letter-spacing: .5px; }
.viewer-fmt.sm { font-size: 10px; padding: 2px 6px; }
.lib-pick, .replace-pick { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.lib-pick-row, .replace-pick-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 9px; font-size: 13px; transition: .14s; }
.lib-pick-row:hover, .replace-pick-row:hover { background: var(--surface-sunk); }
.import-tabs { display: flex; gap: 8px; margin: 12px 0; }
.imp-tab { padding: 9px 17px; border: 1px solid var(--border-strong); background: #fff; border-radius: 10px; font-size: 13px; color: #55607a; font-weight: 500; transition: .15s; }
.imp-tab.active { background: linear-gradient(120deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; box-shadow: var(--sh-primary); }
.import-content { max-height: 380px; overflow-y: auto; }
.imp-group { margin-bottom: 15px; }
.imp-group-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; margin-bottom: 7px; color: var(--ink); }
.imp-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 13px; transition: .14s; }
.imp-row:hover { background: var(--surface-sunk); }

/* ---------- Record ---------- */
.cam-off { background: rgba(240,86,143,.11); color: var(--rose); padding: 8px 15px; border-radius: 20px; font-size: 13px; font-weight: 600; white-space: nowrap; border: 1px solid rgba(240,86,143,.22); }
.record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.rec-stage { position: relative; aspect-ratio: 16/9; background: radial-gradient(circle at 50% 40%, #16233b, #0c1424); border-radius: 13px; overflow: hidden; display: grid; place-items: center; box-shadow: inset 0 0 60px rgba(0,0,0,.4); }
.rec-preview { width: 100%; height: 100%; object-fit: contain; background: #000; }
.rec-placeholder { position: absolute; color: #7484a3; text-align: center; font-size: 13px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.rec-placeholder .emoji { font-size: 44px; opacity: .9; }
.rec-status { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: 13px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #c3ccdd; }
.rec-dot.live { background: var(--coral); animation: pulse 1.2s infinite; box-shadow: 0 0 0 4px rgba(255,106,90,.2); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.rec-state { font-weight: 700; color: var(--ink); }
.rec-timer { font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 800; color: var(--ink); }
.rec-opts { display: flex; gap: 18px; margin-bottom: 14px; }
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #3c4a68; cursor: pointer; }
.rec-controls { display: flex; gap: 10px; }
.hint { margin-top: 12px; font-size: 12px; line-height: 1.65; }

.edit-video { width: 100%; border-radius: 12px; background: #000; max-height: 260px; }
.timeline { position: relative; height: 46px; background: var(--surface-sunk); border: 1px solid var(--border); border-radius: 10px; margin: 14px 0 6px; cursor: pointer; }
.tl-range { position: absolute; top: 0; bottom: 0; background: rgba(16,181,163,.22); box-shadow: inset 0 0 0 1px rgba(16,181,163,.35); border-radius: 3px; }
.tl-handle { position: absolute; top: -3px; width: 12px; height: 52px; background: linear-gradient(180deg, var(--primary), var(--primary-2)); border-radius: 5px; transform: translateX(-50%); cursor: ew-resize; box-shadow: var(--sh-2); }
.tl-playhead { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--coral); pointer-events: none; }
.tl-segs { position: absolute; inset: 0; }
.tl-seg { position: absolute; top: 5px; height: 8px; background: var(--indigo); border-radius: 3px; opacity: .75; }
.tl-seg.removed { background: var(--coral); opacity: .6; top: auto; bottom: 5px; }
.tl-labels { display: flex; align-items: center; font-size: 12px; }
.edit-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.edit-summary { margin: 8px 0; font-size: 12px; }
.edit-foot { border-top: 1px solid var(--border); padding-top: 15px; margin-top: 6px; }
.edit-foot-actions { margin-top: 14px; }
.save-preview { display: flex; align-items: center; gap: 12px; padding: 15px; background: var(--surface-sunk); border-radius: 12px; margin-top: 12px; }

/* ---------- Library ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab { padding: 10px 18px; border: none; background: transparent; border-bottom: 2px solid transparent; font-size: 14px; color: #55607a; font-weight: 500; margin-bottom: -1px; transition: .15s; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary-ink); border-bottom-color: var(--primary); font-weight: 700; }
.filters { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); gap: 16px; }
.lib-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #fff; transition: transform .2s var(--ease), box-shadow .2s var(--ease); box-shadow: var(--sh-1); }
.lib-card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); }
.lib-thumb { position: relative; height: 134px; display: grid; place-items: center; }
.lib-ico { font-size: 46px; }
.dur-tag { position: absolute; right: 8px; bottom: 8px; background: rgba(14,20,36,.72); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: 600; backdrop-filter: blur(4px); }
.edit-tag { position: absolute; left: 8px; top: 8px; background: linear-gradient(120deg, var(--primary), var(--primary-2)); color: #fff; font-size: 10px; padding: 3px 8px; border-radius: 6px; font-weight: 700; box-shadow: var(--sh-primary); }
.lib-info { padding: 13px 15px; }
.lib-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-line { display: flex; align-items: center; gap: 8px; margin-top: 9px; }

/* ---------- Assistant ---------- */
.assistant-layout { display: grid; grid-template-columns: 1fr 384px; gap: 18px; align-items: start; }
.chat-card { display: flex; flex-direction: column; height: 640px; }
.chat-feed { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 8px 4px; }
.msg { display: flex; gap: 11px; max-width: 92%; }
.msg.me { align-self: flex-end; }
.msg.ai { align-self: flex-start; }
.msg-avatar { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), var(--indigo)); display: grid; place-items: center; font-size: 18px; flex-shrink: 0; box-shadow: 0 4px 12px -4px rgba(16,181,163,.5); }
.msg-body { background: var(--surface-sunk); padding: 13px 15px; border-radius: 14px; border-top-left-radius: 4px; font-size: 13.5px; line-height: 1.7; color: var(--text); }
.msg.me .msg-body { background: linear-gradient(120deg, var(--primary), var(--primary-2)); color: #fff; border-radius: 14px; border-top-right-radius: 4px; box-shadow: var(--sh-primary); }
.rec-title { font-size: 12px; color: var(--muted); margin: 13px 0 9px; font-weight: 700; }
.rec-list { display: flex; flex-direction: column; gap: 8px; }
.rec-card { display: flex; align-items: center; gap: 11px; background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; transition: .15s; }
.rec-card:hover { border-color: var(--primary); box-shadow: var(--sh-1); }
.rec-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.chat-input { display: flex; gap: 10px; margin-top: 12px; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.search-panel { position: sticky; top: 0; }
.search-box { display: flex; gap: 8px; margin-bottom: 12px; }
.search-results { display: flex; flex-direction: column; gap: 8px; max-height: 500px; overflow-y: auto; }
.search-row { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--border); border-radius: 11px; transition: .15s; }
.search-row:hover { border-color: var(--border-strong); box-shadow: var(--sh-1); }
.sr-name { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }

/* ---------- Analytics ---------- */
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.chart-wrap { width: 100%; }
.chart-svg { width: 100%; height: auto; }
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut { width: 200px; height: 200px; filter: drop-shadow(0 8px 16px rgba(16,24,40,.1)); }
.donut-legend { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.lg-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.lg-dot { width: 12px; height: 12px; border-radius: 5px; }
.lg-val { margin-left: auto; font-weight: 700; color: var(--ink); }
.replace-card .replace-body { display: flex; align-items: center; gap: 20px; }
.replace-info { flex: 1; }
.replace-cur { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.notice { margin-top: 14px; font-size: 12.5px; color: #8a6a2f; background: linear-gradient(120deg, #fef8e9, #fdf3d8); border: 1px solid #f3e3b0; padding: 11px 15px; border-radius: 10px; }
.before-box { background: var(--surface-sunk); padding: 13px; border-radius: 10px; margin: 10px 0; }
.ok-banner { background: linear-gradient(120deg, rgba(16,181,163,.13), rgba(91,108,255,.1)); color: var(--primary-ink); padding: 13px 17px; border-radius: 11px; font-size: 14px; font-weight: 700; margin-bottom: 14px; border: 1px solid rgba(16,181,163,.2); }
.mini-table, .data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td, .data-table th, .data-table td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--border); }
.mini-table th, .data-table th { color: var(--muted); font-weight: 700; font-size: 12px; background: var(--surface-sunk); }
.green { color: var(--primary-ink); font-weight: 700; }
.table-scroll { overflow-x: auto; }
.bar-cell { display: flex; align-items: center; gap: 8px; }
.bar-bg { width: 84px; height: 8px; background: #eef1f7; border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--indigo)); border-radius: 5px; }

/* ---------- 3D Viewer ---------- */
.viewer-stage { width: 100%; background: #0e1526; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 40px rgba(0,0,0,.35); }
.viewer-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.viewer-status { margin-top: 10px; font-size: 12px; color: var(--muted); }
.viewer-status.ok { color: var(--primary-ink); font-weight: 600; }
.viewer-status.err { color: var(--coral); }
.viewer-controls { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .course-body, .record-grid, .analytics-grid, .assistant-layout { grid-template-columns: 1fr; }
  .stats-row, .entry-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .stats-row, .entry-grid { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 60px; }
}
