/* ============================================================
   呼吸音之認識 - 教學網站主樣式（淺色活潑版）
   CSS Version: 3.0 Light & Playful
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700;900&family=Nunito:wght@400;600;700;900&family=Baloo+2:wght@400;600;700;800&display=swap');

/* ── Design Tokens ── */
:root {
  /* Primary palette - teal/mint */
  --primary:        #0ea5e9;
  --primary-light:  #e0f2fe;
  --primary-dark:   #0369a1;

  /* Secondary - coral/orange */
  --secondary:      #f97316;
  --secondary-light:#fff7ed;
  --secondary-dark: #c2410c;

  /* Accent - purple */
  --accent:         #8b5cf6;
  --accent-light:   #ede9fe;

  /* Success / Warning / Danger */
  --success:        #22c55e;
  --success-light:  #dcfce7;
  --warning:        #f59e0b;
  --warning-light:  #fef3c7;
  --danger:         #ef4444;
  --danger-light:   #fee2e2;
  --purple:         #a855f7;
  --purple-light:   #f3e8ff;

  /* Backgrounds */
  --bg:             #f8faff;
  --bg-card:        #ffffff;
  --bg-card2:       #f1f5f9;
  --bg-muted:       #e2e8f0;

  /* Text */
  --text-dark:      #0f172a;
  --text-body:      #334155;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;

  /* Border */
  --border:         #e2e8f0;
  --border-focus:   rgba(14, 165, 233, 0.4);

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.12);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.15);

  /* Radii */
  --radius-xs:  6px;
  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  32px;
  --radius-2xl: 48px;
  --radius-full: 9999px;

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-normal: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-slow:   0.5s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Noto Sans TC', 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Decorative blob shapes */
body::before {
  content: '';
  position: fixed;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14,165,233,0.06) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -200px; left: -200px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,0.05) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============================================================
   SCROLL PROGRESS
   ============================================================ */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 4px; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  z-index: 9999; transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 70px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid var(--primary-light);
  box-shadow: 0 2px 20px rgba(14,165,233,0.08);
}

.nav-brand {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
}

.nav-brand-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(14,165,233,0.3);
  transform: rotate(-5deg);
  transition: transform var(--t-fast);
}
.nav-brand:hover .nav-brand-icon { transform: rotate(0deg) scale(1.05); }

.nav-brand-text {
  font-family: 'Baloo 2', 'Noto Sans TC', sans-serif;
  font-weight: 800; font-size: 1.05rem; color: var(--primary-dark);
  line-height: 1.2;
}
.nav-brand-sub {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 0.7rem; color: var(--text-muted);
  font-weight: 400; display: block;
}

.nav-links { display: flex; align-items: center; gap: 0.2rem; list-style: none; }

.nav-links a {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: var(--radius-full);
  text-decoration: none; color: var(--text-muted);
  font-size: 0.86rem; font-weight: 600;
  transition: all var(--t-fast); white-space: nowrap;
}
.nav-links a:hover { color: var(--primary); background: var(--primary-light); }
.nav-links a.active {
  color: var(--primary-dark); background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(14,165,233,0.2);
}

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 8px; background: none; border: none;
}
.hamburger span {
  display: block; width: 22px; height: 2.5px;
  background: var(--text-body); border-radius: 2px;
  transition: all var(--t-fast);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 85vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 5rem 2rem 6rem;
  overflow: hidden; z-index: 1;
}

/* Decorative circles */
.hero-decor {
  position: absolute; border-radius: 50%;
  animation: float 6s ease-in-out infinite;
  pointer-events: none;
}
.hero-decor-1 { width: 120px; height: 120px; top: 10%; left: 5%; background: rgba(14,165,233,0.08); animation-delay: 0s; }
.hero-decor-2 { width: 80px;  height: 80px;  top: 20%; right: 8%; background: rgba(249,115,22,0.1); animation-delay: 1s; }
.hero-decor-3 { width: 60px;  height: 60px;  bottom: 20%; left: 10%; background: rgba(139,92,246,0.1); animation-delay: 2s; }
.hero-decor-4 { width: 100px; height: 100px; bottom: 15%; right: 5%; background: rgba(34,197,94,0.08); animation-delay: 0.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-20px) rotate(5deg); }
}

