/* 像素小课堂 —— 科技 × 可爱 深色主题 v3（学生端 + 教师端） */
:root {
  --bg: #0B1026;
  --ink: #E8ECFF;
  --mut: #9AA3C7;
  --dim: #6B76A3;
  --cyan: #4CC9F0;
  --pur: #8B7CFF;
  --yel: #FFD166;
  --pink: #FF7BAC;
  --grn: #51E6A8;
  --org: #FF9F5A;
  --card-b: rgba(140,160,255,.16);
  /* 交互网格单元尺寸（随分辨率缩放） */
  --pcell: 26px;
  --dcell: 30px;
  --led: 34px;
  --bit: 40px;
}
/* 小屏/矮屏（1366×768 等 720p 笔记本）：整体紧凑 */
@media (max-width: 1400px), (max-height: 820px) {
  :root { --pcell: 22px; --dcell: 25px; --led: 30px; --bit: 36px; }
  .card { padding: 16px; }
  .stage-hero { padding: 14px 18px; margin-bottom: 12px; }
  main { padding-top: 14px; }
}
/* 2K 屏：整体放大 1.35 倍 */
@media (min-width: 2200px) { body { zoom: 1.35; } }
/* 4K 屏：整体放大 1.8 倍 */
@media (min-width: 3400px) { body { zoom: 1.8; } }
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.6; min-height: 100vh;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(circle at 10% 14%, rgba(76,201,240,.12), transparent 40%),
    radial-gradient(circle at 90% 82%, rgba(139,124,255,.13), transparent 42%),
    radial-gradient(circle at 55% 115%, rgba(255,123,172,.07), transparent 46%),
    linear-gradient(rgba(255,255,255,.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.032) 1px, transparent 1px);
  background-size: auto, auto, auto, 46px 46px, 46px 46px;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: 15px; }
input, textarea, select { font-family: inherit; font-size: 15px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(140,160,255,.25); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 背景漂浮像素星 ---------- */
.bg-stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.float-star { position: absolute; width: 10px; height: 10px; border-radius: 2px; opacity: .5; animation: floaty 7s ease-in-out infinite; }
.float-star.s1 { left: 6%; top: 22%; background: var(--cyan); animation-delay: 0s; }
.float-star.s2 { left: 92%; top: 30%; background: var(--yel); animation-delay: 1.6s; width: 12px; height: 12px; }
.float-star.s3 { left: 84%; top: 78%; background: var(--pink); animation-delay: 3.1s; }
.float-star.s4 { left: 10%; top: 74%; background: var(--pur); animation-delay: 4.4s; width: 8px; height: 8px; }
.float-star.s5 { left: 50%; top: 8%; background: var(--grn); animation-delay: 2.3s; width: 7px; height: 7px; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-16px) rotate(35deg); } }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: rgba(11,16,38,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(140,160,255,.15); box-shadow: 0 2px 20px rgba(76,201,240,.07);
  flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-star { flex: 0 0 auto; animation: floaty 4s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(255,209,102,.6)); }
.logo-txt { display: flex; flex-direction: column; line-height: 1.25; }
.logo-txt b { font-size: 17.5px; color: var(--cyan); letter-spacing: 1.5px; text-shadow: 0 0 14px rgba(76,201,240,.55); }
.logo-txt span { font-size: 11.5px; color: #8A93BE; letter-spacing: .4px; }
.stage-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; justify-content: center; }
.chip {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; color: #A9B2D8;
  background: rgba(255,255,255,.055); border: 1px solid rgba(140,160,255,.18); transition: all .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-1px); }
