/* ==========================================================================
   上林成語小鎮 - 藍紫色軟萌系 (Pastel Blue-Purple Kawaii) 完整視覺樣式表
   重點設計：
   1. 主要按鍵文字嚴格禁止隨意分行 (white-space: nowrap; word-break: keep-all)
   2. 段落排版舒適美觀 (line-height: 1.85; text-wrap: pretty)
   3. 專為國小低中高年段平板觸控與桌機雙端最佳化
   ========================================================================== */

:root {
  --bg-top: #E9F0FF;
  --bg-mid: #F3EDFF;
  --bg-bot: #E6F4FF;

  --purple-main: #7C6CF0;
  --purple-deep: #5E4FD4;
  --purple-soft: #EDE9FE;
  --purple-border: rgba(139, 121, 246, 0.28);

  --blue-main: #5A9BFF;
  --blue-deep: #3B7CEB;
  --blue-soft: #E0F0FF;

  --pink-blush: #FF8FB8;
  --pink-soft: #FFEAF2;
  --gold-soft: #FFF4D2;
  --gold-main: #F4B400;
  --mint-soft: #E1FAEE;
  --mint-main: #22B573;
  --coral-warn: #FF6B8A;

  --ink-dark: #2F2A56;
  --ink-body: #4E4A75;
  --ink-muted: #7C78A3;

  --card-bg: rgba(255, 255, 255, 0.88);
  --card-shadow: 0 12px 32px rgba(108, 95, 224, 0.12), 0 3px 10px rgba(90, 155, 255, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-pill: 999px;

  --font-display: "Zen Maru Gothic", "Noto Sans TC", "Microsoft JhengHei UI", "PingFang TC", sans-serif;
  --font-body: "Noto Sans TC", "Zen Maru Gothic", "Microsoft JhengHei", "PingFang TC", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink-dark);
  background: linear-gradient(160deg, var(--bg-top) 0%, var(--bg-mid) 52%, var(--bg-bot) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--ink-dark);
  letter-spacing: 0.02em;
}

p {
  margin: 0;
}

.pretty-paragraph {
  line-height: 1.85;
  letter-spacing: 0.03em;
  color: var(--ink-body);
  text-wrap: pretty;
  word-break: normal;
  overflow-wrap: break-word;
}

.hidden {
  display: none !important;
}

/* ==================== 夢幻雲朵星空背景 ==================== */
.sky-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.cloud-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(45px);
  opacity: 0.55;
  animation: floatCloud 18s ease-in-out infinite;
}

.cloud-1 {
  width: 380px;
  height: 220px;
  background: radial-gradient(circle, #C8DCFF 0%, rgba(200, 220, 255, 0) 75%);
  top: -40px;
  left: -60px;
}

.cloud-2 {
  width: 440px;
  height: 260px;
  background: radial-gradient(circle, #D8C7FF 0%, rgba(216, 199, 255, 0) 75%);
  top: 22%;
  right: -90px;
  animation-delay: -6s;
}

.cloud-3 {
  width: 360px;
  height: 240px;
  background: radial-gradient(circle, #C4E7FF 0%, rgba(196, 231, 255, 0) 75%);
  bottom: -60px;
  left: 25%;
  animation-delay: -11s;
}

.sparkle-dot {
  position: absolute;
  color: rgba(139, 121, 246, 0.35);
  font-size: 22px;
  animation: twinkle 4s ease-in-out infinite;
}

.sp-1 { top: 14%; left: 10%; animation-delay: 0s; }
.sp-2 { top: 28%; right: 12%; font-size: 28px; color: rgba(90, 155, 255, 0.4); animation-delay: 1.2s; }
.sp-3 { bottom: 20%; left: 7%; font-size: 18px; animation-delay: 2.4s; }
.sp-4 { bottom: 14%; right: 9%; font-size: 20px; color: rgba(255, 143, 184, 0.45); animation-delay: 0.8s; }

@keyframes floatCloud {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(22px, -16px) scale(1.05); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.9) rotate(0deg); }
  50% { opacity: 0.85; transform: scale(1.18) rotate(12deg); }
}

@keyframes gentleBob {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-7px); }
}

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.92) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==================== 玻璃軟萌卡片 ==================== */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid var(--purple-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
}

