:root {
  --bg: #0d0f0e;
  --panel: #151917;
  --panel-2: #1d231f;
  --line: rgba(225, 255, 223, 0.16);
  --text: #edf4e8;
  --muted: #9ba79a;
  --green: #84ff8b;
  --yellow: #ffd45a;
  --red: #ff5c5c;
  --cyan: #69d8ff;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(132, 255, 139, 0.13), transparent 28%),
    radial-gradient(circle at 90% 20%, rgba(255, 212, 90, 0.1), transparent 24%),
    linear-gradient(135deg, #0b0d0c 0%, #111612 46%, #0a0b0b 100%);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.screen {
  display: none;
  min-height: calc(100vh - 48px);
  align-items: center;
  justify-content: center;
}

.screen.is-active {
  display: flex;
}

.terminal-card {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.terminal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 9px;
  opacity: 0.16;
}

.hero-card {
  padding: 22px;
}

.status-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

.status-chip {
  margin-left: auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--yellow);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 30px;
  align-items: center;
  padding: 54px 24px 22px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.hero-copy h1 {
  margin-bottom: 14px;
  font-size: clamp(46px, 7vw, 86px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 620px;
  margin-bottom: 12px;
  color: #dce7d5;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 750;
}

.hero-hook {
  max-width: 560px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.primary-button,
.ghost-button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 850;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.primary-button {
  padding: 0 22px;
  color: #091009;
  background: var(--green);
  box-shadow: 0 14px 36px rgba(132, 255, 139, 0.2);
}

.ghost-button {
  padding: 0 16px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.battery-machine {
  border: 1px solid rgba(132, 255, 139, 0.22);
  border-radius: 16px;
  background: #0c100e;
  padding: 18px;
}

.machine-header,
.machine-log {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.battery-core {
  position: relative;
  height: 260px;
  margin: 18px 0;
  border: 2px solid rgba(237, 244, 232, 0.18);
  border-radius: 22px;
  overflow: hidden;
  background: #121714;
}

.battery-core::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 24px;
  height: 56px;
  border-radius: 8px;
  background: rgba(237, 244, 232, 0.12);
}

.battery-fill {
  position: absolute;
  inset: auto 12px 12px;
  height: 58%;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--yellow), var(--green));
  animation: batteryPulse 2.4s ease-in-out infinite;
}

.battery-noise {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 20%, rgba(255, 255, 255, 0.1) 21%, transparent 22%),
    linear-gradient(180deg, transparent 0 48%, rgba(255, 92, 92, 0.24) 49%, transparent 51%);
  opacity: 0.45;
}

.machine-log {
  flex-direction: column;
}

.quiz-topbar {
  width: min(780px, 100%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.screen-quiz {
  flex-direction: column;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.progress-track {
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 220ms ease;
}

.question-card {
  width: min(780px, 100%);
  padding: 28px;
}

.question-card h2 {
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
  font-size: clamp(25px, 5vw, 42px);
  line-height: 1.22;
  letter-spacing: 0;
}

.options-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.option-button {
  width: 100%;
  min-height: 64px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  text-align: left;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: center;
}

.option-button:hover {
  border-color: rgba(132, 255, 139, 0.48);
  background: rgba(132, 255, 139, 0.08);
}

.option-button.is-selected {
  border-color: rgba(132, 255, 139, 0.82);
  background: rgba(132, 255, 139, 0.13);
  box-shadow: inset 0 0 0 1px rgba(132, 255, 139, 0.2);
}

.option-key {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: rgba(132, 255, 139, 0.1);
  color: var(--green);
  font-weight: 900;
}

.quiz-nav {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 12px;
  margin-top: 18px;
}

.quiz-nav button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.loading-card {
  width: min(560px, 100%);
  padding: 30px;
  text-align: center;
}

.scanner {
  position: relative;
  height: 170px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle, rgba(132, 255, 139, 0.2), transparent 32%),
    #0b0f0d;
}

.scanner-line {
  position: absolute;
  inset: 0;
  height: 3px;
  background: var(--green);
  box-shadow: 0 0 24px var(--green);
  animation: scan 1.4s ease-in-out infinite;
}

.loading-card h2 {
  position: relative;
  z-index: 1;
  font-size: 28px;
}

.loading-card p {
  position: relative;
  z-index: 1;
  color: var(--muted);
}

.result-card {
  padding: 28px;
}

.result-header {
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
}

.result-header h2 {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 16px;
}

.result-header h1 {
  margin-bottom: 10px;
  font-size: clamp(42px, 8vw, 78px);
  line-height: 1;
}

.result-model {
  color: var(--yellow);
  font-weight: 800;
}

.result-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 24px;
  align-items: start;
}

.character-card {
  --accent: var(--green);
  min-height: 360px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 34%),
    #0d120f;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.character-card::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px dashed color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 16px;
}

.character-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.character-face {
  width: 148px;
  height: 180px;
  border: 3px solid var(--accent);
  border-radius: 34px 34px 22px 22px;
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.1));
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 28%, transparent);
}

.face-screen {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 28px;
  height: 64px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 18%, #111);
}

.face-eyes {
  position: absolute;
  left: 43px;
  right: 43px;
  top: 52px;
  height: 12px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 0 50%, var(--accent) 0 5px, transparent 6px),
    radial-gradient(circle at 100% 50%, var(--accent) 0 5px, transparent 6px);
}

.face-mouth {
  position: absolute;
  left: 52px;
  right: 52px;
  top: 120px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.character-shadow {
  position: absolute;
  bottom: 56px;
  width: 170px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  filter: blur(7px);
}

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

.tagline {
  margin: 0;
  padding: 18px;
  border-left: 4px solid var(--green);
  border-radius: 12px;
  background: rgba(132, 255, 139, 0.08);
  font-size: 20px;
  font-weight: 850;
  line-height: 1.55;
}

.result-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.result-block h3 {
  margin-bottom: 10px;
  color: var(--yellow);
  font-size: 15px;
}

.result-block p,
.result-block li {
  color: #dce7d5;
  line-height: 1.75;
}

.paragraph-stack {
  display: grid;
  gap: 10px;
}

.paragraph-stack p {
  margin: 0;
}

.result-block ul {
  margin: 0;
  padding-left: 20px;
}

.score-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.score-panel div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.score-panel span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.score-panel strong {
  font-size: 18px;
}

.result-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  left: 50%;
  top: max(18px, env(safe-area-inset-top));
  z-index: 20;
  transform: translateX(-50%) translateY(-16px);
  opacity: 0;
  max-width: min(90vw, 520px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(10, 13, 11, 0.92);
  box-shadow: var(--shadow);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes batteryPulse {
  0%,
  100% {
    height: 42%;
  }
  50% {
    height: 72%;
  }
}

@keyframes scan {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(167px);
  }
}

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

  .screen {
    min-height: calc(100vh - 28px);
  }

  .hero-card,
  .question-card,
  .result-card {
    border-radius: 16px;
  }

  .hero-grid,
  .result-layout,
  .score-panel {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    padding: 34px 4px 4px;
  }

  .battery-core {
    height: 190px;
  }

  .quiz-topbar {
    grid-template-columns: 1fr;
  }

  .question-card,
  .result-card {
    padding: 20px;
  }

  .option-button {
    min-height: 72px;
  }

  .quiz-nav {
    grid-template-columns: 1fr;
  }

  .character-card {
    min-height: 300px;
  }
}
