/* ============================================
   魔耳编程 · 数码宝贝编程大冒险
   主样式表 main.css
   包含：全局变量、重置、导航、页面容器、
   按钮、弹窗、表单、首页、地图、设置等
   ============================================ */

/* ---------- CSS变量 ---------- */
:root {
  --color-primary: #FF6B35;
  --color-primary-dark: #E55A2B;
  --color-secondary: #4ECDC4;
  --color-accent: #FFE66D;
  --color-success: #6BCB77;
  --color-danger: #FF6B6B;
  --color-info: #4D96FF;
  --color-purple: #9B59B6;

  --color-bg: #FFF8F0;
  --color-bg-card: #FFFFFF;
  --color-text: #2D3436;
  --color-text-light: #636E72;
  --color-border: #E0E0E0;

  /* 积木颜色 */
  --block-event: #FFC107;
  --block-motion: #4C97FF;
  --block-loop: #FFAB19;
  --block-condition: #5CB85C;
  --block-variable: #FF8C1A;
  --block-function: #9966FF;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);

  --font-main: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
}

/* ---------- 全局重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  font-family: var(--font-main);
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-bg);
  user-select: none;
  -webkit-user-select: none;
}

body {
  background: linear-gradient(135deg, #FFF8F0 0%, #FFE8D6 50%, #E8F5E9 100%);
  min-height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

input, select {
  font-family: inherit;
  outline: none;
}

/* ---------- 加载屏 ---------- */
.loading-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #FFE8D6, #E8F5E9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s;
}
.loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loading-content { text-align: center; }
.loading-digimon {
  font-size: 80px;
  animation: bounce 1s infinite;
}
.loading-text {
  font-size: 20px;
  color: var(--color-primary);
  margin: 16px 0;
  font-weight: bold;
}
.loading-bar {
  width: 240px;
  height: 12px;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  margin: 0 auto;
}
.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 6px;
  transition: width 0.3s;
}

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

/* ---------- 顶部导航 ---------- */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: linear-gradient(90deg, var(--color-primary), #FF8C42);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}
.top-nav.hidden { display: none; }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: bold;
}
.nav-logo { font-size: 24px; }
.nav-title-long {
  font-size: 16px;
  white-space: nowrap;
}
.nav-title-short {
  display: none;
  font-size: 16px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-btn {
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.2s;
}
.nav-btn:hover { background: rgba(255,255,255,0.2); }
.nav-btn.active { background: rgba(255,255,255,0.3); font-weight: bold; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}

/* ---------- 页面容器 ---------- */
#app-main {
  padding-top: 56px;
  min-height: 100vh;
}

.page {
  display: none;
  min-height: calc(100vh - 56px);
  animation: fadeIn 0.3s;
}
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}
.page-title {
  font-size: 28px;
  color: var(--color-primary);
  margin-bottom: 20px;
  text-align: center;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: bold;
  transition: all 0.2s;
  min-height: 44px;
  min-width: 44px;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #FF8C42);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(255,107,53,0.4); }
.btn-secondary {
  background: #fff;
  color: var(--color-text);
  border: 2px solid var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn-large { padding: 14px 32px; font-size: 18px; }
.btn-xlarge { padding: 18px 48px; font-size: 22px; }

.btn-run { background: var(--color-success); color: #fff; }
.btn-pause { background: var(--color-info); color: #fff; }
.btn-reset { background: var(--color-accent); color: var(--color-text); }
.btn-hint { background: var(--color-purple); color: #fff; }

.btn-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  transition: background 0.2s;
}
.btn-icon:hover { background: #e0e0e0; }

.btn-back-map {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  background: #fff;
  box-shadow: var(--shadow-md);
}

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  animation: fadeIn 0.2s;
}
.modal.hidden { display: none; }
.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.3s;
}
.modal-small { max-width: 400px; text-align: center; }

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-size: 24px;
  color: var(--color-primary);
  margin-bottom: 16px;
}
.modal-desc {
  color: var(--color-text-light);
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ---------- 表单 ---------- */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}
.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 6px;
  color: var(--color-text);
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--color-primary);
}

/* ---------- 登录页 ---------- */
#page-login {
  display: none;
  align-items: center;
  justify-content: center;
  padding-top: 0;
}
#page-login.active { display: flex; }
.login-container {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-header { margin-bottom: 30px; }
.login-logo {
  font-size: 72px;
  animation: bounce 2s infinite;
}
.login-title {
  font-size: 32px;
  color: var(--color-primary);
  margin: 10px 0 4px;
}
.login-subtitle {
  font-size: 16px;
  color: var(--color-text-light);
}

/* ---------- 首页 ---------- */
.home-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px;
  text-align: center;
}
.home-hero { margin-bottom: 30px; }
.home-avatar {
  font-size: 80px;
  display: inline-block;
  animation: bounce 2s infinite;
}
.home-welcome {
  font-size: 28px;
  color: var(--color-text);
  margin: 10px 0;
}
.home-welcome span { color: var(--color-primary); }
.home-difficulty-tag {
  display: inline-block;
  background: var(--color-accent);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-icon { font-size: 32px; }
.stat-value {
  font-size: 28px;
  font-weight: bold;
  color: var(--color-primary);
  margin: 4px 0;
}
.stat-label { font-size: 13px; color: var(--color-text-light); }

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  margin-bottom: 30px;
}
.home-actions .btn { width: 280px; }

