:root {
  --primary: #2563eb;
  --primary-deep: #1d4ed8;
  --tint: #e8f0fe;
  --accent: #ff9f43;
  --bg: #eef3f9;
  --bg-2: #dfe8f4;
  --card: #ffffff;
  --text: #1f2d3d;
  --muted: #5a6b7b;
  --line: #d5dee9;
  --ok: #16a34a;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(31, 45, 61, 0.08);
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, #c7dbff 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #ffe2bd 0%, transparent 50%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
a { color: var(--primary); text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

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

.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.82);
  border-bottom: 1px solid rgba(213,222,233,0.9);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
}
.brand-text { min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  box-shadow: 0 6px 16px rgba(37,99,235,0.35);
  flex: 0 0 auto;
}
.brand-logo {
  height: 32px; width: auto; max-width: 160px;
  object-fit: contain;
  flex: 0 0 auto;
  background: transparent;
  border-radius: 6px;
}
.brand h1 {
  margin: 0; font-size: 1.15rem; letter-spacing: 0.02em; white-space: nowrap;
  color: var(--text);
}
.brand .sub {
  color: var(--muted); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.user-chip {
  color: var(--muted); font-size: 0.9rem;
}
.btn.ghost.is-active {
  color: var(--primary);
  background: var(--tint);
}

.page { flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; padding: 28px 20px 48px; }
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.3;
}
.page-desc {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 40em;
}
.page-header-extra { flex: 0 0 auto; }
.stat-pill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 88px;
}
.stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}
.stat-label { color: var(--muted); font-size: 0.8rem; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.nav-panel {
  padding: 14px 14px 6px;
  margin-bottom: 18px;
}
.footer {
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 16px 12px 24px;
}

.tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px;
}
@media (max-width: 860px) {
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs > .tab { flex: 0 0 auto; }
}
.tab {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.7);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  transition: 0.15s ease;
}
.tab:hover { border-color: #93c5fd; color: var(--primary); }
.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37,99,235,0.25);
}
.sub-tabs .tab {
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.92rem;
}
.level-tabs .tab.active {
  background: #1d4ed8;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.course-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(31,45,61,0.14);
}
.course-cover {
  height: 140px;
  position: relative;
  display: flex; align-items: flex-end; padding: 12px 14px; color: #fff;
  font-weight: 600;
}
.course-cover.cover-0 {
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,0.07) 10px, rgba(255,255,255,0.07) 20px),
    linear-gradient(135deg, #1d4ed8, #60a5fa);
}
.course-cover.cover-1 {
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,0.07) 10px, rgba(255,255,255,0.07) 20px),
    linear-gradient(135deg, #4f46e5, #a5b4fc);
}
.course-cover.cover-2 {
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,0.07) 10px, rgba(255,255,255,0.07) 20px),
    linear-gradient(135deg, #0e7490, #67e8f9);
}
.course-cover.cover-3 {
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,0.07) 10px, rgba(255,255,255,0.07) 20px),
    linear-gradient(135deg, #0369a1, #7dd3fc);
}
.course-cover.cover-4 {
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,0.07) 10px, rgba(255,255,255,0.07) 20px),
    linear-gradient(135deg, #3730a3, #818cf8);
}
.course-cover.cover-5 {
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,0.07) 10px, rgba(255,255,255,0.07) 20px),
    linear-gradient(135deg, #475569, #94a3b8);
}
.course-cover.has-img {
  background-size: cover;
  background-position: center;
}
.course-cover .cover-title {
  position: relative;
  font-size: 1.12rem;
  line-height: 1.35;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-cover .cover-play {
  position: absolute;
  right: 12px; top: 12px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
  display: flex; align-items: center; justify-content: center;
}
.course-cover .cover-play::after {
  content: "";
  width: 0; height: 0;
  border-left: 9px solid var(--primary);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  margin-left: 2px;
}
.cover-badge {
  position: absolute;
  left: 12px; top: 12px;
  background: rgba(255,255,255,0.92);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  z-index: 1;
}
.course-progress {
  display: flex; align-items: center; gap: 8px;
  margin-top: 2px;
}
.course-progress-track {
  flex: 1; height: 6px; border-radius: 999px;
  background: var(--tint);
  overflow: hidden;
}
.course-progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #16a34a, #4ade80);
  transition: width 0.3s ease;
}
.course-progress-text {
  font-size: 0.78rem; color: var(--muted);
  white-space: nowrap;
}
.course-recent {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 500;
}
.course-search {
  width: 100%; max-width: 420px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 0.95rem;
  background: #fff;
}
.course-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--tint);
}
.course-info {
  padding: 18px 20px;
  margin-top: 18px;
}
.course-info h3 { margin: 0 0 10px; font-size: 1rem; }
.course-info p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.65;
}
.course-info-meta { font-size: 0.88rem; color: var(--muted); }
.course-info-progress {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}
.course-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-body h3 { margin: 0; font-size: 1.05rem; }
.course-meta { color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.course-body .desc {
  color: var(--muted); font-size: 0.88rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 10px;
  padding: 10px 16px;
  background: var(--primary); color: #fff;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--primary-deep); }
.btn:active { transform: scale(0.98); }
.btn.secondary {
  background: #fff; color: var(--primary); border: 1px solid #bfdbfe;
}
.btn.ghost {
  background: transparent; color: var(--muted); border: 1px solid transparent;
}
.btn.ghost:hover { color: var(--primary); background: var(--tint); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.auto-next {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; color: var(--muted);
  cursor: pointer; user-select: none;
}
.auto-next input { accent-color: var(--primary); width: 15px; height: 15px; }

.loading {
  display: flex; justify-content: center; align-items: center;
  padding: 48px 0;
}
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--tint);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-wrap {
  min-height: calc(100vh - 120px);
  display: grid; place-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #1e40af 100%);
  border-radius: 20px;
  margin: 16px 0;
  padding: 40px 20px;
}
.auth-card {
  width: min(440px, 100%);
  padding: 28px 26px 24px;
}
.auth-card .page-header {
  margin-bottom: 16px;
}
.auth-card .page-header h2 { font-size: 1.45rem; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.auth-switch { margin-top: 14px; text-align: center; color: var(--muted); font-size: 0.9rem; }
.error {
  background: #fef2f2; color: var(--danger);
  border: 1px solid #fecaca; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 12px; font-size: 0.9rem;
}
.ok {
  background: #f0fdf4; color: var(--ok);
  border: 1px solid #bbf7d0; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 12px; font-size: 0.9rem;
}

.play-layout {
  display: grid;
  grid-template-columns: 1.55fr 0.75fr;
  gap: 18px;
  align-items: start;
}
.player-card, .seg-card, .admin-card {
  /* panel already provides card chrome when combined */
}
.player-card { padding: 16px; }
.player-frame {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
}
.player-poster {
  position: absolute; inset: 0;
  z-index: 3;
  cursor: pointer;
}
.player-poster[hidden] { display: none; }
.poster-cover {
  position: absolute; inset: 0;
  opacity: 0.45;
}
.poster-cover.cover-0 { background: linear-gradient(135deg, #1d4ed8, #60a5fa); }
.poster-cover.cover-1 { background: linear-gradient(135deg, #4f46e5, #a5b4fc); }
.poster-cover.cover-2 { background: linear-gradient(135deg, #0e7490, #67e8f9); }
.poster-cover.cover-3 { background: linear-gradient(135deg, #0369a1, #7dd3fc); }
.poster-cover.cover-4 { background: linear-gradient(135deg, #3730a3, #818cf8); }
.poster-cover.cover-5 { background: linear-gradient(135deg, #475569, #94a3b8); }
.poster-text {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  color: #fff;
  text-align: center;
  padding: 20px;
}
.poster-title {
  font-size: 1.3rem; font-weight: 700;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.poster-hint {
  font-size: 0.85rem;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 6px 16px;
}
.player-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #0f172a;
  vertical-align: top;
}
.mosaic-overlay {
  position: absolute;
  /* 具体 left/top/width/height 由 JS 按画面实际显示区域计算 */
  top: 10px;
  right: 12px;
  width: 140px;
  height: 40px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 5;
  box-shadow: none;
  outline: none;
  opacity: 1;
  background: #111;
  image-rendering: pixelated;
}
.player-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.fs-nav {
  display: none;
  position: absolute;
  left: 50%;
  /* 放顶部，避免挡住底部进度条 */
  top: max(12px, env(safe-area-inset-top));
  bottom: auto;
  transform: translateX(-50%);
  z-index: 6;
  gap: 10px;
  align-items: center;
  pointer-events: auto;
}
/* 系统全屏 API 打在容器上，或 CSS 伪全屏（iOS） */
.player-frame.is-page-fs,
.player-frame:fullscreen,
.player-frame:-webkit-full-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
  background: #000;
  opacity: 1;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  display: block;
  overflow: hidden;
}
.player-frame.is-page-fs video,
.player-frame:fullscreen video,
.player-frame:-webkit-full-screen video {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  background: #000;
  opacity: 1;
}
.player-frame.is-page-fs .fs-nav,
.player-frame:fullscreen .fs-nav,
.player-frame:-webkit-full-screen .fs-nav {
  display: flex;
}
.player-frame.is-page-fs .fs-nav .btn,
.player-frame:fullscreen .fs-nav .btn,
.player-frame:-webkit-full-screen .fs-nav .btn {
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 8px 14px;
  font-size: 0.9rem;
  min-height: 36px;
}
body.player-fs-lock {
  overflow: hidden;
}
.now-playing {
  margin-top: 12px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
}
.play-hint {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--danger);
}
.seg-card { padding: 14px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.seg-card h3 { margin: 0 0 10px; font-size: 1rem; }
.seg-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.seg-head h3 { margin: 0; }
.unplayed-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.78rem; color: var(--muted);
  cursor: pointer; user-select: none;
}
.unplayed-toggle input { accent-color: var(--primary); width: 14px; height: 14px; }
.seg-list.only-unplayed li:has(button.played) { display: none; }
.seg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.seg-list li button {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 9px;
  border: 1px solid transparent;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
}
.seg-list li button:hover { background: var(--tint); }
.seg-list li button.active {
  background: var(--tint);
  border-color: #93c5fd;
  color: var(--primary-deep);
  font-weight: 600;
}
.seg-list li button .seg-title {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seg-dur { font-size: 0.75rem; color: var(--muted); flex: 0 0 auto; }
.seg-check {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  flex: 0 0 auto;
  position: relative;
}
.seg-list li button.played .seg-check {
  background: #16a34a;
  border-color: #16a34a;
}
.seg-list li button.played .seg-check::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.seg-list li button.active .seg-check { border-color: var(--primary); }
.seg-nav { display: flex; gap: 8px; margin-top: 12px; }

.admin-card { padding: 18px; margin-bottom: 16px; }
.admin-card h3 { margin: 0 0 12px; }
.admin-card { overflow-x: auto; }
.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  align-items: start;
}
.admin-main { min-width: 0; }
.admin-side {
  position: sticky; top: 76px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
}
.admin-nav {
  display: block;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: 0.15s ease;
}
.admin-nav:hover { background: var(--tint); color: var(--primary); }
.admin-nav.active { background: var(--primary); color: #fff; }
.admin-section[hidden] { display: none; }
.course-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px auto;
  gap: 12px;
  align-items: end;
}
.course-form .field { margin: 0; min-width: 0; }
.course-form input,
.course-form select {
  width: 100%;
}
.course-form .btn { white-space: nowrap; }
.course-cat-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.course-cat-row .tag-filters { margin: 0; }
.course-tags-pick { grid-column: 1 / -1; }
.course-tags-pick {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 14px;
}
.course-tags-label {
  font-size: 0.9rem; color: var(--muted);
  padding-top: 10px; white-space: nowrap;
}
.tag-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: 0.15s ease;
}
.tag-pill input { accent-color: var(--primary); width: 14px; height: 14px; }
.tag-pill:has(input:checked) {
  background: color-mix(in srgb, var(--tc, #2563eb) 14%, white);
  border-color: var(--tc, #2563eb);
  color: var(--tc, #2563eb);
}
.course-tag {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  margin: 2px 4px 2px 0;
  white-space: nowrap;
}
.tag-del {
  border: none; background: transparent;
  color: inherit; cursor: pointer;
  font-size: 0.95rem; line-height: 1;
  padding: 0 2px;
}
.tag-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 16px;
}
.tag-filter {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.88rem;
  transition: 0.15s ease;
}
.tag-filter:hover { border-color: #93c5fd; color: var(--primary); }
.tag-filter.active {
  background: var(--tc, var(--primary));
  border-color: var(--tc, var(--primary));
  color: #fff;
}
.filter-group {
  margin-bottom: 14px;
}
.filter-group:last-child {
  margin-bottom: 0;
}
.training-category {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.filter-group .tag-filters {
  margin-bottom: 0;
}
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15,23,42,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  width: min(460px, 100%);
}
.modal-box h3 { margin: 0 0 14px; font-size: 1.05rem; }
#login-logs-table .table { min-width: 720px; }
#login-logs-table td .ok,
#login-logs-table td .error {
  display: inline-block;
  padding: 2px 10px;
  margin: 0;
  font-size: 0.8rem;
  white-space: nowrap;
  border-radius: 999px;
}
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-nav { width: auto; }
  .course-form { grid-template-columns: 1fr 1fr; }
  .course-form .btn { grid-column: 1 / -1; }
}
.logo-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.logo-preview {
  width: 160px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px; text-align: left; vertical-align: top;
}
.table th { color: var(--muted); font-weight: 600; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.empty {
  padding: 36px 16px; text-align: center; color: var(--muted);
}
.empty.panel {
  border-style: dashed;
}

@media (max-width: 860px) {
  .play-layout { grid-template-columns: 1fr; }
  .seg-card { position: static; max-height: none; }
  .brand .sub { display: none; }
  .page-header { flex-direction: column; }
  .topbar-inner { padding: 10px 14px; }
  .topbar-inner { flex-wrap: wrap; }
  .player-card { padding: 10px; }
  .player-card video { border-radius: 0; }
  .seg-list li button { padding: 12px 14px; font-size: 1rem; }
  .btn { min-height: 40px; }
}
@media (max-width: 480px) {
  .brand h1 { font-size: 1rem; }
  .nav-actions .btn.ghost { padding: 6px 8px; font-size: 0.85rem; }
}

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