:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e5e7eb;
  --line-soft: #f1f5f9;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px -18px rgba(15, 23, 42, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 650; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }

p { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* ---------------- 通用控件 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { background: var(--red-soft); border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,0.4); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 26px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }

.linkish {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.linkish:hover { color: var(--primary); }
.linkish.danger:hover { color: var(--red); }

.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.select { padding-right: 30px; appearance: none; 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='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input-flat { border-color: transparent; background: transparent; height: 32px; padding: 0 8px; font-weight: 500; }
.input-flat:hover { background: var(--line-soft); }
.input-flat:focus { background: #fff; border-color: var(--primary); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; color: var(--ink-2); font-weight: 500; }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { margin: 3px 0 0; accent-color: var(--primary); width: 16px; height: 16px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .input, .filters .select { width: auto; min-width: 140px; }
.inline { display: inline; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.inline-form .select { width: auto; min-width: 150px; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.inline-field .input { width: auto; }

/* ---------------- 后台框架 ---------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--ink); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 6px 14px -6px rgba(99, 102, 241, 0.6);
}
.brand-mark.big { width: 54px; height: 54px; border-radius: 16px; font-size: 28px; }
.brand-text { font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 14px;
}
.nav-link:hover { background: var(--line-soft); color: var(--ink); }
.nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-link .ico { width: 18px; text-align: center; font-size: 14px; opacity: 0.8; }

.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 8px 2px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.main { flex: 1; margin-left: 232px; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 26px;
  background: rgba(245, 246, 250, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}
.page-title { font-size: 19px; font-weight: 650; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.menu-btn { display: none; font-size: 20px; }
.content { padding: 22px 26px 60px; max-width: 1240px; }

.flash {
  margin: 0 26px 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid transparent;
}
.flash.ok { background: var(--green-soft); color: #047857; border-color: #a7f3d0; }
.flash.err { background: var(--red-soft); color: #b91c1c; border-color: #fecaca; }
.flash.warn { background: var(--amber-soft); color: #92400e; border-color: #fde68a; }
.flash a { text-decoration: underline; }

/* ---------------- 卡片与数据 ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card + .card { margin-top: 18px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h2 { font-size: 15px; }
.card-body { padding: 18px; }
.more { font-size: 13px; color: var(--muted); }
.more:hover { color: var(--primary); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2 > .card + .card { margin-top: 0; }
.detail-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; align-items: start; }
.detail-grid.wide-left { grid-template-columns: 1.35fr 1fr; }
.detail-grid > .card + .card { margin-top: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-grid.compact { grid-template-columns: repeat(3, 1fr); }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stat-value.small-value { font-size: 16px; padding-top: 8px; }
.stat-sub { font-size: 12px; color: var(--muted); }

.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.quick {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--ink-2);
  font-size: 14px;
}
.quick:hover { border-color: #c7d2fe; background: #fafaff; color: var(--primary); }
.quick-ico { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 700; }

.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.list-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; color: var(--ink); }
.list-title { font-weight: 550; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time { font-size: 12px; color: var(--muted); white-space: nowrap; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-green { background: var(--green-soft); color: #047857; }
.badge-red { background: var(--red-soft); color: #b91c1c; }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-slate { background: #f1f5f9; color: var(--muted); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 14px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbff; }
.table .right { white-space: nowrap; }
.strong-link { color: var(--ink); font-weight: 550; }
.strong-link:hover { color: var(--primary); }
.empty-cell { text-align: center; color: var(--muted); padding: 42px 16px !important; }
.row-deleted td { opacity: 0.6; }
.compact-table th, .compact-table td { padding: 8px 10px; }

.empty { padding: 26px 10px; text-align: center; color: var(--muted); font-size: 14px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px 0 4px; }
.pager-info { font-size: 13px; color: var(--muted); }

.panel {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}
.panel[hidden] { display: none; }

.back-link { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.back-link:hover { color: var(--primary); }

.danger-zone {
  margin-top: 26px;
  padding: 16px 18px;
  border: 1px dashed #fecaca;
  border-radius: var(--radius);
  background: #fffafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv code { font-size: 12.5px; background: var(--line-soft); padding: 2px 6px; border-radius: 6px; }

/* ---------------- 二维码 ---------------- */

.qr-card .card-body.center { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-img { width: 190px; height: 190px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.copy-row { display: flex; gap: 8px; width: 100%; }
.copy-row .input { flex: 1; height: 36px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------------- 目录 ---------------- */

.cat-tree { list-style: none; margin: 0; padding: 0; }
.cat-tree.root { display: flex; flex-direction: column; gap: 2px; }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; }
.cat-row:hover { background: #fafbff; }
.cat-rename { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.cat-rename .input { flex: 1; max-width: 320px; }
.cat-actions { display: flex; gap: 2px; margin-left: auto; }
.cat-node > .cat-tree { margin-left: 12px; border-left: 1px dashed var(--line); padding-left: 4px; }

/* ---------------- 班级 ---------------- */

.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.class-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.class-card:hover { border-color: #c7d2fe; transform: translateY(-1px); color: var(--ink); }
.class-card.archived { opacity: 0.6; }
.class-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.class-top h3 { font-size: 16px; }
.class-meta { font-size: 13px; color: var(--muted); }
.class-stats { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.class-stats strong { color: var(--ink); font-size: 15px; }

/* ---------------- 上传 ---------------- */

.upload-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; margin-bottom: 18px; }
.upload-grid > .card + .card { margin-top: 0; }
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 38px 16px;
  border: 1.5px dashed #c7d2fe;
  border-radius: var(--radius);
  background: #fbfbff;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.dropzone:hover, .dropzone.dragover { background: #f5f3ff; border-color: var(--primary); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 22px; font-weight: 700; }
.dz-title { font-weight: 600; color: var(--ink); }
.dz-sub { font-size: 12.5px; color: var(--muted); }
.dz-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dz-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; background: var(--line-soft); border-radius: 8px; padding: 7px 10px; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }

/* ---------------- 预览 ---------------- */

.preview-frame { width: 100%; height: 68vh; min-height: 420px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.detail-grid .stack { display: flex; flex-direction: column; gap: 18px; }
.detail-grid .stack > .card + .card { margin-top: 0; }

/* ---------------- 图表 ---------------- */

.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 8px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar-stack { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; }
.bar-fill { border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-fill.views { background: #6366f1; }
.bar-fill.downloads { background: #34d399; }
.bar-legend { display: flex; align-items: center; gap: 16px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.dot.views { background: #6366f1; }
.dot.downloads { background: #34d399; }

/* ---------------- 学生端 ---------------- */

.student-body { background: var(--bg); padding-bottom: 78px; }
.s-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 58px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.s-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 650; font-size: 15px; }
.s-brand .brand-mark { width: 28px; height: 28px; font-size: 15px; border-radius: 8px; }
.s-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.s-name { color: var(--ink-2); }
.s-main { max-width: 760px; margin: 0 auto; padding: 16px 14px 30px; }

.s-hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
  color: #fff;
  border-radius: 20px;
  padding: 24px 22px;
  box-shadow: 0 18px 40px -22px rgba(79, 70, 229, 0.8);
}
.s-hello { font-size: 22px; font-weight: 700; }
.s-sub { font-size: 13px; opacity: 0.85; margin-top: 2px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 12.5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
a.chip { color: #fff; }
.filter-row { margin-top: 0; margin-bottom: 14px; }
.filter-row .chip { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.filter-row .chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.s-section { margin-top: 22px; }
.s-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.s-section-head h2 { font-size: 16px; }
.s-section-head a { font-size: 13px; color: var(--muted); }

.s-search { display: flex; gap: 8px; margin-bottom: 10px; }
.s-search .input { flex: 1; height: 42px; border-radius: 12px; }
.s-search .btn { height: 42px; border-radius: 12px; }

.m-list { display: flex; flex-direction: column; gap: 10px; }
.m-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s, transform 0.1s;
}
.m-card:hover { border-color: #c7d2fe; transform: translateY(-1px); color: var(--ink); }
.m-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.m-date { margin-left: auto; font-size: 12px; color: var(--muted); }
.m-title { font-size: 16px; font-weight: 600; }
.m-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.s-empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 16px; padding: 40px 16px; text-align: center; color: var(--muted); font-size: 14px; }

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px -10px rgba(15, 23, 42, 0.55);
}
.tab { display: flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 999px; color: #cbd5e1; font-size: 13px; }
.tab.active { background: #fff; color: var(--ink); font-weight: 600; }
.tab-ico { font-size: 14px; }

.v-head { margin-bottom: 12px; }
.v-head h1 { font-size: 21px; }
.v-head .chip-row .chip { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.v-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.v-preview { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.v-preview iframe { width: 100%; height: 72vh; min-height: 420px; border: 0; display: block; background: #f8fafc; }
.v-preview.image { padding: 8px; }
.v-preview.image img { width: 100%; height: auto; border-radius: 10px; display: block; }
.v-audio { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.v-audio audio { width: 100%; }
.v-video { background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; }
.v-video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------------- 公开页 ---------------- */

.public-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(900px 500px at 10% -10%, #e0e7ff 0%, transparent 60%),
    radial-gradient(700px 500px at 110% 110%, #f3e8ff 0%, transparent 55%),
    var(--bg);
}
.public-main { width: 100%; max-width: 430px; }
.public-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 28px;
  box-shadow: 0 24px 60px -30px rgba(15, 23, 42, 0.35);
}
.login-box { display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; justify-content: center; }
.login-title { text-align: center; font-size: 22px; }
.login-sub { text-align: center; color: var(--muted); font-size: 14px; margin-top: -8px; }
.login-box .flash { margin: 0; }
.login-box .hint { text-align: center; }

.landing { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.landing-icon { font-size: 40px; }
.landing-title { font-size: 24px; }
.landing-sub { color: var(--muted); font-size: 14px; }
.landing-tip { background: var(--primary-soft); color: var(--primary-dark); border-radius: 12px; padding: 12px 16px; font-size: 14px; width: 100%; }
.landing .btn-ghost { color: var(--ink-2); border-color: var(--line); }
.landing .btn-ghost:hover { background: var(--line-soft); color: var(--ink); }

.error-page { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.error-code { font-size: 54px; font-weight: 800; color: var(--primary); letter-spacing: -0.03em; }
.error-message { color: var(--muted); }

.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 35;
}

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

@media (min-width: 768px) {
  .student-body { padding-bottom: 0; }
  .tabbar {
    position: static;
    transform: none;
    width: fit-content;
    margin: 26px auto 8px;
    background: #0f172a;
  }
}

@media (max-width: 1080px) {
  .detail-grid, .detail-grid.wide-left { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .table { min-width: 680px; }
  .table th, .table td { white-space: nowrap; }
  .students-table th:nth-child(5), .students-table td:nth-child(5) { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform 0.22s ease; box-shadow: 0 0 40px rgba(15, 23, 42, 0.2); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px 14px 50px; }
  .topbar { padding: 0 14px; height: 58px; }
  .flash { margin-left: 14px; margin-right: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .quick-row { grid-template-columns: 1fr 1fr; }
  .stat-grid.compact { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .top-actions .btn { height: 34px; padding: 0 10px; font-size: 13px; }
}

@media (max-width: 520px) {
  h1 { font-size: 20px; }
  .card-body { padding: 15px; }
  .card-head { padding: 12px 15px; }
  .stat-value { font-size: 24px; }
  .detail-grid { gap: 14px; }
  .qr-img { width: 170px; height: 170px; }
  .bar-col:nth-child(odd) .bar-fill { opacity: 0.95; }
  .s-hero { padding: 20px 18px; }
  .s-hello { font-size: 20px; }
  .v-head h1 { font-size: 19px; }
}
