﻿:root {
  --bg: #f3ede2;
  --panel: #fffaf2;
  --panel-strong: #f7efe2;
  --ink: #2e2219;
  --muted: #6f6256;
  --accent: #9f2f21;
  --accent-dark: #7d2419;
  --line: #d7c6af;
  --success: #2e6a47;
  --warning: #8f5a14;
  --shadow: 0 18px 40px rgba(55, 35, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(159, 47, 33, 0.12), transparent 30%),
    linear-gradient(180deg, #f8f2e8 0%, var(--bg) 100%);
  min-height: 100vh;
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.hero,
.panel,
.card,
.choice-card,
.summary-card,
.dashboard-card,
.paragraph-box {
  border: 1px solid rgba(159, 47, 33, 0.12);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(159, 47, 33, 0.94), rgba(82, 24, 17, 0.92));
  color: #fff7f1;
  padding: 28px;
  border-radius: 28px;
  margin-bottom: 24px;
}

.eyebrow,
.status-label,
.meta-label,
.hint-label {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  margin-bottom: 12px;
}

.hero-copy {
  max-width: 520px;
  margin-bottom: 0;
  line-height: 1.7;
}

.panel {
  background: rgba(255, 250, 242, 0.94);
  border-radius: 28px;
  padding: 24px;
}

.intro-grid,
.dashboard-grid,
.choice-grid,
.summary-grid,
.analysis-grid {
  display: grid;
  gap: 20px;
}

.intro-grid,
.dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card,
.choice-card,
.summary-card,
.dashboard-card,
.paragraph-box {
  background: var(--panel);
  border-radius: 22px;
  padding: 20px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.primary-button,
.ghost-button,
.choice-button,
.tag-button {
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.primary-button,
.choice-button {
  background: var(--accent);
  color: #fff8f5;
  padding: 12px 18px;
}

.primary-button:hover,
.choice-button:hover,
.ghost-button:hover,
.tag-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  background: #cab7a5;
  cursor: not-allowed;
  transform: none;
}

.ghost-button,
.tag-button {
  background: rgba(255, 247, 241, 0.14);
  color: inherit;
  border: 1px solid rgba(255, 247, 241, 0.28);
  padding: 10px 16px;
}

.panel .ghost-button,
.tag-button {
  background: transparent;
  color: var(--accent);
  border-color: rgba(159, 47, 33, 0.22);
}

.form-actions,
.choice-actions,
.review-actions,
.dashboard-head,
.status-bar,
.history-banner,
.mode-banner {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.bullet-list,
.fact-list,
.log-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.scene-title {
  margin-bottom: 12px;
}

.scene-copy,
.explain-box,
.scene-quote,
.paragraph-text {
  line-height: 1.8;
}

.image-placeholder {
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  border: 1px dashed rgba(159, 47, 33, 0.3);
  background:
    linear-gradient(135deg, rgba(159, 47, 33, 0.08), rgba(255, 255, 255, 0.4)),
    var(--panel-strong);
  display: grid;
  place-items: center;
  color: var(--muted);
  margin: 18px 0;
  text-align: center;
  padding: 16px;
}

.mode-banner,
.history-banner,
.result-banner,
.warning-banner,
.success-banner {
  padding: 14px 16px;
  border-radius: 18px;
  margin: 16px 0;
}

.mode-banner,
.history-banner,
.success-banner {
  background: rgba(46, 106, 71, 0.1);
  color: var(--success);
}

.warning-banner {
  background: rgba(143, 90, 20, 0.12);
  color: var(--warning);
}

.result-banner {
  background: rgba(159, 47, 33, 0.1);
  color: var(--accent-dark);
}

.choice-grid,
.summary-grid,
.analysis-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 20px;
}

.choice-card h3,
.summary-card h3,
.dashboard-card h3 {
  margin-bottom: 10px;
}

.chip-row,
.boundary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip,
.metric-chip {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(159, 47, 33, 0.1);
  color: var(--accent-dark);
}

.tag-button.active {
  background: var(--accent);
  color: #fff8f5;
  border-color: var(--accent);
}

.paragraph-box {
  position: relative;
}

.paragraph-box.correct {
  border-color: rgba(46, 106, 71, 0.35);
}

.paragraph-box.wrong {
  border-color: rgba(159, 47, 33, 0.32);
}

.boundary-button {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.boundary-button.active {
  background: rgba(159, 47, 33, 0.12);
  border-style: solid;
  color: var(--accent-dark);
}

.answer-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.dashboard-table th,
.dashboard-table td {
  border-bottom: 1px solid rgba(159, 47, 33, 0.12);
  padding: 10px 8px;
  text-align: left;
}

.muted {
  color: var(--muted);
}

@media (max-width: 720px) {
  .app-shell {
    padding: 20px 14px 40px;
  }

  .hero {
    padding: 22px;
    border-radius: 24px;
  }

  .panel,
  .card,
  .choice-card,
  .summary-card,
  .dashboard-card,
  .paragraph-box {
    padding: 18px;
  }
}

.hero a.ghost-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.score-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-dark);
  margin-bottom: 8px;
}

.mode-now {
  margin: 14px 0 0;
  color: var(--muted);
}

.article-review-card {
  margin-top: 20px;
}

.article-text {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
  line-height: 1.8;
}

.article-text p {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(159, 47, 33, 0.1);
}

.inline-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.practice-panel {
  display: grid;
  gap: 22px;
}

.hidden {
  display: none;
}

.scene-image {
  margin: 18px 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(159, 47, 33, 0.14);
  background: var(--panel-strong);
  box-shadow: 0 14px 30px rgba(55, 35, 20, 0.1);
}

.scene-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.image-gallery .scene-image {
  margin: 0;
}

/* Series home */
.series-home {
  background:
    linear-gradient(120deg, rgba(30, 48, 42, 0.88), rgba(82, 24, 17, 0.78)),
    url("168picture/ChatGPT Image 2026骞?鏈?9鏃?14_47_05 (8).webp") center / cover fixed;
}

.home-shell {
  max-width: 1180px;
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 24px;
}

.home-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  color: #fff7f1;
  padding: 22px 0 10px;
}