.hero-wave {
  position: absolute; bottom: -1px; left: 0; right: 0; height: 80px; z-index: 1;
}
.hero-wave svg { width: 100%; height: 100%; }

.hero-content { position: relative; z-index: 2; max-width: 820px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 20px;
  background: linear-gradient(135deg, var(--primary-light), rgba(249,115,22,0.1));
  border: 1.5px solid rgba(14,165,233,0.25);
  border-radius: var(--radius-full);
  font-size: 0.82rem; color: var(--primary-dark);
  font-weight: 700; letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.6s ease both;
}

.hero-title {
  font-family: 'Baloo 2', 'Noto Sans TC', sans-serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800; line-height: 1.15;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  animation: fadeInDown 0.7s ease 0.1s both;
}

.hero-title-cn {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: clamp(1.4rem, 3.5vw, 2.4rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.2rem;
  animation: fadeInDown 0.7s ease 0.15s both;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 600px; margin: 0 auto 2.5rem;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-stats {
  display: flex; justify-content: center; gap: 2.5rem;
  margin-bottom: 3rem; flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-stat { text-align: center; }
.hero-stat-value {
  font-family: 'Baloo 2', sans-serif; font-size: 2.2rem;
  font-weight: 800; color: var(--primary-dark); line-height: 1;
}
.hero-stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }

.hero-cta {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.4s both;
}

/* Lung animation (colorful for light theme) */
.lung-animation { display: flex; align-items: center; gap: 5px; height: 52px; }
.lung-bar {
  width: 6px; border-radius: 3px;
  animation: lungWave 1.6s ease-in-out infinite;
}
.lung-bar:nth-child(odd)  { background: linear-gradient(to top, var(--primary), var(--primary-light)); }
.lung-bar:nth-child(even) { background: linear-gradient(to top, var(--secondary), var(--warning-light)); }
.lung-bar:nth-child(1) { animation-delay: 0s; }
.lung-bar:nth-child(2) { animation-delay: 0.1s; }
.lung-bar:nth-child(3) { animation-delay: 0.2s; }
.lung-bar:nth-child(4) { animation-delay: 0.3s; }
.lung-bar:nth-child(5) { animation-delay: 0.4s; }
.lung-bar:nth-child(6) { animation-delay: 0.3s; }
.lung-bar:nth-child(7) { animation-delay: 0.2s; }
.lung-bar:nth-child(8) { animation-delay: 0.1s; }
.lung-bar:nth-child(9) { animation-delay: 0s; }
@keyframes lungWave {
  0%, 100% { height: 12px; opacity: 0.5; }
  50%       { height: 44px; opacity: 1; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 26px; border-radius: var(--radius-full);
  font-size: 0.95rem; font-weight: 700;
  font-family: 'Noto Sans TC', sans-serif;
  text-decoration: none; cursor: pointer; border: none;
  transition: all var(--t-normal); position: relative;
  overflow: hidden; white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: 0 4px 20px rgba(14,165,233,0.4);
}
.btn-primary:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 30px rgba(14,165,233,0.5); }

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: #fff; box-shadow: 0 4px 20px rgba(249,115,22,0.4);
}
.btn-secondary:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(249,115,22,0.5); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff; box-shadow: 0 4px 20px rgba(139,92,246,0.4);
}
.btn-accent:hover { transform: translateY(-3px); }

