/* ============================================
   互联网应用与创新——教学网站样式
   ============================================ */

/* --- 色彩体系：活泼而严谨，面向初中学生 --- */
:root {
  /* 基础�?*/
  --bg: #f4f8fc;
  --surface: #fdfeff;
  --surface-alt: rgba(255, 255, 255, 0.7);
  --text: #22324a;
  --muted: #6b7a90;
  --line: #dce7f3;
  --line-strong: #bfd4ea;

  /* 主色�?*/
  --primary: #2f6bff;
  --primary-deep: #1e3a66;
  --primary-light: #e8f0ff;
  --accent: #22b8cf;
  --accent-light: #e6fafb;

  /* 功能�?*/
  --success: #34c759;
  --success-light: #eafbef;
  --warning: #ff9f0a;
  --warning-light: #fff6e6;
  --danger: #ff5a5f;
  --danger-light: #ffeaeb;

  /* 活泼扩展色 — 每种对应一个单元/交互类型，适度降低饱和度 */
  --coral: #f06060;
  --coral-light: #fef0f0;
  --violet: #7058d8;
  --violet-light: #f2effe;
  --amber: #e8a020;
  --amber-light: #fef6e2;
  --emerald: #28b890;
  --emerald-light: #ecfaf5;
  --rose: #e068a0;
  --rose-light: #fef1f7;
  --sky: #30a8e0;
  --sky-light: #eaf7fe;
  --indigo: #5860c8;
  --indigo-light: #f0f0fe;

  /* 单元主题色映�?*/
  --unit-1: var(--primary);
  --unit-2: var(--violet);
  --unit-3: var(--accent);
  --unit-4: var(--coral);
  --unit-5: var(--emerald);
  --unit-6: var(--amber);

  /* 圆角 */
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  /* 阴影 */
  --shadow: 0 24px 60px rgba(30, 58, 102, 0.12);
  --shadow-sm: 0 8px 24px rgba(30, 58, 102, 0.08);
  --shadow-glow: 0 0 20px rgba(47, 107, 255, 0.15);

  /* 动画——活泼但不幼稚：用指数缓动替代弹性缓动 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 全局重置与基础 --- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 107, 255, 0.06), transparent 28%),
    radial-gradient(circle at bottom right, rgba(124, 92, 255, 0.04), transparent 30%),
    var(--bg);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- 布局容器 --- */
.site-shell {
  width: min(1380px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
  position: relative;
  z-index: 1;
}

/* 所有容器使用不透明背景，确保教学内容清晰可�?*/

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 360px);
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.site-header.compact {
  align-items: start;
}

/* --- 标签与排�?--- */
.eyebrow,
.section-tag,
.panel-label,
.source-badge {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow,
.section-tag,
.panel-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

/* 不同模块标签用不同颜色，增加视觉层次 */
.content-card[data-color="coral"] .section-tag { color: var(--coral); }
.content-card[data-color="violet"] .section-tag { color: var(--violet); }
.content-card[data-color="emerald"] .section-tag { color: var(--emerald); }
.content-card[data-color="amber"] .section-tag { color: var(--amber); }
.content-card[data-color="rose"] .section-tag { color: var(--rose); }

h1, h2, h3 {
  margin: 0;
  font-family: "STZhongsong", "Songti SC", "Noto Serif SC", serif;
  color: var(--primary-deep);
}

h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.2;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.3;
}

p, li, span, strong {
  line-height: 1.7;
}

.lede {
  max-width: 60ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* --- 面板与卡�?--- */
.header-panel,
.hero-callout,
.diagram-card,
.milestone-note {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--primary-light);
  border: 1px solid rgba(47, 107, 255, 0.12);
}

.header-panel strong {
  display: block;
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--primary-deep);
}

.header-panel p,
.hero-callout li,
.section-copy,
.content-card p,
.milestone-note p,
.metric-card p {
  color: var(--muted);
}

/* --- 按钮系统 --- */
.primary-button,
.ghost-button,
.footer-link,
.pill-button,
.quiz-option {
  transition:
    transform 180ms var(--ease-out),
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--primary);
  color: #fefeff;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(47, 107, 255, 0.24);
  border: none;
  cursor: pointer;
}

.primary-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 40px rgba(47, 107, 255, 0.30);
}

.primary-button:active {
  transform: translateY(0) scale(0.98);
}

.primary-button.coral { background: var(--coral); box-shadow: 0 14px 30px rgba(255, 107, 107, 0.24); }
.primary-button.violet { background: var(--violet); box-shadow: 0 14px 30px rgba(124, 92, 255, 0.24); }
.primary-button.emerald { background: var(--emerald); box-shadow: 0 14px 30px rgba(45, 212, 160, 0.24); }
.primary-button.amber { background: var(--amber); color: var(--text); box-shadow: 0 14px 30px rgba(245, 166, 35, 0.24); }

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: end;
}

