:root {
  --brand: #4f6ef7;
  --brand-2: #7b5cff;
  --brand-soft: #eef2ff;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #14172b;
  --text-2: #4b5169;
  --muted: #8a90a6;
  --border: #e6e9f2;
  --success: #12b981;
  --success-bg: #e7f8f1;
  --warn: #f59e0b;
  --warn-bg: #fef4e6;
  --danger: #ef4444;
  --danger-bg: #fdecec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(30, 41, 90, .07);
  --shadow-lg: 0 18px 50px rgba(30, 41, 90, .14);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.6;
}

button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; cursor: pointer; font-weight: 500;
  transition: all .16s ease; white-space: nowrap;
}
.btn:hover { background: #4160ea; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: #fff; color: var(--text-2); border-color: var(--border); }
.btn.ghost:hover { background: #f7f8fc; color: var(--text); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f6d5d5; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn-gradient { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn-gradient:hover { filter: brightness(1.06); }

.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}

.input, .textarea, .select {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fff; outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 110, 247, .12);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
label.field { display: block; margin-bottom: 14px; }
label.field > span.lbl { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px;
  border-radius: 20px; font-size: 12px; font-weight: 500; line-height: 1.7;
}
.tag.green { background: var(--success-bg); color: #0a8f68; }
.tag.orange { background: var(--warn-bg); color: #b47309; }
.tag.red { background: var(--danger-bg); color: #cc3b3b; }
.tag.blue { background: var(--brand-soft); color: #414fc4; }
.tag.gray { background: #f1f2f7; color: var(--muted); }
.tag.purple { background: #f3eeff; color: #6a41c4; }

.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .ico { font-size: 40px; opacity: .35; margin-bottom: 10px; }

.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 18px; border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); font-size: 14px; animation: drop .22s ease;
}
.toast.ok { border-left: 3px solid var(--success); }
.toast.err { border-left: 3px solid var(--danger); }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }

.modal-mask {
  position: fixed; inset: 0; background: rgba(19, 23, 42, .42); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; z-index: 900;
  padding: 40px 16px; overflow-y: auto; animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 620px;
  box-shadow: var(--shadow-lg); animation: rise .22s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.x { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; background: none; border: none; padding: 4px; }
.x:hover { color: var(--text); }

.spinner { display: flex; justify-content: center; padding: 60px; }
.spinner i {
  width: 26px; height: 26px; border: 3px solid var(--border);
  border-top-color: var(--brand); border-radius: 50%; display: inline-block;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }

/* 封面：信息科技实验风。深蓝紫底 + 实验网格纸 + 电路走线 + 数据脉冲，
   配色偏「科技蓝紫」而不是儿童高饱和，圆角与光晕保留亲和感 —— 面向初中生但不幼稚。 */
.auth-side {
  position: relative; overflow: hidden; color: #fff;
  padding: 50px 56px 42px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 520px at 92% -12%, rgba(126, 92, 255, .55), transparent 60%),
    radial-gradient(700px 480px at 4% 106%, rgba(0, 186, 255, .30), transparent 62%),
    linear-gradient(158deg, #0e1430 0%, #1a2350 46%, #2a1e60 100%);
}
/* 实验记录纸的方格（右下淡出，避免压住文字） */
.auth-side::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(130% 95% at 18% 4%, #000 42%, transparent 100%);
  mask-image: radial-gradient(130% 95% at 18% 4%, #000 42%, transparent 100%);
}
.auth-side::after {
  content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(146, 108, 255, .30), transparent 66%);
  right: -180px; bottom: -200px;
}
/* 电路走线只占右上角：实测下缘压在特性卡片后面会显得脏，所以纵向也不让它往下长 */
.as-traces { position: absolute; top: -14px; right: -30px; width: min(50%, 380px); height: auto; opacity: .9; pointer-events: none; }
@media (max-width: 1100px) { .as-traces { display: none; } }
/* 走线上的「数据流动」虚线：用固定 7/15 的虚线周期做位移，
   不依赖路径长度，任何长短的走线都能稳定看到流动效果 */
.as-pulse { stroke-dasharray: 7 15; animation: as-flow 1.2s linear infinite; }
@keyframes as-flow { to { stroke-dashoffset: -22; } }
@media (prefers-reduced-motion: reduce) { .as-pulse { animation: none; } }

.as-head { position: relative; z-index: 1; }
.auth-side .logo { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 600; }
.auth-side .logo span { line-height: 1.35; letter-spacing: .2px; }
.auth-side .logo-box {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: #d9f2ff;
  background: linear-gradient(140deg, rgba(120, 226, 255, .30), rgba(150, 110, 255, .42));
  border: 1px solid rgba(160, 220, 255, .34);
  box-shadow: 0 6px 18px rgba(10, 16, 50, .35);
}
.auth-side .logo-box svg { width: 23px; height: 23px; display: block; }

.as-hero { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 26px 0 18px; max-width: 700px; }
.as-kicker {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: 12.5px; letter-spacing: .1em; color: #a8e6ff;
  padding: 5px 13px 5px 11px; border-radius: 999px;
  background: rgba(120, 220, 255, .10); border: 1px solid rgba(120, 220, 255, .26);
}
.as-kicker i { width: 6px; height: 6px; border-radius: 50%; background: #5ee7ff; box-shadow: 0 0 0 3px rgba(94, 231, 255, .16); }
/* 主标题：系统全称就是封面的视觉主体。用 clamp 让最长那行「初中信息科技实验教学」（10 字）
   在任意宽度下都顶满封面可用宽度而**不换行**——字号上限受「封面列宽 ÷ 10 字」约束，
   所以按视口宽（封面约占 51%）取 3.8vw，再叠一层冷光让它从深色底上浮起来。 */
.auth-side h1 {
  font-size: clamp(30px, 3.9vw, 64px);
  line-height: 1.18; font-weight: 800; margin: 18px 0 16px; letter-spacing: 1px;
  text-shadow: 0 2px 20px rgba(96, 150, 255, .38);
}
.auth-side p.sub { color: rgba(255, 255, 255, .80); font-size: 15px; max-width: 360px; }
.as-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.as-chips span {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: rgba(255, 255, 255, .88);
  padding: 6px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
}
.as-chips b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; font-weight: 600; color: #7ce9ff;
}

.auth-feats { display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.auth-feat {
  display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; border-radius: 13px;
  background: rgba(255, 255, 255, .075); border: 1px solid rgba(255, 255, 255, .14);
}
.auth-feat .bi {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 16px;
  background: linear-gradient(140deg, rgba(120, 220, 255, .20), rgba(150, 110, 255, .28));
  border: 1px solid rgba(255, 255, 255, .16);
}
.auth-feat b { font-weight: 500; display: block; font-size: 14px; }
.auth-feat span { color: rgba(255, 255, 255, .78); font-size: 13px; }

.as-foot {
  position: relative; z-index: 1; margin-top: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; letter-spacing: .06em; color: rgba(255, 255, 255, .50);
}

@media (max-width: 1200px) {
  .auth-side { padding: 42px 40px 34px; }
  .auth-side .logo { font-size: 15px; gap: 10px; }
  .auth-side .logo-box { width: 36px; height: 36px; border-radius: 11px; }
  .auth-side .logo-box svg { width: 20px; height: 20px; }
  /* 这里刻意不再覆写 h1 字号：clamp 已按视口宽缩放，写死数值反而会把标题压回小号 */
  .as-hero { max-width: 620px; }
  .as-chips span { font-size: 12px; padding: 5px 10px; }
}
/* 笔记本等高度有限的屏幕：压缩纵向留白，避免特性块被裁掉。
   但标题要保持主体地位，所以只小幅收字号（而不是砍到 30 出头）。 */
@media (max-height: 800px) {
  .auth-side { padding: 34px 48px 28px; }
  .auth-side h1 { font-size: clamp(26px, 3.2vw, 52px); margin: 14px 0 11px; }
  .as-hero { padding: 16px 0 12px; }
  .as-chips { margin-top: 14px; }
  .auth-feat { padding: 9px 11px; }
  .auth-feat .bi { width: 30px; height: 30px; font-size: 15px; }
  .as-foot { margin-top: 12px; }
}

.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 396px; }
.auth-card h2 { font-size: 25px; font-weight: 600; margin-bottom: 6px; }
.auth-card .tip { color: var(--muted); margin-bottom: 26px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.role-opt {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 14px;
  cursor: pointer; text-align: center; transition: all .16s; background: #fff;
}
.role-opt:hover { border-color: #c9d2f5; }
.role-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.role-opt .ico { font-size: 22px; display: block; margin-bottom: 4px; }
.role-opt b { font-weight: 500; font-size: 14px; }
.role-opt span { display: block; font-size: 12px; color: var(--muted); }
.demo-box { margin-top: 18px; padding: 13px 15px; background: #f7f8fd; border: 1px dashed #d5dbea; border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text-2); line-height: 1.9; }
.demo-box b { color: var(--text); }
.sw { margin-top: 18px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 应用布局 ---------- */
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 12px;
  position: sticky; top: 0; z-index: 100;
}
.topbar .logo { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; }
.topbar .logo span { white-space: nowrap; }
@media (max-width: 1100px) { .topbar .logo span { font-size: 14px; } }
@media (max-width: 900px) { .topbar .logo span { font-size: 13px; } }
.topbar .logo-box {
  width: 32px; height: 32px; border-radius: 9px; color: #fff; display: grid; place-items: center;
  font-size: 16px; background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.topbar .logo-box svg { width: 18px; height: 18px; display: block; }
.spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 9px; cursor: default; padding: 5px 10px 5px 5px; border-radius: 22px; }
.user-chip:hover { background: #f5f6fa; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 500; background: linear-gradient(135deg, var(--brand), var(--brand-2)); flex: none;
}
.role-badge { font-size: 11px; padding: 1px 8px; border-radius: 20px; background: var(--brand-soft); color: #414fc4; font-weight: 500; }

.shell { display: grid; grid-template-columns: 216px 1fr; min-height: calc(100vh - 60px); }
.sidebar { background: #fff; border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.nav-grp { margin-bottom: 18px; }
.nav-grp .gt { font-size: 11px; color: var(--muted); padding: 0 12px; margin-bottom: 7px; letter-spacing: .6px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer; margin-bottom: 2px; transition: all .14s; font-size: 14px;
}
.nav-item:hover { background: #f5f6fa; color: var(--text); }
.nav-item.on { background: var(--brand-soft); color: #3a4ad0; font-weight: 500; }
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; }
.nav-item .cnt { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }

.main { padding: 24px 28px 60px; min-width: 0; }
.page-head { margin-bottom: 20px; display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 600; }
.page-head p { color: var(--muted); font-size: 13px; }

/* 统计卡 */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { padding: 18px 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card .lb { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.stat-card .vl { font-size: 28px; font-weight: 600; margin-top: 6px; letter-spacing: -.5px; }
.stat-card .ex { font-size: 12px; color: var(--muted); }
.stat-card::before { content: ''; position: absolute; right: -18px; top: -18px; width: 74px; height: 74px; border-radius: 50%; background: var(--brand-soft); opacity: .8; }
.stat-card.warn::before { background: var(--warn-bg); }
.stat-card.green::before { background: var(--success-bg); }
.stat-card.violet::before { background: #f3ecff; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 16px; }
.course-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: all .18s; display: flex; flex-direction: column; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.course-cover { height: 92px; padding: 14px 16px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.cover-aurora { background: linear-gradient(135deg, #5b8cff, #7b5bff); }
.cover-sunset { background: linear-gradient(135deg, #ff7a59, #ff4f81); }
.cover-mint { background: linear-gradient(135deg, #1fb89b, #46d0bd); }
.cover-violet { background: linear-gradient(135deg, #8e6bff, #c471ed); }
.cover-ocean { background: linear-gradient(135deg, #3a8dff, #26cdfa); }
.course-cover .t { font-size: 16px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .12); line-height: 1.4; }
.course-cover .meta { font-size: 12px; opacity: .9; display: flex; gap: 12px; }
.course-cover .enter-hint { position: absolute; right: 10px; top: 10px; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.45); backdrop-filter: blur(2px); }
.course-card:hover .enter-hint { background: rgba(255,255,255,.36); }
.upload-bar { height: 8px; background: #eef1f7; border-radius: 999px; position: relative; padding-bottom: 18px; box-sizing: content-box; }
.upload-bar i { display: block; height: 8px; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .2s; }
.upload-bar span { position: absolute; top: 12px; left: 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.course-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.course-body .desc { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.course-body .foot { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.invite-pill { font-family: ui-monospace, Consolas, monospace; background: #f2f4f9; padding: 2px 8px; border-radius: 6px; letter-spacing: 1px; font-size: 12px; color: var(--text-2); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; font-size: 15px; font-weight: 600; }
.section-title .line { flex: 1; height: 1px; background: var(--border); }

/* 列表行 */
.list-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--border); transition: background .14s; }
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: #fafbfe; }
.list-row .main-col { flex: 1; min-width: 0; }
.list-row .ttl { font-weight: 500; font-size: 14.5px; margin-bottom: 3px; }
.list-row .sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }

/* 任务详情 */
.task-head { padding: 22px 24px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.task-head h2 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.task-desc { color: var(--text-2); white-space: pre-wrap; line-height: 1.75; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tab { padding: 9px 16px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }

/* 批量导入成员弹窗 */
.imp-tabs { margin-bottom: 16px; }
.imp-tabs .tab { user-select: none; }
.imp-tabs .tab[data-mode] { cursor: pointer; }
.imp-result .stat-row { grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 8px; }
.imp-result .stat-row .stat-card { padding: 12px 14px; }
.imp-result .stat-row .stat-card .lb { font-size: 12px; }
.imp-result .stat-row .stat-card .vl { font-size: 20px; margin-top: 4px; }
.imp-fail-list {
  font-size: 12.5px; color: #b83232; background: var(--danger-bg); border-radius: 8px;
  padding: 10px 12px; max-height: 190px; overflow: auto; line-height: 1.75;
}
.imp-fail-list > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
textarea.textarea { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.7; }

/* 进度条 */
.bar { height: 6px; background: #eef0f6; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 6px; transition: width .4s; }
.bar.green i { background: linear-gradient(90deg, #22c1a3, #4fd6a8); }

/* 答题区 */
.q-card { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; background: #fff; }
.q-title { font-weight: 500; margin-bottom: 12px; display: flex; gap: 8px; }
.q-no { color: var(--brand); font-weight: 600; flex: none; }
.opt-row { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; transition: all .14s; }
.opt-row:hover { border-color: #c3cdf7; background: #fafbff; }
.opt-row.on { border-color: var(--brand); background: var(--brand-soft); }
.opt-dot { width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid #c8cfe2; flex: none; display: grid; place-items: center; }
.opt-row.on .opt-dot { border-color: var(--brand); }
.opt-row.on .opt-dot::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }

.result-box { padding: 16px 20px; border-radius: var(--radius); background: var(--success-bg); border: 1px solid #bcebd8; margin-bottom: 18px; }
.score-big { font-size: 30px; font-weight: 600; color: #0a8f68; }
.fb-box { background: #f8f9fd; border-left: 3px solid var(--brand); padding: 12px 15px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-top: 10px; color: var(--text-2); white-space: pre-wrap; }

.file-row { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; background: #f5f7fc; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.grade-cell { display: flex; gap: 6px; align-items: center; }
.score-input { width: 74px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; text-align: center; outline: none; }
.score-input:focus { border-color: var(--brand); }
.file-input-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-input-wrap input[type=file] { display: none; }

.opt-row.right { border-color: #a8e6cd; background: var(--success-bg); }
.opt-row.right .opt-dot { border-color: var(--success); }
.opt-row.right .opt-dot::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--success); }
.opt-row.wrong { border-color: #f3b6b6; background: var(--danger-bg); }
.opt-row.wrong .opt-dot { border-color: var(--danger); }

/* 多选题使用方形勾选框，与单选题的圆点区分 */
.opt-dot.square { border-radius: 4px; }
.opt-row.on .opt-dot.square::after { width: 9px; height: 9px; border-radius: 2px; }
.opt-row.right .opt-dot.square::after { border-radius: 2px; }

.q-builder { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; background: #fbfcfe; }
.q-builder .row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.q-builder .row input[type=text] { flex: 1; }
.opt-input-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.opt-input-row input[type=text] { flex: 1; }
.opt-input-row input[type=radio] { accent-color: var(--brand); }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 18px 14px 50px; }
}

/* ==================== 课件预览页（#/material/:id） ==================== */
/* 目标：像国家中小学智慧教育平台的资源播放页，点开就在页面里看到内容 */

.list-row.is-clickable { cursor: pointer; }

.pv-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.pv-head .pv-titlebox { min-width: 0; }
.pv-head h2 { font-size: 20px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.pv-metabar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.pv-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-warn { color: #b47309; }

.pv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }

.pv-stage { padding: 0; overflow: hidden; position: relative; }
.pv-stage:fullscreen { background: #1b1e33; padding: 0; }
.pv-stage:fullscreen .pv-frame { height: 100vh; border-radius: 0; }
.pv-stage:fullscreen .pv-imgbox { max-height: 100vh; }

/* PDF：交给浏览器自带阅读器，可翻页/缩放/搜索 */
.pv-frame { display: block; width: 100%; height: min(78vh, 900px); min-height: 460px; border: 0; background: #fff; }
.pv-stagebar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #fbfcfe; flex-wrap: wrap; }
.pv-zoomval { font-size: 12.5px; color: var(--muted); min-width: 56px; }

/* 图片 */
.pv-imgbox { max-height: min(78vh, 900px); overflow: auto; text-align: center; padding: 14px; background: #f5f7fc; }
.pv-img { display: block; margin: 0 auto; max-width: 100%; border-radius: 8px; box-shadow: 0 4px 18px rgba(30, 41, 90, .12); }

/* 文本 / Markdown */
.pv-doc { max-height: min(78vh, 900px); overflow: auto; padding: 24px 28px; background: #fff; }
.pv-pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
.pv-loading { color: var(--muted); padding: 30px 0; text-align: center; }
.pv-md { font-size: 14.5px; line-height: 1.85; color: var(--text); }
.pv-md h1, .pv-md h2, .pv-md h3, .pv-md h4, .pv-md h5, .pv-md h6 { margin: 20px 0 10px; line-height: 1.4; font-weight: 600; }
.pv-md h1 { font-size: 22px; } .pv-md h2 { font-size: 19px; }
.pv-md h3 { font-size: 17px; } .pv-md h4, .pv-md h5, .pv-md h6 { font-size: 15px; }
.pv-md h1:first-child, .pv-md h2:first-child, .pv-md h3:first-child { margin-top: 0; }
.pv-md p { margin: 10px 0; }
.pv-md ul, .pv-md ol { margin: 10px 0 10px 22px; }
.pv-md li { margin: 4px 0; }
.pv-md blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; color: var(--text-2); }
.pv-md code { background: #f1f3f9; padding: 1.5px 5px; border-radius: 5px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.pv-md .md-code { background: #f7f8fc; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow: auto; margin: 12px 0; }
.pv-md .md-code code { background: none; padding: 0; }
.pv-md hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.pv-md a { word-break: break-all; }

/* 音视频 */
.pv-mediabox { padding: 28px; background: #14172b; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 340px; }
.pv-media { width: 100%; max-height: min(72vh, 820px); border-radius: 10px; background: #000; }
.pv-audioicon { font-size: 42px; }
.pv-audioname { color: #d9dcec; font-size: 13.5px; word-break: break-all; text-align: center; }
.pv-audio { width: min(560px, 100%); }

/* 链接 / 不支持预览 / 在线练习 的降级卡片 */
.pv-linkcard { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 46px 26px; text-align: center; min-height: 300px; }
.pv-linkico { font-size: 42px; opacity: .8; }
.pv-linkurl { color: var(--text-2); font-size: 13.5px; word-break: break-all; max-width: 560px; }
.pv-nonettl { font-size: 15.5px; font-weight: 600; }
.pv-embedwrap { border-top: 1px solid var(--border); }

.pv-tip { padding: 10px 16px; font-size: 12.5px; color: var(--muted); background: #fafbfe; border-top: 1px solid var(--border); text-align: center; }

/* 右侧信息栏 */
.pv-side { display: flex; flex-direction: column; gap: 16px; }
.pv-panel { padding: 16px 18px; }
.pv-panel-ttl { font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.pv-desc { color: var(--text-2); font-size: 13.5px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.pv-info { display: grid; grid-template-columns: 68px 1fr; gap: 8px 10px; font-size: 13px; }
.pv-info dt { color: var(--muted); }
.pv-info dd { word-break: break-word; color: var(--text-2); }
.pv-siblings { display: flex; flex-direction: column; gap: 2px; }
.pv-sib { display: flex; align-items: center; gap: 9px; padding: 9px 8px; border-radius: var(--radius-sm); color: var(--text); transition: background .14s; }
.pv-sib:hover { background: #f5f7fc; text-decoration: none; }
.pv-sib-ico { font-size: 15px; flex: none; }
.pv-sib-ttl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.pv-sib-tag { flex: none; font-size: 11px; }

@media (max-width: 1000px) {
  .pv-layout { grid-template-columns: 1fr; }
  .pv-frame, .pv-imgbox, .pv-doc { height: auto; max-height: 68vh; min-height: 340px; }
}

/* ==================== 资料卡片网格 + 第一页缩略图 ==================== */
/*
 * 参照国家中小学智慧教育平台的资料库：卡片铺开，缩略图就是该资料「第一页」的样子，
 * 点卡片直接进预览页。取不到真实首页时退回「类型图标 + 类型名」，不会出现空白框。
 */

.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 16px; }

.mat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; transition: transform .16s ease, box-shadow .16s ease;
}
.mat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* 缩略图区：固定高度，四周留白当「桌面」，中间放一张纸（.mat-doc） */
.mat-thumb {
  position: relative; display: block; height: 166px; overflow: hidden;
  padding: 10px 10px 0;
  background: linear-gradient(158deg, #f7f9fe, #e9edf7);
  border-bottom: 1px solid var(--border);
}
.mat-thumb:hover { text-decoration: none; }
/* 图片 / 视频是照片和画面，整块铺满更好看，不留桌面 */
.mat-thumb.is-image, .mat-thumb.is-video, .mat-thumb.is-micro { padding: 0; background: #fff; }

/*
 * 那张「纸」：白底 + 发丝边 + 柔和投影，底部直接贴着缩略图裁掉，
 * 于是读起来就是一页还在往下延续的纸，而不是一块悬浮的白色方块。
 */
.mat-doc {
  position: relative; height: 100%; overflow: hidden;
  background: #fff; border: 1px solid rgba(20, 23, 43, .09); border-bottom: 0;
  border-radius: 7px 7px 0 0;
  box-shadow: 0 6px 18px rgba(30, 41, 90, .10);
}

/* 占位：类型图标（带类型色的圆角底片）+ 类型名 */
.mat-thumb-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; }
.mat-ph-ico {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  font-size: 24px; line-height: 1; background: var(--brand-soft);
}
.mat-ph-cap { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.mat-thumb.is-pdf .mat-ph-ico { background: #fdecec; }
.mat-thumb.is-docx .mat-ph-ico { background: #e8f0ff; }
.mat-thumb.is-text .mat-ph-ico { background: #eef2ff; }
.mat-thumb.is-image .mat-ph-ico { background: var(--success-bg); }
.mat-thumb.is-video .mat-ph-ico { background: #f1ecff; }
.mat-thumb.is-micro .mat-ph-ico { background: #f1ecff; }
.mat-thumb.is-audio .mat-ph-ico { background: var(--warn-bg); }
.mat-thumb.is-link .mat-ph-ico { background: var(--success-bg); }
.mat-thumb.is-practice .mat-ph-ico { background: var(--warn-bg); }
.mat-thumb.is-none .mat-ph-ico { background: #f0f2f7; }

/* 图片 / 视频 / PDF：铺满整块 */
.mat-thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #fff; }
.mat-thumb-video { position: absolute; inset: 0; background: #101426; }
.mat-thumb-vid { width: 100%; height: 100%; object-fit: cover; display: block; }
.mat-play {
  position: absolute; inset: 0; margin: auto; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(10, 14, 28, .5); color: #fff; font-size: 14px; padding-left: 3px;
  display: grid; place-items: center;
}
.mat-thumb-frame { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border: 0; background: transparent; }

/*
 * 缩略图上的透明点击层 —— 「点缩略图进资料」的保底。
 *
 * 为什么需要它：PDF 缩略图是一整个 <iframe>（.mat-thumb-frame，z-index:1 铺满），
 * 真实点击会落进 iframe 自己的文档里，根本不冒泡到外层 <a class="mat-thumb">，
 * 于是点缩略图毫无反应（点标题却可以进）——这就是用户遇到的「点了没反应」。
 * 用 ::after 盖一层透明蒙版就能堵住：伪元素在命中测试里归属于 <a> 本身，
 * 点它等于点链接，自然导航；z-index 压过 iframe/video/img，对各种类型一视同仁。
 *
 * 为什么偏偏用伪元素而不是真的插一个 <span>：image / video 的真实缩略图
 * 是 nativeThumb() 用 box.innerHTML = ... 整块重写进来的，DOM 子节点会被冲掉，
 * 伪元素不是 DOM 节点，重写多少次都还在。
 */
.mat-thumb::after { content: ''; position: absolute; inset: 0; z-index: 5; }

/*
 * 文档首页（文本 / Word）：先在 1.95 倍宽的虚拟画布上按真实排版渲染，再整体缩到 1 / 1.95。
 * 宽度写成 195% 而缩放写成 .512821，两者互为倒数，于是无论卡片多宽，
 * 看到的都是等比缩小的「第一页」，而不是被压扁的排版。
 */
.mat-page {
  position: absolute; top: 0; left: 0; z-index: 1;
  width: 195%; height: 1200px;
  transform: scale(.512821); transform-origin: top left;
  background: #fff; pointer-events: none;
}
.mat-page .pv-md { padding: 18px 20px 0; font-size: 13px; line-height: 1.72; color: var(--text); }
.mat-page .pv-md h1 { font-size: 21px; margin: 0 0 10px; }
.mat-page .pv-md h2 { font-size: 17px; margin: 12px 0 8px; }
.mat-page .pv-md h3, .mat-page .pv-md h4, .mat-page .pv-md h5, .mat-page .pv-md h6 { font-size: 15px; margin: 10px 0 6px; }
.mat-page .pv-md p { margin: 7px 0; }
.mat-page .pv-md ul, .mat-page .pv-md ol { margin: 7px 0 7px 20px; }
.mat-page .pv-md li { margin: 3px 0; }
.mat-page .pv-md h1:first-child, .mat-page .pv-md h2:first-child { margin-top: 0; }
.mat-page .pv-md img { max-width: 100%; }
.mat-page .pv-md table { border-collapse: collapse; margin: 8px 0; }
.mat-page .pv-md td, .mat-page .pv-md th { border: 1px solid var(--border); padding: 4px 8px; }
.mat-page .dc-doc { max-width: none; }

.mat-body { display: block; padding: 12px 14px 4px; color: var(--text); flex: 1; }
.mat-body:hover { text-decoration: none; }
.mat-ttl { font-weight: 600; font-size: 14px; line-height: 1.45; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mat-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.mat-desc { margin-top: 7px; font-size: 12.5px; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mat-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 10px 14px 12px; }

/* Word 文档排版：给 docx 渲染结果一点文档感 */
.dc-doc { max-width: 860px; margin: 0 auto; }
.dc-doc table { border-collapse: collapse; margin: 12px 0; width: auto; }
.dc-doc td, .dc-doc th { border: 1px solid var(--border); padding: 7px 11px; vertical-align: top; }
.dc-doc td p, .dc-doc th p { margin: 0; }
.dc-doc img { max-width: 100%; border-radius: 6px; margin: 6px 0; }
.dc-doc hr.dc-pagebreak { border: 0; border-top: 1px dashed var(--border); margin: 26px 0; }
.dc-img-miss { color: var(--muted); font-size: 12.5px; }
/* 首页缩略图按长度截断后的省略标记（服务端 clipHtml 追加） */
.dc-clip { color: var(--muted); letter-spacing: .2em; }

/* ---------- PPT 预览：按页翻看 ---------- */
.pv-pptx { display: flex; flex-direction: column; gap: 12px; }
.pv-slidebar { display: flex; align-items: center; justify-content: center; gap: 10px; }
.pv-slidenum { font-size: 13px; color: var(--text-2); min-width: 74px; text-align: center; }
.pv-slidebox { display: block; }

/*
 * 幻灯片容器（全屏预览是 .pv-slidebox，列表缩略图是 .pv-slide）。
 * 它的唯一职责是给里面的 .pg 一个宽度，并**充当容器查询的锚点**（container-type）。
 *
 * 为什么 container-type 必须写在这一层、绝不能写到 .pg 自己身上：
 *   cqw 这类容器查询长度单位只在**祖先**容器里解析，元素不算自己的祖先。
 *   旧写法把 container-type 与 font-size:1.875cqw 写在同一个 .pg 上，
 *   于是 cqw 无处可依，按规范回退成「视口宽度的 1%」：
 *   实测视口 1904px、幻灯片框 900px 时，24pt 正文算出 47.5px（应 22.5px），
 *   整整放大 2.12 倍 —— 这就是老师报的「课件的文字超级无敌大」。
 *   把容器移到外层之后，字与版面、字与图片的比例才和 PowerPoint 一致。
 */
.pv-slidebox, .pv-slide { display: block; container-type: inline-size; }
/*
 * 一页幻灯片本体：按母版真实比例（服务端内联 aspect-ratio）开一张白纸，
 * 里面的形状按课件原始坐标绝对定位（见 .pg-sp）。
 *
 * 字号基准 --pg-base 也由服务端内联给出（= 18pt 正文占母版宽度的百分比），
 * 于是无论容器多宽，字与版面、字与图片的比例都和原课件一致 ——
 * 这就是「像国家中小学智慧教育平台那样整页铺满」的观感，而不是把文字抽出来重排。
 */
.pg {
  position: relative;
  background: #fff;
  aspect-ratio: 16 / 9;   /* 服务端会用母版真实比例覆盖（4:3 课件不会被硬塞进 16:9） */
  overflow: hidden;       /* 内容不越出这张纸；形状内部溢出仍然可见，宁可多显示也不丢字 */
  color: #1f2437;
  font-size: 15.5px;      /* 兜底：不支持容器查询的浏览器退回固定像素（比例略失，但不放大） */
  /* 兜底字体栈：课件里绝大多数 run 自带字体（服务端按 <a:ea>/<a:latin> 内联 font-family），
     这里只用来接住没写字体的那部分文字 —— 用中文字形最稳的无衬线起头 */
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
    "Source Han Sans SC", "Noto Sans CJK SC", "SimHei", "Heiti SC",
    "WenQuanYi Micro Hei", sans-serif;
}
@supports (container-type: inline-size) {
  /* 现代浏览器：按母版百分比等比缩放。cqw 解析在外层容器上（见上一条规则） */
  .pg { font-size: var(--pg-base); }
}
.pv-slidebox > .pg, .pv-slide > .pg {
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 6px 18px rgba(20, 28, 60, .06);
}
/*
 * 一个形状（文本框 / 图片 / 表格 / 视频）：位置与尺寸全部取自课件的原始坐标，
 * 由服务端换算成百分比内联在 style 上（left/top/width/height）。
 *
 * 为什么用绝对定位而不是纵向流动：课件的版面本身就是绝对定位的
 * （「两列对照」「图文左右分栏」「标题压在图上」），一旦改成纵向流动，
 * 这些版面会被彻底拍平成一列文字 —— 那已经不是「格式有问题」，是信息丢失。
 *
 * 内边距（bodyPr 的 lIns/tIns/rIns/bIns）用 cqw 表达而不是百分比：
 * 容器是「按宽度定比例」的，cqw 在横向纵向都等比正确；百分比内边距只会按宽度算，纵向会错。
 */
.pg-sp {
  position: absolute; box-sizing: border-box;
  display: flex; flex-direction: column; overflow: visible;
}
/* bodyPr 的 anchor：文本框里的内容贴顶 / 居中 / 贴底 */
.pg-an-t { justify-content: flex-start; }
.pg-an-c { justify-content: center; }
.pg-an-b { justify-content: flex-end; }

/*
 * 兜底排版：该页有形状拿不到原始坐标时（占位符几何既不在幻灯片、也不在版式里），
 * 整页退回「按阅读顺序纵向排」——位置不还原，但字号仍是母版百分比、一个字都不会丢。
 * 观感复刻老版式：纸内一张居中排版的框 + 条目间距。
 */
.pg-flow {
  position: absolute; inset: 0; padding: 4.5% 5.5%; overflow: auto;
  display: flex; flex-direction: column; justify-content: center; gap: .35em;
}
/* flex 居中 + overflow 的经典坑：内容超高时顶部会被裁掉、滚不到。
   给首尾子元素 auto 外边距，内容装得下时居中、装不下时自动从顶部开始。 */
.pg-flow > :first-child { margin-top: auto; }
.pg-flow > :last-child { margin-bottom: auto; }
.pg-flowblk { margin: 0; }

/*
 * 段落样式不挂在任何一层容器下：列表缩略图与全屏预览渲染的是同一批元素。
 * 字号一律由服务端内联的百分比决定（见 src/pptx.js），这里**绝不写死 px** ——
 * 一旦写死，就会把「标题 40pt / 正文 18pt」的层级差抹平。
 * 行距默认 1.2（≈ PowerPoint 单倍行距）；具体段落由服务端按课件的 <a:lnSpc> 内联覆盖，
 * 因为文本框高度是作者按自己的行距定死的 —— 行距折算偏松会把文字挤出框、压到下一块内容上。
 */
.pg-p { margin: 0; line-height: 1.2; }
.pg-p.pg-lv1 { margin-left: 1.4em; }
.pg-p.pg-lv2 { margin-left: 2.6em; }
.pg-p.pg-lv3 { margin-left: 3.8em; }
.pg-p.pg-lv4 { margin-left: 5em; }
/* 有项目符号的段落用悬挂缩进：第二行与首行文字左对齐，不顶到符号下面 */
.pg-hasbul { padding-left: 1.35em; text-indent: -1.35em; }
.pg-bul { display: inline-block; width: 1.35em; text-indent: 0; color: var(--brand); }
.pg-title { font-weight: 600; }
/* 图片：适应作者给定的框（contain 保持比例，不拉伸变形） */
.pg-img { align-items: center; justify-content: center; }
.pg-imgel { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.pg-img-miss { align-items: center; justify-content: center; color: var(--muted); font-size: .82em; text-align: center; }
/* 图表 / 智能图形：图形本体还原不了，但里面的文字保留下来 */
.pg-table { padding-left: .3em; border-left: 2px solid var(--brand-soft); }
/* 表格：还原成真正的行列，而不是一列竖排的文字 */
.pg-tblwrap { display: block; }
.pg-tbl { border-collapse: collapse; width: 100%; table-layout: auto; }
.pg-tbl td, .pg-tbl th { border: 1px solid var(--border); padding: .22em .5em; vertical-align: top; }
.pg-tbl th { background: #f5f7fc; font-weight: 600; }
.pg-tbl .pg-p { margin: 0; }
/* 课件里嵌入的视频（PPT 插入的 mp4）：能直接播就播，不能播也要说清楚为什么 */
.pg-video { align-items: center; justify-content: center; gap: 6px;
  color: var(--text-2); font-size: .85em; text-align: center; }
.pg-video-el { width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 8px; background: #000; }
.pg-video-ico { font-size: 1.6em; color: var(--brand); }
.pg-video-tip { color: var(--muted); font-size: .92em; }
.pg-empty { color: var(--muted); padding: 4%; }
/* 列表缩略图里的一页：外层 .mat-doc 已经是那张「纸」，这一页不必再来一圈边框与投影 */
.mat-page .pg { border: 0; border-radius: 0; box-shadow: none; }
/* PPT 缩略图直接在卡片宽度上摆一张小页（.pg 自带母版原始比例），
   不需要文档那套「1.95 倍宽再整体缩小」的技巧 —— 那套是为长文档首页设计的 */
.mat-page:has(.pv-slide) { width: 100%; height: auto; transform: none; }
.mat-page:has(.pv-slide) .pv-md { padding: 0; }
.pv-pptx .pv-slidebar .btn[disabled] { opacity: .45; cursor: default; }
/* 视频播放失败：给可操作的说明，而不是留一块黑播放器让人猜 */
.pv-video-err { margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--warn-bg); color: var(--text-2); font-size: 13px; line-height: 1.6; }

@media (max-width: 640px) {
  .mat-grid { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 12px; }
  .mat-thumb { height: 124px; padding: 7px 7px 0; }
  .mat-ph-ico { font-size: 24px; }
  .mat-ph-cap { display: none; }
  .mat-acts { padding: 8px 12px 10px; }
}
