/* 躺不平在线课堂 · 深色星空风格（2026-08-11） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #0b0f1e; color: #e8ecf7; min-height: 100vh;
}
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.topbar {
  position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: rgba(15,20,40,.72); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(120,160,255,.16);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#5b8cff,#8a5bff); box-shadow: 0 0 18px rgba(91,140,255,.45);
}
.top-right { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #93a0c4; }
.stage { position: relative; z-index: 1; max-width: 1120px; margin: 26px auto 60px; padding: 0 20px; }
.view { display: none; }
.view.on { display: block; }
.glass {
  background: rgba(20,28,55,.72); border: 1px solid rgba(120,160,255,.18); border-radius: 18px;
  backdrop-filter: blur(16px); box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.tagline { text-align: center; margin: 20px 0 30px; }
.tagline h1 { font-size: 26px; margin-bottom: 6px; }
.tagline p { color: #93a0c4; font-size: 14px; }

/* 登录页 */
.login-card { max-width: 720px; margin: 0 auto; padding: 34px; }
.scan-row { display: flex; gap: 34px; align-items: center; justify-content: center; flex-wrap: wrap; }
.qrcode-box { text-align: center; }
.qrcode-frame {
  width: 200px; height: 200px; padding: 12px; border-radius: 14px; background: #fff;
  box-shadow: 0 0 0 1px rgba(120,160,255,.25), 0 14px 40px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
}
.qrcode-frame img { width: 176px; height: 176px; }
.qr-tip { margin-top: 12px; font-size: 13px; color: #93a0c4; line-height: 1.7; }
.scan-right { flex: 1; min-width: 250px; max-width: 360px; }
.scan-right h3 { font-size: 21px; margin-bottom: 8px; }
.scan-right .desc { font-size: 13px; color: #93a0c4; line-height: 1.9; margin-bottom: 18px; }
.divider { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #7c88ac; margin: 6px 0 14px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(120,160,255,.16); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #93a0c4; margin-bottom: 7px; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 10px; font-size: 15px;
  background: rgba(10,16,36,.7); border: 1px solid rgba(120,160,255,.2); color: #e8ecf7;
  outline: none;
}
.field input:focus { border-color: #5b8cff; box-shadow: 0 0 0 3px rgba(91,140,255,.18); }
.code-input { letter-spacing: 2px; font-weight: 600; }
.code-segs { display: flex; gap: 8px; align-items: center; justify-content: flex-start; }
.code-seg {
  width: 88px; padding: 12px 8px; font-size: 20px; font-weight: 700;
  text-align: center; letter-spacing: 2px; text-transform: uppercase;
  background: rgba(255,255,255,.04); color: #e8ecf7;
  border: 1px solid rgba(120,160,255,.28); border-radius: 10px; outline: none;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.code-seg::placeholder { color: #4d5878; font-weight: 500; }
.code-seg:focus { border-color: #5b8cff; box-shadow: 0 0 0 3px rgba(91,140,255,.22); }
.code-dash { color: #5b8cff; font-size: 18px; font-weight: 700; }

/* 🍞 2026-08-12: 登录页已登录兜底条（扫码后或刷新已有 token 时显示，给用户手动进课堂的入口） */
.logged-bar { max-width: 880px; margin: 0 auto 16px; padding: 14px 18px; display: flex; align-items: center; gap: 14px; border-radius: 14px; }
.logged-bar .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(91,140,255,.35); background: #1a2138; flex-shrink: 0; }
.logged-bar .logged-info { flex: 1; min-width: 0; }
.logged-bar .logged-name { font-weight: 700; color: #e8ecf7; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logged-bar .logged-tip { font-size: 12px; color: #6c79a5; margin-top: 2px; }
.logged-bar .logged-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-main {
  width: 100%; padding: 13px; border: none; border-radius: 10px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg,#5b8cff,#8a5bff); font-size: 16px; font-weight: 600; margin-top: 4px;
  box-shadow: 0 6px 20px rgba(91,140,255,.35);
}
.btn-main:hover { transform: translateY(-1px); }
.hint { text-align: center; font-size: 12px; color: #7c88ac; margin-top: 14px; line-height: 1.7; }

/* 我的课程 */
.welcome { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 24px; }
.welcome h2 { font-size: 20px; }
.welcome .sub { font-size: 13px; color: #93a0c4; margin-top: 4px; }
.top-actions { display: flex; gap: 10px; }
.btn-ghost {
  font-size: 13px; color: #93a0c4; cursor: pointer; padding: 8px 14px;
  border: 1px solid rgba(120,160,255,.2); border-radius: 8px; background: transparent;
}
.btn-ghost:hover { color: #5b8cff; border-color: #5b8cff88; }
.btn-ghost.danger:hover { color: #ff7a7a; border-color: #ff7a7a66; }
.grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }
.course-card { overflow: hidden; cursor: pointer; transition: .25s; }
.course-card:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(0,0,0,.5), 0 0 0 1px rgba(120,160,255,.35); }
.cover { height: 130px; display: flex; align-items: center; justify-content: center; font-size: 44px; position: relative; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,transparent 40%,rgba(10,14,30,.85)); }
.cover .play {
  position: absolute; z-index: 2; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
}
.cover .play::before { content: "▶"; margin-left: 3px; }
.badge { position: absolute; z-index: 2; top: 10px; right: 10px; font-size: 11px; padding: 3px 9px; border-radius: 20px; background: rgba(46,204,113,.9); color: #04260f; font-weight: 600; }
.body { padding: 16px 16px 18px; }
.body h3 { font-size: 15px; margin-bottom: 10px; }
.prog { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #93a0c4; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(120,160,255,.12); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg,#5b8cff,#8a5bff); }
.c1 { background: linear-gradient(135deg,#3b5bdb,#7c4dff); }
.c2 { background: linear-gradient(135deg,#e8590c,#ff6b9d); }
.c3 { background: linear-gradient(135deg,#0ca678,#22b8cf); }
.empty { text-align: center; padding: 80px 0; color: #7c88ac; font-size: 15px; }
.empty .big { font-size: 46px; margin-bottom: 14px; }

/* 上课页 */
.player-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; }
@media (max-width: 820px) { .player-layout { grid-template-columns: 1fr; } }
.chapter { padding: 12px; max-height: 560px; overflow-y: auto; }
.chapter h4 { font-size: 13px; color: #93a0c4; margin: 8px 4px 10px; }
.ep { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; cursor: pointer; transition: .15s; margin-bottom: 4px; }
.ep:hover { background: rgba(120,160,255,.1); }
.ep.on { background: rgba(91,140,255,.18); border: 1px solid rgba(91,140,255,.3); }
.ep .num { width: 26px; height: 26px; border-radius: 8px; background: rgba(120,160,255,.12); display: flex; align-items: center; justify-content: center; font-size: 12px; color: #aeb8d8; flex-shrink: 0; }
.ep.on .num { background: linear-gradient(135deg,#5b8cff,#8a5bff); color: #fff; }
.ep.done .num { font-size: 0; }
.ep.done .num::after { content: "✓"; }
.ep .t { flex: 1; font-size: 14px; line-height: 1.4; }
.ep .dur { font-size: 12px; color: #7c88ac; flex-shrink: 0; }
.video-wrap { border-radius: 16px; overflow: hidden; background: #05070f; aspect-ratio: 16/9; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.video-wrap video { width: 100%; height: 100%; display: block; background: #000; }
.video-bar { display: flex; align-items: center; gap: 16px; margin-top: 14px; padding: 14px 18px; }
.video-bar .title { flex: 1; font-size: 15px; font-weight: 600; }
.btn { padding: 8px 18px; border-radius: 9px; cursor: pointer; font-size: 13px; border: 1px solid rgba(120,160,255,.25); color: #c6d0ec; background: rgba(120,160,255,.08); }
.btn:hover { background: rgba(120,160,255,.18); }
.btn.primary { background: linear-gradient(135deg,#5b8cff,#8a5bff); color: #fff; border: none; }
.back-home { margin-top: 16px; background: none; border: none; color: #93a0c4; cursor: pointer; font-size: 13px; }
.back-home:hover { color: #5b8cff; }

/* 弹窗 */
.modal-mask { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(5,8,18,.7); align-items: center; justify-content: center; }
.modal-mask.on { display: flex; }
.modal { width: 360px; padding: 28px; }
.modal h3 { margin-bottom: 8px; }
.modal-desc { font-size: 12px; color: #93a0c4; margin-bottom: 16px; line-height: 1.7; }
.modal input { width: 100%; padding: 12px 14px; border-radius: 10px; font-size: 15px; background: rgba(10,16,36,.7); border: 1px solid rgba(120,160,255,.2); color: #e8ecf7; outline: none; margin-bottom: 16px; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; }

/* 提示 */
#toastWrap { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 20px; border-radius: 10px; font-size: 13px; background: rgba(20,28,55,.92); border: 1px solid rgba(120,160,255,.3); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.err { border-color: #ff7a7a88; color: #ff9a9a; }
.toast.ok { border-color: #2ecc7188; color: #7cefb2; }