.ghost-button,
.pill-button,
.quiz-option,
.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.85);
  color: var(--primary-deep);
  font-weight: 600;
  cursor: pointer;
}

.ghost-button,
.footer-link {
  min-height: 44px;
  padding: 0 16px;
}

.ghost-button.active,
.pill-button.active {
  background: var(--primary);
  color: #fefeff;
  border-color: var(--primary);
  box-shadow: 0 12px 24px rgba(47, 107, 255, 0.18);
}

.ghost-button.disabled,
.footer-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.primary-button:hover,
.ghost-button:hover,
.footer-link:hover,
.pill-button:hover,
.quiz-option:hover {
  transform: translateY(-1px);
}

/* --- 总览�?--- */
.overview-main,
.lesson-main {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

.overview-card,
.content-card,
.sidebar-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.overview-card,
.content-card {
  padding: 28px;
}

.sidebar-card {
  padding: 22px;
}

.intro-grid,
.split-card,
.recap-grid,
.achievement-grid {
  display: grid;
  gap: 18px;
}

.intro-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
}

.metric-stack {
  display: grid;
  gap: 14px;
}

.metric-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 200ms var(--ease-out), box-shadow 200ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-card strong {
  display: block;
  font-size: 2rem;
  color: var(--primary-deep);
}

/* --- 单元卡片彩色标记 --- */
.unit-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 200ms var(--ease-out), box-shadow 200ms ease;
  position: relative;
  overflow: hidden;
}

.unit-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px 0 0 4px;
}

.unit-card[data-unit="1"]::before { background: var(--unit-1); }
.unit-card[data-unit="2"]::before { background: var(--unit-2); }
.unit-card[data-unit="3"]::before { background: var(--unit-3); }
.unit-card[data-unit="4"]::before { background: var(--unit-4); }
.unit-card[data-unit="5"]::before { background: var(--unit-5); }
.unit-card[data-unit="6"]::before { background: var(--unit-6); }

.unit-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.unit-card h3 {
  margin-bottom: 10px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}

.text-link {
  color: var(--primary);
  font-weight: 700;
}

.unit-grid {
  display: grid;
  gap: 16px;
}

.lesson-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lesson-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.08);
  color: var(--primary-deep);
  font-size: 0.94rem;
  transition: transform 180ms var(--ease-out), background-color 180ms ease;
}

.lesson-chip:hover {
  transform: scale(1.04);
}

.lesson-chip.is-active {
  background: var(--primary);
  color: #fefeff;
}

.lesson-chip.is-disabled {
  opacity: 0.68;
}

/* --- 课程页布局 --- */
.lesson-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  margin-top: 24px;
}

.lesson-sidebar {
  display: grid;
  gap: 18px;
  align-self: start;
  position: sticky;
  top: 20px;
}

.lesson-switcher,
.goal-list,
.logic-list {
  margin: 0;
  padding-left: 18px;
}

.lesson-switcher {
  padding: 0;
  list-style: none;
}

.lesson-switcher li + li {
  margin-top: 10px;
}

.lesson-switcher a,
.lesson-switcher span {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 300ms ease;
}

.lesson-switcher a.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-deep);
  font-weight: 700;
}

.lesson-switcher span.disabled {
  opacity: 0.62;
}

/* --- Hero 卡片 --- */
.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(250px, 0.7fr);
  gap: 18px;
}

.hero-callout span {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.12);
  color: var(--primary-deep);
  font-weight: 700;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 184, 207, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(34, 184, 207, 0.14);
}

/* --- Tab 面板（阶段切换） --- */
.interactive-panel {
  display: grid;
  gap: 16px;
}

.panel-tools {
  display: flex;
  justify-content: flex-end;
}

.panel-button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.92rem;
}

.stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-button {
  padding: 10px 14px;
  font-size: 0.95rem;
}

.stage-display {
  min-height: 240px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  animation: fadeSlideIn 300ms var(--ease-smooth);
}

.stage-display strong {
  color: var(--primary);
  display: block;
  margin: 0 0 8px;
}

.stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.stage-meta span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.08);
  color: var(--primary-deep);
  font-size: 0.88rem;
}

/* --- 分栏卡与概念�?--- */
.split-card {
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
}

.concept-stack {
  display: grid;
  gap: 14px;
}

.concept-block {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 200ms var(--ease-out), box-shadow 200ms ease;
}

