/* v6.2 學生學習中心：手機優先、深色太空主題（與教師端一致），文字對比 ≥ 4.5:1 */
:root { --bg: #0a1230; --panel: #13204a; --line: #2b3d77; --text: #f2f6ff; --muted: #b9c6e8; --accent: #00e5ff; --ok: #6dffb0; --todo: #ffd23f; --err: #ff8a8a; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: radial-gradient(ellipse at top, #1a2a66, var(--bg) 60%) fixed; color: var(--text); font: 17px/1.55 system-ui, -apple-system, 'Noto Sans TC', 'Microsoft JhengHei', sans-serif; }
/* BUG-031：姓名、作業名稱、班級名稱可能是很長、沒有空白的字串；不換行會讓手機頁面變寬（Linux 字型在 390px 就超出） */
.stu-app { max-width: 720px; margin: 0 auto; padding: 12px 16px 96px; min-height: 100vh; overflow-wrap: anywhere; }
h1 { font-size: 1.5em; margin: 0.2em 0 0.6em; }
h2 { font-size: 1.3em; margin: 0.4em 0 0.2em; }
h3 { font-size: 1.1em; margin: 0 0 0.4em; }
.stu-sub, .stu-hint, .stu-updated { color: var(--muted); font-size: 0.92em; }
.stu-loading { color: var(--muted); text-align: center; margin-top: 30vh; }
.stu-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 12px 0; }
.stu-login { display: grid; gap: 8px; margin-top: 8vh; }
.stu-login label { font-weight: 700; margin-top: 6px; }
input, select { font: inherit; padding: 12px; border-radius: 10px; border: 2px solid var(--line); background: #0c1738; color: var(--text); width: 100%; }
select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.stu-btn { font: inherit; font-weight: 700; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 2px solid var(--line); background: #1b2b5e; color: var(--text); cursor: pointer; }
.stu-btn-primary { background: linear-gradient(135deg, #00b8d4, #2962ff); border-color: transparent; }
.stu-btn:disabled { opacity: 0.55; cursor: progress; }
.stu-link { font: inherit; background: none; border: 0; color: var(--accent); text-decoration: underline; cursor: pointer; padding: 8px; min-height: 44px; }
.stu-note { border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.stu-note-error { background: rgba(255, 90, 90, 0.16); color: var(--err); }
.stu-note-warn { background: rgba(255, 210, 63, 0.14); color: var(--todo); }
.stu-note-ok { background: rgba(109, 255, 176, 0.14); color: var(--ok); }
.stu-note-info { background: rgba(0, 229, 255, 0.1); color: var(--text); }
.stu-rules { color: var(--muted); margin: 4px 0; padding-left: 1.2em; }
.stu-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.stu-header-actions { display: flex; gap: 4px; }
.stu-tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: #0b1534; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.stu-tab { font: inherit; font-size: 0.85em; display: grid; justify-items: center; gap: 2px; padding: 8px 2px; min-height: 60px; background: none; border: 0; color: var(--muted); cursor: pointer; }
.stu-tab[aria-current="page"] { color: var(--accent); font-weight: 800; }
.stu-tab-icon { font-size: 1.4em; line-height: 1; }
@media (min-width: 760px) { .stu-tabs { position: static; border: 1px solid var(--line); border-radius: 14px; margin-top: 16px; } .stu-app { padding-bottom: 24px; } }
.stu-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.stu-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; justify-items: center; }
.stu-stat-num { font-size: 2.2em; font-weight: 900; color: var(--accent); line-height: 1.1; }
.stu-todo { color: var(--todo); font-weight: 700; }
.stu-chips { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.stu-chip { font: inherit; min-height: 44px; padding: 6px 16px; border-radius: 999px; border: 2px solid var(--line); background: none; color: var(--text); cursor: pointer; }
.stu-chip[aria-pressed="true"] { background: var(--accent); color: #04122e; border-color: var(--accent); font-weight: 800; }
.stu-hw-list { list-style: none; padding: 0; margin: 0; }
.stu-hw { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.stu-hw-title { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.stu-hw-type, .stu-hw-dates { color: var(--muted); font-size: 0.9em; }
.stu-hw-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.stu-badge { border-radius: 8px; padding: 2px 10px; font-size: 0.92em; font-weight: 700; border: 1px solid currentColor; }
.stu-badge-ok { color: var(--ok); }
.stu-badge-todo { color: var(--todo); }
.stu-badge-muted { color: var(--muted); }
.stu-hw-empty { color: var(--muted); padding: 16px 0; }
.stu-scene { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 800 / 360; margin: 10px 0; }
.stu-scene svg.scene { display: block; width: 100%; height: 100%; }
.stu-scene-deco { position: absolute; left: 8px; bottom: 6px; font-size: 1.6em; letter-spacing: 4px; pointer-events: none; }
.scene-actor { cursor: pointer; outline: none; }
.scene-actor:focus-visible .actor-bob, .scene-actor.selected .actor-bob { filter: drop-shadow(0 0 6px #ffd23f) drop-shadow(0 0 2px #fff); }
.actor-bob { animation: actorBob 3.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -0.37s); transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes actorBob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-4px) scale(1.02, 0.98); } }
.scene-actor.react .actor-bob { animation: actorJump 0.8s cubic-bezier(.2, .8, .3, 1); }
@keyframes actorJump { 0% { transform: translateY(0); } 30% { transform: translateY(-22px) rotate(-6deg); } 60% { transform: translateY(0) rotate(4deg); } 100% { transform: translateY(0); } }
.stu-care-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.stu-care-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.stu-care-actions .stu-btn { flex: 1 1 140px; }
.stu-badges { display: flex; gap: 10px; font-size: 1.6em; }
.stu-deco { opacity: 0.45; }
.stu-deco.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .actor-bob, .scene-actor.react .actor-bob { animation: none; } }

/* v6.2 小老師：登記作業 */
.stu-reg-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.stu-reg { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.stu-reg-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.stu-reg-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stu-reg-btn { min-height: 44px; padding: 6px 4px; font-size: 0.95rem; }
@media (max-width: 380px) { .stu-reg-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* P3：多班級（班級切換、我的班級、加入班級）與 Google 登入 */
.stu-classbar { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.stu-classbar label { font-weight: 700; white-space: nowrap; }
.stu-classbar select { flex: 1 1 auto; min-width: 0; padding: 8px 10px; }
.stu-class-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 10px; }
.stu-class { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.stu-class > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stu-class-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stu-class-actions .stu-btn { flex: 1 1 120px; }
.stu-google { display: grid; gap: 8px; justify-items: center; margin-top: 8px; }
.stu-or { color: var(--muted); margin: 0; }
.stu-gsi { display: flex; justify-content: center; min-height: 48px; }
