:root {
  --bg: #FFF7EE;
  --card: #FFFFFF;
  --text: #2E221A;
  --muted: #7A6A5C;
  --line: #E8DCCB;
  --tag: #F3E6D3;
  --primary: #D9483B;
  --green: #2E8B57;
  --blue: #3A6EA5;
  --radius: 24px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  font-size: 24px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
.transcript { -webkit-user-select: text; user-select: text; }

/* ---------- 页面骨架 ---------- */
.screen {
  display: none;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}
.screen.active { display: flex; }
.grow { flex: 1; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.center-text { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.back {
  background: none; border: none; font: inherit;
  font-size: 28px; font-weight: 600; color: var(--blue);
  padding: 12px 16px 12px 0; min-height: 64px; cursor: pointer;
}

/* ---------- 文字 ---------- */
.hero { font-size: 88px; line-height: 1; margin-bottom: 8px; }
.greeting { font-size: 46px; font-weight: 800; margin: 8px 0; line-height: 1.3; }
.sub { font-size: 28px; color: var(--muted); margin: 4px 0; }
.count { font-size: 24px; color: var(--muted); margin-top: 24px; }
.hint { font-size: 24px; color: var(--muted); margin: 0; }
.title { font-size: 36px; font-weight: 800; margin: 0; }
.muted { color: var(--muted); font-weight: 500; font-size: 26px; }
.meta { color: var(--muted); font-size: 22px; margin: 0; }
.status { color: var(--blue); font-size: 22px; margin: 0; min-height: 0; }
.status:empty { display: none; }

.question { font-size: 38px; font-weight: 700; line-height: 1.45; margin: 12px 0; }
.question.small { font-size: 28px; font-weight: 600; margin: 0; }
.tag {
  display: inline-block; background: var(--tag); color: var(--muted);
  border-radius: 999px; padding: 6px 18px; font-size: 22px; font-weight: 600;
}
.answered-note { font-size: 22px; color: var(--green); margin: 0; }

/* ---------- 大按钮 ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 96px; padding: 16px 20px;
  border: none; border-radius: var(--radius);
  font: inherit; font-size: 30px; font-weight: 700;
  color: #fff; background: var(--blue);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .14);
  cursor: pointer;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .14); }
.btn:disabled { opacity: .6; }
.btn.primary { background: var(--primary); min-height: 124px; font-size: 34px; }
.btn.green { background: var(--green); min-height: 124px; font-size: 34px; }
.btn.secondary { background: var(--card); color: var(--text); border: 3px solid var(--line); box-shadow: 0 6px 0 var(--line); }
.btn.text { background: transparent; color: var(--muted); box-shadow: none; min-height: 72px; font-size: 26px; font-weight: 500; }
.btn.text:active { transform: none; }
.btn[hidden] { display: none; }

/* ---------- 录音中：内容压紧一点，保证「讲完了」不用滚动就能看到 ---------- */
#screen-recording { gap: 12px; }
#screen-recording .question.small {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#screen-recording .transcript { flex-basis: 100px; min-height: 100px; }
#screen-recording .btn.text { min-height: 56px; }

.rec-circle {
  position: relative; width: 150px; height: 150px; margin: 4px auto;
  border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 68px; box-shadow: 0 10px 30px rgba(217, 72, 59, .35);
}
.rec-circle::before {
  content: ""; position: absolute; inset: -16px; border-radius: 50%;
  border: 6px solid rgba(217, 72, 59, .4);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.9); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}
.timer { font-size: 48px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.1; }

.transcript {
  background: var(--card); border: 2px solid var(--line); border-radius: 20px;
  padding: 18px 20px; font-size: 26px; line-height: 1.6;
  flex: 1 1 140px; min-height: 140px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
}
.transcript.empty { color: var(--muted); }

/* ---------- 故事列表 ---------- */
.card {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: 20px;
  padding: 18px 20px; font: inherit; color: var(--text); cursor: pointer;
  box-shadow: 0 4px 0 var(--line);
}
.card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.card-q { font-size: 26px; font-weight: 700; line-height: 1.4; }
.card-meta { font-size: 22px; color: var(--muted); margin-top: 6px; }
.card-arrow { float: right; color: var(--blue); font-size: 30px; margin-left: 12px; }
.empty-note { color: var(--muted); font-size: 24px; text-align: center; }

.big-check { font-size: 120px; line-height: 1; }
.demo-badge {
  position: fixed; top: 6px; right: 8px; z-index: 5;
  font-size: 14px; background: #333; color: #fff; padding: 2px 8px; border-radius: 6px; opacity: .7;
}

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal[hidden] { display: none; }
.modal-box {
  background: var(--card); border-radius: 24px; padding: 28px 24px;
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column; gap: 16px; text-align: center;
}
.modal-box h2 { font-size: 32px; margin: 0; }
.modal-box p { font-size: 26px; margin: 0; color: var(--muted); }
