:root {
  color-scheme: light;
  --page-bg:
    radial-gradient(circle at 14% 16%, rgba(204, 216, 255, 0.88), transparent 25%),
    radial-gradient(circle at 82% 20%, rgba(255, 224, 241, 0.88), transparent 28%),
    radial-gradient(circle at 50% 88%, rgba(213, 246, 241, 0.75), transparent 28%),
    linear-gradient(180deg, #f6f9ff 0%, #eef2ff 44%, #f8f3ff 100%);
  --text: #243149;
  --text-soft: #5f6d89;
  --text-faint: #8692ac;
  --line: rgba(255, 255, 255, 0.44);
  --line-soft: rgba(255, 255, 255, 0.24);
  --panel: rgba(255, 255, 255, 0.4);
  --panel-strong: rgba(255, 255, 255, 0.58);
  --shadow: 0 28px 80px rgba(84, 102, 154, 0.16);
  --shadow-soft: 0 14px 36px rgba(107, 124, 176, 0.12);
  --accent: linear-gradient(135deg, #8ca7ff 0%, #caaeff 52%, #ffd7e8 100%);
  --accent-deep: #90a4ff;
  --accent-soft: rgba(149, 164, 255, 0.12);
  --success: #86c6bb;
  --max-width: 468px;
  --page-overlay: rgba(255, 255, 255, 0.22);
  --page-overlay-2: rgba(255, 255, 255, 0.18);
  --panel-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.24));
  --panel-shine: linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 58%);
  --chip-bg: rgba(255, 255, 255, 0.34);
  --chip-border: rgba(255, 255, 255, 0.42);
  --card-bg: rgba(255, 255, 255, 0.34);
  --card-bg-strong: rgba(255, 255, 255, 0.48);
  --button-ghost-bg: rgba(255, 255, 255, 0.32);
  --button-ghost-border: rgba(255, 255, 255, 0.42);
  --progress-track-bg: rgba(255, 255, 255, 0.35);
  --progress-track-border: rgba(255, 255, 255, 0.38);
  --orbit-border: rgba(255, 255, 255, 0.45);
  --orbit-ring: rgba(255, 255, 255, 0.38);
  --orbit-shadow: inset 0 0 48px rgba(255, 255, 255, 0.5);
  --noise-mask: radial-gradient(circle at center, black 40%, transparent 90%);
  --input-shadow: 0 12px 28px rgba(122, 138, 188, 0.08);
  --selected-shadow: 0 16px 34px rgba(140, 154, 207, 0.14);
  --modal-bg: rgba(234, 239, 255, 0.42);
  --icon-bg: rgba(255, 255, 255, 0.46);
  --theme-toggle-bg: rgba(255, 255, 255, 0.42);
  --theme-toggle-indicator: rgba(255, 255, 255, 0.72);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --page-bg:
    radial-gradient(circle at 18% 16%, rgba(85, 98, 173, 0.48), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(141, 92, 164, 0.36), transparent 26%),
    radial-gradient(circle at 50% 86%, rgba(74, 135, 143, 0.28), transparent 24%),
    linear-gradient(180deg, #11162a 0%, #171d33 46%, #151325 100%);
  --text: #eef2ff;
  --text-soft: #b8c2e3;
  --text-faint: #8f99bd;
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 14px 36px rgba(0, 0, 0, 0.22);
  --accent: linear-gradient(135deg, #6e86ff 0%, #9565e8 52%, #dc7bb8 100%);
  --accent-deep: #8092ff;
  --accent-soft: rgba(122, 141, 255, 0.18);
  --success: #78c6bc;
  --page-overlay: rgba(255, 255, 255, 0.06);
  --page-overlay-2: rgba(255, 255, 255, 0.04);
  --panel-bg: linear-gradient(180deg, rgba(29, 36, 63, 0.72), rgba(20, 24, 44, 0.54));
  --panel-shine: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 60%);
  --chip-bg: rgba(255, 255, 255, 0.06);
  --chip-border: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(255, 255, 255, 0.06);
  --card-bg-strong: rgba(255, 255, 255, 0.09);
  --button-ghost-bg: rgba(255, 255, 255, 0.07);
  --button-ghost-border: rgba(255, 255, 255, 0.12);
  --progress-track-bg: rgba(255, 255, 255, 0.08);
  --progress-track-border: rgba(255, 255, 255, 0.08);
  --orbit-border: rgba(255, 255, 255, 0.16);
  --orbit-ring: rgba(255, 255, 255, 0.1);
  --orbit-shadow: inset 0 0 48px rgba(255, 255, 255, 0.04);
  --noise-mask: radial-gradient(circle at center, black 52%, transparent 92%);
  --input-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
  --selected-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  --modal-bg: rgba(10, 14, 29, 0.46);
  --icon-bg: rgba(255, 255, 255, 0.08);
  --theme-toggle-bg: rgba(255, 255, 255, 0.08);
  --theme-toggle-indicator: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--page-bg);
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

