:root {
  --bg: #f8f4ea;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --text: #1f1e1a;
  --muted: #655f50;
  --line: rgba(66, 61, 48, 0.15);
  --primary: #d45c1a;
  --primary-deep: #a73d0b;
  --primary-soft: rgba(212, 92, 26, 0.14);
  --accent: #006a5a;
  --accent-soft: rgba(0, 106, 90, 0.13);
  --danger: #b2392f;
  --shadow: 0 24px 56px rgba(38, 28, 12, 0.15);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

.bg-layer {
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(1px);
}

.bg-layer-top {
  width: 38rem;
  height: 38rem;
  top: -10rem;
  right: -10rem;
  background: radial-gradient(circle at center, rgba(212, 92, 26, 0.22), rgba(212, 92, 26, 0));
}

.bg-layer-bottom {
  width: 44rem;
  height: 44rem;
  left: -14rem;
  bottom: -18rem;
  background: radial-gradient(circle at center, rgba(0, 106, 90, 0.22), rgba(0, 106, 90, 0));
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 32px));
  margin: 28px auto 52px;
}

.screen {
  display: none;
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 30px;
  animation: rise-in 320ms ease;
}

.screen.active {
  display: block;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

#home-title {
  font-size: clamp(30px, 5.2vw, 42px);
  line-height: 1.2;
}

.subtitle {
  margin-top: 10px;
  color: var(--primary-deep);
  font-size: clamp(18px, 3vw, 23px);
  font-weight: 700;
}

.intro-copy {
  margin-top: 18px;
  color: var(--muted);
}

.tag-grid {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}

.card-block {
  margin-top: 22px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.card-block h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

.card-block p + p {
  margin-top: 6px;
}

.theory-card {
  border: 1px dashed rgba(0, 106, 90, 0.35);
}

.formula {
  color: var(--accent);
  font-weight: 800;
  font-size: 19px;
}

.home-actions {
  margin-top: 28px;
  display: grid;
  gap: 12px;
}

.btn {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.btn-primary {
  background: linear-gradient(120deg, var(--primary), #ef8245);
  color: #fff;
  box-shadow: 0 12px 24px rgba(206, 84, 20, 0.3);
}

.btn-secondary {
  background: #fff;
  color: #30291d;
  border: 1px solid rgba(80, 65, 47, 0.25);
}

.quiz-head {
  display: grid;
  gap: 10px;
}

.question-progress {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 30, 26, 0.1);
  overflow: hidden;
}

.progress-fill {
  width: 10%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #17a57e);
  transition: width 280ms ease;
}

.question-title {
  margin-top: 24px;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.3;
}

.dimension-badge {
  margin-top: 10px;
  display: inline-flex;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-weight: 700;
  font-size: 13px;
}

.options-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.option-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(88, 72, 53, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: border-color 130ms ease, transform 130ms ease, box-shadow 140ms ease;
}

.option-item strong {
  display: inline-block;
  min-width: 24px;
  margin-right: 10px;
  color: var(--primary-deep);
}

.option-item:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 92, 26, 0.45);
}

.option-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(212, 92, 26, 0.16);
  background: #fff7f3;
}

.quiz-warning {
  margin-top: 12px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

.quiz-actions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.loading-screen {
  text-align: center;
  padding-top: 56px;
  padding-bottom: 56px;
}

.spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 4px solid rgba(212, 92, 26, 0.26);
  border-top-color: var(--primary);
  animation: spin 700ms linear infinite;
}

.loading-screen h2 {
  font-size: clamp(24px, 4vw, 31px);
}

#loading-line {
  margin-top: 14px;
  color: var(--muted);
  font-weight: 600;
}

.result-content {
  display: grid;
  gap: 16px;
}

.result-title {
  font-size: clamp(27px, 4.8vw, 38px);
  line-height: 1.3;
}

.result-summary {
  color: var(--muted);
  font-size: 17px;
}

.score-card,
.result-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.result-state-inline {
  margin: 2px 0 10px;
  display: grid;
  gap: 8px;
}

