:root {
  --bg: #f3efe3;
  --panel: rgba(255, 251, 242, 0.88);
  --ink: #1e2b24;
  --muted: #5f6e64;
  --line: rgba(54, 77, 64, 0.14);
  --accent: #cf5c36;
  --accent-deep: #9f3d22;
  --leaf: #5a7d4d;
  --shadow: 0 20px 60px rgba(53, 49, 37, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(208, 166, 79, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(90, 125, 77, 0.18), transparent 22%),
    linear-gradient(180deg, #f7f2e6 0%, #efe8d6 100%);
}

img { max-width: 100%; display: block; }
.page-shell { width: min(1180px, calc(100% - 32px)); margin: 18px auto 32px; padding-top: 100px; }
.hero {
  background: linear-gradient(145deg, rgba(255, 249, 238, 0.95), rgba(247, 235, 214, 0.95));
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px 24px 0;
  flex-wrap: wrap;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(255, 249, 238, 0.98), rgba(247, 235, 214, 0.98));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(53, 49, 37, 0.08);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--leaf), #7ba36d);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-title, .brand-subtitle, .eyebrow, .hero-card-label, .card-tag, .section-heading span, .score-board p, .assistant-tip, .stream-status { margin: 0; }
.brand-title { font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 700; }
.brand-subtitle { color: var(--muted); font-size: 0.95rem; }
.nav-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.nav-tab, .action-btn, .preset-chip {
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-tab {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font-weight: 600;
}

.nav-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(207, 92, 54, 0.24);
}

.hero-content { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr); gap: 28px; padding: 40px 24px 32px; }
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.eyebrow {
  color: var(--accent-deep);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  opacity: 0.92;
}

.hero-copy h1 {
  margin: 12px 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 28ch;
  text-wrap: pretty;
  color: #0f1a14;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  overflow-wrap: break-word;
  word-break: keep-all;
}

.hero-copy p, .feature-card p, .knowledge-copy p, .assistant-tip, .quiz-explanation, .answer-box, .assistant-config label span, .prompt-box span {
  color: var(--muted);
  line-height: 1.75;
}
.hero-copy > p {
  margin: 0;
  max-width: 56ch;
  font-size: 1.02rem;
  line-height: 1.9;
}

.hero-actions, .assistant-actions, .practice-meta, .preset-prompts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions { margin-top: 28px; }
.action-btn { padding: 13px 18px; border-radius: 14px; font-weight: 700; }
.action-btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 30px rgba(207, 92, 54, 0.24);
}
.action-btn.secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border: 1px solid rgba(95, 110, 100, 0.2);
}
.action-btn:hover, .preset-chip:hover, .nav-tab:hover { transform: translateY(-1px); }

.hero-panel { display: flex; align-items: end; }
.hero-card, .feature-card, .knowledge-card, .quiz-card, .assistant-config, .assistant-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-card {
  width: 100%;
  border-radius: 26px;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(250, 240, 230, 0.85) 50%, rgba(246, 217, 199, 0.85) 100%),
    linear-gradient(180deg, rgba(255, 251, 242, 0.95), rgba(248, 244, 229, 0.95));
  border: 1.5px solid rgba(207, 92, 54, 0.12);
  box-shadow:
    0 20px 60px rgba(53, 49, 37, 0.1),
    0 8px 24px rgba(207, 92, 54, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(207, 92, 54, 0.2), transparent);
  z-index: 1;
}

.hero-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 30px 80px rgba(53, 49, 37, 0.15),
    0 12px 32px rgba(207, 92, 54, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border-color: rgba(207, 92, 54, 0.2);
}

.hero-card-label, .card-tag, .section-heading span {
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card-label {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(90deg, rgba(207, 92, 54, 0.1), rgba(90, 125, 77, 0.1));
  border-radius: 999px;
  border: 1px solid rgba(207, 92, 54, 0.15);
  margin-bottom: 20px;
  backdrop-filter: blur(4px);
}

.hero-points, .knowledge-list { margin: 16px 0 0; padding-left: 18px; line-height: 1.85; }

.hero-points {
  margin: 20px 0 0;
  padding-left: 0;
  list-style: none;
}

.hero-points li {
  position: relative;
  padding: 12px 16px 12px 48px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  border: 1px solid rgba(95, 110, 100, 0.08);
  transition: all 0.2s ease;
  font-size: 0.98rem;
  line-height: 1.6;
}

.hero-points li:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
  border-color: rgba(207, 92, 54, 0.2);
  box-shadow: 0 6px 16px rgba(53, 49, 37, 0.06);
}

.hero-points li::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}
main { margin-top: 22px; }
.tab-panel { display: none; animation: fadeUp 0.4s ease; }
.tab-panel.active { display: block; }
.section-heading { margin-bottom: 18px; }
.section-heading h2 {
  margin: 8px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
}

.knowledge-switcher {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.knowledge-switch {
  padding: 12px 16px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.knowledge-switch:hover {
  transform: translateY(-1px);
}

.knowledge-switch.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(207, 92, 54, 0.24);
}

.feature-grid, .knowledge-grid, .quiz-list { display: grid; gap: 18px; }
.feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-card, .quiz-card, .assistant-config, .assistant-panel { padding: 24px; border-radius: 24px; }
.lab-shell {
  display: grid;
  gap: 18px;
}

.lab-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 22px 24px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.lab-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  max-width: 68ch;
}

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

.lab-frame-wrap {
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: rgba(255, 251, 242, 0.7);
}