.noise-layer,
.aurora,
.halo {
  position: fixed;
  pointer-events: none;
}

.noise-layer {
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(var(--page-overlay) 1px, transparent 1px),
    linear-gradient(90deg, var(--page-overlay-2) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: var(--noise-mask);
}

.aurora {
  border-radius: 50%;
  filter: blur(58px);
  opacity: 0.72;
  animation: drift 18s ease-in-out infinite alternate;
}

.aurora-a {
  width: 360px;
  height: 360px;
  top: 4%;
  left: -110px;
  background: rgba(184, 197, 255, 0.62);
}

.aurora-b {
  width: 380px;
  height: 380px;
  top: 40%;
  right: -130px;
  background: rgba(255, 204, 231, 0.6);
  animation-duration: 21s;
}

.aurora-c {
  width: 280px;
  height: 280px;
  bottom: 2%;
  left: 24%;
  background: rgba(176, 229, 236, 0.52);
  animation-duration: 20s;
}

.halo {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  opacity: 0.34;
}

.halo-a {
  width: 620px;
  height: 620px;
  top: -120px;
  right: -140px;
}

.halo-b {
  width: 520px;
  height: 520px;
  bottom: -160px;
  left: -100px;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px 16px 28px;
}

.screen {
  display: none;
  width: min(100%, var(--max-width));
  animation: fade-up 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.screen-active {
  display: block;
}

.screen-visible {
  animation: fade-up 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.glass-panel {
  position: relative;
  overflow: hidden;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px);
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--panel-shine);
  pointer-events: none;
}

.hero-panel,
.quiz-panel,
.analysis-panel,
.result-panel {
  padding: 24px;
}

.hero-panel {
  min-height: calc(100vh - 46px);
  display: grid;
  align-content: space-between;
  gap: 16px;
}

.hero-top,
.hero-copy,
.hero-actions,
.brand-meta {
  position: relative;
  z-index: 1;
}

.hero-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.hero-top-actions {
  flex: 0 0 auto;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 10vw, 50px);
  line-height: 1.06;
  font-weight: 700;
}

h2 {
  font-size: 30px;
  line-height: 1.22;
  font-weight: 700;
}

h3 {
  font-size: 15px;
  font-weight: 700;
}

.hero-chip-row,
.result-actions,
.poster-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-chip-row {
  flex-wrap: wrap;
  margin-top: 14px;
}

.hero-chip,
.quiz-mode,
.result-badge-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  font-size: 12px;
}

.theme-toggle {
  padding: 4px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  background: var(--theme-toggle-bg);
  box-shadow: var(--shadow-soft);
}

.theme-toggle-track {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-width: 126px;
}

.theme-toggle-option {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--text-soft);
  font-size: 12px;
}

.theme-toggle-option.is-active {
  background: var(--theme-toggle-indicator);
  color: var(--text);
}

.theme-toggle-compact {
  width: 100%;
}

.hero-copy {
  display: grid;
  gap: 14px;
}

.hero-subtitle,
.hero-note,
.analysis-status,
.analysis-note,
.footer-tip,
.result-card p,
.result-tags,
.preview-label,
.preview-item span,
.hero-footer-item span,
.loading-copy,
.brand-meta,
.result-badge-panel p,
.analysis-log li,
.progress-label,
.question-index {
  color: var(--text-soft);
}

.hero-subtitle,
.result-card p,
.analysis-note,
.analysis-status,
.result-badge-panel p {
  line-height: 1.75;
}

.hero-stage {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}

.hero-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 176px;
  height: 176px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid var(--orbit-border);
  box-shadow: var(--orbit-shadow);
}

.hero-orbit::before,
.hero-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--orbit-ring);
}

.hero-orbit::before {
  inset: 12px;
}

.hero-orbit::after {
  inset: 28px;
}

.orbit-core {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 28px;
  background: var(--accent);
  box-shadow: 0 18px 34px rgba(146, 164, 255, 0.3);
}

.orbit-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.7);
}

.orbit-dot-a {
  top: 18px;
  right: 30px;
}

.orbit-dot-b {
  left: 24px;
  bottom: 28px;
}

.hero-preview-card,
.result-badge-panel {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--card-bg-strong), var(--card-bg));
  border: 1px solid var(--chip-border);
  box-shadow: var(--shadow-soft);
}

.preview-label {
  font-size: 13px;
  margin-bottom: 12px;
}

.preview-grid,
.result-grid,
.analysis-log {
  display: grid;
  gap: 12px;
}

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

.preview-item {
  padding: 14px;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--chip-border);
  display: grid;
  gap: 6px;
}

.preview-item strong,
.hero-footer-item strong,
.result-badge-panel strong {
  font-weight: 700;
  color: var(--text);
}

