/* 全域通用樣式與過關彈窗樣式 */
:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 50%, #faf5ff 100%);
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "PingFang TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: var(--bg-gradient);
  min-height: 100vh;
  color: #1e293b;
  padding-bottom: 40px;
}

/* 頂部導航列 */
.global-stage-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid #e2e8f0;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.nav-btn-home {
  text-decoration: none;
  background: #f1f5f9;
  color: #334155;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cbd5e1;
}

.nav-btn-home:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: translateX(-2px);
}

.nav-stage-badge {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 999px;
}

.nav-stage-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.nav-btn-sound {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* 主容器 */
.stage-main-container {
  max-width: 1000px;
  margin: 24px auto;
  padding: 0 16px;
}

/* 提示導引橫幅 */
.intro-banner {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
  border-left: 6px solid #3b82f6;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.intro-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.intro-content h2 {
  font-size: 1.3rem;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.intro-content p {
  font-size: 1rem;
  color: #475569;
  line-height: 1.6;
}

/* 實驗主操作區塊 */
.experiment-board {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(226, 232, 240, 0.8);
  margin-bottom: 24px;
}

/* 按鈕風格 */
.btn-action {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-action:active {
  transform: translateY(0);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* 過關彈跳視窗 */
.victory-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.victory-card {
  background: white;
  border-radius: 28px;
  max-width: 550px;
  width: 100%;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  border: 6px solid #86efac;
  animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bounceIn {
  0% { transform: scale(0.6); opacity: 0; }
  80% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

.victory-icon {
  font-size: 4rem;
  margin-bottom: 12px;
}

.victory-title {
  font-size: 1.8rem;
  color: #065f46;
  margin-bottom: 14px;
}

.victory-desc {
  font-size: 1.1rem;
  color: #334155;
  line-height: 1.7;
  margin-bottom: 28px;
}

.victory-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.v-btn {
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.v-btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.v-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

.v-btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.v-btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* 獨立測驗 Icon 與按鈕樣式 */
.nav-btn-quiz {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-btn-quiz:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
}

/* 右下角獨立浮動測驗按鈕 (Floating Quiz Icon) */
.floating-quiz-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 95;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: white;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.45);
  cursor: pointer;
  border: 3px solid #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-quiz-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 25px rgba(234, 88, 12, 0.6);
}

/* 測驗問卷卡片專屬樣式 */
.quiz-question-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  text-align: left;
}

.q-badge-basic {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 6px;
}

.q-badge-literacy {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 6px;
}

.q-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.5;
  margin-bottom: 10px;
}

.q-options-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.q-option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
}

.q-option-label:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.q-option-label input[type="radio"] {
  accent-color: #3b82f6;
  width: 16px;
  height: 16px;
}

.q-explanation {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
}
