:root {
  --bg: #0f1020;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --text: #f8fafc;
  --muted: #c8c7d9;
  --gold: #f5c46b;
  --violet: #9b7cff;
  --line: rgba(255, 255, 255, 0.16);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.36);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(155, 124, 255, 0.28), transparent 34rem),
    radial-gradient(circle at 88% 22%, rgba(245, 196, 107, 0.16), transparent 28rem),
    linear-gradient(145deg, #080914, #17132d 52%, #0b1426);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.book-shell {
  width: min(920px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 26px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.back-link:hover { color: var(--gold); }

.hero {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(42px, 9vw, 86px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.question-card,
.history-panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(13, 16, 35, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-weight: 800;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  line-height: 1.6;
}

textarea:focus {
  border-color: rgba(245, 196, 107, 0.76);
  box-shadow: 0 0 0 4px rgba(245, 196, 107, 0.14);
}

button {
  min-height: 48px;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  color: #17111f;
  background: linear-gradient(135deg, #f6d184, #f0a954);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

button:hover { transform: translateY(-1px); filter: brightness(1.04); }
button:active { transform: translateY(0); }

.answer-card {
  margin-top: 22px;
  min-height: 220px;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid rgba(245, 196, 107, 0.28);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(245, 196, 107, 0.14), rgba(155, 124, 255, 0.16)),
    var(--panel);
}

.answer-card.is-turning {
  animation: turnPage 0.46s ease;
}

.answer-tone {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.answer-text {
  font-size: clamp(26px, 5vw, 46px);
  line-height: 1.28;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.answer-hint {
  color: var(--muted);
  font-size: 14px;
}

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

button.ghost {
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.history-panel h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

#historyList {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.6;
}

#historyList:empty::after {
  content: "还没有记录。";
  color: rgba(200, 199, 217, 0.72);
}

@keyframes turnPage {
  0% { transform: rotateX(0deg) scale(1); opacity: 0.78; }
  45% { transform: rotateX(8deg) scale(0.985); opacity: 0.38; }
  100% { transform: rotateX(0deg) scale(1); opacity: 1; }
}

@media (max-width: 640px) {
  .book-shell { width: min(100vw - 22px, 920px); padding-top: 18px; }
  .hero, .question-card, .history-panel { border-radius: 20px; padding: 18px; }
  .actions button { width: 100%; }
}