.state-main-line,
.state-sub-line {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-chip-main {
  padding: 8px 14px;
  font-size: 15px;
}

.status-chip-sub {
  padding: 4px 10px;
  font-size: 13px;
}

.status-chip-action {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.status-chip--positive {
  background: #17824f;
  border-color: #17824f;
  color: #fff;
}

.status-chip--neutral {
  background: #f6de8f;
  border-color: #e2c36a;
  color: #6f5400;
}

.status-chip--negative {
  background: #f8c0ad;
  border-color: #e89a7e;
  color: #8a2f14;
}

.status-chip-main--soft.status-chip--neutral {
  background: #fff2c3;
  border-color: #e2c36a;
  color: #6f5400;
}

.status-chip-main--soft.status-chip--negative {
  background: #ffe6dc;
  border-color: #efb09a;
  color: #8a2f14;
}

.status-chip-main--outline.status-chip--neutral {
  background: transparent;
  border-color: #d1b154;
  color: #6f5400;
}

.result-status-divider {
  color: #8f7740;
  font-weight: 700;
}

.radar-card {
  display: grid;
  gap: 8px;
}

.radar-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.radar-svg {
  width: min(100%, 360px);
  height: auto;
}

.radar-grid {
  fill: rgba(23, 130, 79, 0.05);
  stroke: rgba(23, 130, 79, 0.22);
  stroke-width: 1;
}

.radar-axis {
  stroke: rgba(28, 85, 59, 0.24);
  stroke-width: 1;
}

.radar-area {
  fill: rgba(23, 130, 79, 0.24);
  stroke: #17824f;
  stroke-width: 2;
}

.radar-dot {
  fill: #0f6f44;
  stroke: #fff;
  stroke-width: 1.5;
}

.radar-label {
  font-size: 12px;
  font-weight: 700;
  fill: #3a3327;
  text-anchor: middle;
  dominant-baseline: middle;
}

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

.radar-score-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  min-height: 92px;
}

.radar-score-item strong {
  font-size: 26px;
  line-height: 1;
}

.radar-score-item--low {
  background: #ffe8e3;
  border-color: #f6b8a8;
  color: #aa2d14;
}

.radar-score-item--mid {
  background: #fff4cf;
  border-color: #efd488;
  color: #7f6207;
}

.radar-score-item--high {
  background: #e6f5ed;
  border-color: #b2e0c8;
  color: #176b47;
}

.radar-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: currentColor;
  font-size: 14px;
  font-weight: 700;
}

.score-total {
  font-size: 27px;
  color: var(--primary-deep);
  font-weight: 800;
}

.dimension-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.dimension-row {
  display: grid;
  grid-template-columns: 86px 1fr 56px;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.dimension-row span:last-child {
  text-align: right;
  font-weight: 700;
}

.dimension-bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(28, 25, 18, 0.12);
}

.dimension-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #17a57e);
  transition: width 420ms ease;
}

.label-title {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.bullet-list,
.step-list {
  margin: 0;
  padding-left: 20px;
  color: #40392d;
}

.bullet-list li + li,
.step-list li + li {
  margin-top: 7px;
}

.highlight-title {
  color: var(--primary-deep);
  font-weight: 800;
}

.cta-panel {
  display: grid;
  gap: 10px;
}

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

.extra-actions {
  display: grid;
  gap: 10px;
}

.error-actions {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.metrics-box {
  margin-top: 8px;
  border: 1px dashed rgba(0, 106, 90, 0.35);
  border-radius: var(--radius-md);
  background: rgba(0, 106, 90, 0.06);
}

.metrics-box summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--accent);
}

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

.metrics-box pre {
  margin: 0;
  padding: 0 14px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  color: #2c3f38;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(16px);
  max-width: min(640px, calc(100vw - 36px));
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(33, 30, 25, 0.92);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

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

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

@media (max-width: 700px) {
  .app-shell {
    width: calc(100% - 20px);
    margin-top: 16px;
    margin-bottom: 32px;
  }

  .screen {
    border-radius: 20px;
    padding: 20px;
  }

  .dimension-row {
    grid-template-columns: 70px 1fr 48px;
  }

  .radar-legend {
    gap: 8px;
  }

  .radar-score-item {
    min-height: 78px;
    gap: 6px;
    padding: 8px 6px;
  }

  .radar-badge {
    font-size: 12px;
    padding: 3px 8px;
  }

  .radar-score-item strong {
    font-size: 22px;
  }
}