/* ==================== 按鍵系統（嚴格防隨意分行） ==================== */
button, .btn, .tab-btn, .role-pill, .nav-pill, .pill-tag {
  font-family: var(--font-display);
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.18s ease, border-color 0.18s ease;
  user-select: none;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #FFFFFF;
  background: linear-gradient(135deg, #6E8BFF 0%, #866CF5 100%);
  box-shadow: 0 6px 18px rgba(124, 108, 240, 0.32), inset 0 -3px 0 rgba(70, 52, 175, 0.28);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 9px 22px rgba(124, 108, 240, 0.42), inset 0 -3px 0 rgba(70, 52, 175, 0.28);
}

.btn-secondary {
  color: var(--purple-deep);
  background: linear-gradient(135deg, #EEF3FF 0%, #F2EBFF 100%);
  border-color: rgba(124, 108, 240, 0.32);
  box-shadow: 0 4px 12px rgba(124, 108, 240, 0.12);
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #E4ECFF 0%, #EAE0FF 100%);
  border-color: var(--purple-main);
}

.btn-mint {
  color: #FFFFFF;
  background: linear-gradient(135deg, #43CFA0 0%, #24B47E 100%);
  box-shadow: 0 6px 16px rgba(36, 180, 126, 0.28), inset 0 -3px 0 rgba(16, 118, 79, 0.25);
}

.btn-pink {
  color: #FFFFFF;
  background: linear-gradient(135deg, #FF95BD 0%, #FF6B9E 100%);
  box-shadow: 0 6px 16px rgba(255, 107, 158, 0.28), inset 0 -3px 0 rgba(190, 48, 100, 0.22);
}

.btn-outline-sm {
  padding: 7px 14px;
  font-size: 13px;
  color: var(--purple-deep);
  background: #FFFFFF;
  border: 1.5px solid rgba(124, 108, 240, 0.32);
}

.btn-soft-icon {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--ink-dark);
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px solid var(--purple-border);
}

.btn-lg {
  padding: 14px 26px;
  font-size: 16.5px;
}

.btn-full {
  width: 100%;
}

.btn-chip {
  padding: 8px 15px;
  font-size: 13.5px;
  color: var(--purple-deep);
  background: #FFFFFF;
  border: 1.5px solid rgba(124, 108, 240, 0.26);
  box-shadow: 0 3px 8px rgba(124, 108, 240, 0.08);
}

.btn-chip:hover:not(:disabled) {
  background: var(--purple-soft);
  border-color: var(--purple-main);
}

/* ==================== 標籤膠囊 ==================== */
.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.pill-purple { background: var(--purple-soft); color: var(--purple-deep); }
.pill-blue { background: var(--blue-soft); color: var(--blue-deep); }
.pill-mint { background: var(--mint-soft); color: #128554; }
.pill-gold { background: var(--gold-soft); color: #A66E00; }
.pill-pink { background: var(--pink-soft); color: #C93A73; }

/* ==================== 頂部導覽列（含雙溪區上林國小合照半透明底圖） ==================== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 245, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2px solid rgba(139, 121, 246, 0.24);
  overflow: hidden;
}

.header-photo-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("../assets/shanglin-banner.jpg");
  background-size: cover;
  background-position: center 28%;
  opacity: 0.28;
  pointer-events: none;
}

.header-photo-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(244, 242, 255, 0.82) 0%,
    rgba(237, 243, 255, 0.52) 48%,
    rgba(244, 242, 255, 0.82) 100%
  );
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 2;
  max-width: 1220px;
  margin: 0 auto;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 5px 14px 5px 8px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(139, 121, 246, 0.22);
}

.school-brand-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.school-name-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #678DFF 0%, #866CF5 100%);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(124, 108, 240, 0.24);
}

.school-emblem-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(124, 108, 240, 0.32);
  box-shadow: 0 4px 12px rgba(108, 95, 224, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
}

.school-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-logo {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(135deg, #4F7BFF 0%, #7D5BF0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.15;
}

.brand-tagline {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}

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

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(90, 155, 255, 0.3);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-dark);
  white-space: nowrap;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint-main);
  box-shadow: 0 0 0 0 rgba(34, 181, 115, 0.6);
  animation: livePulse 2s infinite;
  flex-shrink: 0;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 181, 115, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(34, 181, 115, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 181, 115, 0); }
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px 5px 12px;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  border: 1.5px solid var(--purple-border);
}

.user-chip-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--purple-soft);
  color: var(--purple-deep);
  white-space: nowrap;
}

.user-chip-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-dark);
  white-space: nowrap;
}

/* 即時打卡動態跑馬燈（固定高度避免頁面抖動） */
.live-ticker-bar {
  position: relative;
  z-index: 2;
  background: linear-gradient(90deg, rgba(244, 242, 255, 0.88) 0%, rgba(235, 241, 255, 0.9) 100%);
  border-top: 1px solid rgba(139, 121, 246, 0.18);
  padding: 0 20px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13.5px;
  overflow: hidden;
}

.ticker-tag {
  background: linear-gradient(135deg, #6E8BFF, #8A6CF5);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-content {
  color: var(--ink-dark);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 960px;
}

/* ==================== 主容器 ==================== */
.main-container {
  position: relative;
  z-index: 2;
  max-width: 1220px;
  margin: 0 auto;
  padding: 26px 20px 56px;
}

/* ==================== 登入頁面 ==================== */
.auth-hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 24px;
  align-items: start;
}

.auth-welcome-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mascot-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 150px;
  animation: gentleBob 4s ease-in-out infinite;
}

.welcome-copy {
  text-align: center;
}

.welcome-copy h2 {
  font-size: 27px;
  margin: 10px 0 10px;
  color: var(--ink-dark);
}

.reward-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.reward-mini-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 15px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #F6F8FF 0%, #F8F3FF 100%);
  border: 1.5px solid rgba(139, 121, 246, 0.2);
}

.reward-mini-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.reward-mini-card h3 {
  font-size: 15px;
  margin-bottom: 5px;
  color: var(--purple-deep);
}

.reward-mini-card p {
  font-size: 13px;
  line-height: 1.65;
}

.mini-campus-pulse {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(90, 155, 255, 0.12), rgba(138, 108, 245, 0.15));
  border: 1.5px solid rgba(124, 108, 240, 0.22);
}

.pulse-stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pulse-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--purple-deep);
}

.pulse-label {
  font-size: 12px;
  color: var(--ink-body);
  font-weight: 600;
}

/* 登入表單卡片 */
.auth-form-card {
  padding: 28px;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius-pill);
  background: #F0ECFF;
  margin-bottom: 22px;
}

