:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: rgba(12, 18, 22, 0.82);
  --panel-strong: rgba(8, 10, 12, 0.94);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: rgba(0, 217, 255, 0.26);
  --blue: #00d9ff;
  --green: #00ff85;
  --red: #ff3b30;
  --shadow-blue: 0 0 28px rgba(0, 217, 255, 0.28);
  --shadow-red: 0 0 32px rgba(255, 59, 48, 0.24);
  --radius: 8px;
  font-family: "HarmonyOS Sans", "MiSans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 8%, rgba(0, 217, 255, 0.18), transparent 28%),
    radial-gradient(circle at 84% 20%, rgba(255, 59, 48, 0.12), transparent 24%),
    linear-gradient(145deg, #050505 0%, #071013 46%, #050505 100%);
  color: var(--text);
}

button {
  font: inherit;
}

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

.noise-layer,
.scanline-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.noise-layer {
  opacity: 0.08;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 18px 18px;
  mix-blend-mode: screen;
}

.scanline-layer {
  opacity: 0.28;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04) 0,
    rgba(255, 255, 255, 0.04) 1px,
    transparent 1px,
    transparent 7px
  );
  animation: scanMove 9s linear infinite;
}

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 1040px);
  min-height: min(760px, calc(100vh - 36px));
  padding: clamp(18px, 3vw, 34px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 217, 255, 0.08), transparent 34%),
    var(--panel);
  box-shadow: var(--shadow-blue), inset 0 0 80px rgba(0, 0, 0, 0.38);
}

.screen::before,
.screen::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.screen::before {
  display: none;
}

.screen::after {
  right: 28px;
  bottom: 78px;
  width: min(210px, 38vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 59, 48, 0.92));
  box-shadow: 0 0 18px rgba(255, 59, 48, 0.62);
  transform: rotate(-18deg);
  opacity: 0.42;
}

.system-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 34px;
  color: var(--green);
  font-family: "JetBrains Mono", "IBM Plex Mono", Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.protocol-nav {
  position: relative;
  z-index: 1;
}

.danger-dot {
  color: var(--red);
  text-shadow: 0 0 18px rgba(255, 59, 48, 0.8);
}

.hero,
.protocol-card,
.question-card,
.loading-card,
.result-layout,
.legal-note,
.site-footer {
  position: relative;
  z-index: 1;
}

.hero {
  max-width: 760px;
  padding: clamp(46px, 8vw, 88px) 0 18px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-family: "JetBrains Mono", "IBM Plex Mono", Menlo, monospace;
  font-size: 13px;
}

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

h1 {
  max-width: 740px;
  margin-bottom: 18px;
  font-size: clamp(40px, 7.4vw, 82px);
  line-height: 0.98;
  letter-spacing: 0;
  text-shadow: 2px 0 rgba(255, 59, 48, 0.7), -2px 0 rgba(0, 217, 255, 0.8);
}

h1 span {
  display: block;
  white-space: nowrap;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 14px;
  font-size: 16px;
  color: var(--blue);
}

.hero-subtitle {
  max-width: 680px;
  margin-bottom: 28px;
  color: rgba(229, 231, 235, 0.84);
  font-size: clamp(16px, 2.6vw, 20px);
  line-height: 1.72;
}

.terminal-panel {
  display: grid;
  gap: 12px;
  width: min(100%, 620px);
  min-height: 96px;
  margin-bottom: 26px;
  padding: 16px 20px;
  border: 0;
  border-left: 4px solid rgba(0, 255, 133, 0.62);
  background: linear-gradient(90deg, rgba(0, 255, 133, 0.09), rgba(0, 217, 255, 0.04));
  box-shadow: inset 0 0 22px rgba(0, 255, 133, 0.08);
  color: var(--green);
  font-family: "JetBrains Mono", "IBM Plex Mono", Menlo, monospace;
}

.terminal-label {
  display: block;
  color: var(--blue);
}

.scan-message {
  display: block;
  min-height: 2.8em;
  font-size: clamp(18px, 4.5vw, 24px);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.hero-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.primary-button,
.ghost-button,
.icon-link {
  min-height: 48px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  min-width: 168px;
  padding: 0 22px;
  border: 1px solid var(--red);
  background: linear-gradient(180deg, rgba(255, 59, 48, 0.95), rgba(128, 18, 16, 0.92));
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow-red);
}

.ghost-button {
  min-width: 150px;
  padding: 0 18px;
  border: 1px solid rgba(0, 217, 255, 0.5);
  background: rgba(0, 217, 255, 0.07);
  color: var(--blue);
}

.icon-link {
  width: 42px;
  min-width: 42px;
  border: 1px solid rgba(0, 217, 255, 0.38);
  background: rgba(0, 0, 0, 0.34);
  color: var(--blue);
}

.primary-button:hover,
.ghost-button:hover,
.icon-link:hover,
.option-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(0, 217, 255, 0.26), var(--shadow-red);
}

