:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --surface-2: #f0ece4;
  --text: #1f1d1a;
  --muted: #6f6a61;
  --border: #e4ded3;
  --accent: #f0532d;
  --shadow: 0 1px 2px rgba(31, 29, 26, 0.04), 0 10px 30px rgba(31, 29, 26, 0.07);

  --ai-gpt: #0f9f7b;
  --ai-claude: #d4683f;
  --ai-gemini: #8b5cf6;
  --ai-grok: #27272a;
  --ai-deepseek: #4d6bfe;
  --ai-doubao: #e8408f;
  --ai: var(--accent);

  /* 单色 logo（ChatGPT、Grok）正面和侧面的颜色 */
  --mono-face: none;
  --mono-core: invert(0.45);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412;
    --surface: #1f1d1a;
    --surface-2: #2a2723;
    --text: #f3f0ea;
    --muted: #a8a299;
    --border: #36322d;
    --accent: #ff6b47;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);

    --ai-gpt: #22c79d;
    --ai-claude: #e88a64;
    --ai-gemini: #a78bfa;
    --ai-grok: #e4e4e7;
    --ai-deepseek: #7b93ff;
    --ai-doubao: #f472b6;

    --mono-face: invert(1);
    --mono-core: invert(0.6);

    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
}

.app {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 16px 24px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fade-in 0.35s ease;
}

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ---------- 像素 logo ---------- */

.pixel-logo {
  display: block;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-drag: none;
}

.pixel-logo.core {
  filter: brightness(0.6);
}

.pixel-logo.mono {
  filter: var(--mono-face);
}

.pixel-logo.mono.core {
  filter: var(--mono-core);
}

.logo-small {
  flex: none;
  width: 24px;
  height: 24px;
}

.logo3d {
  flex: none;
  width: var(--size);
  height: var(--size);
  perspective: calc(var(--size) * 6);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.logo3d:active {
  cursor: grabbing;
}

.logo3d-spin {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

.logo3d .pixel-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---------- 按钮 ---------- */

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 15px 28px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.btn:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--muted);
}

.btn-ghost {
  appearance: none;
  background: none;
  border: 0;
  padding: 6px 0;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.btn-ghost:hover {
  color: var(--text);
}

/* ---------- 首页 ---------- */

.hero {
  padding-top: 7vh;
  text-align: center;
}

.hero h1 {
  margin: 12px 0 14px;
  font-size: clamp(36px, 11vw, 54px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hero-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

[tabindex="-1"]:focus {
  outline: none;
}

.noscript-note {
  max-width: 520px;
  margin: 20px auto;
  padding: 16px;
  text-align: center;
}

.marker {
  padding: 0 6px;
  background: linear-gradient(transparent 58%, color-mix(in srgb, var(--accent) 38%, transparent) 58%);
}

.ai-chips {
  list-style: none;
  margin: 32px 0 36px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ai-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--ai);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
}

.btn-start {
  width: min(100%, 300px);
}

/* ---------- 答题页 ---------- */

.quiz-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.quiz-step {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.progress {
  height: 6px;
  margin-bottom: 28px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

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

.quiz-card.enter {
  animation: slide-in 0.3s ease;
}

.dimension {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 999px;
}

.question {
  margin: 0 0 22px;
  font-size: clamp(20px, 5.6vw, 24px);
  font-weight: 800;
  line-height: 1.45;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  font-size: 15.5px;
  line-height: 1.55;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.option:hover {
  border-color: color-mix(in srgb, var(--text) 35%, var(--border));
  transform: translateY(-1px);
}

.option-letter {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 8px;
}

.option-text {
  overflow-wrap: anywhere;
}

.option.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.option.selected .option-letter {
  color: #fff;
  background: var(--accent);
}

/* ---------- 结果页 ---------- */

.result-card {
  padding: 28px 22px 22px;
  text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ai) 15%, var(--surface)) 0, var(--surface) 200px);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.result-logo {
  display: grid;
  place-items: center;
  width: 144px;
  height: 144px;
  margin: 12px auto 6px;
  background: color-mix(in srgb, var(--ai) 14%, var(--surface));
  border: 3px solid var(--ai);
  border-radius: 50%;
  animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.drag-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.result-name {
  margin: 0;
  font-size: clamp(34px, 10vw, 46px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--ai);
}

.result-title {
  margin: 4px 0 16px;
  font-size: 18px;
  font-weight: 800;
}

.catchphrase {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 10px 16px;
  font-weight: 700;
  background: var(--surface-2);
  border-radius: 16px 16px 16px 4px;
}

.result-desc {
  margin: 0 0 18px;
  text-align: left;
  font-size: 15.5px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.tag {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ai);
  background: color-mix(in srgb, var(--ai) 12%, transparent);
  border-radius: 999px;
}

.relations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.relations div {
  padding: 12px 14px;
  text-align: left;
  background: var(--surface-2);
  border-radius: 14px;
}

.relations dt {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.relations dd {
  margin: 2px 0 0;
  font-size: 14.5px;
  font-weight: 700;
}

.panel {
  margin-top: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 800;
}

.dimensions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dimensions li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--ai) 9%, var(--surface));
  border-left: 3px solid var(--ai);
  border-radius: 10px;
}

.dim-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.dim-ai {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 800;
}

.bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bars li {
  display: grid;
  grid-template-columns: 112px 1fr 44px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.bar-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ai);
  border-radius: inherit;
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bar-value {
  text-align: right;
  font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.actions .btn {
  flex: 1;
  padding: 14px 16px;
  font-size: 16px;
}

.footer {
  padding: 8px 16px 28px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 380px) {
  .actions {
    flex-direction: column;
  }

  .bars li {
    grid-template-columns: 104px 1fr 40px;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