.home-hero-copy h1 {
  font-size: clamp(2.3rem, 6vw, 5.8rem);
  line-height: 1.05;
  margin-bottom: 18px;
  text-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
}

.home-hero-copy p:last-child {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 247, 241, 0.86);
  font-size: 18px;
  line-height: 1.8;
}

.weekly-badge {
  min-width: 150px;
  border: 1px solid rgba(255, 247, 241, 0.36);
  background: rgba(255, 250, 242, 0.12);
  backdrop-filter: blur(12px);
  border-radius: 8px;
  padding: 14px 16px;
  text-align: right;
  color: #fff7f1;
}

.weekly-badge span,
.weekly-badge strong {
  display: block;
}

.weekly-badge span {
  font-size: 13px;
  opacity: 0.78;
}

.weekly-badge strong {
  margin-top: 4px;
  font-size: 20px;
}

.series-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.level-card {
  min-height: 520px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  color: #fff7f1;
  border: 1px solid rgba(255, 247, 241, 0.24);
  border-radius: 8px;
  background: rgba(46, 34, 25, 0.72);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.level-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 247, 241, 0.58);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.34);
}

.level-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.4s ease;
}

.level-card:hover img {
  transform: scale(1.07);
}

.level-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 14, 0.08), rgba(20, 16, 14, 0.84));
}

.level-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 24px;
}

.level-kicker {
  margin: 0;
  color: rgba(255, 247, 241, 0.72);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.level-content h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.25;
}

.level-content p:not(.level-kicker) {
  margin: 0;
  color: rgba(255, 247, 241, 0.82);
  line-height: 1.7;
}

.level-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.level-action {
  width: fit-content;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 16px;
  background: #fff7f1;
  color: #7d2419;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}

.level-action-homework {
  border: 1px solid rgba(255, 247, 241, 0.7);
  background: rgba(255, 247, 241, 0.16);
  color: #fff7f1;
}

.level-card-primary .level-action:not(.level-action-homework) {
  background: #d8bd7a;
  color: #2e2219;
}

.level-card-locked {
  cursor: default;
}

.level-card-locked:hover {
  transform: none;
}

.locked-art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(35, 54, 47, 0.96), rgba(71, 65, 45, 0.92)),
    var(--panel-strong);
}

.locked-art span {
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 247, 241, 0.26);
  border-radius: 50%;
  font-size: 96px;
  font-family: "STKaiti", "KaiTi", serif;
  color: rgba(255, 247, 241, 0.78);
}

.level-action.disabled {
  background: rgba(255, 247, 241, 0.18);
  color: rgba(255, 247, 241, 0.78);
}

@media (max-width: 900px) {
  .home-shell {
    align-content: start;
  }

  .home-hero {
    display: grid;
    align-items: start;
  }

  .weekly-badge {
    text-align: left;
  }

  .series-panel {
    grid-template-columns: 1fr;
  }

  .level-card {
    min-height: 360px;
  }
}