.concept-block:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.micro-note {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.diagram-card {
  display: grid;
  align-content: start;
}

/* --- 旧判断题（保留兼容） --- */
.quiz-list {
  display: grid;
  gap: 16px;
}

.quiz-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.quiz-card h3 {
  margin-bottom: 8px;
}

.quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.quiz-option {
  min-height: 42px;
  padding: 0 14px;
  cursor: pointer;
}

.quiz-option.is-correct {
  border-color: rgba(52, 199, 89, 0.3);
  background: rgba(52, 199, 89, 0.12);
  color: #19693c;
}

.quiz-option.is-wrong {
  border-color: rgba(255, 90, 95, 0.3);
  background: rgba(255, 90, 95, 0.1);
  color: #a33a40;
}

.quiz-feedback {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(34, 184, 207, 0.08);
  border: 1px solid rgba(34, 184, 207, 0.14);
  color: var(--text);
}

.quiz-feedback.visible {
  display: block;
}

/* --- 时间�?--- */
.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.timeline-year {
  display: inline-flex;
  justify-content: center;
  padding: 10px 0;
  border-radius: 999px;
  background: var(--primary-deep);
  color: #fefeff;
  font-weight: 700;
}

/* --- 成就网格 --- */
.achievement-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.achievement-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 200ms var(--ease-out), box-shadow 200ms ease;
}

.achievement-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.achievement-card.coral { background: var(--coral-light); border-color: rgba(255, 107, 107, 0.2); }
.achievement-card.violet { background: var(--violet-light); border-color: rgba(124, 92, 255, 0.2); }
.achievement-card.accent {
  background: var(--indigo-light);
  border-color: rgba(99, 102, 241, 0.2);
}

/* --- 本课总结 --- */
.recap-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recap-grid section {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

/* --- 底部导航 --- */
.lesson-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

/* ============================================
   新增交互组件样式
   ============================================ */

/* --- 闯关进度�?--- */
.quest-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.quest-step {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: var(--line);
  position: relative;
  overflow: hidden;
  transition: background 400ms var(--ease-smooth);
}

.quest-step.completed {
  background: var(--success);
}

.quest-step.active {
  background: var(--line);
  box-shadow: 0 0 0 2px var(--primary);
}

.quest-step.active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--primary);
  border-radius: 99px;
  animation: progressPulse 1.2s ease-in-out infinite;
}

.quest-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-deep);
  white-space: nowrap;
  min-width: 60px;
  text-align: center;
}

.quest-label.completed {
  color: var(--success);
}

/* --- 拖拽排序 --- */
.drag-sort-area {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--line-strong);
  background: var(--surface);
  transition: border-color 300ms ease;
}

.drag-sort-area.drag-over {
  border-color: var(--primary);
  background: rgba(47, 107, 255, 0.04);
}

.drag-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  cursor: grab;
  user-select: none;
  transition: transform 200ms var(--ease-out), box-shadow 200ms ease, border-color 200ms ease;
}

.drag-item:active {
  cursor: grabbing;
}

.drag-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.drag-item.dragging {
  opacity: 0.5;
  transform: scale(0.97);
}

.drag-item.drag-target {
  border-color: var(--primary);
  background: rgba(47, 107, 255, 0.06);
}

.drag-handle {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
  opacity: 0.4;
  flex-shrink: 0;
}

.drag-handle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
}

.drag-item:hover .drag-handle {
  opacity: 0.8;
}

.drag-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.drag-item.is-correct .drag-number {
  background: var(--success-light);
  color: var(--success);
}

.drag-item.is-wrong .drag-number {
  background: var(--danger-light);
  color: var(--danger);
}

.drag-item-text {
  flex: 1;
  font-size: 0.95rem;
}

.drag-item-sub {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

/* --- 连线匹配 --- */
.match-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  position: relative;
}

.match-column {
  display: grid;
  gap: 10px;
}

.match-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: transform 180ms var(--ease-out), border-color 180ms ease, box-shadow 180ms ease;
  font-size: 0.95rem;
}

.match-item:hover {
  border-color: var(--primary);
  transform: scale(1.02);
}

.match-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.15);
}

.match-item.matched {
  border-color: var(--success);
  background: var(--success-light);
  cursor: default;
  opacity: 0.85;
}

.match-item.wrong {
  border-color: var(--danger);
  background: var(--danger-light);
  animation: shake 400ms var(--ease-out);
}

.match-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fefeff;
}

.match-column:first-child .match-icon { background: var(--primary); }
.match-column:last-child .match-icon { background: var(--violet); }

