:root {
  --bg: #f7efe4;
  --bg-strong: #eadcc7;
  --panel: rgba(255, 250, 242, 0.92);
  --panel-soft: rgba(255, 245, 233, 0.86);
  --text: #35231b;
  --muted: #7a6658;
  --line: rgba(113, 79, 56, 0.16);
  --accent: #cf5c3f;
  --accent-deep: #9f321c;
  --accent-gold: #d6a84f;
  --sea: #26646f;
  --sea-soft: #86b7b5;
  --shadow: 0 24px 50px rgba(74, 41, 24, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Outfit", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 227, 191, 0.95), rgba(247, 239, 228, 0) 36%),
    radial-gradient(circle at bottom right, rgba(129, 190, 186, 0.28), rgba(247, 239, 228, 0) 28%),
    linear-gradient(180deg, #f8f1e7 0%, #f5ebdd 44%, #f3ece6 100%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-deep);
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.panel-soft {
  background: var(--panel-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(214, 168, 79, 0.16);
  border: 1px solid rgba(214, 168, 79, 0.26);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  padding: 28px;
}

.hero-copy h1,
.type-name,
.share-title {
  font-family: "Noto Serif SC", serif;
}

.hero-copy h1 {
  margin: 18px 0 0;
  font-size: clamp(34px, 6vw, 66px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-sub,
.body-copy,
.notes-content p,
.credit-card p {
  color: var(--muted);
  line-height: 1.9;
}

.hero-sub {
  margin-top: 18px;
  font-size: 16px;
  max-width: 48rem;
}

.hero-actions,
.action-row,
.tag-row,
.share-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.btn {
  border-radius: 16px;
  padding: 14px 18px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #fff6eb;
  background: linear-gradient(135deg, #cf5c3f, #9f321c);
  box-shadow: 0 16px 28px rgba(159, 50, 28, 0.22);
}

.btn-secondary {
  color: var(--text);
  background: linear-gradient(180deg, #fffaf5, #f5e7d5);
  border: 1px solid rgba(94, 63, 44, 0.14);
}

.btn-ghost {
  color: var(--sea);
  background: rgba(38, 100, 111, 0.08);
  border: 1px solid rgba(38, 100, 111, 0.14);
}

.hero-grid,
.credits-grid,
.result-grid {
  display: grid;
  gap: 18px;
}

.hero-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.mini-panel,
.credit-card,
.top-matches {
  padding: 18px;
}

.mini-panel h2,
.credit-card h3,
.test-panel h2,
.result-panel h3 {
  margin: 0;
}

.mini-panel ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.hero-art {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
  background:
    radial-gradient(circle at top, rgba(214, 168, 79, 0.24), rgba(255, 245, 233, 0) 44%),
    linear-gradient(180deg, rgba(255, 248, 238, 0.96), rgba(236, 246, 244, 0.84));
}

.hero-art p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.credits-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.test-panel,
.result-panel {
  padding: 24px;
}

.test-topbar,
.result-hero {
  display: grid;
  gap: 18px;
}

.test-topbar {
  grid-template-columns: 0.8fr 1.2fr;
  align-items: end;
}

.progress-wrap {
  display: grid;
  gap: 8px;
}

.progress {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(113, 79, 56, 0.08);
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent), var(--sea));
  transition: width 0.24s ease;
}

.progress-text,
.hint,
.mode-note,
.type-subname,
.poster-caption,
.share-subtitle,
.share-footer,
.timeline-meta,
.rank-copy,
.dim-item p {
  color: var(--muted);
}

.mode-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(38, 100, 111, 0.08);
  border: 1px solid rgba(38, 100, 111, 0.12);
  line-height: 1.75;
}

.agent-batch-tools {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(38, 100, 111, 0.06);
  border: 1px solid rgba(38, 100, 111, 0.12);
}

.agent-batch-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.agent-batch-head h3 {
  margin: 0;
}

.bulk-label {
  display: block;
  margin-top: 14px;
  margin-bottom: 8px;
  color: var(--sea);
  font-size: 13px;
  font-weight: 700;
}

.bulk-textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid rgba(38, 100, 111, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(252, 255, 255, 0.8);
}

.batch-status {
  color: var(--sea);
  font-size: 13px;
  line-height: 1.7;
}

.question-list,
.dim-list,
.timeline-list,
.rank-list {
  display: grid;
  gap: 14px;
}

.question-list {
  margin-top: 18px;
}

.question-card,
.dim-item,
.timeline-item,
.rank-item {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
}

.question-card {
  padding: 18px;
}

.question-head,
.timeline-item,
.rank-item,
.dim-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.question-head {
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(214, 168, 79, 0.14);
  border: 1px solid rgba(214, 168, 79, 0.22);
}

.question-card h3 {
  margin: 12px 0 0;
  font-size: 19px;
  line-height: 1.65;
}

.agent-prompt {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(38, 100, 111, 0.06);
  border: 1px solid rgba(38, 100, 111, 0.1);
}

.agent-prompt strong {
  display: block;
  margin-bottom: 8px;
  color: var(--sea);
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.option {
  display: grid;
  grid-template-columns: 24px 32px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(113, 79, 56, 0.14);
  background: rgba(255, 255, 255, 0.74);
}

.option input {
  margin-top: 3px;
  accent-color: var(--accent-deep);
}

.option-code {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(207, 92, 63, 0.12);
  color: var(--accent-deep);
  font-weight: 800;
}

.option-text {
  display: grid;
  gap: 5px;
}

.option-detail {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.agent-note {
  margin-top: 14px;
}

.agent-note label {
  display: block;
  font-size: 13px;
  color: var(--sea);
  font-weight: 700;
  margin-bottom: 8px;
}

.agent-note textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid rgba(38, 100, 111, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(252, 255, 255, 0.8);
}

.bottom-bar,
.result-actions {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.result-hero {
  grid-template-columns: 0.88fr 1.12fr;
}

.poster-box,
.type-box {
  padding: 18px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.92), rgba(235, 246, 243, 0.72));
}

.poster-art {
  min-height: 320px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(214, 168, 79, 0.16), rgba(214, 168, 79, 0) 30%),
    radial-gradient(circle at 80% 80%, rgba(38, 100, 111, 0.16), rgba(38, 100, 111, 0) 34%),
    rgba(255, 255, 255, 0.7);
}

.poster-caption {
  margin: 12px 0 0;
  line-height: 1.8;
}

.type-kicker {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 700;
}

.type-name {
  margin: 10px 0 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.match-badge,
.trait-tag,
.share-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 700;
}

.match-badge {
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(207, 92, 63, 0.11);
  border: 1px solid rgba(207, 92, 63, 0.18);
  color: var(--accent-deep);
}

.type-subname {
  margin-top: 14px;
  line-height: 1.8;
}

.tag-row {
  margin-top: 18px;
}

.trait-tag,
.share-tag {
  padding: 8px 12px;
  background: rgba(38, 100, 111, 0.08);
  border: 1px solid rgba(38, 100, 111, 0.12);
  color: var(--sea);
}

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

.result-grid > .panel {
  padding: 18px;
}

.share-card {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  border-radius: 22px;
  border: 1px solid rgba(38, 100, 111, 0.12);
  background: #fff9ef;
}

.share-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-content {
  position: relative;
  z-index: 1;
  padding: 18px;
  display: grid;
  gap: 14px;
  min-height: 250px;
}

.share-meta {
  font-size: 12px;
  color: var(--sea);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.share-main {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: center;
}

.share-poster {
  min-height: 160px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
}

.share-title {
  font-size: 28px;
  line-height: 1.1;
}

.share-subtitle {
  margin-top: 8px;
  line-height: 1.75;
}

.share-footer {
  margin-top: auto;
  font-size: 12px;
}

.dim-item,
.timeline-item,
.rank-item {
  padding: 14px;
}

.dim-head,
.rank-item {
  align-items: baseline;
}

.dim-score,
.rank-score,
.timeline-choice {
  color: var(--accent-deep);
  font-weight: 800;
  white-space: nowrap;
}

.timeline-item {
  flex-direction: column;
}

.timeline-item strong,
.rank-item strong,
.notes-box summary {
  color: var(--text);
}

.timeline-body {
  line-height: 1.8;
  color: var(--muted);
}

.rank-item {
  justify-content: space-between;
}

.rank-copy {
  margin-top: 5px;
  line-height: 1.7;
}

.notes-box {
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
}

.notes-box summary {
  list-style: none;
  cursor: pointer;
  padding: 18px;
  font-weight: 800;
}

.notes-box summary::-webkit-details-marker {
  display: none;
}

.notes-content {
  border-top: 1px solid var(--line);
  padding: 0 18px 18px;
}

.notes-content p {
  margin: 14px 0 0;
}

.svg-poster {
  width: 100%;
  max-width: 320px;
}

@media (max-width: 980px) {
  .hero-panel,
  .result-hero,
  .result-grid,
  .credits-grid,
  .hero-grid,
  .share-main,
  .test-topbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 10px;
  }

  .hero-panel,
  .test-panel,
  .result-panel {
    padding: 16px;
  }

  .hero-copy h1 {
    font-size: 38px;
  }

  .option {
    grid-template-columns: 24px 28px 1fr;
  }

  .type-name {
    font-size: 38px;
  }

  .agent-batch-tools {
    padding: 14px;
  }
}
