:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --danger: #dc2626;
  --warn-bg: #fff7ed;
  --notice-bg: #ecfdf5;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --card: #1a1d23;
    --text: #e6e8eb;
    --muted: #9aa1ab;
    --line: #2b3038;
    --accent: #4f8cff;
    --danger: #f87171;
    --warn-bg: #2a2117;
    --notice-bg: #13261e;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: 0.4rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.8rem; }
main { max-width: 920px; margin: 0 auto; padding: 16px 16px 48px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; color: var(--text); }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who form { margin: 0; }
.email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 8vh auto 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--danger); }
.notice { background: var(--notice-bg); padding: 10px 12px; border-radius: 8px; }
.badge { background: var(--danger); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 0.8rem; vertical-align: middle; }
.top-gap { margin-top: 16px; }

input, select, button, .button {
  font: inherit; color: inherit; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); padding: 9px 12px; min-height: 40px;
}
input, select { width: 100%; }
button, .button { cursor: pointer; display: inline-block; }
button.primary, .button { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
button.link { border: none; background: none; padding: 0; min-height: 0; color: var(--accent); }
button.danger.link { color: var(--danger); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row input, .row select { flex: 1 1 160px; width: auto; }
.row.spread { justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
form.inline { display: inline; }
.code-input { font-size: 1.6rem; letter-spacing: 0.4em; text-align: center; }

.google-btn { display: flex; justify-content: center; min-height: 44px; margin: 8px 0; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lessons a {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.lessons a:hover { border-color: var(--accent); text-decoration: none; }
.play { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 0.85rem; flex: none; }
.info { display: flex; flex-direction: column; min-width: 0; }
.title { font-weight: 600; }

.lesson-title { margin-bottom: 12px; }
.player {
  position: relative; background: #000; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16 / 9; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.player video { width: 100%; height: 100%; display: block; background: #000; }
.wm {
  position: absolute; pointer-events: none; color: rgba(255, 255, 255, 0.28);
  font-size: clamp(11px, 1.8vw, 16px); white-space: nowrap; text-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
  transition: top 1.2s ease, left 1.2s ease; top: 10%; left: 10%;
}
.wm-fixed { top: auto; left: auto; right: 12px; bottom: 54px; color: rgba(255, 255, 255, 0.18); transition: none; }
.player-msg {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  background: rgba(0, 0, 0, 0.75); color: #fff;
}
.player:fullscreen, .player.pseudo-fs { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.player.pseudo-fs { position: fixed; inset: 0; z-index: 1000; }
.player-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0; }
.player-bar label { display: flex; align-items: center; gap: 8px; }
.player-bar select { width: auto; }

.request { border-bottom: 1px solid var(--line); padding: 12px 0; display: grid; gap: 6px; }
.request:last-of-type { border-bottom: none; }
.student { border-bottom: 1px solid var(--line); padding: 10px 0; }
.student summary { cursor: pointer; }
.student form { margin-top: 8px; }
.plain { list-style: none; padding: 0; margin: 8px 0; }
.plain li { padding: 3px 0; }
.lesson-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lesson-row > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.lesson-row.warn { background: var(--warn-bg); margin: 0 -20px; padding: 10px 20px; }
.inline-details summary { cursor: pointer; color: var(--accent); }
.inline-details[open] { flex-basis: 100%; }
.inline-details form { margin-top: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td:first-child { white-space: nowrap; color: var(--muted); }
.ev-anomaly td { color: var(--danger); }

@media (max-width: 560px) {
  .card { padding: 16px; }
  .lesson-row.warn { margin: 0 -16px; padding: 10px 16px; }
  .table td:nth-child(2) { display: none; }
}
.center { text-align: center; }
