@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;700&family=Noto+Serif+SC:wght@500;700;900&display=swap");

:root {
  --bg: #0c1220;
  --bg-soft: #111b2f;
  --card: rgba(16, 24, 42, 0.6);
  --card-border: rgba(120, 146, 196, 0.15);
  --text: #e9f0ff;
  --muted: #9db0d4;
  --primary: #61d3c4;
  --primary-strong: #1ec9b2;
  --accent: #f0b45b;
  --danger: #ff7f7f;
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
  box-sizing: border-box;
}

@keyframes gradient-move {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--text);
  /* Set a solid base color to prevent white flash during scroll/load */
  background-color: #0f172a;
  background-image: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a, #111827);
  background-size: 400% 400%;
  animation: gradient-move 15s ease infinite;
  font-family: "Manrope", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-feature-settings: "liga" 1, "kern" 1;
  min-height: 100vh;
  /* Prevent horizontal scroll */
  overflow-x: hidden;
  /* Smooth scrolling */
  scroll-behavior: smooth;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 50%, rgba(97, 211, 196, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(240, 180, 91, 0.05), transparent 25%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--primary);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}

h1,
h2 {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  letter-spacing: 0.01em;
}

h3 {
  font-weight: 700;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(97, 211, 196, 0.2);
}

h2 {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
}

.hero {
  padding: 72px 0 42px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(16, 24, 42, 0.3);
  backdrop-filter: blur(10px);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

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

.lead {
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 500;
}

.micro {
  color: var(--muted);
  font-size: 12px;
}

.hero-actions,
.quiz-actions,
.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 14px;
}

.btn {
  border: 1px solid rgba(115, 142, 195, 0.38);
  color: var(--text);
  background: rgba(17, 27, 47, 0.75);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(132, 165, 226, 0.6);
}

.btn.primary {
  color: #032f2a;
  border-color: rgba(76, 224, 203, 0.92);
  background: linear-gradient(135deg, #7ce8d8 0%, #2cd0bb 100%);
}

.btn.ghost {
  background: rgba(20, 31, 53, 0.4);
}

.hero-card,
.card,
.campaign-banner {
  animation: rise-in 0.45s ease both;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.hero-card-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: #c6f6ef;
}

.campaign-banner {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(97, 211, 196, 0.4);
  background: rgba(13, 80, 71, 0.28);
  color: #d4fffa;
  font-size: 13px;
}

.campaign-banner a {
  font-weight: 700;
  color: #ffcf86;
}

.section {
  padding: 38px 0;
}

.section.soft {
  background: linear-gradient(180deg, rgba(17, 27, 47, 0.65), rgba(17, 27, 47, 0.25));
}

.section-lead {
  color: var(--muted);
  margin: 8px 0 18px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

.card {
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--card-border);
  background: var(--card);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
  border-color: rgba(120, 146, 196, 0.35);
}

.nono-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

.nono-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  opacity: 0;
  transform: rotate(30deg);
  transition: opacity 0.3s;
  pointer-events: none;
}

.nono-card:hover::before {
  opacity: 1;
}

.nono-card-img {
  width: 100px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease;
}

.nono-card:hover .nono-card-img {
  transform: scale(1.05) rotate(2deg);
}

.card.wide {
  grid-column: 1 / -1;
}

.invite-code {
  margin-top: 12px;
  margin-bottom: 12px;
  border: 1px dashed rgba(240, 180, 91, 0.55);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #ffd89e;
  background: rgba(98, 67, 23, 0.25);
  width: fit-content;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.kpi {
  border: 1px solid rgba(118, 145, 192, 0.25);
  border-radius: 12px;
  background: rgba(14, 22, 39, 0.4);
  padding: 10px;
}

.kpi-label {
  color: var(--muted);
  font-size: 12px;
}

.kpi-value {
  margin-top: 2px;
  font-size: 24px;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(97, 211, 196, 0.5);
}

.growth-track {
  margin-top: 14px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(21, 35, 62, 0.92);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.growth-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #61d3c4, #f0b45b);
  transition: width 0.28s ease;
  box-shadow: 0 0 10px rgba(97, 211, 196, 0.7);
}

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

.progress-container {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--primary);
}

.question-list {
  display: grid;
  gap: 12px;
}

.question-card {
  padding: 0;
  border: none;
  background: transparent;
  animation: slide-in 0.3s ease;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.question-title {
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 24px;
  color: #fff;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.option:hover {
  background: rgba(97, 211, 196, 0.15);
  border-color: var(--primary);
  transform: translateX(4px);
}

.option input {
  accent-color: var(--primary);
  transform: scale(1.2);
}

.result {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(115, 142, 195, 0.25);
  border-radius: 12px;
  min-height: 46px;
  background: rgba(14, 22, 39, 0.78);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  color: var(--accent);
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
  margin: 20px auto;
}

.bars {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.bar {
  display: grid;
  grid-template-columns: 100px 1fr 60px;
  align-items: center;
  gap: 10px;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(20, 38, 69, 0.85);
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #61d3c4, #f0b45b);
}

.share-card {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

/* Generation Overlay */
.generation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 15, 25, 0.95);
  backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
  color: #61d3c4;
}

.gen-terminal {
  width: 90%;
  max-width: 600px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #333;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 40px;
  box-shadow: 0 0 20px rgba(97, 211, 196, 0.1);
}

.gen-header {
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
  margin-bottom: 10px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #fff;
  opacity: 0.7;
}

.gen-log {
  height: 150px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
  color: #a9b4c9;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.gen-log div {
  animation: fadeIn 0.3s ease;
}

.gen-progress {
  width: 100%;
  height: 4px;
  background: #1a2232;
  margin-top: 15px;
  position: relative;
  border-radius: 2px;
  overflow: hidden;
}

.gen-bar {
  width: 0%;
  height: 100%;
  background: #61d3c4;
  box-shadow: 0 0 10px #61d3c4;
  transition: width 0.1s linear;
}

.gen-spinner {
  width: 80px;
  height: 80px;
  border: 4px solid rgba(97, 211, 196, 0.1);
  border-top-color: #61d3c4;
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.share-card img {
  width: 100%;
  max-width: 520px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(12, 18, 32, 0.85);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: block;
  /* Ensure block display explicitly */
}

/* Hide broken image icon when src is empty */
.share-card img:not([src]),
.share-card img[src=""] {
  display: none;
}

.input-group {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.input-group span {
  color: var(--muted);
  font-size: 13px;
}

.input-group textarea,
.input-group input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(116, 143, 190, 0.35);
  background: rgba(11, 17, 30, 0.92);
  color: var(--text);
  padding: 10px;
}

.input-group textarea {
  min-height: 88px;
}

#share-text {
  white-space: pre-line;
}

.checks {
  margin: 0;
  padding-left: 18px;
}

.log-list {
  display: grid;
  gap: 10px;
}

.log-item {
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(115, 142, 195, 0.25);
  background: rgba(14, 22, 39, 0.76);
}

.log-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.model-card {
  cursor: pointer;
  transition: transform 0.16s ease;
}

.model-card:hover {
  transform: translateY(-2px);
}

.footer {
  padding: 28px 0;
  text-align: center;
  border-top: 1px solid var(--card-border);
  color: var(--muted);
  font-weight: 500;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {

  .hero-inner,
  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .hero {
    padding-top: 56px;
  }

  .btn {
    width: 100%;
  }

  .hero-actions .btn {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {

  .hero-card,
  .card,
  .campaign-banner,
  .model-card,
  .btn,
  .growth-fill {
    animation: none !important;
    transition: none !important;
  }
}