:root {
  --ink: #1d2743;
  --muted: #5d6a86;
  --line: rgba(36, 73, 132, 0.12);
  --sky: #f3fbff;
  --paper: rgba(255, 255, 255, 0.88);
  --accent: #ff8f3d;
  --accent-deep: #ff6a3d;
  --mint: #34c99a;
  --sun: #ffd44d;
  --blue: #5da8ff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 226, 153, 0.6), transparent 26%),
    radial-gradient(circle at top right, rgba(129, 212, 250, 0.5), transparent 24%),
    linear-gradient(180deg, #f7fcff 0%, #eef7ff 46%, #fdfaf2 100%);
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto auto 0 0;
  width: 28vw;
  height: 28vw;
  max-width: 420px;
  max-height: 420px;
  border-radius: 50%;
  background: rgba(255, 201, 124, 0.12);
  filter: blur(12px);
  pointer-events: none;
}

body::after {
  inset: 8% 6% auto auto;
  width: 24vw;
  height: 24vw;
  max-width: 320px;
  max-height: 320px;
  background: rgba(93, 168, 255, 0.12);
}

.story-shell {
  height: 100vh;
  padding: 0;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3.2vh 3vw;
}

.screen-active {
  display: flex;
}

.screen-card {
  background: var(--paper);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: 0 18px 44px rgba(76, 116, 173, 0.12);
}

.intro-card {
  width: min(92vw, 1560px);
  height: min(90vh, 940px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  gap: 24px;
  padding: 34px 40px;
}

.hero-card {
  display: flex;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 212, 77, 0.24);
  color: #9b6400;
  font-weight: 700;
  font-size: 18px;
}

.hero-copy h1 {
  margin: 14px 0 12px;
  font-size: clamp(40px, 4vw, 64px);
  line-height: 1.08;
}

.hero-status {
  margin: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.6;
}

.hero-badges {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 320px;
}

.bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  min-height: 108px;
  border-radius: 32px;
  font-size: 24px;
  font-weight: 800;
  color: #25456b;
  transform: rotate(-6deg);
}

.bubble-sun {
  background: linear-gradient(135deg, #ffe98a 0%, #ffd24b 100%);
}

.bubble-cloud {
  background: linear-gradient(135deg, #d9efff 0%, #a9d7ff 100%);
  transform: rotate(4deg);
}

.bubble-star {
  background: linear-gradient(135deg, #dff7eb 0%, #8fe3c2 100%);
}

.intro-action {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 34px 36px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82) 0%, rgba(242,248,255,0.9) 100%);
  border: 1px solid rgba(36, 73, 132, 0.08);
}

.intro-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sync-hint {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.stage-ring {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), transparent 30%),
    linear-gradient(135deg, #ffd572 0%, #ff9b56 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 22px 44px rgba(255, 143, 61, 0.25);
}

.stage-ring.recording {
  animation: pulseRing 1.4s ease-in-out infinite;
}

.record-button {
  width: 146px;
  height: 146px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #fff8ec 100%);
  box-shadow: inset 0 -8px 18px rgba(255, 161, 72, 0.22);
  color: var(--accent-deep);
  cursor: pointer;
}

.record-icon {
  font-size: 54px;
  font-weight: 900;
  display: inline-block;
  transform: translateX(3px);
}

.record-button.recording .record-icon {
  transform: none;
}

.action-copy h2 {
  margin: 0 0 10px;
  font-size: 40px;
}

.action-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.6;
}

.timer-chip {
  min-width: 136px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeeff 100%);
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  color: #2b5ea8;
}

.analysis-card,
.overview-card,
.detail-card {
  width: min(92vw, 1560px);
  height: min(90vh, 940px);
}

.analysis-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  padding: 48px;
}

.analysis-orb {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, rgba(255,255,255,0.95), transparent 24%),
    linear-gradient(135deg, #7bd8ff 0%, #34c99a 100%);
  box-shadow: 0 24px 48px rgba(52, 201, 154, 0.24);
  animation: pulseRing 1.5s ease-in-out infinite;
}

.analysis-card h2 {
  margin: 0;
  font-size: clamp(40px, 4vw, 66px);
}

.analysis-text,
.analysis-sub {
  margin: 0;
  font-size: 26px;
  line-height: 1.6;
  color: var(--muted);
}