.chip.active { background: var(--cyan); border-color: var(--cyan); color: #0B1026; font-weight: 600; box-shadow: 0 0 16px rgba(76,201,240,.5); }
.chip.done::after { content: " ✓"; color: var(--grn); font-weight: 700; }
.chip.active.done::after { color: #0B5C3E; }
.chip.locked { opacity: .42; cursor: not-allowed; border-style: dashed; }
.chip.locked:hover { border-color: rgba(140,160,255,.18); color: #A9B2D8; transform: none; }
.mebox { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.mebox .who { color: var(--ink); font-weight: 500; }
.mebox .stars { color: var(--yel); font-weight: 700; font-size: 16px; text-shadow: 0 0 10px rgba(255,209,102,.55); }
.follow-toggle { display: none; }

/* ---------- 通用布局 ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 22px 18px 64px; }
.teacher main { max-width: 1280px; }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.062), rgba(255,255,255,.035));
  border: 1px solid var(--card-b); border-radius: 18px; padding: 22px;
  box-shadow: 0 6px 26px rgba(5,8,25,.42); margin-bottom: 16px;
}
.card h2 { font-size: 17.5px; color: #FFF; margin-bottom: 8px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; letter-spacing: .3px; }
.card h2::before {
  content: ''; width: 9px; height: 9px; border-radius: 2.5px; flex: 0 0 auto;
  background: var(--cyan); box-shadow: 0 0 9px rgba(76,201,240,.8);
}
.card h2 .tag { font-size: 12px; font-weight: 400; color: #8A93BE; }
.hint { font-size: 13.5px; color: var(--mut); margin-bottom: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: 12px; font-size: 15px; font-weight: 500; transition: all .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, #5ED2F6, #3BB8E8); color: #081226; font-weight: 700; box-shadow: 0 4px 16px rgba(76,201,240,.4); }
.btn-primary:hover { box-shadow: 0 5px 22px rgba(76,201,240,.58); }
.btn-soft { background: rgba(76,201,240,.13); color: var(--cyan); border: 1px solid rgba(76,201,240,.32); }
.btn-soft:hover { background: rgba(76,201,240,.24); }
.btn-ghost { background: rgba(255,255,255,.06); color: #A9B2D8; border: 1px solid rgba(140,160,255,.22); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-orange { background: rgba(255,123,172,.14); color: var(--pink); border: 1px solid rgba(255,123,172,.32); }
.btn-orange:hover { background: rgba(255,123,172,.26); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-lg { padding: 13px 30px; font-size: 17px; border-radius: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; text-align: left; }
.field label { font-size: 13.5px; color: #C6CDEA; font-weight: 500; }
.field input, .field textarea {
  border: 1.5px solid rgba(140,160,255,.28); border-radius: 11px; padding: 11px 13px; outline: none;
  background: rgba(255,255,255,.07); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field input:focus, .field textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(76,201,240,.18); }
.field input.locked-input { background: rgba(81,230,168,.09); border-color: rgba(81,230,168,.42); color: var(--grn); cursor: not-allowed; font-weight: 600; }

/* ---------- 加入页 ---------- */
.join-wrap { max-width: 470px; margin: 4.5vh auto 0; text-align: center; }
.join-wrap .big-title {
  font-size: 34px; font-weight: 800; margin-bottom: 6px; letter-spacing: 3px;
  background: linear-gradient(92deg, #4CC9F0 5%, #8B7CFF 48%, #FF7BAC 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.join-wrap .sub { color: var(--mut); font-size: 13.5px; margin-bottom: 24px; letter-spacing: .4px; }
.pixel-logo {
  display: grid; grid-template-columns: repeat(7, 17px); grid-template-rows: repeat(7, 17px);
  gap: 3px; justify-content: center; margin-bottom: 18px;
}
.pixel-logo i { border-radius: 4px; background: rgba(255,255,255,.09); }
.pixel-logo i.on-1 { background: var(--cyan); box-shadow: 0 0 8px rgba(76,201,240,.65); animation: pixpulse 2.6s ease-in-out infinite; }
.pixel-logo i.on-2 { background: var(--org); box-shadow: 0 0 8px rgba(255,159,90,.65); animation: pixpulse 2.6s ease-in-out infinite .5s; }
@keyframes pixpulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.join-wrap .card { padding: 26px 26px 20px; border-color: rgba(76,201,240,.28); box-shadow: 0 0 0 1px rgba(76,201,240,.08), 0 10px 40px rgba(5,8,25,.55), 0 0 44px rgba(76,201,240,.1); }
.err-tip { color: var(--org); font-size: 13.5px; min-height: 22px; margin-top: 10px; }

/* ---------- 舞台横幅（每关开头） ---------- */
.stage-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px;
  padding: 20px 24px; border-radius: 20px; margin-bottom: 16px;
  border: 1px solid rgba(140,160,255,.22); box-shadow: 0 6px 26px rgba(5,8,25,.4);
}
.stage-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(90deg, transparent, #000 30%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%);
}
.hero-0 { background: linear-gradient(115deg, rgba(139,124,255,.34), rgba(139,124,255,.05) 62%), rgba(255,255,255,.04); }
.hero-1 { background: linear-gradient(115deg, rgba(76,201,240,.34), rgba(76,201,240,.05) 62%), rgba(255,255,255,.04); }
.hero-2 { background: linear-gradient(115deg, rgba(255,209,102,.3), rgba(255,209,102,.05) 62%), rgba(255,255,255,.04); }
.hero-3 { background: linear-gradient(115deg, rgba(255,123,172,.3), rgba(255,123,172,.05) 62%), rgba(255,255,255,.04); }
.hero-4 { background: linear-gradient(115deg, rgba(81,230,168,.3), rgba(81,230,168,.05) 62%), rgba(255,255,255,.04); }
.hero-5 { background: linear-gradient(115deg, rgba(255,159,90,.3), rgba(255,159,90,.05) 62%), rgba(255,255,255,.04); }
.hero-icon { display: grid; gap: 2px; width: 62px; height: 62px; flex: 0 0 auto; filter: drop-shadow(0 0 10px var(--hc)); }
.hero-icon i { border-radius: 2px; background: rgba(255,255,255,.07); }
.hero-icon i.on { background: var(--hc); box-shadow: 0 0 5px var(--hc); }
.hero-txt { flex: 1; min-width: 0; }
.hero-kicker { font-size: 11.5px; letter-spacing: 2.5px; color: var(--mut); font-weight: 600; margin-bottom: 3px; }
.hero-title { font-size: 22px; font-weight: 800; color: #FFF; letter-spacing: .6px; line-height: 1.3; }
.hero-goal { font-size: 13.5px; color: #B9C4E8; margin-top: 5px; max-width: 640px; }
.hero-stars {
  flex: 0 0 auto; align-self: flex-start; font-size: 13px; font-weight: 700; color: var(--yel);
  background: rgba(255,209,102,.13); border: 1px solid rgba(255,209,102,.4);
  padding: 5px 13px; border-radius: 999px; text-shadow: 0 0 8px rgba(255,209,102,.5); white-space: nowrap;
}
@media (max-width: 640px) {
  .stage-hero { flex-wrap: wrap; gap: 12px; padding: 16px 18px; }
  .hero-icon { width: 46px; height: 46px; }
  .hero-title { font-size: 19px; }
}

/* ---------- 热身：猜猜看 ---------- */
.warm-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.guess-grid { display: grid; gap: 2px; background: rgba(255,255,255,.94); padding: 10px; border: 2px solid rgba(76,201,240,.45); border-radius: 14px; box-shadow: 0 0 26px rgba(76,201,240,.2); }
.guess-grid i { border-radius: 3px; background: #FFF; }
.guess-opts { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.guess-opts .btn { padding: 10px 24px; }
.warm-tip { font-size: 14px; color: var(--mut); }
.warm-tip.ok { color: var(--grn); }
.story { display: flex; gap: 18px; align-items: flex-start; }
.story .pic { flex: 0 0 96px; display: grid; grid-template-columns: repeat(6, 15px); grid-template-rows: repeat(6, 15px); gap: 2px; }
.story .pic i { background: rgba(255,255,255,.12); border-radius: 2px; }
.story .pic i.b { background: #8B9CF5; box-shadow: 0 0 5px rgba(139,156,245,.5); }
.story p { font-size: 15px; color: #C6CDEA; }
.story p b { color: var(--yel); }

/* ---------- 关卡一：像素画板 ---------- */
.l1-layout { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .l1-layout { grid-template-columns: 1fr; } }
.code-panel { overflow: auto; background: rgba(5,8,25,.42); border-radius: 14px; padding: 14px; border: 1px solid rgba(140,160,255,.14); }
.code-grid-shell { display: flex; flex-direction: column; gap: 4px; background: rgba(140,160,255,.25); padding: 8px; border-radius: 12px; width: max-content; margin: 0 auto; box-shadow: 0 0 24px rgba(139,124,255,.16); }
.paint-wrap { display: flex; flex-direction: column; gap: 4px; background: rgba(140,160,255,.25); padding: 8px; border-radius: 12px; width: max-content; box-shadow: 0 0 24px rgba(76,201,240,.16); }
.paint-grid.inner { background: none; padding: 0; border-radius: 0; box-shadow: none; width: auto; }
.axis-top { display: flex; gap: 6px; }
.axis-corner { width: 18px; height: 16px; flex: none; }
.axis-cols { display: grid; gap: 2px; }
.axis-cols i { width: var(--pcell); height: 16px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 10.5px; color: #B9C4F5; font-family: Consolas, monospace; }
.axis-body { display: flex; gap: 6px; }
.axis-rail { display: grid; grid-auto-rows: var(--pcell); gap: 2px; }
.axis-rail i { width: 18px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 10.5px; color: #B9C4F5; font-family: Consolas, monospace; }
.code-cells { display: grid; grid-auto-rows: var(--pcell); gap: 2px; }
.code-cells i {
  width: var(--pcell); display: flex; align-items: center; justify-content: center; font-style: normal;
  font-family: Consolas, Menlo, monospace; font-size: 14px; background: transparent; color: #7C86B2;
}
.code-cells i.one { background: transparent; color: var(--cyan); font-weight: 700; text-shadow: 0 0 8px rgba(76,201,240,.75); }
.paint-grid { display: grid; gap: 2px; background: rgba(140,160,255,.25); padding: 8px; border-radius: 12px; width: max-content; touch-action: none; box-shadow: 0 0 24px rgba(76,201,240,.16); }
.pcell { background: #FFF; border-radius: 3px; width: var(--pcell); height: var(--pcell); transition: background .06s; }
.pcell.dark { background: #1B2138; }
.pcell.wrong { outline: 2px solid var(--org); outline-offset: -1px; }
.paint-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.paint-tip { font-size: 13.5px; color: var(--mut); margin-top: 8px; }

/* ---------- 关卡二：LED 编码 ---------- */
.l2-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .l2-layout { grid-template-columns: 1fr; } }
.led-grid { display: grid; gap: 6px; background: #11162E; padding: 12px; border-radius: 14px; width: max-content; border: 1px solid rgba(140,160,255,.2); }
.led { width: var(--led); height: var(--led); border-radius: 50%; background: #232A4A; transition: all .1s; }
.led.on { background: #FFD43B; box-shadow: 0 0 14px rgba(255,212,59,.75); }
.led-tag { font-size: 12.5px; color: var(--mut); margin-bottom: 8px; letter-spacing: .4px; font-weight: 500; }
.bit-rows { display: flex; flex-direction: column; gap: 8px; }
.bit-row { display: flex; align-items: center; gap: 8px; }
.bit-row .rowlab { width: 52px; font-size: 13px; color: #8A93BE; }
.bit { width: var(--bit); height: var(--bit); border-radius: 10px; background: rgba(255,255,255,.07); border: 1.5px solid rgba(140,160,255,.3); font-size: 17px; font-weight: 700; color: #8A93BE; font-family: Consolas, monospace; transition: all .12s; }
.bit:hover { border-color: var(--cyan); }
.bit.on { background: #1B2138; color: var(--yel); border-color: var(--yel); text-shadow: 0 0 8px rgba(255,209,102,.6); }
.bit.locked { cursor: not-allowed; }
.bit-row.locked .bit { background: rgba(255,255,255,.04); color: #565F8A; cursor: not-allowed; }
.bit-row.locked .bit.on { background: #2A3155; color: #B9C4F5; border-color: #5A66A8; text-shadow: none; }

/* ---------- 关卡三：设计师 ---------- */
.designer-layout { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .designer-layout { grid-template-columns: 1fr; } }
.palette { display: grid; grid-template-columns: repeat(2, 34px); gap: 7px; justify-content: center; background: rgba(5,8,25,.3); padding: 10px; border-radius: 14px; border: 1px solid rgba(140,160,255,.14); }
.swatch { width: 34px; height: 34px; border-radius: 9px; border: 2px solid rgba(140,160,255,.3); transition: transform .1s; }
.swatch.sel { border-color: #FFF; transform: scale(1.14); box-shadow: 0 0 10px rgba(255,255,255,.35); }
.design-grid { display: grid; gap: 0; grid-auto-rows: var(--dcell); background: #FFF; border: 2px solid rgba(76,201,240,.45); border-radius: 10px; overflow: hidden; width: max-content; touch-action: none; box-shadow: 0 0 28px rgba(76,201,240,.2); }
.design-grid.lines .dcell { outline: 1px solid rgba(150,160,190,.4); outline-offset: -0.5px; }
.dcell { background: #FFF; }
.design-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rgb-box { margin-top: 14px; border-top: 1px dashed rgba(140,160,255,.25); padding-top: 12px; }
.rgb-box summary { cursor: pointer; font-size: 14px; color: var(--cyan); font-weight: 500; }
.rgb-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13.5px; color: #C6CDEA; }
.rgb-row label { width: 70px; }
.rgb-row input[type=range] { flex: 1; accent-color: var(--cyan); }
.rgb-mix { width: 54px; height: 36px; border-radius: 9px; border: 1px solid rgba(140,160,255,.35); }
.submit-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.submit-row input { flex: 1; min-width: 180px; border: 1.5px solid rgba(140,160,255,.28); border-radius: 11px; padding: 10px 13px; outline: none; background: rgba(255,255,255,.07); color: var(--ink); }
.submit-row input::placeholder { color: var(--dim); }
.submit-row input:focus { border-color: var(--cyan); }

/* ---------- 画廊 ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.art-card { background: rgba(255,255,255,.055); border: 1px solid rgba(140,160,255,.18); border-radius: 14px; padding: 11px; text-align: center; transition: all .15s; }
.art-card:hover { border-color: var(--cyan); box-shadow: 0 5px 22px rgba(76,201,240,.24); transform: translateY(-2px); }
.art-thumb { display: grid; gap: 0; width: 108px; height: 108px; margin: 0 auto 8px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,.25); cursor: zoom-in; background: #FFF; }
.art-thumb i { display: block; }
.art-title { font-size: 14px; color: #FFF; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-author { font-size: 12.5px; color: #8A93BE; margin-bottom: 6px; }
.like-btn { font-size: 13px; color: var(--pink); background: rgba(255,123,172,.14); border-radius: 999px; padding: 4px 14px; }
.like-btn:hover { background: rgba(255,123,172,.28); }
.like-btn.mine { background: rgba(255,255,255,.07); color: #8A93BE; cursor: default; }
.like-btn.liked { background: var(--pink); color: #0B1026; font-weight: 600; }
.empty-tip { color: var(--dim); font-size: 14px; text-align: center; padding: 26px 0; }

/* ---------- 测评 ---------- */
.quiz-q { margin-bottom: 18px; }
.quiz-q .q { font-size: 15.5px; font-weight: 500; color: #FFF; margin-bottom: 8px; }
.opts { display: flex; flex-direction: column; gap: 7px; }
.opt { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1.5px solid rgba(140,160,255,.22); border-radius: 11px; cursor: pointer; font-size: 14.5px; background: rgba(255,255,255,.05); color: #C6CDEA; transition: border-color .12s; }
.opt:hover { border-color: var(--cyan); }
.opt input { accent-color: var(--cyan); }
.quiz-result { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 13px; background: rgba(76,201,240,.1); border: 1px solid rgba(76,201,240,.3); margin-bottom: 16px; }
.quiz-result .score { font-size: 30px; font-weight: 700; color: var(--cyan); text-shadow: 0 0 12px rgba(76,201,240,.5); }
.selfcheck { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.selfcheck label { display: flex; gap: 9px; align-items: center; font-size: 14.5px; color: #C6CDEA; cursor: pointer; }
.selfcheck input { accent-color: var(--grn); width: 17px; height: 17px; }
.medal { text-align: center; padding: 24px 12px; }
.medal .m-icon { font-size: 52px; line-height: 1.2; color: var(--yel); text-shadow: 0 0 22px rgba(255,209,102,.65); }
.medal .m-name { font-size: 21px; font-weight: 700; color: #FFF; margin: 4px 0 2px; }
.medal .m-stars { color: var(--yel); font-size: 17px; font-weight: 700; letter-spacing: 2px; text-shadow: 0 0 10px rgba(255,209,102,.5); }
.medal .m-sub { font-size: 13px; color: #8A93BE; }

/* ---------- 教师端仪表盘网格 ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.dash-grid > .card, .dash-grid > .stat-row { margin-bottom: 0; }
.span5 { grid-column: span 5; }
.span6 { grid-column: span 6; }
.span7 { grid-column: span 7; }
.span12 { grid-column: span 12; }
@media (max-width: 1100px) { .span5, .span6, .span7 { grid-column: span 12; } }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 12px; }
.stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,.062), rgba(255,255,255,.035));
  border: 1px solid var(--card-b); border-radius: 14px; padding: 14px 12px; text-align: center;
}
.stat-card .num { font-size: 26px; font-weight: 800; color: #FFF; line-height: 1.2; }
.stat-card .num.blue { color: var(--cyan); text-shadow: 0 0 10px rgba(76,201,240,.45); }
.stat-card .num.orange { color: var(--yel); text-shadow: 0 0 10px rgba(255,209,102,.45); }
.stat-card .num.green { color: var(--grn); text-shadow: 0 0 10px rgba(81,230,168,.45); }
.stat-card .lab { font-size: 12px; color: #8A93BE; margin-top: 3px; }
.stage-ctl { display: flex; gap: 8px; flex-wrap: wrap; }
.stage-ctl .btn { flex: 1; min-width: 130px; flex-direction: column; gap: 1px; padding: 8px 10px; }
.stage-ctl .btn .st-name { font-size: 14px; }
.stage-ctl .btn .st-count { font-size: 11.5px; opacity: .78; font-weight: 400; letter-spacing: .5px; }
.stage-ctl .btn.active { color: #081226; font-weight: 700; border-color: transparent; }
.stage-ctl .btn.active .st-count { opacity: .85; font-weight: 600; }
.stage-ctl .btn.active.s0 { background: linear-gradient(135deg, #A89DFF, #7F70EE); box-shadow: 0 4px 18px rgba(139,124,255,.55); }
.stage-ctl .btn.active.s1 { background: linear-gradient(135deg, #5ED2F6, #3BB8E8); box-shadow: 0 4px 18px rgba(76,201,240,.55); }
.stage-ctl .btn.active.s2 { background: linear-gradient(135deg, #FFDB7D, #F0B93F); box-shadow: 0 4px 18px rgba(255,209,102,.55); }
.stage-ctl .btn.active.s3 { background: linear-gradient(135deg, #FF9CC0, #F06A9B); box-shadow: 0 4px 18px rgba(255,123,172,.55); }
.stage-ctl .btn.active.s4 { background: linear-gradient(135deg, #7AEBB9, #43D18F); box-shadow: 0 4px 18px rgba(81,230,168,.55); }
.stage-ctl .btn.active.s5 { background: linear-gradient(135deg, #FFB877, #F08A3C); box-shadow: 0 4px 18px rgba(255,159,90,.55); }
.qbar { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 13.5px; }
.qbar .ql { width: 148px; color: #C6CDEA; flex: 0 0 auto; }
.qbar .track { flex: 1; height: 14px; background: rgba(255,255,255,.08); border-radius: 7px; overflow: hidden; }
.qbar .fill { height: 100%; background: linear-gradient(90deg, #3BB8E8, #5ED2F6); border-radius: 7px; transition: width .3s; box-shadow: 0 0 8px rgba(76,201,240,.5); }
.qbar .qv { width: 88px; text-align: right; color: #8A93BE; flex: 0 0 auto; }
.stu-scroll { max-height: 430px; overflow-y: auto; border-radius: 10px; }
.stu-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.stu-table th { background: #232B56; color: #B9C4F5; font-weight: 500; padding: 7px 6px; border-bottom: 1px solid rgba(140,160,255,.2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.stu-table td { padding: 6px 6px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: center; color: #C6CDEA; }
.stu-table td.nm { text-align: left; font-weight: 500; color: #FFF; white-space: nowrap; }
.stu-table .ok { color: var(--grn); font-weight: 700; }
.stu-table .no { color: #565F8A; }
.online-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #3A4166; margin-right: 4px; }
.online-dot.on { background: var(--grn); box-shadow: 0 0 6px rgba(81,230,168,.7); }
.notes-list { display: flex; flex-direction: column; gap: 8px; max-height: 330px; overflow-y: auto; }
.note-item { background: rgba(255,255,255,.055); border: 1px solid rgba(140,160,255,.12); border-radius: 11px; padding: 9px 13px; font-size: 13.5px; color: #C6CDEA; }
.url-box { display: flex; align-items: center; gap: 8px; background: rgba(76,201,240,.09); border: 1px solid rgba(76,201,240,.28); border-radius: 11px; padding: 9px 13px; font-size: 14px; color: var(--cyan); font-weight: 500; word-break: break-all; }

/* ---------- 画廊投屏设置（每屏幅数） ---------- */
.seg { display: inline-flex; align-items: center; gap: 3px; background: rgba(255,255,255,.06); border: 1px solid rgba(140,160,255,.22); border-radius: 999px; padding: 3px; margin-left: auto; }
.seg-label { font-size: 12px; color: #8A93BE; padding: 0 4px 0 9px; white-space: nowrap; }
.seg-btn { font-size: 12.5px; color: #A9B2D8; padding: 4px 12px; border-radius: 999px; transition: all .12s; white-space: nowrap; }
.seg-btn:hover { color: var(--cyan); }
.seg-btn.on { background: var(--cyan); color: #0B1026; font-weight: 700; box-shadow: 0 0 10px rgba(76,201,240,.4); }

/* ---------- 轮播投屏 ---------- */
.carousel-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  align-items: center; justify-content: space-between; gap: 12px; padding: 3vh 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(76,201,240,.1), transparent 55%),
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px),
    #060918;
  background-size: auto, 44px 44px, 44px 44px, auto;
}
.c-head { text-align: center; }
.c-title { color: #FFF; font-size: 24px; font-weight: 800; letter-spacing: 2px; text-shadow: 0 0 18px rgba(76,201,240,.6); }
.c-page { color: #8A93BE; font-size: 13px; margin-top: 4px; letter-spacing: 1px; }
.c-body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; flex: 1; width: 100%; min-height: 0; }
.c-body > .art-thumb { border: 2px solid rgba(76,201,240,.45); box-shadow: 0 0 44px rgba(76,201,240,.3); cursor: default; }
.c-btitle { color: #FFF; font-size: 21px; font-weight: 700; }
.c-bauthor { color: #B9C0D8; font-size: 15px; }
.c-grid { display: grid; gap: 20px 26px; justify-content: center; align-content: center; }
.c-grid.pp4 { grid-template-columns: repeat(2, auto); }
.c-grid.pp6 { grid-template-columns: repeat(3, auto); }
.c-grid.pp9 { grid-template-columns: repeat(3, auto); }
.c-cell { text-align: center; }
.c-cell .art-thumb { margin: 0 auto 7px; cursor: default; border: 2px solid rgba(76,201,240,.38); box-shadow: 0 0 26px rgba(76,201,240,.22); }
.c-cell .ct { color: #FFF; font-size: 14.5px; font-weight: 600; }
.c-cell .ca { color: #8A93BE; font-size: 12.5px; }
.c-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.c-nav {
  font-size: 13.5px; color: #C6CDEA; background: rgba(255,255,255,.07);
  border: 1px solid rgba(140,160,255,.3); border-radius: 999px; padding: 7px 18px; transition: all .12s;
}
.c-nav:hover { border-color: var(--cyan); color: var(--cyan); }
.c-hint { color: #565F8A; font-size: 12.5px; margin-left: 8px; }

/* ---------- 人物介绍页 ---------- */
.story-overlay {
  position: fixed; inset: 0; z-index: 220; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 4vh 28px;
  background:
    radial-gradient(circle at 20% 10%, rgba(139,124,255,.14), transparent 50%),
    radial-gradient(circle at 85% 90%, rgba(76,201,240,.1), transparent 50%),
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px),
    #070A1C;
  background-size: auto, auto, 44px 44px, 44px 44px, auto;
}
.story-panel {
  display: flex; gap: 38px; align-items: center; max-width: 1060px; width: 100%;
  background: rgba(255,255,255,.05); border: 1px solid rgba(140,160,255,.24);
  border-radius: 24px; padding: 38px 42px; box-shadow: 0 14px 60px rgba(3,5,18,.7), 0 0 60px rgba(139,124,255,.12);
}
.story-left { flex: 0 0 auto; text-align: center; }
.story-img {
  width: min(330px, 32vw); border-radius: 16px; display: block;
  border: 2px solid rgba(139,124,255,.5); box-shadow: 0 0 36px rgba(139,124,255,.32); background: #FFF;
}
.story-cap { margin-top: 12px; font-size: 12.5px; color: #8A93BE; letter-spacing: .4px; max-width: 320px; }
.story-right { flex: 1; min-width: 0; }
.story-kicker { font-size: 12px; letter-spacing: 3px; color: var(--pur); font-weight: 700; margin-bottom: 6px; }
.story-title { font-size: 30px; font-weight: 800; color: #FFF; letter-spacing: 1px; margin-bottom: 16px; text-shadow: 0 0 24px rgba(139,124,255,.5); }
.story-facts { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.story-fact { display: flex; gap: 12px; font-size: 15px; line-height: 1.7; color: #C6CDEA; }
.story-fact b {
  flex: 0 0 58px; text-align: center; align-self: flex-start; font-size: 12.5px; color: var(--cyan);
  background: rgba(76,201,240,.13); border: 1px solid rgba(76,201,240,.35);
  border-radius: 999px; padding: 3px 0; font-weight: 600;
}
.story-script {
  background: rgba(255,209,102,.08); border: 1px dashed rgba(255,209,102,.45);
  border-radius: 14px; padding: 13px 16px;
}
.story-script .ss-tag { font-size: 12px; color: var(--yel); font-weight: 700; letter-spacing: 1px; margin-bottom: 5px; }
.story-script p { font-size: 13.5px; color: #E8DDB8; line-height: 1.7; }
.story-hint { color: #565F8A; font-size: 12.5px; }

/* ---------- 课堂音乐弹窗 ---------- */
.music-row { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.music-now { font-size: 13.5px; color: var(--mut); }
.music-seg { margin: 0 0 14px; flex-wrap: wrap; border-radius: 14px; }
.music-vol { font-size: 13px; color: var(--cyan); width: 44px; text-align: right; }
@media (max-width: 860px) {
  .story-panel { flex-direction: column; gap: 20px; padding: 22px; }
  .story-title { font-size: 24px; }
}

/* ---------- 课前人物介绍页（学生端页内版） ---------- */
.intro-wrap { max-width: 1000px; margin: 3.5vh auto 0; }
.story-panel.inpage { margin-bottom: 18px; }
.intro-wait {
  text-align: center; font-size: 15px; font-weight: 600; letter-spacing: 1px;
  color: var(--yel); text-shadow: 0 0 12px rgba(255,209,102,.5);
  animation: waitpulse 2s ease-in-out infinite;
}
@keyframes waitpulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- 上课封面（教师端投屏） ---------- */
.cover-overlay {
  position: fixed; inset: 0; z-index: 240; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(76,201,240,.22), transparent 55%),
    radial-gradient(ellipse at 12% 85%, rgba(139,124,255,.2), transparent 50%),
    radial-gradient(ellipse at 88% 80%, rgba(255,123,172,.14), transparent 50%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    #060918;
  background-size: auto, auto, auto, 52px 52px, 52px 52px, auto;
}
.cover-px { position: absolute; top: 105%; border-radius: 2px; opacity: .7; animation: risepx linear infinite; }
@keyframes risepx { to { transform: translateY(-125vh) rotate(320deg); } }
.cover-box { position: relative; text-align: center; animation: coverin .9s cubic-bezier(.2,.9,.25,1) both; }
@keyframes coverin { from { opacity: 0; transform: translateY(34px) scale(.96); } to { opacity: 1; transform: none; } }
.cover-star { animation: floaty 3.6s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(255,209,102,.75)); margin-bottom: 18px; }
.cover-kicker { font-size: 15px; letter-spacing: 3.5px; color: #9AA3C7; margin-bottom: 20px; }
.cover-title {
  font-size: clamp(56px, 8.5vw, 110px); font-weight: 900; letter-spacing: 10px; line-height: 1.15;
  background: linear-gradient(94deg, #4CC9F0 0%, #8B7CFF 45%, #FF7BAC 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 26px rgba(76,201,240,.35)) drop-shadow(0 4px 30px rgba(139,124,255,.3));
}
.cover-sub { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 26px 0 30px; }
.cover-line { width: 120px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(76,201,240,.7), transparent); }
.cover-sub-t { font-size: 15px; letter-spacing: 5px; color: var(--cyan); font-weight: 600; text-shadow: 0 0 12px rgba(76,201,240,.6); }
.cover-teacher { display: inline-flex; align-items: center; gap: 12px; }
.cover-t-label {
  font-size: 13.5px; color: var(--yel); letter-spacing: 2px; padding: 5px 14px;
  border: 1px solid rgba(255,209,102,.5); border-radius: 999px; background: rgba(255,209,102,.1);
}
.cover-t-name { font-size: 26px; font-weight: 700; color: #FFF; letter-spacing: 5px; text-shadow: 0 0 18px rgba(255,255,255,.3); }
.cover-school { margin-top: 26px; font-size: clamp(15px, 1.7vw, 21px); letter-spacing: 6px; color: #9AA3C7; font-weight: 600; }
.cover-t-plain { margin-top: 14px; font-size: clamp(18px, 2vw, 24px); font-weight: 700; color: #FFF; letter-spacing: 4px; text-shadow: 0 0 18px rgba(255,255,255,.3); }
.cover-wait { color: var(--yel); font-size: 15px; letter-spacing: 2.5px; animation: waitpulse 2s ease-in-out infinite; text-shadow: 0 0 14px rgba(255,209,102,.45); }

/* ---------- 课前流程按钮（封面/登录/人物介绍） ---------- */
.stage-ctl.pre { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed rgba(140,160,255,.28); }
.stage-ctl.pre .btn { min-width: 110px; border-style: dashed; }
.stage-ctl.pre .btn.active.spre { color: #081226; font-weight: 700; border-color: transparent; background: linear-gradient(135deg, #B9C4FF, #8B9BF0); box-shadow: 0 4px 18px rgba(139,155,240,.5); }

/* ---------- 课堂总结 · 板书设计（黑板风） ---------- */
.bb-card .bb-board {
  margin-top: 10px; border-radius: 14px; padding: 22px 26px;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(255,255,255,.06), transparent 60%),
    linear-gradient(160deg, #2E5A46, #22463A 70%, #1D3D33);
  border: 6px solid #8D6E63; box-shadow: inset 0 0 40px rgba(0,0,0,.35), 0 6px 20px rgba(5,8,25,.45);
  font-family: "Kaiti SC", "STKaiti", KaiTi, "楷体", serif;
}
.bb-title {
  text-align: center; font-size: 26px; font-weight: 700; color: #FFF8DC; letter-spacing: 8px;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 2px dashed rgba(255,248,220,.4);
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.bb-line { display: flex; gap: 14px; align-items: baseline; padding: 7px 0; color: #F5F2E4; font-size: 17px; letter-spacing: 1px; }
.bb-line b {
  flex: none; min-width: 58px; text-align: center; color: #FFE9A8; font-size: 16.5px;
  border: 1.5px solid rgba(255,233,168,.55); border-radius: 8px; padding: 2px 8px;
}
.bb-line span { flex: 1; }

/* ---------- 课后任务 ---------- */
.hw-card .hw-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; }
.hw-card .hw-item + .hw-item { border-top: 1px dashed rgba(140,160,255,.25); }
.hw-badge { flex: none; font-size: 12.5px; font-weight: 700; padding: 4px 12px; border-radius: 999px; letter-spacing: 1px; margin-top: 1px; }
.hw-badge.must { background: rgba(81,230,168,.16); color: var(--grn); border: 1px solid rgba(81,230,168,.45); }
.hw-badge.opt { background: rgba(255,209,102,.14); color: var(--yel); border: 1px solid rgba(255,209,102,.45); }
.hw-text { flex: 1; font-size: 15px; line-height: 1.7; color: var(--ink); }

/* ---------- 弹层 / 提示 ---------- */
#toastWrap { position: fixed; top: 66px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: rgba(20,26,60,.97); color: var(--ink); border: 1px solid rgba(140,160,255,.3); padding: 11px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 22px rgba(5,8,25,.6); animation: slidein .25s; max-width: 320px; }
.toast.ok { border-color: rgba(81,230,168,.5); color: var(--grn); }
.toast.warn { border-color: rgba(255,159,90,.55); color: var(--org); }
.toast.stage { border-color: rgba(76,201,240,.6); color: var(--cyan); font-size: 15px; box-shadow: 0 0 20px rgba(76,201,240,.3); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
#modalWrap { position: fixed; inset: 0; background: rgba(7,10,28,.72); z-index: 250; display: none; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(4px); }
#modalWrap.show { display: flex; }
.modal { background: #151B3D; border: 1px solid rgba(140,160,255,.25); border-radius: 18px; padding: 22px; max-width: 620px; width: 100%; max-height: 88vh; overflow: auto; position: relative; box-shadow: 0 10px 44px rgba(5,8,25,.7); }
.modal h3 { font-size: 18px; color: #FFF; margin-bottom: 12px; }
.modal .close-x { position: absolute; top: 12px; right: 14px; font-size: 20px; color: #8A93BE; line-height: 1; }
.modal .close-x:hover { color: #FFF; }
.footnote { text-align: center; color: #565F8A; font-size: 12px; padding: 26px 0 12px; letter-spacing: .3px; }

/* ---------- 动效 ---------- */
.confetti-piece { position: fixed; top: -14px; width: 10px; height: 14px; z-index: 400; border-radius: 2px; animation: cfall .95s ease-in forwards; pointer-events: none; }
@keyframes cfall { to { transform: translateY(106vh) rotate(660deg); opacity: .9; } }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
