/* ==========================================================================
   Classroom Star (星耀课堂) - 现代化教学响应式设计规范
   针对大屏投影、电子白板及低配置电脑深度适配
   ========================================================================== */

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.75);
  --bg-card-hover: rgba(51, 65, 85, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(99, 102, 241, 0.4);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-gold: #fbbf24;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-cyan: #06b6d4;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-btn: 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.35);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.12) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 全屏 Canvas 动效层 */
#fxCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* ================= 顶栏 Navigation ================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* 顶部课前 30 分钟温和提醒横幅 */
.pre-class-banner {
  display: none;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(16, 185, 129, 0.15));
  border-bottom: 1px solid rgba(245, 158, 11, 0.4);
  backdrop-filter: blur(10px);
  padding: 12px 24px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  animation: slideDownBanner 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@keyframes slideDownBanner {
  0% { transform: translateY(-100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.reminder-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.reminder-icon {
  font-size: 28px;
  animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(6deg); }
}

.reminder-title {
  font-size: 15px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reminder-tag {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.reminder-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.reminder-checkin-btn {
  font-size: 15px;
  padding: 10px 20px;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
  animation: pulseGlowBtn 2s infinite;
}

@keyframes pulseGlowBtn {
  0%, 100% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.4); transform: scale(1); }
  50% { box-shadow: 0 0 24px rgba(16, 185, 129, 0.8); transform: scale(1.03); }
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 26px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.4));
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 班级选择下拉卡片 */
.class-selector-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.class-selector-box select {
  background: transparent;
  color: #fff;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
}

.class-selector-box select option {
  background: #1e293b;
  color: #fff;
}

/* 模式导航切换按钮组 */
.view-nav {
  display: flex;
  background: rgba(30, 41, 59, 0.9);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.5);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #4f46e5);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #7073f4, #4338ca);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}
.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ================= 核心内容主区域 ================= */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* 顶部状态控制条 (当堂信息、快捷动作、抽签、批量加分) */
.lesson-control-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.lesson-info-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseDot 2s infinite;
}

.status-text {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}

.lesson-timer {
  font-family: monospace;
  font-size: 16px;
  color: var(--text-gold);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
}

.quick-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ================= 岛台实景座位系统 (Group Island Seating) ================= */
.classroom-stage-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 讲台/黑板指示条 */
.podium-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 小组岛台大网格 (大屏2~3组一行) */
.group-islands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 24px;
}

/* 单个小组大岛台容器 */
.group-island-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group-island-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* 岛台顶栏信息与全组加分 */
.island-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.island-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.island-group-badge {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.island-group-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-gold);
}

.island-quick-actions {
  display: flex;
  gap: 6px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

/* 岛台实景舞台 */
/* 岛台实景舞台 (U型 6 座位：左2人 + 中间6课桌 + 右2人 + 底2人，顶端面向黑板无遮挡) */
.island-layout-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  width: 100%;
}

/* 中间主体 (左列2座[座位1,座位2] + 中间6张拼接课桌 + 右列2座[座位3,座位4]) */
.island-middle-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

/* 左侧一列座位 (2人: 座位1[左上], 座位2[左下]) */
.island-seats-col-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 110px;
  flex-shrink: 0;
}

/* 右侧一列座位 (2人: 座位3[右上], 座位4[右下]) */
.island-seats-col-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 110px;
  flex-shrink: 0;
}

/* 底部座位行 (后排 2人: 座位5[左后], 座位6[右后]) */
.island-seats-row-bottom {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 140px));
  justify-content: center;
  gap: 24px;
  width: 100%;
}

/* 课桌岛台 (6张拼接课桌：顶排2横桌、中排2竖桌、底排2竖桌) */
.island-desk-cluster {
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 160px;
  flex-shrink: 0;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5), 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 课桌子行 */
.desk-subrow {
  display: flex;
  gap: 6px;
  width: 100%;
}

/* 横拼桌 (高40px, 宽50%) */
.desk-block.desk-h {
  flex: 1;
  height: 38px;
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.8), rgba(30, 41, 59, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 竖拼桌 (高52px, 宽50%) */
.desk-block.desk-v {
  flex: 1;
  height: 48px;
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.8), rgba(30, 41, 59, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desk-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.5px;
}

/* 岛台中心互动指示 */
.desk-center-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-glow);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.hub-icon {
  font-size: 14px;
}

.hub-text {
  font-size: 10px;
  font-weight: 800;
  color: #fbbf24;
  white-space: nowrap;
}

/* 单个座位卡片 (精简高能) */
.island-seat-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 6px;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  will-change: transform;
}