.lab-frame {
  display: block;
  width: 100%;
  min-height: 1220px;
  border: 0;
  background: #f6f1df;
}
.knowledge-grid { grid-template-columns: 1fr; }
.knowledge-grid .knowledge-panel { display: none; }
.knowledge-grid .knowledge-panel.active { display: grid; }
.knowledge-card {
  border-radius: 28px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 28px;
  align-items: center;
  min-height: 360px;
}
.knowledge-card.spotlight {
  background: linear-gradient(135deg, rgba(250, 235, 223, 0.95), rgba(248, 244, 229, 0.95)), var(--panel);
}
.knowledge-card.wide {
  grid-template-columns: 1fr;
  min-height: auto;
}
#knowledge-5 {
  --knowledge-five-pad: 28px;
  overflow: hidden;
}
.knowledge-card.wide img {
  justify-self: center;
}
.knowledge-card img {
  width: 100%;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 240, 220, 0.9));
  border: 1px solid rgba(95, 110, 100, 0.12);
  min-height: 260px;
  object-fit: cover;
}
#knowledge-5 img {
  width: calc(100% + (var(--knowledge-five-pad) * 2));
  max-width: none;
  margin: 8px calc(var(--knowledge-five-pad) * -1) calc(var(--knowledge-five-pad) * -1);
  min-height: auto;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
}
#knowledge-2 img {
  min-height: 560px;
}
.knowledge-copy h3 {
  margin: 10px 0 14px;
  font-family: FangSong, "FangSong_GB2312", STFangsong, serif;
  font-size: clamp(1.55rem, 2.6vw, 2.3rem);
}
.knowledge-copy p {
  font-family: FangSong, "FangSong_GB2312", STFangsong, serif;
  font-size: 1.04rem;
}
.knowledge-list {
  font-family: FangSong, "FangSong_GB2312", STFangsong, serif;
  font-size: 1rem;
}
.two-column-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.practice-meta { justify-content: space-between; margin-bottom: 18px; }
.generated-meta { margin-top: 28px; }
.score-board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 18px;
  min-width: 180px;
}
.score-board strong { display: block; margin-top: 6px; font-size: 1.4rem; }
.question-bank-note {
  margin: -6px 0 18px;
  color: var(--muted);
  line-height: 1.75;
}
.quiz-source {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.quiz-card h3 { margin-top: 0; line-height: 1.6; }
.option-list { display: grid; gap: 10px; margin: 18px 0; }
.option-item {
  display: flex;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(95, 110, 100, 0.12);
}
.option-item input { margin-top: 5px; }
.quiz-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.quiz-result { font-weight: 700; }
.quiz-result.correct { color: #23633f; }
.quiz-result.wrong { color: #a13722; }
.quiz-explanation {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(246, 217, 199, 0.36);
  display: none;
}
.quiz-explanation.visible { display: block; }

.assistant-layout { display: grid; grid-template-columns: 1fr; gap: 18px; }
.prompt-box { display: block; margin-top: 14px; }
.prompt-box textarea {
  width: 100%;
  margin-top: 8px;
  border-radius: 14px;
  border: 1px solid rgba(95, 110, 100, 0.2);
  padding: 12px 14px;
  font: inherit;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}
.preset-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(246, 217, 199, 0.7);
  color: var(--accent-deep);
  font-weight: 700;
}
.assistant-actions { margin-top: 16px; }
.stream-status { margin-top: 18px; font-weight: 700; }
.answer-box {
  min-height: 260px;
  margin-top: 12px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(95, 110, 100, 0.12);
  white-space: pre-wrap;
}
.answer-placeholder { margin: 0; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
  .hero-content, .feature-grid, .two-column-list, .knowledge-card, .knowledge-card.spotlight {
    grid-template-columns: 1fr;
  }

  .lab-toolbar {
    padding: 18px;
  }

  .knowledge-card {
    min-height: auto;
    padding: 20px;
    gap: 20px;
  }

  #knowledge-5 {
    --knowledge-five-pad: 20px;
  }

  .knowledge-card img {
    min-height: 220px;
  }

  #knowledge-2 img {
    min-height: 420px;
  }

  .hero-card {
    padding: 24px;
  }

  .hero-points li {
    padding: 10px 14px 10px 40px;
  }

  .hero-copy h1 {
    font-size: clamp(1.95rem, 3.8vw, 3rem);
    max-width: none;
  }

  .topbar {
    padding-top: 18px;
  }

  .page-shell {
    padding-top: 90px;
  }
}

@media (max-width: 640px) {
  .page-shell { width: min(100% - 20px, 1180px); }
  .hero-copy h1 {
    max-width: none;
    text-wrap: pretty;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    line-height: 1.25;
    margin: 10px 0 16px;
  }

  .hero-copy > p {
    max-width: none;
  }

  .lab-frame {
    min-height: 980px;
  }

  .topbar, .hero-content { padding-left: 16px; padding-right: 16px; }
  .feature-card, .knowledge-card, .quiz-card, .assistant-panel { padding: 18px; }
  #knowledge-5 {
    --knowledge-five-pad: 18px;
  }
  .hero-card {
    padding: 20px;
    border-radius: 22px;
  }

  .hero-card-label {
    padding: 5px 12px;
    font-size: 0.75rem;
    margin-bottom: 16px;
  }

  .hero-points li {
    padding: 8px 12px 8px 36px;
    font-size: 0.92rem;
    margin-bottom: 8px;
  }

  .hero-points li::before {
    left: 12px;
    width: 6px;
    height: 6px;
  }

  .knowledge-switcher { gap: 8px; }
  .knowledge-switch { width: calc(50% - 4px); text-align: center; }

  .topbar {
    padding-top: 16px;
  }

  .page-shell {
    padding-top: 80px;
  }
}