.tab-btn {
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--ink-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tab-btn.active {
  background: #FFFFFF;
  color: var(--purple-deep);
  box-shadow: 0 4px 14px rgba(124, 108, 240, 0.18);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: popIn 0.25s ease;
}

.form-intro h3 {
  font-size: 20px;
  margin-bottom: 6px;
}

.form-intro p {
  font-size: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-field label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-dark);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(139, 121, 246, 0.28);
  background: rgba(255, 255, 255, 0.95);
  font-family: var(--font-body);
  font-size: 15.5px;
  color: var(--ink-dark);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--purple-main);
  box-shadow: 0 0 0 4px rgba(124, 108, 240, 0.16);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 12px;
}

.form-error {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: #FFF0F4;
  border: 1.5px solid #FFB3C8;
  color: #C2255C;
  font-size: 13.5px;
  font-weight: 600;
}

.quick-demo-box {
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #F4F7FF 0%, #F7F1FF 100%);
  border: 1.5px dashed rgba(124, 108, 240, 0.34);
}

.quick-demo-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-deep);
  margin-bottom: 10px;
  line-height: 1.6;
}

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

/* 教師/管理者 5 大身分按鍵（絕不分行） */
.staff-role-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.role-pill {
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 2px solid rgba(139, 121, 246, 0.25);
  background: #FFFFFF;
  color: var(--ink-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.role-pill:hover {
  border-color: var(--purple-main);
  background: #F6F3FF;
}

.role-pill.active {
  color: #FFFFFF;
  border-color: transparent;
  background: linear-gradient(135deg, #648CFF 0%, #8367F5 100%);
  box-shadow: 0 5px 14px rgba(124, 108, 240, 0.28);
}

.helper-note {
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.65;
}

.helper-note code {
  background: var(--purple-soft);
  color: var(--purple-deep);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
}

/* ==================== 學生學習主介面 ==================== */
.student-banner {
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.student-banner-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 280px;
}

.student-mascot-mini {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  animation: gentleBob 4.2s ease-in-out infinite;
}

.greeting-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.student-greeting h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.student-greeting p {
  font-size: 14.5px;
}

.student-banner-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-bubble {
  min-width: 118px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.stat-purple { background: linear-gradient(145deg, #F1ECFF, #E6DEFF); border: 1.5px solid rgba(124, 108, 240, 0.28); }
.stat-blue { background: linear-gradient(145deg, #EAF4FF, #DCEBFF); border: 1.5px solid rgba(90, 155, 255, 0.3); }
.stat-gold { background: linear-gradient(145deg, #FFF9E6, #FFEFBF); border: 1.5px solid rgba(244, 180, 0, 0.32); }

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-body);
  white-space: nowrap;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
  color: var(--ink-dark);
  white-space: nowrap;
}

/* 導覽膠囊列 */
.sub-nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.nav-pill {
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--purple-border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-pill:hover {
  border-color: var(--purple-main);
  color: var(--purple-deep);
}

.nav-pill.active {
  color: #FFFFFF;
  border-color: transparent;
  background: linear-gradient(135deg, #678DFF 0%, #866CF5 100%);
  box-shadow: 0 6px 16px rgba(124, 108, 240, 0.28);
}

/* ==================== 每日任務卡片與步驟條 ==================== */
.task-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.step-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid var(--purple-border);
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-body);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.step-chip.active {
  background: #FFFFFF;
  border-color: var(--purple-main);
  color: var(--purple-deep);
  box-shadow: 0 6px 16px rgba(124, 108, 240, 0.18);
}

.step-chip.done {
  background: var(--mint-soft);
  border-color: rgba(34, 181, 115, 0.45);
  color: #117A4D;
}

.task-card {
  padding: 26px 28px;
  margin-bottom: 20px;
  animation: popIn 0.26s ease;
}

.no-pop-anim {
  animation: none !important;
}

/* 七階成語榮耀晉升路線圖 */
.rank-ladder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}

.rank-tier-card {
  padding: 14px 12px;
  border-radius: var(--radius-lg);
  text-align: center;
  background: #F6F4FF;
  border: 2px dashed rgba(139, 121, 246, 0.28);
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.rank-tier-card.unlocked {
  background: linear-gradient(145deg, #EEF2FF, #EBE1FF);
  border: 2px solid var(--purple-main);
  color: var(--ink-dark);
  box-shadow: 0 6px 16px rgba(124, 108, 240, 0.16);
}

.rank-tier-card.current-target {
  background: linear-gradient(145deg, #FFFDF0, #FFF3CC);
  border: 2px solid var(--gold-main);
  color: #7D5000;
  box-shadow: 0 6px 16px rgba(244, 180, 0, 0.18);
}

.rank-tier-card.highest {
  background: linear-gradient(145deg, #FFF7D6, #E9E2FF);
  border: 2.5px solid var(--gold-main);
  color: var(--purple-deep);
}

.task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.task-header h3 {
  font-size: 21px;
  margin-bottom: 6px;
}

.task-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==================== 低年級：1 分鐘動畫劇院 ==================== */
.anim-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.theater-box {
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #F0F5FF 0%, #F7F1FF 100%);
  border: 2px solid rgba(139, 121, 246, 0.26);
  overflow: hidden;
  padding: 20px;
}

.theater-stage {
  position: relative;
  border-radius: var(--radius-lg);
  background: #FFFFFF;
  border: 2px solid rgba(124, 108, 240, 0.18);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.theater-svg-wrap {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #E8F3FF, #F4EEFF);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theater-svg-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.theater-caption-box {
  width: 100%;
  max-width: 680px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #F7F5FF, #EFF6FF);
  border: 1.5px solid rgba(124, 108, 240, 0.2);
  text-align: center;
}

.theater-caption-box p {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-dark);
  line-height: 1.8;
}

.theater-progress-track {
  width: 100%;
  height: 12px;
  border-radius: var(--radius-pill);
  background: #E5E0FF;
  overflow: hidden;
  margin: 14px 0 12px;
}

.theater-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #5A9BFF, #8A6CF5);
  transition: width 0.3s linear;
}

.theater-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.theater-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.moral-callout {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: #FFF9E6;
  border: 1.5px solid rgba(244, 180, 0, 0.35);
  font-size: 14.5px;
  color: #6B4D00;
  line-height: 1.75;
}

/* ==================== 低年級：看圖選成語觸控配對 ==================== */
.picture-match-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 22px;
  align-items: center;
}

.picture-card-frame {
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, #EFF5FF, #F5EEFF);
  border: 2.5px solid rgba(139, 121, 246, 0.26);
  padding: 16px;
  text-align: center;
}

.picture-card-frame svg {
  width: 100%;
  max-height: 260px;
  border-radius: 16px;
  display: block;
  margin: 0 auto;
}

.touch-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.option-btn {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 2.5px solid rgba(139, 121, 246, 0.28);
  background: #FFFFFF;
  color: var(--ink-dark);
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(139, 121, 246, 0.16);
  transition: all 0.16s ease;
  text-align: center;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--purple-main);
  background: #F6F3FF;
  transform: translateY(-2px);
}

.option-btn.correct {
  background: var(--mint-soft);
  border-color: var(--mint-main);
  color: #10784B;
  box-shadow: 0 5px 0 rgba(34, 181, 115, 0.25);
}

.option-btn.wrong {
  background: #FFF0F4;
  border-color: var(--coral-warn);
  color: #C2255C;
  animation: gentleShake 0.35s ease;
}

@keyframes gentleShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ==================== 低年級：數字成語小遊戲 ==================== */
.number-game-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, #F4F7FF, #F7F1FF);
  border: 2px solid rgba(139, 121, 246, 0.24);
}

.idiom-slots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.idiom-char-tile {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  background: #FFFFFF;
  color: var(--ink-dark);
  border: 2.5px solid rgba(124, 108, 240, 0.28);
  box-shadow: 0 6px 0 rgba(124, 108, 240, 0.14);
}

.idiom-char-tile.blank {
  background: #EEF2FF;
  border: 2.5px dashed var(--purple-main);
  color: var(--purple-deep);
  cursor: pointer;
}

.idiom-char-tile.filled {
  background: linear-gradient(135deg, #6E8BFF, #8A6CF5);
  border: 2.5px solid transparent;
  color: #FFFFFF;
}

.num-bubbles-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.num-bubble {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2.5px solid rgba(90, 155, 255, 0.4);
  background: linear-gradient(145deg, #FFFFFF, #EAF3FF);
  color: var(--purple-deep);
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(90, 155, 255, 0.2);
  transition: transform 0.15s ease, background 0.15s ease;
}

.num-bubble:hover:not(:disabled) {
  transform: scale(1.09) translateY(-2px);
  background: linear-gradient(145deg, #E8EEFF, #E3D9FF);
}

/* ==================== 中年級：生活對話 & 動植物小遊戲 ==================== */
.dialogue-stage {
  display: block;
}

.dialogue-bubbles {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
}

.chat-bubble {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 15px 18px;
  border-radius: 20px;
  background: #FFFFFF;
  border: 2px solid rgba(139, 121, 246, 0.22);
  box-shadow: 0 5px 14px rgba(124, 108, 240, 0.08);
}

.chat-bubble.right {
  background: linear-gradient(135deg, #F3F0FF, #EDF5FF);
  border-color: rgba(90, 155, 255, 0.34);
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--purple-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.chat-speaker {
  font-size: 13px;
  font-weight: 800;
  color: var(--purple-deep);
  margin-bottom: 4px;
}

.chat-text {
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ink-dark);
}

.nature-clue-card {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, #F0F9FF, #F4EEFF);
  border: 2px solid rgba(90, 155, 255, 0.28);
  text-align: center;
}

.nature-emoji-badge {
  font-size: 52px;
  line-height: 1.2;
  margin-bottom: 10px;
}

/* ==================== 高年級：二階段儀表板、新聞抓漏、故事、微寫作 ==================== */
.stage-banner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.stage-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid var(--purple-border);
  cursor: pointer;
  transition: all 0.18s ease;
}

.stage-card.active {
  border-color: var(--purple-main);
  box-shadow: 0 8px 22px rgba(124, 108, 240, 0.2);
  background: #FFFFFF;
}

.stage-card.completed {
  background: linear-gradient(135deg, #ECFFF6, #F4F9FF);
  border-color: rgba(34, 181, 115, 0.45);
}

.stage-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

/* 新聞抓漏王 */
.newspaper-card {
  padding: 22px 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F5FF 100%);
  border: 2.5px solid rgba(124, 108, 240, 0.3);
  box-shadow: 0 8px 24px rgba(124, 108, 240, 0.1);
}

.news-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 2px dashed rgba(124, 108, 240, 0.25);
}

.news-headline-chars {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.6;
  margin: 10px 0 18px;
}

.news-char-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 44px;
  padding: 0 4px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: transparent;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  color: var(--ink-dark);
  cursor: pointer;
  transition: all 0.14s ease;
}

.news-char-btn:hover {
  background: var(--purple-soft);
  border-color: var(--purple-main);
  transform: translateY(-2px);
}

.news-char-btn.spotted {
  background: #FFE5EE;
  border-color: var(--coral-warn);
  color: #C2255C;
  box-shadow: 0 0 0 3px rgba(255, 107, 138, 0.2);
}

.news-char-btn.fixed {
  background: var(--mint-soft);
  border-color: var(--mint-main);
  color: #0E7A4C;
}

/* 聽我說故事 */
.story-book-box {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, #FBF9FF, #F0F6FF);
  border: 2px solid rgba(139, 121, 246, 0.25);
}

.story-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 18px;
}

.story-paragraphs p {
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-dark);
  text-indent: 2em;
}

.story-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.story-quiz-option {
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(139, 121, 246, 0.26);
  background: #FFFFFF;
  color: var(--ink-dark);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  white-space: normal;
  word-break: keep-all;
  text-wrap: pretty;
  line-height: 1.6;
  cursor: pointer;
  transition: all 0.16s ease;
}

.story-quiz-option:hover:not(:disabled) {
  border-color: var(--purple-main);
  background: #F6F3FF;
}

.story-quiz-option.correct {
  background: var(--mint-soft);
  border-color: var(--mint-main);
  color: #10784B;
}

.story-quiz-option.wrong {
  background: #FFF0F4;
  border-color: var(--coral-warn);
  color: #C2255C;
}

/* 微寫作接龍牆 */
.writing-composer {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #F6F3FF, #EFF6FF);
  border: 2px solid rgba(139, 121, 246, 0.25);
  margin-bottom: 20px;
}

.idiom-chip-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.writings-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.writing-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: #FFFFFF;
  border: 2px solid rgba(139, 121, 246, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.writing-card.featured {
  border-color: rgba(244, 180, 0, 0.6);
  background: linear-gradient(180deg, #FFFDF5 0%, #FFFFFF 100%);
  box-shadow: 0 8px 20px rgba(244, 180, 0, 0.14);
}

.writing-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.writing-author {
  font-weight: 800;
  font-size: 14.5px;
  color: var(--ink-dark);
}

.writing-content {
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--ink-body);
}

.writing-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(139, 121, 246, 0.2);
}

.heart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(255, 107, 158, 0.35);
  background: #FFF5F8;
  color: #D6336C;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.heart-btn:hover:not(:disabled) {
  background: #FFE0EC;
  transform: scale(1.04);
}

.heart-btn.liked {
  background: linear-gradient(135deg, #FF8FB8, #FF669B);
  color: #FFFFFF;
  border-color: transparent;
}

/* ==================== 回饋氣泡 ==================== */
.feedback-banner {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.75;
  animation: popIn 0.2s ease;
}

.feedback-banner.success {
  background: var(--mint-soft);
  border: 1.5px solid rgba(34, 181, 115, 0.45);
  color: #0E6B42;
}

.feedback-banner.error {
  background: #FFF0F4;
  border: 1.5px solid rgba(255, 107, 138, 0.45);
  color: #B51F52;
}

/* ==================== 15 天成語小學士徽章牆 & 90% 領航班 ==================== */
.streak-grid-15 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.day-stamp {
  padding: 14px 10px;
  border-radius: var(--radius-lg);
  text-align: center;
  background: #F6F4FF;
  border: 2px dashed rgba(139, 121, 246, 0.28);
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.day-stamp.earned {
  background: linear-gradient(145deg, #EEF2FF, #EBE2FF);
  border: 2px solid var(--purple-main);
  color: var(--purple-deep);
  box-shadow: 0 5px 14px rgba(124, 108, 240, 0.16);
}

.day-stamp.milestone {
  background: linear-gradient(145deg, #FFF7D6, #FFE8A3);
  border: 2px solid var(--gold-main);
  color: #8A5A00;
}

.badge-certificate {
  margin-top: 20px;
  padding: 26px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #F5F2FF 0%, #EEF6FF 50%, #FFF9E6 100%);
  border: 3px solid rgba(124, 108, 240, 0.35);
  text-align: center;
}

.class-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.class-rate-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: #FFFFFF;
  border: 2px solid rgba(139, 121, 246, 0.22);
  position: relative;
}

.class-rate-card.leader {
  border-color: var(--gold-main);
  background: linear-gradient(180deg, #FFFDF4 0%, #FFFFFF 100%);
  box-shadow: 0 10px 26px rgba(244, 180, 0, 0.16);
}

.rate-bar-wrap {
  position: relative;
  height: 16px;
  border-radius: var(--radius-pill);
  background: #ECE9FF;
  overflow: hidden;
  margin: 12px 0 8px;
}

.rate-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #5A9BFF, #8A6CF5);
  transition: width 0.5s ease;
}

.rate-bar-fill.gold {
  background: linear-gradient(90deg, #FFCA4B, #FF9933);
}

.rate-threshold-line {
  position: absolute;
  left: 90%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #E03131;
}

/* ==================== 教師與管理者後台 ==================== */
.admin-header-card {
  padding: 24px 28px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 2px solid var(--purple-border);
  box-shadow: var(--card-shadow);
}

.kpi-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.kpi-val {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  color: var(--purple-deep);
}

.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--purple-border);
  background: #FFFFFF;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.data-table th, .data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #EFEBFF;
  white-space: nowrap;
}

.data-table th {
  background: #F4F1FF;
  color: var(--purple-deep);
  font-family: var(--font-display);
  font-weight: 800;
}

.data-table tr:hover td {
  background: #FAF9FF;
}

/* ==================== 彈窗與 Toast ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(47, 42, 86, 0.48);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  padding: 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: popIn 0.28s ease;
}

.modal-actions {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast-item {
  padding: 13px 18px;
  border-radius: var(--radius-lg);
  background: rgba(47, 42, 86, 0.94);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  box-shadow: 0 10px 26px rgba(47, 42, 86, 0.25);
  animation: popIn 0.22s ease;
}

.site-footer {
  position: relative;
  z-index: 2;
  padding: 18px 20px 28px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}

.footer-inner {
  max-width: 1220px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==================== 響應式 RWD（平板與手機） ==================== */
@media (max-width: 960px) {
  .auth-hero-grid {
    grid-template-columns: 1fr;
  }
  .picture-match-grid,
  .dialogue-stage,
  .stage-banner-grid {
    grid-template-columns: 1fr;
  }
  .admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .reward-preview-grid,
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  .streak-grid-15 {
    grid-template-columns: repeat(3, 1fr);
  }
  .task-card {
    padding: 20px 18px;
  }
  .touch-options-grid {
    grid-template-columns: 1fr;
  }
  .idiom-char-tile {
    width: 60px;
    height: 60px;
    font-size: 26px;
  }
  .header-inner {
    padding: 10px 14px;
  }
}

/* ==================== 班級累計 15 日無敵星星榮耀列 ==================== */
.invincible-stars-box {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #FFFDF0 0%, #F4F1FF 100%);
  border: 1.5px solid rgba(244, 180, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invincible-stars-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.stars-sequence {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.invincible-star-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, #FFE47A, #FFA826);
  box-shadow: 0 3px 10px rgba(244, 180, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-size: 16px;
  line-height: 1;
}

.invincible-star-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F1EEFF;
  border: 1.5px dashed rgba(139, 121, 246, 0.38);
  font-size: 13px;
  color: var(--ink-muted);
}

.star-meta-text {
  font-size: 12.5px;
  font-weight: 700;
  color: #8A5A00;
}

/* ==================== 專屬數位榮譽證書列印樣式 ==================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 18mm;
  }

  html, body {
    background: #FFFFFF !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 隱藏證書以外的所有元素 */
  body * {
    visibility: hidden !important;
  }

  .sky-backdrop,
  .top-header,
  .student-banner,
  .sub-nav-bar,
  .site-footer,
  .toast-container,
  .modal-overlay,
  .no-print {
    display: none !important;
  }

  #printableCertificate,
  #printableCertificate * {
    visibility: visible !important;
  }

  #printableCertificate {
    position: fixed !important;
    top: 24mm !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 170mm !important;
    max-width: 170mm !important;
    margin: 0 !important;
    padding: 36px 34px !important;
    border: 4px double #7C6CF0 !important;
    border-radius: 26px !important;
    background: linear-gradient(135deg, #F6F3FF 0%, #EEF6FF 55%, #FFF9E6 100%) !important;
    box-shadow: none !important;
    text-align: center !important;
  }

  #printableCertificate .no-print {
    display: none !important;
    visibility: hidden !important;
  }
}

/* ==================== 學生點名登入（班級＋姓名卡片） ==================== */
.roster-class-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-name-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 2px;
}

.student-name-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 10px;
  border-radius: 18px;
  border: 2px solid rgba(139, 121, 246, 0.25);
  background: #FFFFFF;
  color: var(--ink-dark);
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.student-name-card:hover {
  border-color: var(--purple-main);
  background: #F5F2FF;
  transform: translateY(-2px);
}

.student-name-card.selected {
  color: #FFFFFF;
  border-color: transparent;
  background: linear-gradient(135deg, #678DFF 0%, #866CF5 100%);
  box-shadow: 0 6px 16px rgba(124, 108, 240, 0.32);
}

.student-name-card .stu-seat-tag {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.82;
}

.student-name-card .stu-name-main {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.selected-student-banner {
  padding: 11px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #EEF4FF 0%, #F3ECFF 100%);
  border: 1.5px solid rgba(124, 108, 240, 0.3);
  color: var(--purple-deep);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ==================== 管理者教學示範專區與示範橫幅 (index3) ==================== */
.demo-mode-bar {
  padding: 14px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 2.5px solid rgba(244, 180, 0, 0.55);
  background: linear-gradient(135deg, #FFFDF2 0%, #F5F1FF 100%);
}

.demo-mode-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-mode-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-demo-box {
  padding: 20px 24px;
  margin-bottom: 20px;
  border: 2px solid rgba(124, 108, 240, 0.32);
  background: linear-gradient(135deg, #F6F3FF 0%, #EEF6FF 55%, #FFFDF2 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
