:root {
  color-scheme: dark;
  --ink: #f5f7fb;
  --muted: #b6c3d4;
  --soft: #dce6f4;
  --page: #0b1220;
  --panel: rgba(12, 20, 35, 0.78);
  --panel-strong: rgba(13, 24, 43, 0.94);
  --line: rgba(189, 206, 230, 0.18);
  --teal: #61e7d0;
  --mint: #a6f3bf;
  --gold: #f2c66d;
  --coral: #ff7a66;
  --blue: #7bb7ff;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  background:
    linear-gradient(135deg, rgba(11, 18, 32, 0.98), rgba(13, 31, 39, 0.94) 48%, rgba(34, 26, 44, 0.96)),
    var(--page);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 78%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.knowledge-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.78;
  pointer-events: none;
}

.experience-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1fr);
  gap: 22px;
  width: min(1180px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 24px;
  align-items: center;
}

.hero-panel,
.survey-card,
.success-panel,
.admin-hero,
.glass-panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero-panel {
  position: sticky;
  top: 24px;
  overflow: hidden;
  padding: 34px;
}

.hero-panel::after,
.admin-hero::after {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(97, 231, 208, 0.24);
  content: "";
  transform: rotate(12deg);
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 22px;
  border: 1px solid rgba(97, 231, 208, 0.34);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(97, 231, 208, 0.1);
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
}

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

h1 {
  max-width: 11em;
  margin-bottom: 16px;
  color: white;
  font-size: 3.55rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 34em;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

.knowledge-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 26px 0;
}

.knowledge-strip span {
  min-width: 0;
  border: 1px solid rgba(182, 195, 212, 0.18);
  border-radius: 8px;
  padding: 11px 10px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 780;
  text-align: center;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hero-stats div {
  min-width: 0;
  border: 1px solid rgba(182, 195, 212, 0.16);
  border-radius: 8px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.05);
}

.hero-stats strong {
  display: block;
  color: white;
  font-size: 1.28rem;
  line-height: 1.1;
}

.hero-stats span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.form-stage {
  min-width: 0;
}

.survey-card,
.success-panel {
  min-height: 660px;
  padding: 26px;
}

.form-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 36px;
}

.step-indicator {
  color: var(--teal);
  font-size: 0.86rem;
  font-weight: 900;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(189, 206, 230, 0.14);
}

.progress-track i {
  display: block;
  width: 16.66%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 220ms ease;
}

.survey-step {
  display: none;
  min-height: 430px;
}

.survey-step.is-active {
  display: grid;
  align-content: center;
}

.step-kicker {
  margin-bottom: 12px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
}