.warning-copy,
.legal-note {
  margin: 16px 0 0;
  color: rgba(229, 231, 235, 0.62);
  font-size: 13px;
  line-height: 1.7;
}

.protocol-card,
.loading-card {
  width: min(100%, 760px);
  margin: clamp(28px, 6vw, 66px) auto 0;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(0, 217, 255, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(0, 217, 255, 0.04), transparent 42%),
    rgba(0, 0, 0, 0.54);
}

.protocol-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 24px 0;
}

.protocol-grid > div {
  padding: 6px 0 6px 18px;
  border-left: 3px solid rgba(0, 255, 133, 0.4);
  background: linear-gradient(90deg, rgba(0, 255, 133, 0.06), transparent 78%);
}

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

li {
  margin-bottom: 10px;
}

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

.quiz-top {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.quiz-bar {
  margin-bottom: 0;
}

.human-status {
  display: grid;
  gap: 10px;
  width: 100%;
}

.human-status .progress-track {
  width: 100%;
}

.quiz-nav {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.quiz-arrow {
  color: var(--green);
  font-size: 22px;
}

.quiz-arrow:disabled {
  cursor: not-allowed;
  opacity: 0.35;
  transform: none;
  box-shadow: none;
}

.question-card {
  display: block;
  padding: clamp(18px, 4vw, 32px);
  border: 1px solid rgba(0, 217, 255, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(0, 217, 255, 0.035), transparent 34%),
    rgba(0, 0, 0, 0.42);
}

.question-card.is-answering {
  animation: scanConfirm 260ms ease;
}

.chapter-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--green);
  font-family: "JetBrains Mono", Menlo, monospace;
  font-size: 12px;
}

.chapter-row {
  align-items: baseline;
  flex-wrap: wrap;
}

.question-card h2 {
  max-width: 820px;
  margin: 24px 0 22px;
  line-height: 1.28;
}

blockquote {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-left: 3px solid var(--red);
  background: linear-gradient(90deg, rgba(255, 59, 48, 0.11), rgba(255, 59, 48, 0.025));
  color: rgba(229, 231, 235, 0.88);
  line-height: 1.72;
}

.options-list {
  display: grid;
  align-content: start;
  gap: 12px;
  margin-top: 10px;
}

.option-button {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 217, 255, 0.25);
  border-radius: 6px;
  background: rgba(3, 12, 15, 0.72);
  color: var(--text);
  text-align: left;
}

.option-button span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(0, 255, 133, 0.48);
  color: var(--green);
  font-family: "JetBrains Mono", Menlo, monospace;
}

.option-button strong {
  min-width: 0;
  line-height: 1.45;
}

.option-button.is-selected {
  border-color: rgba(0, 255, 133, 0.82);
  background:
    linear-gradient(90deg, rgba(0, 255, 133, 0.14), rgba(0, 217, 255, 0.06)),
    rgba(3, 12, 15, 0.86);
  box-shadow: 0 0 24px rgba(0, 255, 133, 0.22), inset 0 0 22px rgba(0, 217, 255, 0.08);
}

.option-button.is-selected span {
  border-color: var(--green);
  background: rgba(0, 255, 133, 0.12);
  box-shadow: 0 0 16px rgba(0, 255, 133, 0.36);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 217, 255, 0.32);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--red));
  transition: width 240ms ease;
}

.human-track span {
  background: linear-gradient(90deg, var(--red), var(--blue), var(--green));
}

.loading-card {
  text-align: center;
}

.loader-orbit {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 24px auto;
  border: 1px solid rgba(0, 217, 255, 0.34);
  border-radius: 50%;
}