.btn-outline {
  background: #fff; color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover { background: var(--primary-light); transform: translateY(-2px); }

.btn-success {
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: #fff; box-shadow: 0 4px 20px rgba(34,197,94,0.35);
}
.btn-success:hover { transform: translateY(-2px); }

.btn-sm { padding: 7px 18px; font-size: 0.84rem; }
.btn-lg { padding: 14px 36px; font-size: 1.05rem; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.section { padding: 5rem 2rem; position: relative; z-index: 1; }
.section-sm { padding: 3rem 2rem; position: relative; z-index: 1; }
.section-colored { background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%); }

.section-title {
  font-family: 'Baloo 2', 'Noto Sans TC', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800; color: var(--text-dark); margin-bottom: 0.5rem;
}
.section-subtitle { color: var(--text-muted); font-size: 1rem; margin-bottom: 2.5rem; }

.section-header { text-align: center; margin-bottom: 3rem; }

.section-pill {
  display: inline-block; padding: 4px 16px;
  background: var(--primary-light); color: var(--primary-dark);
  border-radius: var(--radius-full); font-size: 0.78rem;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.section-pill-orange { background: var(--secondary-light); color: var(--secondary-dark); }
.section-pill-purple { background: var(--accent-light); color: #5b21b6; }

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-normal);
  position: relative; overflow: hidden;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(14,165,233,0.25);
}

.card-colored-blue { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border-color: #bfdbfe; }
.card-colored-orange { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); border-color: #fed7aa; }
.card-colored-green { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); border-color: #bbf7d0; }
.card-colored-purple { background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%); border-color: #ddd6fe; }
.card-colored-red { background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%); border-color: #fecaca; }

.card-icon {
  width: 56px; height: 56px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; margin-bottom: 1.2rem; flex-shrink: 0;
}

.card-title { font-size: 1.1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.5rem; }
.card-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* ============================================================
   GRID
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* ============================================================
   SOUND PLAYER (Light theme)
   ============================================================ */
.sound-player {
  background: #fff; border: 2px solid var(--border);
  border-radius: var(--radius-md); padding: 1rem 1.25rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: all var(--t-normal); cursor: default;
}
.sound-player:hover { border-color: var(--primary); box-shadow: 0 4px 20px rgba(14,165,233,0.12); }

.sound-player-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sound-player-info  { display: flex; align-items: center; gap: 10px; }

.sound-icon-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2.5px solid var(--primary);
  background: var(--primary-light); color: var(--primary);
  font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast); flex-shrink: 0;
}
.sound-icon-btn:hover, .sound-icon-btn.playing {
  background: var(--primary); color: #fff;
  box-shadow: 0 0 16px rgba(14,165,233,0.4);
  transform: scale(1.08);
}
.sound-icon-btn.playing { animation: playPulse 1.5s ease infinite; }
@keyframes playPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(14,165,233,0.4); }
  50%       { box-shadow: 0 0 28px rgba(14,165,233,0.7); }
}

.sound-name { font-weight: 700; font-size: 0.95rem; color: var(--text-dark); }
.sound-en   { font-size: 0.76rem; color: var(--primary); font-style: italic; }