.survey-step h2,
.success-panel h2,
.section-heading h2 {
  margin-bottom: 14px;
  color: white;
  font-size: 2.08rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.step-copy {
  max-width: 36em;
  margin-bottom: 28px;
  color: var(--muted);
  line-height: 1.7;
}

.text-field {
  display: grid;
  gap: 10px;
  color: var(--soft);
  font-weight: 800;
}

.solo-field {
  max-width: 440px;
}

.text-field input,
.text-field textarea {
  width: 100%;
  border: 1px solid rgba(189, 206, 230, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.085);
  color: white;
  outline: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.text-field input {
  min-height: 60px;
  padding: 0 16px;
  font-size: 1.05rem;
}

.text-field textarea {
  min-height: 178px;
  resize: vertical;
  padding: 16px;
  font-size: 1rem;
  line-height: 1.65;
}

.text-field input::placeholder,
.text-field textarea::placeholder {
  color: rgba(214, 225, 239, 0.48);
}

.text-field input:focus,
.text-field textarea:focus {
  border-color: rgba(97, 231, 208, 0.74);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(97, 231, 208, 0.12);
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.rating-grid label {
  position: relative;
  min-width: 0;
}

.rating-grid input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.rating-grid span {
  display: grid;
  min-height: 116px;
  border: 1px solid rgba(189, 206, 230, 0.2);
  border-radius: 8px;
  padding: 14px 8px;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.rating-grid b {
  color: white;
  font-size: 2rem;
  line-height: 1;
}

.rating-grid small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.rating-grid label:hover span {
  transform: translateY(-3px);
  border-color: rgba(97, 231, 208, 0.5);
}

.rating-grid input:checked + span {
  border-color: rgba(97, 231, 208, 0.9);
  background: rgba(97, 231, 208, 0.16);
  box-shadow: inset 0 0 0 1px rgba(97, 231, 208, 0.42), 0 18px 34px rgba(0, 0, 0, 0.22);
}

.rating-grid input:checked + span b {
  color: var(--teal);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
  margin-top: 22px;
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 54px;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
}

.primary-button {
  border: 0;
  background: linear-gradient(90deg, var(--teal), var(--mint));
  color: #06201c;
  box-shadow: 0 16px 34px rgba(97, 231, 208, 0.2);
}

.ghost-button {
  border: 1px solid rgba(189, 206, 230, 0.22);
  background: rgba(255, 255, 255, 0.07);
  color: var(--soft);
}

.danger-button {
  border: 1px solid rgba(255, 122, 102, 0.36);
  background: rgba(255, 122, 102, 0.12);
  color: #ffd8d1;
}

.status {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.status[data-tone="success"] {
  color: var(--mint);
}

.status[data-tone="error"] {
  color: #ffb3a6;
}

.success-panel {
  display: grid;
  align-content: center;
}

.success-panel p:not(.step-kicker) {
  color: var(--muted);
  line-height: 1.7;
}

.success-panel .ghost-button {
  width: fit-content;
  margin-top: 24px;
}

[hidden] {
  display: none !important;
}

.admin-workspace {
  position: relative;
  z-index: 1;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.admin-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 30px;
}

.admin-hero h1 {
  font-size: 2.8rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-content: start;
}

.admin-status {
  grid-column: 1 / -1;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.metric-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.075);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 760;
}

.metric-card strong {
  color: white;
  font-size: 2.25rem;
  line-height: 1;
}

.glass-panel {
  margin-top: 16px;
  padding: 22px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 1.6rem;
}

.chart-grid,
.distribution-grid,
.text-response-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.chart-card,
.distribution-card,
.quote-card,
.response-card {
  border: 1px solid rgba(189, 206, 230, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.chart-card,
.distribution-card {
  min-height: 250px;
  padding: 16px;
}

.chart-card h3,
.distribution-card h3,
.text-response-grid h3 {
  margin: 0 0 14px;
  color: white;
  font-size: 1rem;
}

.chart-fallback {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.score-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.score-row + .score-row {
  margin-top: 10px;
}

.score-row strong {
  color: white;
  text-align: right;
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(189, 206, 230, 0.16);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.quote-list,
.response-list {
  display: grid;
  gap: 12px;
}

.quote-card {
  padding: 15px;
}

.quote-card p {
  margin-bottom: 12px;
  color: var(--ink);
  line-height: 1.62;
}

.quote-card span {
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 800;
}

.response-card {
  padding: 17px;
}

.response-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.response-head strong {
  color: white;
  font-size: 1.06rem;
}

.response-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.response-card dl {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 9px 14px;
  margin: 0;
}

.response-card dt {
  color: var(--muted);
  font-weight: 850;
}

.response-card dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1020px) {
  .experience-shell {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-panel {
    position: relative;
    top: auto;
  }

  .survey-card,
  .success-panel {
    min-height: auto;
  }

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

@media (max-width: 720px) {
  body {
    background:
      linear-gradient(180deg, rgba(11, 18, 32, 0.98), rgba(14, 34, 39, 0.96) 50%, rgba(34, 26, 44, 0.96)),
      var(--page);
  }

  body::before {
    background-size: 30px 30px;
  }

  .knowledge-canvas {
    opacity: 0.42;
  }

  .experience-shell,
  .admin-workspace {
    min-height: 100svh;
    padding: 10px;
  }

  .hero-panel,
  .survey-card,
  .success-panel,
  .admin-hero,
  .glass-panel {
    padding: 18px 14px;
  }

  .hero-panel {
    min-height: 360px;
    display: grid;
    align-content: end;
  }

  .hero-panel::after,
  .admin-hero::after {
    right: 16px;
    bottom: 16px;
    width: 86px;
    height: 86px;
  }

  h1 {
    max-width: 9.8em;
    font-size: 2.45rem;
    line-height: 1.05;
  }

  .hero-copy,
  .step-copy {
    font-size: 0.98rem;
  }

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

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

  .hero-stats div {
    padding: 10px 8px;
  }

  .hero-stats strong {
    font-size: 1.06rem;
  }

  .survey-card {
    min-height: auto;
    display: block;
  }

  .form-topbar {
    margin-bottom: 18px;
  }

  .survey-step {
    min-height: 0;
  }

  .survey-step.is-active {
    align-content: start;
  }

  .survey-step h2,
  .success-panel h2 {
    font-size: 1.72rem;
  }

  .text-field input {
    min-height: 58px;
  }

  .text-field textarea {
    min-height: 190px;
  }

  .rating-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
  }

  .rating-grid span {
    min-height: 92px;
    padding: 12px 3px;
  }

  .rating-grid b {
    font-size: 1.55rem;
  }

  .rating-grid small {
    font-size: 0.72rem;
  }

  .form-actions {
    position: static;
    grid-template-columns: 0.8fr 1.2fr;
    margin: 18px 0 0;
    padding-top: 0;
    background: transparent;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    min-height: 56px;
  }

  .admin-hero,
  .metric-grid,
  .chart-grid,
  .distribution-grid,
  .text-response-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    display: grid;
    justify-content: stretch;
  }

  .admin-hero h1 {
    font-size: 2.05rem;
  }

  .metric-card strong {
    font-size: 2rem;
  }

  .response-head {
    display: block;
  }

  .response-head span {
    display: block;
    margin-top: 5px;
  }

  .response-card dl {
    grid-template-columns: 1fr;
  }

  .response-card dt {
    margin-top: 6px;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 2.12rem;
  }

  .survey-step h2,
  .success-panel h2 {
    font-size: 1.48rem;
  }

  .rating-grid {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .rating-grid label {
    min-width: 44px;
  }
}

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