.preview-item strong {
  font-size: 17px;
  line-height: 1.45;
}

.preview-item-wide {
  grid-column: 1 / -1;
}

.hero-actions {
  display: grid;
  gap: 12px;
}

.hero-note {
  font-size: 13px;
}

.brand-meta {
  display: grid;
  gap: 4px;
  font-size: 12px;
  line-height: 1.65;
  margin-top: 4px;
}

.brand-meta-result {
  margin-top: 8px;
}

.primary-button,
.ghost-button,
.option-button,
.icon-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.24s ease, box-shadow 0.24s ease, background 0.24s ease, opacity 0.24s ease, border-color 0.24s ease;
}

.primary-button,
.ghost-button {
  min-height: 56px;
  border-radius: 18px;
  padding: 0 20px;
}

.primary-button {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 18px 36px rgba(150, 166, 255, 0.3);
}

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

.primary-button:active,
.ghost-button:active,
.option-button:active,
.icon-button:active {
  transform: scale(0.985);
}

.glow-button {
  animation: breathe 2.8s ease-in-out infinite;
}

.quiz-panel,
.analysis-panel,
.result-panel {
  min-height: calc(100vh - 46px);
  display: flex;
  flex-direction: column;
}

.quiz-topbar,
.question-block,
.quiz-footer,
.analysis-panel,
.result-panel {
  position: relative;
  z-index: 1;
}

.quiz-topbar {
  display: grid;
  gap: 12px;
}

.quiz-topbar-row,
.quiz-footer,
.result-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-label,
.question-index,
.quiz-mode {
  font-size: 12px;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--progress-track-bg);
  overflow: hidden;
  border: 1px solid var(--progress-track-border);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s ease;
}

.question-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 22px 0;
}

.question-enter {
  animation: question-rise 0.4s ease;
}

#question-title {
  font-size: 29px;
  line-height: 1.48;
}

.question-caption {
  margin-top: -6px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-faint);
}

.options {
  display: grid;
  gap: 12px;
}

.option-button {
  position: relative;
  overflow: hidden;
  min-height: 76px;
  padding: 14px 16px;
  border-radius: 22px;
  text-align: left;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--chip-border);
  box-shadow: var(--input-shadow);
}

.option-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 70%);
  pointer-events: none;
}

.option-button:hover,
.option-button.selected {
  transform: translateY(-2px);
  box-shadow: var(--selected-shadow);
}

.option-button.selected {
  background: var(--card-bg-strong);
  border-color: rgba(149, 165, 255, 0.54);
  animation: selection-bounce 0.36s ease;
}

.option-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: center;
}

.option-key {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card-bg-strong);
  border: 1px solid var(--chip-border);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.option-text {
  line-height: 1.62;
}

.quiz-footer {
  align-items: flex-end;
}

.footer-tip {
  max-width: 210px;
  text-align: right;
  font-size: 13px;
  line-height: 1.65;
}

.analysis-panel,
.result-panel {
  justify-content: center;
  gap: 18px;
}

.analysis-ring {
  width: 144px;
  height: 144px;
  margin: 10px auto 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.94) 0 44%, transparent 45%),
    conic-gradient(from 180deg, #b3c2ff, #dcb4ff, #95d7d1, #b3c2ff);
  box-shadow: inset 0 0 36px rgba(255, 255, 255, 0.9), 0 16px 38px rgba(145, 159, 219, 0.2);
}

body[data-theme="dark"] .analysis-ring {
  background:
    radial-gradient(circle at center, rgba(16, 22, 42, 0.98) 0 44%, transparent 45%),
    conic-gradient(from 180deg, #8092ff, #b07fff, #6fcbc6, #8092ff);
  box-shadow: inset 0 0 36px rgba(255, 255, 255, 0.08), 0 16px 38px rgba(0, 0, 0, 0.32);
}

.analysis-ring span {
  font-size: 28px;
  font-weight: 700;
}

.analysis-track {
  margin-top: -2px;
}

.analysis-status,
.analysis-note {
  text-align: center;
}

.analysis-status {
  animation: pulse-text 1.8s ease-in-out infinite;
}

.analysis-note {
  font-size: 13px;
}

.analysis-log {
  padding: 0;
  margin: 0;
  list-style: none;
  gap: 10px;
}

.analysis-log li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  opacity: 0.5;
  transition: opacity 0.24s ease, color 0.24s ease;
}

.analysis-log li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(154, 166, 255, 0.45);
}

.analysis-log li.active,
.analysis-log li.done {
  opacity: 1;
  color: var(--text);
}

.analysis-log li.done::before {
  background: var(--success);
}

.result-panel {
  justify-content: flex-start;
  padding-top: 30px;
}

.result-hero {
  align-items: stretch;
}