.match-lines-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.match-line {
  stroke: var(--success);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  fill: none;
  opacity: 0;
  transition: opacity 300ms ease;
}

.match-line.visible {
  opacity: 0.7;
}

.match-line.wrong-line {
  stroke: var(--danger);
}

/* --- 翻转卡牌 --- */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.flip-card {
  perspective: 800px;
  height: 180px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 500ms var(--ease-smooth);
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  backface-visibility: hidden;
}

.flip-card-front {
  background: var(--primary-light);
  border: 2px solid var(--primary);
}

.flip-card-front .flip-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.flip-card-front h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--primary-deep);
}

.flip-card-front p {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.flip-card-back {
  background: var(--violet-light);
  border: 2px solid var(--violet);
  transform: rotateY(180deg);
}

.flip-card-back p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

.flip-card-back .flip-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 8px;
}

.flip-card.flipped .flip-card-front {
  display: none;
}

.flip-card .flip-flip-hint {
  font-size: 0.78rem;
  color: var(--primary);
  margin-top: 6px;
  opacity: 0.7;
}

/* 不同颜色的翻转卡�?*/
.flip-card.coral .flip-card-front { border-color: var(--coral); background: var(--coral-light); }
.flip-card.coral .flip-card-front h4 { color: var(--coral); }
.flip-card.emerald .flip-card-front { border-color: var(--emerald); background: var(--emerald-light); }
.flip-card.emerald .flip-card-front h4 { color: var(--emerald); }
.flip-card.amber .flip-card-front { border-color: var(--amber); background: var(--amber-light); }
.flip-card.amber .flip-card-front h4 { color: var(--amber); }

/* --- 填词组装 --- */
.fill-blank-area {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.fill-sentence {
  font-size: 1.05rem;
  line-height: 2.2;
  color: var(--text);
  margin-bottom: 16px;
}

.fill-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 36px;
  padding: 4px 14px;
  margin: 0 4px;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.8);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  vertical-align: middle;
  transition: border-color 200ms ease, background 200ms ease, transform 200ms var(--ease-out);
}

.fill-slot.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.05);
}

.fill-slot.filled {
  border-style: solid;
  border-color: var(--primary);
  background: var(--primary-light);
  cursor: pointer;
}

.fill-slot.correct {
  border-color: var(--success);
  background: var(--success-light);
  color: #19693c;
}

.fill-slot.wrong {
  border-color: var(--danger);
  background: var(--danger-light);
  color: #a33a40;
  animation: shake 400ms var(--ease-out);
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.word-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--primary-light);
  border: 1px solid rgba(47, 107, 255, 0.18);
  color: var(--primary-deep);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: grab;
  user-select: none;
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease, opacity 200ms ease;
}

.word-chip:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: var(--shadow-sm);
}

.word-chip:active {
  cursor: grabbing;
  transform: scale(0.96);
}

.word-chip.used {
  opacity: 0.35;
  pointer-events: none;
  transform: scale(0.95);
}

/* --- 奖励弹出 --- */
.reward-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--success), var(--emerald));
  color: #fefeff;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 0 12px 40px rgba(52, 199, 89, 0.30);
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: transform 500ms var(--ease-out), opacity 400ms ease;
}

.reward-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --- 成绩总结�?--- */
.result-card {
  padding: 28px;
  border-radius: var(--radius-xl);
  background: var(--primary-light);
  border: 2px solid var(--primary);
  text-align: center;
  animation: fadeSlideIn 500ms var(--ease-smooth);
}

.result-card h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.result-score {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  margin: 12px 0;
}

.result-msg {
  color: var(--muted);
  margin-bottom: 16px;
}

/* --- 动画关键�?--- */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.08); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes confettiFall {
  0% {
    transform: translateY(-10px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  z-index: 1001;
  pointer-events: none;
  animation: confettiFall 2.5s ease-in forwards;
}

/* --- 响应�?--- */
@media (max-width: 1080px) {
  .site-header,
  .lesson-layout,
  .hero-card,
  .split-card,
  .intro-grid,
  .recap-grid,
  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .lesson-sidebar {
    position: static;
  }

  .match-board {
    grid-template-columns: 1fr;
  }

  .flip-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100vw - 20px, 100%);
    padding: 16px 0 28px;
  }

  .site-header,
  .overview-card,
  .content-card,
  .sidebar-card {
    padding: 20px;
    border-radius: 22px;
  }

  .header-nav,
  .section-heading,
  .lesson-footer-nav {
    justify-content: start;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-year {
    width: fit-content;
    padding: 8px 14px;
  }

  .flip-card {
    height: 150px;
  }

  .quest-progress {
    flex-wrap: wrap;
  }
}