.loader-orbit span {
  position: absolute;
  inset: 14px;
  border: 2px solid transparent;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

.loader-orbit span:last-child {
  inset: 34px;
  border-top-color: var(--green);
  animation-duration: 1.7s;
  animation-direction: reverse;
}

.loading-log {
  display: inline-block;
  width: min(100%, 460px);
  padding: 16px 20px 8px;
  border: 1px solid rgba(0, 255, 133, 0.2);
  background: rgba(0, 0, 0, 0.42);
  color: var(--green);
  font-family: "JetBrains Mono", Menlo, monospace;
  text-align: left;
}

.result-layout {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 24px;
}

.result-card {
  min-width: 0;
  padding: clamp(6px, 1.6vw, 16px) 0 0;
  background:
    linear-gradient(180deg, rgba(0, 217, 255, 0.05), transparent 34%),
    linear-gradient(90deg, rgba(0, 255, 133, 0.05), transparent 42%);
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(180px, 0.58fr) minmax(260px, 1fr);
  gap: clamp(24px, 6vw, 58px);
  align-items: end;
  margin: 4px 0 30px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(0, 217, 255, 0.16);
}

.human-meter {
  display: grid;
  gap: 8px;
}

.human-meter strong {
  color: var(--red);
  font-size: clamp(82px, 14vw, 138px);
  line-height: 0.9;
  text-shadow: 4px 0 rgba(0, 217, 255, 0.58), 0 0 28px rgba(255, 59, 48, 0.18);
}

.human-meter span,
.result-type-panel > span,
.advice-box span {
  color: var(--green);
  font-family: "JetBrains Mono", Menlo, monospace;
  font-size: 12px;
}

.human-meter span {
  font-size: 15px;
}

.result-type-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.result-type {
  display: block;
  margin: 0;
  padding: 0;
  color: #f3f4f6;
  font-size: clamp(34px, 5.6vw, 54px);
  line-height: 1.18;
  text-shadow: 2px 0 rgba(0, 217, 255, 0.68), 0 0 24px rgba(0, 217, 255, 0.18);
}

.result-diagnosis {
  margin: 0 0 30px;
  padding: 20px 22px;
  border-left-width: 4px;
  background: linear-gradient(90deg, rgba(255, 59, 48, 0.16), rgba(255, 59, 48, 0.03));
  font-size: clamp(22px, 4vw, 31px);
  font-weight: 700;
  line-height: 1.62;
}

.symptom-list {
  margin: 26px 0;
  padding-top: 2px;
  color: rgba(229, 231, 235, 0.88);
  font-size: clamp(16px, 2.9vw, 22px);
  line-height: 1.72;
}

.symptom-list h3 {
  margin-bottom: 12px;
  font-size: clamp(20px, 4vw, 28px);
}

.symptom-list li::marker {
  color: var(--green);
}

.advice-box {
  margin: 28px 0 26px;
  padding: 14px 0 14px 18px;
  border: 0;
  border-left: 4px solid rgba(255, 59, 48, 0.76);
  border-radius: 0;
  background: linear-gradient(90deg, rgba(255, 59, 48, 0.13), transparent 82%);
}

.advice-box p {
  margin: 8px 0 0;
  color: rgba(229, 231, 235, 0.9);
  line-height: 1.6;
}

.result-actions {
  margin-top: 22px;
}

.site-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding-top: 22px;
}

.quiz-screen .site-footer {
  opacity: 0.48;
  transform: scale(0.94);
}

.social-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(0, 217, 255, 0.34);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--green);
  cursor: pointer;
  font-family: "JetBrains Mono", "IBM Plex Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.social-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.social-icon:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 255, 133, 0.66);
  box-shadow: 0 0 18px rgba(0, 217, 255, 0.22);
}

.qr-modal {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.poster-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(5px);
}

.poster-modal-card {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(100%, 440px);
  max-height: calc(100vh - 36px);
  padding: 16px;
  overflow: auto;
  border: 1px solid rgba(0, 255, 133, 0.42);
  border-radius: 8px;
  background: #050505;
  box-shadow: 0 0 44px rgba(0, 217, 255, 0.24);
  text-align: center;
}

.poster-modal-card img {
  display: block;
  width: min(100%, 340px);
  margin: 0 auto;
  border: 1px solid rgba(0, 217, 255, 0.3);
  -webkit-touch-callout: default;
  user-select: auto;
}

.poster-save-tip {
  margin: 0;
  color: var(--green);
  font-size: 14px;
  line-height: 1.6;
}

.qr-card {
  position: relative;
  width: min(100%, 330px);
  padding: 22px;
  border: 1px solid rgba(0, 255, 133, 0.48);
  border-radius: 8px;
  background: #050505;
  box-shadow: 0 0 38px rgba(0, 217, 255, 0.22);
  text-align: center;
}

.qr-card img {
  display: block;
  width: min(100%, 258px);
  margin: 8px auto 14px;
  border: 8px solid #fff;
  background: #fff;
}

.qr-card p:last-child {
  margin: 0;
  color: rgba(229, 231, 235, 0.74);
}

.qr-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(0, 217, 255, 0.34);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--blue);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.screen.result-screen::before {
  display: none;
}

.screen.result-screen {
  padding: clamp(18px, 2.4vw, 30px);
}

@keyframes scanMove {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(28px);
  }
}

@keyframes scanConfirm {
  0%,
  100% {
    filter: brightness(1);
  }
  45% {
    filter: brightness(1.18);
  }
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
    place-items: start center;
  }

  .screen {
    min-height: calc(100vh - 24px);
    padding: 14px;
  }

  .system-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    padding-top: 48px;
  }

  .terminal-panel {
    min-height: 92px;
  }

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

  .primary-button,
  .ghost-button {
    width: 100%;
  }

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

  .result-hero {
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
    margin-bottom: 26px;
    padding-bottom: 24px;
  }

  .screen.result-screen {
    padding: 14px;
  }

  .result-layout {
    margin-top: 20px;
  }

  .result-card {
    padding: 8px 0 0;
  }

  .result-diagnosis {
    padding: 18px 16px;
  }

  .advice-box {
    margin-bottom: 22px;
  }

  .question-card {
    padding: 16px;
  }

  .option-button {
    min-height: 56px;
    grid-template-columns: 38px 1fr;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