.home-digimon-preview {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.home-digimon-preview h3 { margin-bottom: 12px; color: var(--color-text); }
.digimon-display {
  font-size: 24px;
  padding: 16px;
  background: linear-gradient(135deg, #FFF3E0, #E8F5E9);
  border-radius: var(--radius-md);
}

/* ---------- 难度选择 ---------- */
.difficulty-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.difficulty-card {
  border: 3px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.difficulty-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.difficulty-card.selected {
  border-color: var(--color-primary);
  background: #FFF3E0;
}
.diff-icon { font-size: 48px; margin-bottom: 8px; }
.difficulty-card h3 { color: var(--color-primary); margin-bottom: 8px; }
.difficulty-card p { font-size: 13px; color: var(--color-text-light); margin-bottom: 4px; }
.diff-knowledge {
  font-size: 12px !important;
  color: var(--color-secondary) !important;
  font-weight: bold;
  margin-top: 8px !important;
}

/* ---------- 地图页 ---------- */
.map-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}
.map-title {
  text-align: center;
  font-size: 28px;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.map-progress {
  text-align: center;
  font-size: 16px;
  color: var(--color-text-light);
  margin-bottom: 24px;
}
.map-islands {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.island {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  position: relative;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.island:hover:not(.locked) {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.island.locked {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f5f5f5;
}
.island.completed {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
}
.island-icon { font-size: 36px; margin-bottom: 6px; }
.island-name {
  font-size: 14px;
  font-weight: bold;
  color: var(--color-text);
  margin-bottom: 4px;
}
.island-stars { font-size: 14px; color: var(--color-accent); }
.island-lock {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 18px;
}

/* ---------- 微课弹窗 ---------- */
.lesson-content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #FFF8E1;
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 16px 0;
}
.lesson-teacher {
  font-size: 48px;
  flex-shrink: 0;
  animation: bounce 2s infinite;
}
.lesson-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text);
}

/* ---------- 通关/失败弹窗 ---------- */
.win-celebration { font-size: 64px; animation: bounce 1s infinite; }
.win-stars {
  font-size: 40px;
  margin: 16px 0;
  letter-spacing: 8px;
}
.win-rewards {
  background: #FFF3E0;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 16px;
  color: var(--color-primary);
  font-weight: bold;
}
.fail-icon { font-size: 56px; }
.fail-msg {
  font-size: 16px;
  color: var(--color-text-light);
  line-height: 1.6;
  margin: 12px 0;
}

/* ---------- 数码兽背包 ---------- */
.backpack-stats {
  display: flex;
  justify-content: space-around;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  font-weight: bold;
}
.digimon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.digimon-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: 3px solid transparent;
}
.digimon-card:hover { transform: translateY(-4px); }
.digimon-card.active {
  border-color: var(--color-primary);
  background: #FFF3E0;
}
.digimon-card.locked {
  opacity: 0.4;
  filter: grayscale(1);
}
.digimon-emoji { font-size: 48px; margin-bottom: 8px; }
.digimon-name { font-weight: bold; font-size: 15px; margin-bottom: 4px; }
.digimon-level { font-size: 12px; color: var(--color-text-light); }

/* 孵化动画 */
.hatch-animation {
  font-size: 80px;
  margin: 20px 0;
  animation: shake 0.5s infinite;
}
.hatch-animation.hatched { animation: popIn 0.5s; }
@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}
.hatch-result {
  font-size: 20px;
  font-weight: bold;
  color: var(--color-primary);
  margin: 16px 0;
}

/* ---------- 知识图鉴 ---------- */
.encyclopedia-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.knowledge-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  border-left: 5px solid var(--color-info);
}
.knowledge-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.knowledge-card.locked { opacity: 0.4; cursor: not-allowed; }
.knowledge-icon { font-size: 32px; margin-bottom: 8px; }
.knowledge-name { font-weight: bold; font-size: 16px; margin-bottom: 4px; }
.knowledge-desc { font-size: 13px; color: var(--color-text-light); }

.knowledge-detail {
  line-height: 1.8;
  font-size: 15px;
}
.knowledge-detail h4 {
  color: var(--color-primary);
  margin: 12px 0 6px;
}
.pseudo-code {
  background: #2D3436;
  color: #6BCB77;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 14px;
  margin: 8px 0;
  white-space: pre-wrap;
}

/* ---------- 成就墙 ---------- */
.achievements-stats {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 20px;
}
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.achievement-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.achievement-card.locked { opacity: 0.35; filter: grayscale(1); }
.achievement-card.unlocked {
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
  border: 2px solid var(--color-accent);
}
.achievement-icon { font-size: 40px; margin-bottom: 8px; }
.achievement-name { font-weight: bold; font-size: 14px; margin-bottom: 4px; }
.achievement-desc { font-size: 12px; color: var(--color-text-light); margin-bottom: 6px; }
.achievement-reward-text { font-size: 12px; color: var(--color-primary); font-weight: bold; }