.island-seat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  background: rgba(30, 41, 59, 0.95);
}

.island-seat-card.selected {
  border-color: var(--accent-warning);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
  background: rgba(45, 38, 25, 0.9);
}

.seat-avatar-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.seat-student-name {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat-points-val {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-gold);
}

.seat-actions-row {
  display: flex;
  gap: 2px;
  width: 100%;
  margin-top: 2px;
}

.seat-btn {
  flex: 1;
  padding: 2px 0;
  font-size: 9.5px;
  font-weight: 800;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: transform 0.1s;
}

.seat-btn:active {
  transform: scale(0.9);
}

/* 空座位卡片 */
.island-seat-empty {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  min-width: 0;
  width: 100%;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  background: rgba(15, 23, 42, 0.4);
}

.island-seat-empty:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
}

/* 学生卡片网格系统 (极低开销 CSS Grid) */
.student-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

/* 单个学生卡片 */
.student-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  will-change: transform;
  cursor: pointer;
}

.student-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.student-card.selected {
  border-color: var(--accent-warning);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.45);
  background: rgba(45, 38, 25, 0.85);
}

.student-card.highlight-anim {
  animation: cardGlow 1s ease-out;
}

/* 头像与学号 */
.avatar-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  margin-bottom: 10px;
}

.student-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.student-number-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.student-name {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
  text-align: center;
}