/* Tags */
.sound-tag {
  font-size: 0.7rem; padding: 3px 10px; border-radius: var(--radius-full);
  font-weight: 700; letter-spacing: 0.3px; border: 1.5px solid transparent;
}
.sound-tag-normal       { background: var(--success-light);  color: #16a34a; border-color: #86efac; }
.sound-tag-continuous   { background: var(--warning-light);  color: #b45309; border-color: #fcd34d; }
.sound-tag-discontinuous{ background: var(--accent-light);   color: #7c3aed; border-color: #c4b5fd; }
.sound-tag-emergency    { background: var(--danger-light);   color: #dc2626; border-color: #fca5a5; }

/* Waveform (light) */
.waveform-bar { display: flex; align-items: center; gap: 3px; height: 28px; }
.waveform-bar span {
  display: inline-block; width: 4px; border-radius: 2px;
  background: var(--primary); opacity: 0.3;
}
.playing .waveform-bar span { opacity: 1; }

.audio-source { font-size: 0.7rem; color: var(--text-light); }
.audio-source a { color: var(--primary); text-decoration: none; }
.audio-source a:hover { text-decoration: underline; }

/* ============================================================
   TAGS / BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.74rem; font-weight: 700;
}
.badge-primary   { background: var(--primary-light);  color: var(--primary-dark); }
.badge-success   { background: var(--success-light);  color: #16a34a; }
.badge-danger    { background: var(--danger-light);   color: #dc2626; }
.badge-warning   { background: var(--warning-light);  color: #b45309; }
.badge-purple    { background: var(--purple-light);   color: #7c3aed; }
.badge-orange    { background: var(--secondary-light);color: var(--secondary-dark); }

/* ============================================================
   TABLE
   ============================================================ */
.table-container { overflow-x: auto; border-radius: var(--radius-md); border: 1.5px solid var(--border); }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead { background: linear-gradient(135deg, var(--primary-light), #dbeafe); }
th {
  padding: 12px 14px; text-align: left;
  font-weight: 700; color: var(--primary-dark);
  font-size: 0.82rem; letter-spacing: 0.4px;
  text-transform: uppercase; white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--primary-light); color: var(--text-body); }

/* ============================================================
   ACCORDION
   ============================================================ */
.accordion-item {
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; margin-bottom: 0.75rem;
}
.accordion-header {
  width: 100%; padding: 1rem 1.25rem; background: #fff;
  border: none; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  cursor: pointer; font-family: 'Noto Sans TC', sans-serif;
  font-size: 0.95rem; font-weight: 700; color: var(--text-dark);
  text-align: left; transition: background var(--t-fast);
}
.accordion-header:hover { background: var(--bg-card2); }
.accordion-arrow { color: var(--primary); transition: transform var(--t-slow); }
.accordion-item.open .accordion-arrow { transform: rotate(180deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; background: var(--bg); }
.accordion-body-inner {
  padding: 1rem 1.25rem; color: var(--text-muted);
  font-size: 0.88rem; line-height: 1.7;
  border-top: 1px solid var(--border);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex; gap: 0.3rem; flex-wrap: wrap;
  background: var(--bg-card2); padding: 6px;
  border-radius: var(--radius-md); margin-bottom: 2rem;
  border: 1.5px solid var(--border);
}
.tab-btn {
  flex: 1; padding: 9px 16px; background: none; border: none;
  border-radius: var(--radius-sm);
  font-family: 'Noto Sans TC', sans-serif; font-size: 0.86rem;
  font-weight: 700; color: var(--text-muted); cursor: pointer;
  transition: all var(--t-fast); white-space: nowrap;
  display: flex; align-items: center; gap: 5px; justify-content: center;
}
.tab-btn:hover { color: var(--text-dark); }
.tab-btn.active {
  background: #fff; color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* ============================================================
   QUIZ / GAME
   ============================================================ */
.quiz-container { max-width: 760px; margin: 0 auto; }

.quiz-progress { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.quiz-progress-bar {
  flex: 1; height: 10px; background: var(--bg-muted);
  border-radius: 5px; overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 5px; transition: width 0.5s ease;
}
.quiz-score-display {
  font-family: 'Baloo 2', sans-serif; font-size: 1.1rem;
  font-weight: 800; color: var(--secondary-dark);
}

.quiz-card {
  background: #fff; border: 2px solid var(--border);
  border-radius: var(--radius-xl); padding: 2.5rem;
  text-align: center; box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}
.quiz-question-num {
  font-size: 0.78rem; color: var(--text-light); margin-bottom: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700;
}
.quiz-question {
  font-size: 1.25rem; font-weight: 700; color: var(--text-dark);
  margin-bottom: 2rem; line-height: 1.5;
}

.quiz-sound-area { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.quiz-play-btn {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none; color: #fff; font-size: 2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast);
  box-shadow: 0 6px 24px rgba(14,165,233,0.4);
}
.quiz-play-btn:hover { transform: scale(1.1); }
.quiz-play-btn.playing { animation: quizPlayPulse 1.2s ease infinite; }
@keyframes quizPlayPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.quiz-option {
  padding: 14px 18px; border: 2px solid var(--border);
  border-radius: var(--radius-md); background: var(--bg-card2);
  color: var(--text-muted); font-size: 0.92rem; font-weight: 600;
  cursor: pointer; text-align: center; transition: all var(--t-fast);
  font-family: 'Noto Sans TC', sans-serif;
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--primary); color: var(--primary-dark);
  background: var(--primary-light); transform: translateY(-2px);
}
.quiz-option.correct { border-color: var(--success); background: var(--success-light); color: #16a34a; }
.quiz-option.wrong   { border-color: var(--danger);  background: var(--danger-light);  color: #dc2626; }
.quiz-option:disabled { cursor: default; }

.quiz-feedback {
  padding: 1rem 1.5rem; border-radius: var(--radius-md);
  font-size: 0.92rem; font-weight: 600; min-height: 54px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; opacity: 0; transition: opacity 0.3s ease;
  text-align: center;
}
.quiz-feedback.show { opacity: 1; }
.quiz-feedback.correct-fb { background: var(--success-light); color: #166534; border: 1.5px solid #86efac; }
.quiz-feedback.wrong-fb   { background: var(--danger-light);  color: #991b1b; border: 1.5px solid #fca5a5; }

/* Results */
.results-screen { text-align: center; padding: 2rem; }
.results-score-circle {
  width: 150px; height: 150px; border-radius: 50%;
  background: conic-gradient(var(--primary) var(--score-pct, 0%), #e2e8f0 0%);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem; position: relative;
}
.results-score-circle::before {
  content: ''; position: absolute; inset: 12px;
  border-radius: 50%; background: #fff;
}
.results-score-value {
  position: relative; z-index: 1;
  font-family: 'Baloo 2', sans-serif; font-size: 1.8rem;
  font-weight: 900; color: var(--primary-dark);
}
.results-grade { font-size: 1.4rem; font-weight: 800; color: var(--text-dark); margin-bottom: 0.5rem; }
.results-message { color: var(--text-muted); margin-bottom: 2rem; }

/* ============================================================
   MATCHING GAME
   ============================================================ */
.matching-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.match-column { display: flex; flex-direction: column; gap: 0.75rem; }
.match-item {
  padding: 12px 16px; border: 2px solid var(--border);
  border-radius: var(--radius-md); background: #fff; cursor: pointer;
  font-size: 0.88rem; font-weight: 600; color: var(--text-muted);
  transition: all var(--t-fast); min-height: 50px;
  display: flex; align-items: center; user-select: none;
}
.match-item:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-light); }
.match-item.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.match-item.matched-correct { border-color: var(--success); background: var(--success-light); color: #166534; }
.match-item.matched-wrong   { border-color: var(--danger);  background: var(--danger-light);  color: #991b1b; animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; top: 84px; right: 1.5rem; z-index: 9999;
  padding: 12px 20px; border-radius: var(--radius-md);
  font-size: 0.9rem; font-weight: 700; box-shadow: var(--shadow-lg);
  transform: translateX(130%); transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 300px; display: flex; align-items: center; gap: 8px;
}
.toast.show { transform: translateX(0); }
.toast-success { background: var(--success); color: #fff; }
.toast-error   { background: var(--danger);  color: #fff; }
.toast-info    { background: var(--primary); color: #fff; }

/* ============================================================
   INFO BOXES
   ============================================================ */
.info-box {
  padding: 1rem 1.25rem; border-radius: var(--radius-md);
  font-size: 0.88rem; line-height: 1.6;
  display: flex; gap: 10px; align-items: flex-start;
}
.info-box-primary { background: var(--primary-light); border-left: 4px solid var(--primary);   color: var(--primary-dark); }
.info-box-warning { background: var(--warning-light); border-left: 4px solid var(--warning);   color: #92400e; }
.info-box-danger  { background: var(--danger-light);  border-left: 4px solid var(--danger);    color: #991b1b; }
.info-box-success { background: var(--success-light); border-left: 4px solid var(--success);   color: #166534; }
.info-box-orange  { background: var(--secondary-light); border-left: 4px solid var(--secondary); color: var(--secondary-dark); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
  border-bottom: 2px solid rgba(14,165,233,0.15);
  padding: 4rem 2rem 3rem; position: relative; overflow: hidden; z-index: 1;
}
.page-header::before {
  content: ''; position: absolute; top: -100px; right: -100px;
  width: 350px; height: 350px; border-radius: 50%;
  background: rgba(249,115,22,0.07); pointer-events: none;
}
.page-header-content { max-width: 800px; position: relative; z-index: 1; }

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1rem;
}
.breadcrumb a { color: var(--primary-dark); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }

.page-title {
  font-family: 'Baloo 2', 'Noto Sans TC', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800; color: var(--text-dark); margin-bottom: 0.75rem;
}
.page-subtitle { color: var(--text-muted); font-size: 1rem; max-width: 600px; }

/* ============================================================
   SCENARIO CARD
   ============================================================ */
.scenario-card {
  background: linear-gradient(135deg, #eff6ff 0%, #faf5ff 100%);
  border: 2px solid #c7d2fe;
  border-radius: var(--radius-lg); padding: 1.75rem; position: relative;
}
.scenario-badge {
  font-size: 0.7rem; padding: 3px 10px; border-radius: var(--radius-full);
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  display: inline-block; margin-bottom: 0.5rem;
}
.scenario-badge-critical { background: var(--danger-light);  color: #dc2626; border: 1px solid #fca5a5; }
.scenario-badge-moderate { background: var(--warning-light); color: #b45309; border: 1px solid #fcd34d; }
.scenario-badge-routine  { background: var(--success-light); color: #16a34a; border: 1px solid #86efac; }

.scenario-title { font-size: 1.1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.5rem; }
.scenario-desc  { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.25rem; }

.vital {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px;
  text-align: center; min-width: 75px;
}
.vital-value { font-family: 'Baloo 2', sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--primary-dark); }
.vital-label { font-size: 0.68rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* ============================================================
   TIMER
   ============================================================ */
.timer { display: flex; align-items: center; gap: 4px; font-family: 'Baloo 2', sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--text-muted); }
.timer.warning { color: var(--warning); }
.timer.danger  { color: var(--danger); animation: blink 0.5s ease infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: rgba(255,255,255,0.85); padding: 3rem 2rem 1.5rem;
  position: relative; z-index: 1; margin-top: 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem; max-width: 1200px; margin: 0 auto 2rem;
}
.footer-brand strong { color: #fff; font-size: 1.1rem; font-family: 'Baloo 2', sans-serif; }
.footer-brand p { margin-top: 0.75rem; font-size: 0.88rem; line-height: 1.6; }
.footer-heading { font-size: 0.85rem; font-weight: 800; color: #fff; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: rgba(255,255,255,0.75); text-decoration: none; font-size: 0.875rem; transition: color var(--t-fast); }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.2);
  flex-wrap: wrap; gap: 1rem; font-size: 0.8rem; color: rgba(255,255,255,0.65);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center  { text-align: center; }
.text-primary { color: var(--primary); }
.text-dark    { color: var(--text-dark); }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-orange  { color: var(--secondary); }
.fw-bold { font-weight: 700; }
.fw-900  { font-weight: 900; }

.d-flex   { display: flex; }
.align-center { align-items: center; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }

.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }

.hidden  { display: none !important; }
.visible { display: block !important; }
.rounded-full { border-radius: var(--radius-full); }

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.highlight {
  background: linear-gradient(120deg, rgba(14,165,233,0.15) 0%, rgba(249,115,22,0.1) 100%);
  border-radius: 4px; padding: 1px 6px; color: var(--primary-dark); font-weight: 700;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp   { from { opacity: 0; transform: translateY(20px);  } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn    { from { opacity: 0; transform: scale(0.92); }      to { opacity: 1; transform: scale(1); } }
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

.animate-fadeIn  { animation: fadeIn 0.5s ease; }
.animate-scaleIn { animation: scaleIn 0.4s ease; }
.animate-bounce  { animation: bounceIn 0.6s ease; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* ============================================================
   GAME STYLES
   ============================================================ */
.game-hud {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem 1.5rem;
  margin-bottom: 2rem; box-shadow: var(--shadow-sm);
}
.game-stat { text-align: center; }
.game-stat-label { font-size: 0.7rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.game-stat-value { font-family: 'Baloo 2', sans-serif; font-size: 1.5rem; font-weight: 900; }

.stage-option {
  padding: 13px 16px; border: 2px solid var(--border);
  border-radius: var(--radius-md); background: var(--bg-card2);
  color: var(--text-muted); cursor: pointer;
  font-family: 'Noto Sans TC', sans-serif; font-size: 0.9rem; font-weight: 600;
  transition: all var(--t-fast); text-align: center;
}
.stage-option:hover:not(:disabled) {
  border-color: var(--primary); color: var(--primary-dark);
  background: var(--primary-light); transform: translateY(-2px);
}
.stage-option.correct { border-color: var(--success); background: var(--success-light); color: #166534; }
.stage-option.wrong   { border-color: var(--danger);  background: var(--danger-light);  color: #991b1b; }
.stage-option:disabled { cursor: default; }

.xp-bar { height: 8px; background: var(--bg-muted); border-radius: 4px; overflow: hidden; margin: 0.5rem 0; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 4px; transition: width 0.5s ease; }

.heart { font-size: 1.4rem; transition: all var(--t-fast); }
.heart.lost { opacity: 0.2; filter: grayscale(1); }

.leaderboard-item { display: flex; align-items: center; gap: 1rem; padding: 9px 0; border-bottom: 1px solid var(--border); }
.leaderboard-item:last-child { border-bottom: none; }
.rank { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.82rem; }
.rank-1 { background: linear-gradient(135deg, #ffd700, #f59e0b); color: #fff; }
.rank-2 { background: linear-gradient(135deg, #c0c0c0, #9ca3af); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #b45309); color: #fff; }
.rank-other { background: var(--bg-muted); color: var(--text-muted); }

/* ============================================================
   DECORATIVE ELEMENTS (fun/playful)
   ============================================================ */
.fun-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 3rem 0; color: var(--text-light); font-size: 1.2rem;
}
.fun-divider::before,
.fun-divider::after { content: ''; flex: 1; height: 2px; background: var(--border); border-radius: 1px; }

.sticker {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: var(--radius-full);
  font-weight: 700; font-size: 0.82rem;
  border: 2px solid;
}
.sticker-blue   { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.sticker-green  { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.sticker-orange { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
.sticker-red    { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.sticker-purple { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0; background: #fff; padding: 1rem; gap: 0.25rem; border-bottom: 2px solid var(--primary-light); box-shadow: var(--shadow-lg); }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .quiz-options { grid-template-columns: 1fr; }
  .matching-grid { grid-template-columns: 1fr; }
  .section { padding: 3rem 1rem; }
  .hero { min-height: auto; padding: 4rem 1.5rem 5rem; }
  .hero-stats { gap: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .game-hud { flex-wrap: wrap; gap: 1rem; }
}
@media (max-width: 480px) {
  .quiz-card { padding: 1.5rem; }
  .btn-lg { padding: 12px 24px; font-size: 0.95rem; }
}