.achievement-popup { background: linear-gradient(135deg, #FFF8E1, #FFECB3); }
.achievement-icon-big { font-size: 64px; animation: popIn 0.5s; }
.achievement-name { font-size: 20px; color: var(--color-primary); }
.achievement-reward { font-size: 16px; color: var(--color-text-light); margin-top: 8px; }

/* ---------- 商店 ---------- */
.shop-coins {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 20px;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.shop-item {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.shop-item:hover { transform: translateY(-4px); }
.shop-item.owned { opacity: 0.6; }
.shop-item-icon { font-size: 40px; margin-bottom: 8px; }
.shop-item-name { font-weight: bold; margin-bottom: 4px; }
.shop-item-desc { font-size: 12px; color: var(--color-text-light); margin-bottom: 10px; }
.shop-item-price {
  font-size: 16px;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 10px;
}

/* ---------- 徽章册 ---------- */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.badge-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.badge-card.locked { opacity: 0.35; filter: grayscale(1); }
.badge-icon { font-size: 40px; margin-bottom: 8px; }
.badge-name { font-weight: bold; font-size: 14px; margin-bottom: 4px; }
.badge-date { font-size: 11px; color: var(--color-text-light); }

/* ---------- 错题本 ---------- */
.mistakes-list { display: flex; flex-direction: column; gap: 12px; }
.mistake-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-danger);
}
.mistake-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.mistake-level { font-weight: bold; color: var(--color-primary); }
.mistake-date { font-size: 12px; color: var(--color-text-light); }
.mistake-reason {
  background: #FFF3E0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 8px;
}
.mistake-actions { display: flex; gap: 8px; }

/* ---------- 挑战副本 ---------- */
.challenge-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.challenge-card {
  background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.challenge-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.challenge-icon { font-size: 48px; margin-bottom: 8px; }
.challenge-name { font-weight: bold; font-size: 18px; margin-bottom: 8px; }
.challenge-desc { font-size: 14px; color: var(--color-text-light); }

/* ---------- 设置页 ---------- */
.settings-list {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 8px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 16px;
}
.setting-item:last-child { border-bottom: none; }
.setting-danger { color: var(--color-danger); }

/* 开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border-radius: 28px;
  transition: 0.3s;
}
.slider:before {
  content: "";
  position: absolute;
  height: 22px; width: 22px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
.switch input:checked + .slider { background: var(--color-success); }
.switch input:checked + .slider:before { transform: translateX(24px); }

.settings-info {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  line-height: 2;
  color: var(--color-text-light);
}

/* ---------- 数据看板 ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.dashboard-item {
  background: #FFF8F0;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}
.dashboard-value {
  font-size: 28px;
  font-weight: bold;
  color: var(--color-primary);
}
.dashboard-label {
  font-size: 13px;
  color: var(--color-text-light);
  margin-top: 4px;
}

/* ---------- 证书 ---------- */
.certificate {
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
  border: 4px double var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  margin: 16px 0;
}
.cert-logo { font-size: 48px; }
.cert-header h3 { color: var(--color-primary); margin: 8px 0; }
.cert-header h2 { font-size: 28px; color: var(--color-text); margin: 8px 0; }
.cert-body { margin: 20px 0; line-height: 2; font-size: 16px; }
.cert-name {
  font-size: 28px;
  font-weight: bold;
  color: var(--color-primary);
  margin: 8px 0;
}
.cert-footer {
  margin-top: 20px;
  font-size: 14px;
  color: var(--color-text-light);
}

/* ---------- Toast提示 ---------- */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  z-index: 3000;
  animation: slideDown 0.3s;
  max-width: 80%;
  text-align: center;
}
.toast.hidden { display: none; }
@keyframes slideDown {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ---------- 新手引导 ---------- */
.tutorial-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tutorial-overlay.hidden { display: none; }
.tutorial-box {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.tutorial-text {
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 20px;
  color: var(--color-text);
}

/* ---------- 作品列表 ---------- */
.workshop-projects {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 20px;
}
.workshop-projects h3 { margin-bottom: 12px; color: var(--color-text); }
.projects-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.project-item {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.project-item:hover { transform: translateY(-2px); }
.project-name { font-weight: bold; font-size: 14px; }
.project-date { font-size: 11px; color: var(--color-text-light); }
.project-delete {
  color: var(--color-danger);
  cursor: pointer;
  font-size: 16px;
}

/* ---------- 课堂演示模式 ---------- */
body.classroom-mode .game-toolbox,
body.classroom-mode .game-canvas-area {
  display: none !important;
}
body.classroom-mode .game-preview {
  flex: 1 !important;
  max-width: 100% !important;
}
body.classroom-mode .game-grid {
  transform: scale(1.3);
}