.student-group-tag {
  font-size: 12px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

/* 积分展示面板 */
.points-display-box {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 12px;
}

.points-number {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-gold);
  text-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.points-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* 当堂加分浮标 */
.lesson-delta-badge {
  font-size: 12px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-left: 6px;
}

/* 快捷操作加减分按钮组 */
.card-actions-row {
  display: flex;
  gap: 6px;
  width: 100%;
}

.score-btn {
  flex: 1;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.1s ease;
}

.score-btn:active {
  transform: scale(0.92);
}

.score-btn-plus1 {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.score-btn-plus1:hover {
  background: #10b981;
  color: #fff;
}

.score-btn-plus2 {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.4);
}
.score-btn-plus2:hover {
  background: #6366f1;
  color: #fff;
}

.score-btn-plus5 {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.score-btn-plus5:hover {
  background: #f59e0b;
  color: #fff;
}

.score-btn-minus {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.score-btn-minus:hover {
  background: #ef4444;
  color: #fff;
}

/* ================= 统计视图 (Stats Mode) ================= */
.stats-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .stats-container {
    grid-template-columns: 1fr;
  }
}

.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.stats-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.stats-card-title {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 小组条形统计 */
.group-chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.group-bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.group-badge {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.group-bar-track {
  width: 100%;
  height: 22px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.group-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: width;
}

.group-bar-value {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* 排行榜表格 */
.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.rank-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.rank-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.rank-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.rank-medal {
  display: inline-flex;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.rank-1 { background: #fbbf24; color: #78350f; }
.rank-2 { background: #cbd5e1; color: #334155; }
.rank-3 { background: #d97706; color: #fff; }

/* ================= 课表视图 (Timetable Grid) ================= */
.timetable-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px;
  text-align: center;
  min-width: 720px;
}

.timetable-grid th {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.timetable-grid th.today-col {
  background: rgba(99, 102, 241, 0.25);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.6);
}

.timetable-grid td {
  padding: 4px;
  vertical-align: middle;
}

.time-slot-label {
  font-size: 14px;
  font-weight: 800;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.course-cell-box {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.course-cell-box:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.course-cell-it {
  border-color: rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(30, 41, 59, 0.9));
}
.course-cell-it:hover {
  border-color: #6366f1;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

.course-cell-sci {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(30, 41, 59, 0.9));
}
.course-cell-sci:hover {
  border-color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.course-cell-read {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(30, 41, 59, 0.9));
}
.course-cell-read:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

.course-sub-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}
.course-cell-it .course-sub-tag { background: rgba(99, 102, 241, 0.3); color: #c7d2fe; }
.course-cell-sci .course-sub-tag { background: rgba(16, 185, 129, 0.3); color: #a7f3d0; }
.course-cell-read .course-sub-tag { background: rgba(245, 158, 11, 0.3); color: #fde68a; }

.course-class-code {
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
}

.empty-cell-slot {
  min-height: 64px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.04);
}

/* ================= 模态弹窗 (Modal) ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  padding: 24px;
  position: relative;
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* 抽签幸运点名器 */
.lucky-draw-box {
  text-align: center;
  padding: 30px 20px;
}

.lucky-name-display {
  font-size: 42px;
  font-weight: 900;
  color: var(--text-gold);
  margin: 20px 0;
  min-height: 60px;
  text-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* 浮动提示 Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ================= 教师登录门禁大厅 (Login Portal) ================= */
.login-portal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 60%, #020617 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  overflow-y: auto;
}

.login-portal-card {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 24px;
  padding: 36px 32px;
  max-width: 860px;
  width: 100%;
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.2);
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: modalScaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portal-brand-header {
  text-align: center;
}

.portal-brand-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.portal-main-title {
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.portal-sub-title {
  font-size: 14px;
  color: var(--text-muted);
}

.portal-section-label {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 12px;
}

.portal-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}

.portal-role-chip {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-role-chip:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: #6366f1;
  transform: translateY(-2px);
}

.portal-role-chip.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(79, 70, 229, 0.55));
  border-color: #818cf8;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.45);
}

.portal-role-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.portal-role-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  flex: 1;
}

.portal-role-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
  white-space: normal;
  line-height: 1.35;
}

.portal-role-desc {
  font-size: 11px;
  color: #94a3b8;
  white-space: normal;
  line-height: 1.3;
}

.portal-pwd-section {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portal-input-group {
  display: flex;
  gap: 12px;
}

.portal-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.portal-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.portal-submit-btn {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
  white-space: nowrap;
}

.portal-hint {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

/* ================= 教室实景前台 (讲台正中 / 靠窗 / 教室门) ================= */
.classroom-front-stage {
  display: grid;
  grid-template-columns: 140px 1fr 180px;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .classroom-front-stage {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.stage-wing {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stage-wing-left {
  justify-content: flex-start;
  border-left: 3px solid #06b6d4;
}

.stage-wing-right {
  justify-content: flex-end;
  border-right: 3px solid #f59e0b;
}

.door-badge {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.door-name {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
}

.door-sub {
  font-size: 10px;
  color: #94a3b8;
}

.stage-podium-center {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 2px solid rgba(99, 102, 241, 0.5);
  border-radius: var(--radius-lg);
  padding: 12px 24px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.podium-blackboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.podium-title {
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1px;
}

.podium-indicator {
  font-size: 11px;
  font-weight: 700;
  color: #818cf8;
  letter-spacing: 0.5px;
}

/* 空班级快捷操作横幅 */
.classroom-empty-quick-bar {
  background: rgba(30, 41, 59, 0.85);
  border: 1px dashed rgba(99, 102, 241, 0.5);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.empty-bar-title {
  font-size: 13px;
  color: var(--text-gold);
  font-weight: 700;
}

.empty-quick-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   移动端与手机屏幕深度响应式适配 (Mobile Phone Responsive Adaptation)
   全面适配 iPhone / 安卓全机型 / 微信内置浏览器 / 平板坚屏
   ========================================================================== */

@media (max-width: 768px) {
  /* 基础内边距与容器 */
  .main-container {
    padding: 10px 8px 80px;
  }

  /* 顶栏 Navigation 适配 */
  .app-header {
    padding: 8px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .brand-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .brand-icon {
    font-size: 20px;
  }

  .brand-title {
    font-size: 16px;
  }

  .header-center {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .class-selector-box {
    width: 100%;
    padding: 6px 12px;
    justify-content: space-between;
  }

  .class-selector-box select {
    font-size: 14px;
    font-weight: 800;
    width: 100%;
  }

  .view-nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 3px;
  }

  .nav-tab-btn {
    flex: 1;
    justify-content: center;
    padding: 6px 4px;
    font-size: 12px;
    gap: 3px;
  }

  .header-actions {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 6px;
  }

  .header-actions .btn {
    flex: 1;
    padding: 6px 4px;
    font-size: 11.5px;
    justify-content: center;
  }

  /* 教室实景前台 (讲台黑板/门窗) */
  .classroom-front-stage {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }

  .stage-podium-center {
    padding: 8px 12px;
  }

  .podium-title {
    font-size: 14px;
  }

  .podium-indicator {
    font-size: 10px;
  }

  .stage-wing {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* 空班级引导横幅 */
  .classroom-empty-quick-bar {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 14px;
  }

  .empty-bar-title {
    font-size: 12px;
    line-height: 1.4;
  }

  .empty-quick-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
  }

  .empty-quick-buttons .btn {
    width: 100%;
    padding: 7px 4px;
    font-size: 11.5px;
    justify-content: center;
  }

  /* 课堂控制条在手机端适配 */
  .lesson-control-bar {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }

  .lesson-info-badge {
    justify-content: space-between;
    width: 100%;
  }

  .quick-toolbar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
  }

  .quick-toolbar .btn {
    width: 100%;
    padding: 8px 2px;
    font-size: 11.5px;
    justify-content: center;
    white-space: nowrap;
  }

  /* 岛台大网格 (手机单列呈现，完美撑满屏幕宽度) */
  .group-islands-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .group-island-card {
    padding: 10px 8px;
    border-radius: 14px;
    gap: 8px;
  }

  /* 岛台顶栏信息与全组加分分行排布 */
  .island-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-bottom: 6px;
  }

  .island-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .island-group-badge {
    font-size: 13px;
    padding: 2px 8px;
  }

  .island-group-score {
    font-size: 12px;
    font-weight: 800;
  }

  .island-quick-actions {
    display: flex;
    width: 100%;
    gap: 4px;
  }

  .island-quick-actions .btn {
    flex: 1;
    padding: 5px 2px;
    font-size: 11px;
    font-weight: 800;
    justify-content: center;
    white-space: nowrap;
  }

  /* 岛台实景内部核心布局 (手机屏幕精细化自适应) */
  .island-layout-stage {
    gap: 8px;
    padding: 4px 0;
    width: 100%;
  }

  .island-middle-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    width: 100%;
  }

  /* 左侧边排座位 (左上1号, 左下2号) */
  .island-seats-col-left {
    width: calc((100% - 124px - 8px) / 2);
    min-width: 78px;
    max-width: 105px;
    gap: 8px;
  }

  /* 课桌岛台在手机端精细尺寸 */
  .island-desk-cluster {
    width: 124px;
    min-width: 110px;
    padding: 6px 4px;
    gap: 4px;
  }

  .desk-subrow {
    gap: 4px;
  }

  .desk-block.desk-h {
    height: 30px;
  }

  .desk-block.desk-v {
    height: 40px;
  }

  .desk-label {
    font-size: 9px;
  }

  .desk-center-hub {
    padding: 2px 5px;
  }

  .hub-icon {
    font-size: 10px;
  }

  .hub-text {
    font-size: 9px;
  }

  /* 右侧边排座位 (右上3号, 右下4号) */
  .island-seats-col-right {
    width: calc((100% - 124px - 8px) / 2);
    min-width: 78px;
    max-width: 105px;
    gap: 8px;
  }

  /* 底部后排座位 (左后5号, 右后6号) */
  .island-seats-row-bottom {
    display: grid;
    grid-template-columns: repeat(2, minmax(78px, 120px));
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 2px;
  }

  /* 座位卡片微缩适配 */
  .island-seat-card {
    padding: 4px 3px;
    gap: 2px;
    border-radius: 8px;
  }

  .seat-avatar-badge {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .seat-student-name {
    font-size: 11px;
    max-width: 52px;
  }

  .seat-points-val {
    font-size: 9.5px;
  }

  .seat-actions-row {
    gap: 1px;
    margin-top: 1px;
  }

  .seat-btn {
    padding: 2px 0;
    font-size: 8.5px;
    border-radius: 2px;
  }

  .island-seat-empty {
    min-height: 50px;
    font-size: 10px;
    padding: 4px;
    border-radius: 8px;
  }

  /* 登录大厅手机端适配 */
  .login-portal-card {
    padding: 20px 14px;
    border-radius: 20px;
    width: 95vw;
  }

  .portal-main-title {
    font-size: 20px;
  }

  .portal-sub-title {
    font-size: 12px;
  }

  .portal-role-grid {
    grid-template-columns: 1fr;
    max-height: 280px;
  }

  .portal-role-chip {
    padding: 10px 12px;
  }

  .portal-input-group {
    flex-direction: column;
    gap: 8px;
  }

  .portal-submit-btn {
    width: 100%;
    padding: 12px;
  }

  /* 模态弹窗手机端自适应 */
  .modal-overlay {
    padding: 8px;
  }

  .modal-card {
    max-width: 98vw;
    max-height: 92vh;
    overflow-y: auto;
    padding: 16px 12px;
    border-radius: 16px;
  }

  .modal-header {
    margin-bottom: 12px;
  }

  .modal-title {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .island-seats-col-left,
  .island-seats-col-right {
    min-width: 72px;
  }

  .island-desk-cluster {
    width: 108px;
    min-width: 98px;
  }

  .seat-student-name {
    max-width: 44px;
    font-size: 10px;
  }

  .island-seats-row-bottom {
    grid-template-columns: repeat(2, minmax(72px, 95px));
    gap: 8px;
  }
}
