:root {
  --bg: #f6f0e6;
  --panel: rgba(255, 252, 246, 0.78);
  --panel-strong: rgba(255, 250, 242, 0.92);
  --line: rgba(83, 62, 41, 0.12);
  --text: #2f241a;
  --muted: #6e5a49;
  --accent: #8c5e34;
  --accent-soft: #d7b491;
  --accent-deep: #5b3a24;
  --green: #597258;
  --shadow: 0 22px 60px rgba(72, 47, 29, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  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(217, 177, 132, 0.35), transparent 28%),
    radial-gradient(circle at top right, rgba(139, 173, 144, 0.18), transparent 22%),
    linear-gradient(180deg, #f9f5ed 0%, #efe6d8 100%);
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

.page-shell {
  position: relative;
  width: min(1200px, calc(100% - 24px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.ambient {
  position: fixed;
  inset: auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.6;
  pointer-events: none;
}

.ambient-left {
  top: 90px;
  left: -60px;
  background: rgba(183, 124, 73, 0.18);
}

.ambient-right {
  right: -50px;
  top: 280px;
  background: rgba(99, 141, 108, 0.18);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xl);
  background: linear-gradient(140deg, rgba(255, 250, 242, 0.88), rgba(243, 235, 223, 0.8));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.88rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  font-size: clamp(2rem, 3vw, 3.6rem);
  line-height: 1.06;
}

.hero-text {
  max-width: 42rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.hero-panel {
  display: grid;
  gap: 14px;
  align-self: stretch;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.46);
}

.panel-stat {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(83, 62, 41, 0.08);
}

.panel-stat:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.label {
  color: var(--muted);
  font-size: 0.9rem;
}

.panel-stat strong {
  font-size: 1.2rem;
}

.panel-note {
  align-self: end;
  padding: 14px;
  border-radius: 18px;
  background: rgba(90, 58, 34, 0.06);
  color: var(--accent-deep);
  line-height: 1.7;
}

.content {
  margin-top: 20px;
}

.toolbar,
.summary-bar,
.random-highlight,
.empty-state {
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: var(--radius-lg);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.toolbar {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip,
.action-button,
.back-to-top,
.question-toggle {
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.chip {
  border: 1px solid rgba(92, 64, 38, 0.14);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
}

.chip:hover,
.chip.is-active {
  border-color: rgba(140, 94, 52, 0.28);
  background: rgba(217, 180, 145, 0.32);
  transform: translateY(-1px);
}

.search-box {
  display: grid;
  gap: 10px;
}

.search-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.search-box input {
  width: 100%;
  border: 1px solid rgba(92, 64, 38, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  outline: none;
}

.search-box input:focus {
  border-color: rgba(140, 94, 52, 0.38);
  box-shadow: 0 0 0 4px rgba(140, 94, 52, 0.08);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.action-button {
  border: 1px solid rgba(92, 64, 38, 0.14);
  border-radius: 16px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
}

.action-button.primary {
  border-color: rgba(92, 64, 38, 0.18);
  background: linear-gradient(135deg, #8d6238, #c79c72);
  color: #fffaf3;
}

.action-button:hover,
.back-to-top:hover,
.question-card.is-highlighted .question-toggle {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(86, 57, 32, 0.14);
}

.summary-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
}

.summary-card {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
}

.summary-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.random-highlight {
  margin-top: 18px;
  padding: 16px 18px;
}

.random-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(89, 114, 88, 0.12);
  color: var(--green);
  font-size: 0.84rem;
}

.random-highlight p {
  margin: 12px 0 0;
  line-height: 1.8;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.question-card {
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 22px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: card-enter 360ms ease both;
}

.question-card.is-highlighted {
  outline: 2px solid rgba(89, 114, 88, 0.42);
  outline-offset: 4px;
}

.question-toggle {
  width: 100%;
  border: none;
  padding: 18px 18px 16px;
  text-align: left;
  color: inherit;
  background: transparent;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.subject-pill,
.order-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.subject-pill {
  background: rgba(89, 114, 88, 0.12);
  color: var(--green);
}

.order-pill {
  background: rgba(140, 94, 52, 0.1);
  color: var(--accent-deep);
}

.question-title {
  margin: 0;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  font-size: 1.18rem;
  line-height: 1.6;
}

.toggle-hint {
  display: inline-block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.question-card.is-open .toggle-hint {
  color: var(--accent);
}

.answer-panel {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.answer-panel[hidden] {
  display: none;
}

.answer-panel p {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(250, 245, 236, 0.88);
  border: 1px solid rgba(92, 64, 38, 0.08);
  line-height: 1.8;
  color: #433324;
}

.empty-state {
  margin-top: 24px;
  padding: 28px 20px;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
}

.empty-state p {
  margin: 12px 0 0;
  color: var(--muted);
}

.back-to-top {
  position: fixed;
  right: max(18px, calc((100vw - min(1200px, calc(100vw - 24px))) / 2 + 12px));
  bottom: 22px;
  border: none;
  border-radius: 999px;
  padding: 13px 16px;
  background: rgba(47, 36, 26, 0.92);
  color: #fff9f0;
  box-shadow: 0 16px 30px rgba(47, 36, 26, 0.2);
  opacity: 0;
  pointer-events: none;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@keyframes card-enter {
  from {
    transform: translateY(10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .summary-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 16px, 1000px);
    padding-top: 16px;
  }

  .hero,
  .toolbar,
  .summary-bar {
    padding: 18px;
  }

  .question-grid {
    grid-template-columns: 1fr;
  }

  .question-toggle {
    padding: 16px 16px 14px;
  }

  .answer-panel {
    padding: 0 16px 16px;
  }

  .back-to-top {
    right: 12px;
    bottom: 12px;
  }
}