.result-hero-copy {
  flex: 1;
  display: grid;
  gap: 10px;
}

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

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--card-bg-strong), var(--card-bg));
  border: 1px solid var(--chip-border);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1;
}

.result-subtitle {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-soft);
}

.result-badge-panel {
  width: 176px;
  flex: 0 0 176px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.result-badge-top {
  display: grid;
  gap: 10px;
}

.result-badge-panel strong {
  font-size: 18px;
  line-height: 1.35;
}

.result-badge-panel p {
  font-size: 12px;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.result-narrative {
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--card-bg-strong), var(--card-bg));
  border: 1px solid var(--chip-border);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  display: grid;
  gap: 10px;
}

.metric-card span,
.narrative-head span {
  font-size: 12px;
  color: var(--text-faint);
}

.metric-card strong {
  font-size: 24px;
  line-height: 1;
}

.metric-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--progress-track-bg);
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.result-narrative {
  display: grid;
  gap: 12px;
}

.narrative-head {
  display: grid;
  gap: 8px;
}

.narrative-head strong {
  font-size: 20px;
  line-height: 1.3;
}

.result-narrative p {
  color: var(--text-soft);
  line-height: 1.78;
}

.reveal-block {
  opacity: 0;
  transform: translateY(16px);
}

.reveal-block.is-revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.result-card {
  min-height: 164px;
  padding: 18px;
  border-radius: 24px;
  background: var(--card-bg);
  border: 1px solid var(--chip-border);
  display: grid;
  align-content: start;
  gap: 10px;
}

.result-card-wide {
  grid-column: 1 / -1;
  min-height: 138px;
}

.closing-card {
  background: linear-gradient(135deg, var(--card-bg-strong), var(--card-bg));
}

.result-actions {
  margin-top: auto;
}

.result-actions > * {
  flex: 1;
}

.poster-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
  background: var(--modal-bg);
  backdrop-filter: blur(18px);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.poster-modal.is-open {
  display: flex;
  opacity: 1;
}

.poster-dialog {
  position: relative;
  z-index: 10000;
  width: min(100%, 460px);
  max-height: min(92vh, 860px);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateY(18px);
  transition: transform 0.28s ease;
}

.poster-modal.is-open .poster-dialog {
  transform: translateY(0);
}

.poster-head {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0;
}

.poster-head h3 {
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.45;
}

.poster-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.poster-mode-button {
  min-height: 42px;
  border-radius: 16px;
  border: 1px solid var(--chip-border);
  background: var(--button-ghost-bg);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.24s ease, color 0.24s ease, transform 0.24s ease;
}

.poster-mode-button.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 28px rgba(150, 166, 255, 0.2);
}

.icon-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  background: var(--icon-bg);
  color: var(--text);
  font-size: 24px;
}

.poster-preview-shell {
  flex: 1;
  min-height: 0;
  padding: 10px;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--card-bg-strong), var(--card-bg));
  border: 1px solid var(--chip-border);
  overflow: auto;
}

#poster-canvas {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 24px;
  background: #f5f7ff;
  box-shadow: 0 16px 32px rgba(120, 132, 178, 0.18);
  display: block;
}

.poster-actions {
  margin-top: 0;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(28px, -22px, 0) scale(1.14);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breathe {
  0%,
  100% {
    box-shadow: 0 18px 36px rgba(150, 166, 255, 0.26);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 24px 46px rgba(150, 166, 255, 0.42);
    transform: translateY(-2px);
  }
}

@keyframes pulse-text {
  0%,
  100% {
    opacity: 0.66;
  }
  50% {
    opacity: 1;
  }
}

@keyframes selection-bounce {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes question-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding: 14px 14px 24px;
  }

  .glass-panel {
    border-radius: 28px;
  }

  .hero-panel,
  .quiz-panel,
  .analysis-panel,
  .result-panel {
    padding: 20px 18px;
  }

  h2,
  #question-title {
    font-size: 25px;
  }

  .hero-orbit {
    width: 154px;
    height: 154px;
  }

  .hero-top {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-top-actions {
    width: 100%;
  }

  .theme-toggle {
    width: 100%;
  }

  .theme-toggle-track {
    min-width: 0;
  }

  .orbit-core {
    width: 80px;
    height: 80px;
    font-size: 24px;
  }

  .preview-grid,
  .result-metrics,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .preview-item-wide,
  .result-card-wide {
    grid-column: auto;
  }

  .result-hero,
  .quiz-footer,
  .result-actions,
  .poster-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .result-badge-panel {
    width: auto;
    flex-basis: auto;
  }

  .poster-dialog {
    max-height: min(94vh, 920px);
    padding: 16px;
  }

  .poster-preview-shell {
    padding: 8px;
    border-radius: 24px;
  }

  .footer-tip {
    max-width: none;
    text-align: left;
  }
}