/* Episode 3 additions */
.image-prompt-frame {
  background: transparent;
}

.image-prompt-box {
  align-content: center;
  gap: 10px;
  line-height: 1.7;
}

.image-prompt-box strong {
  color: var(--accent-dark);
  font-size: 18px;
}

.image-prompt-box span {
  max-width: 860px;
}

.path-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  line-height: 1.7;
}

.path-flow span {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(159, 47, 33, 0.1);
  color: var(--accent-dark);
  font-weight: 700;
}

.path-flow b {
  color: var(--muted);
}

/* Combined teacher dashboard and question emphasis */
.question-box {
  margin: 18px 0 22px;
  padding: 18px 20px;
  border: 2px solid rgba(159, 47, 33, 0.42);
  border-left-width: 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(247, 239, 226, 0.92));
  box-shadow: 0 12px 28px rgba(55, 35, 20, 0.1);
}

.question-box p {
  margin: 0;
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.8;
}

.home-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.home-quick-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 247, 241, 0.36);
  border-radius: 999px;
  background: rgba(255, 247, 241, 0.14);
  color: #fff7f1;
  text-decoration: none;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.combined-dashboard {
  display: grid;
  gap: 20px;
}

.episode-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.episode-dashboard-card {
  display: grid;
  gap: 14px;
}

.compact-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 8px;
}

.compact-summary-grid .summary-card {
  padding: 16px;
  box-shadow: none;
}

.record-strip h4 {
  margin: 8px 0;
}

.mode-switch-row {
  padding: 10px 0 2px;
}

/* Teacher dashboard row layout for more episodes */
.episode-dashboard-list {
  display: grid;
  gap: 14px;
}

.episode-dashboard-list .episode-dashboard-card {
  border-radius: 8px;
  padding: 18px;
}

.episode-row-body {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(190px, 0.8fr) minmax(320px, 1.4fr);
  gap: 16px;
  align-items: center;
}

.episode-row-note p,
.episode-row-mode p {
  margin-bottom: 0;
}

.episode-row-stats {
  display: grid;
  grid-template-columns: 96px 96px minmax(130px, 1fr);
  gap: 10px;
}

.episode-row-stats div {
  min-height: 66px;
  border: 1px solid rgba(159, 47, 33, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.72);
  padding: 10px 12px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.episode-row-stats span {
  color: var(--muted);
  font-size: 12px;
}

.episode-row-stats strong {
  color: var(--accent-dark);
  font-size: 20px;
  line-height: 1.25;
}

@media (max-width: 900px) {
  .episode-row-body,
  .episode-row-stats {
    grid-template-columns: 1fr;
  }
}

/* Episode 3 readable prose and scoring */
.reading-panel {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  max-width: 980px;
}

.narration-card,
.memorial-card {
  border: 1px solid rgba(159, 47, 33, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.86);
  padding: 16px 18px;
  box-shadow: 0 8px 18px rgba(55, 35, 20, 0.06);
}

.narration-card .scene-copy {
  margin: 0;
  line-height: 1.95;
  color: var(--ink);
}

.narration-card .scene-copy + .scene-copy {
  margin-top: 10px;
}

.reading-panel .reading-heading {
  width: fit-content;
  margin: 0;
  padding: 9px 13px;
  border-radius: 8px;
  background: rgba(159, 47, 33, 0.1);
  color: var(--accent-dark);
  font-weight: 800;
  line-height: 1.65;
}

.reading-panel .dialogue-line {
  margin: 0;
  border-left: 6px solid rgba(46, 106, 71, 0.38);
  border-radius: 8px;
  background: rgba(46, 106, 71, 0.09);
  color: #234332;
  padding: 14px 18px;
  line-height: 1.9;
}

.memorial-card {
  position: relative;
  margin: 16px 0 22px;
  border-color: rgba(159, 47, 33, 0.24);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(247, 239, 226, 0.9));
}

.memorial-card strong {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--accent-dark);
  font-size: 17px;
}

.memorial-card p {
  margin: 0;
  line-height: 1.95;
}

.score-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.score-summary-card {
  border-radius: 8px;
}

.score-detail-list {
  display: grid;
  gap: 12px;
}

.score-detail-list section {
  border: 1px solid rgba(159, 47, 33, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 250, 242, 0.72);
}

.score-detail-list section > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.score-detail-list span {
  color: var(--muted);
}

.auth-panel {
  max-width: 620px;
  margin: 0 auto;
}

.auth-card {
  border-radius: 8px;
}