.overview-card,
.detail-card {
  padding: 30px 34px 34px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.overview-card {
  justify-content: space-between;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.result-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.result-head h2 {
  margin: 0;
  font-size: 42px;
}

.score-orb {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(180deg, #e9fff5 0%, #b8f2d8 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -10px 18px rgba(52, 201, 154, 0.18);
}

.score-orb-label {
  color: #2f7d5f;
  font-size: 18px;
  font-weight: 700;
}

.score-orb strong {
  font-size: 64px;
  line-height: 1;
}

.summary-text {
  margin: 0;
  padding: 22px 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 245, 221, 0.8) 0%, rgba(247, 250, 255, 0.9) 100%);
  color: #33476f;
  font-size: 24px;
  line-height: 1.7;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.metric-item {
  padding: 16px 16px 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(242,248,255,0.92) 100%);
  border: 1px solid rgba(53, 107, 182, 0.1);
}

.metric-name {
  display: block;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 800;
}

.metric-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #e8eef7;
  overflow: hidden;
}

.metric-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7bd8ff 0%, #3ac79c 100%);
  transition: width 0.35s ease;
}

.metric-value {
  display: block;
  margin-top: 14px;
  font-size: 30px;
  color: #1f3d68;
}

.transcript-panel,
.feedback-panel {
  padding: 24px 24px 22px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(36, 73, 132, 0.1);
}

.transcript-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.transcript-head h3,
.feedback-panel h3 {
  margin: 0;
  font-size: 28px;
}

.play-audio-button {
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #5da8ff 0%, #3c89f0 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.play-audio-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.transcript-text {
  margin: 0;
  height: calc(100% - 68px);
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(245, 250, 255, 0.95) 0%, rgba(255, 249, 238, 0.95) 100%);
  color: #374969;
  font-size: 22px;
  line-height: 1.8;
  overflow: auto;
  scrollbar-width: none;
}

.transcript-text::-webkit-scrollbar {
  display: none;
}

.overview-transcript {
  flex: 1;
  min-height: 0;
}

.overview-actions,
.detail-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.detail-head h2 {
  margin: 0;
  font-size: 42px;
}

.feedback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.feedback-panel {
  min-height: 0;
}

.feedback-panel h3 {
  margin-bottom: 16px;
}

.feedback-panel ul {
  margin: 0;
  padding-left: 26px;
  display: grid;
  gap: 10px;
  font-size: 20px;
  line-height: 1.55;
  color: #374969;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-width: 220px;
  padding: 18px 26px;
  border: 0;
  border-radius: 999px;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, #ffb259 0%, #ff7c45 100%);
  color: #fff;
  box-shadow: 0 16px 30px rgba(255, 124, 69, 0.28);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.92);
  color: #35527e;
  border: 1px solid rgba(53, 82, 126, 0.12);
}

.ghost-button {
  min-width: 180px;
  padding: 14px 22px;
  background: rgba(255,255,255,0.86);
  color: #35527e;
  border: 1px solid rgba(53, 82, 126, 0.12);
  font-size: 20px;
}

.story-qr-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(29, 39, 67, 0.2);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.story-qr-modal[hidden] {
  display: none !important;
}

.story-qr-card {
  position: relative;
  width: min(92vw, 520px);
  padding: 28px 26px 24px;
  border-radius: 28px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(36, 73, 132, 0.1);
  box-shadow: 0 20px 48px rgba(76, 116, 173, 0.18);
  text-align: center;
}

.story-qr-card h3 {
  margin: 0 0 18px;
  font-size: 32px;
}

.story-qr-image {
  width: min(72vw, 320px);
  height: auto;
  display: block;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: #fff;
}

.story-qr-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.story-qr-url {
  color: #2563eb;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.qr-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(241, 245, 249, 0.9);
  color: #51627e;
  font-size: 26px;
  cursor: pointer;
}

@keyframes pulseRing {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 22px 44px rgba(255, 143, 61, 0.25);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 28px 52px rgba(255, 106, 61, 0.34);
  }
}

@media (max-width: 1200px) {
  .screen {
    padding: 16px;
  }

  .intro-card,
  .analysis-card,
  .overview-card,
  .detail-card {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    padding: 24px;
  }

  .hero-card,
  .result-head,
  .detail-head,
  .feedback-grid,
  .intro-tools,
  .overview-actions,
  .detail-actions {
    flex-direction: column;
  }

  .intro-action {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .hero-badges {
    justify-content: center;
    min-width: 0;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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