:root {
  --bg: #eef3ff;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-strong: #ffffff;
  --primary: #6d76d9;
  --primary-dark: #5a41bb;
  --accent: #88d4ff;
  --text: #22304e;
  --text-soft: #5e6d8e;
  --border: rgba(108, 118, 217, 0.18);
  --shadow: 0 24px 50px rgba(68, 88, 178, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(148, 187, 255, 0.28), transparent 30%),
    radial-gradient(circle at bottom right, rgba(109, 118, 217, 0.16), transparent 25%),
    var(--bg);
}

img {
  display: block;
  max-width: 100%;
}

.hero,
.footer {
  background: linear-gradient(135deg, #6176dc 0%, #7b52b6 100%);
  color: #fff;
  border-bottom-left-radius: 42px;
  border-bottom-right-radius: 42px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 72px 20px 88px;
}

.hero-inner,
.footer {
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.9);
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.1rem);
  line-height: 1.18;
}

.subtitle {
  margin: 18px 0 0;
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: rgba(255, 255, 255, 0.92);
}

.meeting-badge {
  display: inline-block;
  margin-top: 28px;
  padding: 16px 28px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  font-size: 1.02rem;
  line-height: 1.8;
}

.meeting-badge span {
  font-size: 0.96rem;
  color: rgba(255, 255, 255, 0.92);
}

.container {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 72px;
}

section {
  margin-bottom: 72px;
}

.section-title {
  margin: 0 0 28px;
  text-align: center;
  color: var(--primary-dark);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  margin: 18px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.file-cards,
.flashcards-container,
.comic-grid {
  display: grid;
  gap: 26px;
}

.file-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.file-card {
  padding: 34px 24px;
  border-radius: 28px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.file-card:hover,
.file-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 30px 52px rgba(78, 95, 187, 0.22);
}

.icon {
  font-size: 3rem;
}

.file-card h3 {
  margin: 18px 0 10px;
  font-size: 1.9rem;
}

.file-card p {
  min-height: 48px;
  margin: 0 0 18px;
  color: var(--text-soft);
  line-height: 1.6;
}

.view-btn,
#next-btn,
.download-btn {
  appearance: none;
  border: 1px solid rgba(109, 118, 217, 0.56);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--primary);
  padding: 12px 22px;
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.view-btn:hover,
#next-btn:hover,
.download-btn:hover {
  transform: translateY(-1px);
  background: var(--primary);
  color: #fff;
}

.flashcards-container {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scene {
  perspective: 1200px;
  min-height: 230px;
}

.card {
  position: relative;
  width: 100%;
  min-height: 230px;
  transform-style: preserve-3d;
  transition: transform 0.7s ease;
  cursor: pointer;
}

.card.is-flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px;
  border-radius: 26px;
  backface-visibility: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-top: 5px solid var(--primary);
  box-shadow: var(--shadow);
  text-align: center;
}

.card-face h3 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.5;
}

.card-face-back {
  transform: rotateY(180deg);
  align-items: flex-start;
  text-align: left;
}

.answer-label {
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.card-face-back p {
  margin: 0;
  line-height: 1.8;
  font-size: 1.02rem;
}

.quiz-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 30px;
  border-radius: 30px;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
  font-weight: 700;
  margin-bottom: 16px;
}

.question {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.55;
  margin-bottom: 24px;
}

.options {
  display: grid;
  gap: 14px;
}

.option {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(109, 118, 217, 0.14);
  cursor: pointer;
  line-height: 1.65;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.option:hover {
  transform: translateX(4px);
  border-color: rgba(109, 118, 217, 0.36);
}

.option.correct {
  background: rgba(128, 210, 154, 0.2);
  border-color: rgba(64, 166, 98, 0.55);
}

.option.wrong {
  background: rgba(255, 144, 144, 0.16);
  border-color: rgba(219, 98, 98, 0.45);
}

.option.locked {
  cursor: default;
}

.quiz-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}

.quiz-result {
  min-height: 48px;
  color: var(--text-soft);
  line-height: 1.7;
}

#next-btn:disabled {
  background: #c9d4e3;
  border-color: #c9d4e3;
  color: #fff;
  cursor: not-allowed;
  transform: none;
}

.comic-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comic-panel {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.panel-number {
  position: absolute;
  top: 10px;
  left: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(26, 38, 89, 0.86);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  z-index: 2;
}

.comic-panel img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.comic-caption {
  padding: 18px 20px 22px;
  line-height: 1.75;
  color: var(--text);
}

.footer {
  margin-top: 40px;
  padding: 62px 20px 74px;
}

.footer h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.footer p {
  margin: 16px 0 0;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.92);
}

.footer-badge {
  margin-top: 24px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(34, 48, 78, 0.5);
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  position: relative;
  width: min(1080px, 100%);
  max-height: min(92vh, 920px);
  overflow: auto;
  border-radius: 30px;
  padding: 26px;
}

.modal-audio {
  max-width: 860px;
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 0;
  background: transparent;
  font-size: 2rem;
  color: var(--text-soft);
  cursor: pointer;
}

.modal-title {
  margin: 6px 0 18px;
  text-align: center;
  color: var(--primary-dark);
}

.download-row {
  text-align: center;
  margin-bottom: 18px;
}

.download-row p {
  margin: 0 0 10px;
  color: var(--text-soft);
}

.audio-box {
  padding: 22px;
  background: rgba(109, 118, 217, 0.08);
  border-radius: 20px;
  margin-bottom: 26px;
}

.audio-label {
  margin: 0 0 10px;
  font-weight: 800;
  color: var(--primary-dark);
}

audio {
  width: 100%;
}

.audio-note {
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.7;
}

.summary-block + .summary-block {
  margin-top: 20px;
}

.summary-block h3 {
  margin: 0 0 12px;
  color: var(--primary-dark);
}

.summary-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  line-height: 1.75;
}

.summary-item + .summary-item {
  margin-top: 10px;
}

@media (max-width: 980px) {
  .file-cards,
  .flashcards-container,
  .comic-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .scene {
    min-height: 250px;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 58px;
    padding-bottom: 68px;
  }

  .container {
    width: min(100% - 20px, 1160px);
    padding-top: 34px;
  }

  .meeting-badge {
    padding: 14px 18px;
    font-size: 0.95rem;
  }

  .question {
    font-size: 1.25rem;
  }

  .quiz-container,
  .modal-content {
    padding: 18px;
  }

  .quiz-controls {
    flex-direction: column;
    align-items: stretch;
  }

  #next-btn {
    width: 100%;
  }
}
