:root {
  --bg: #eef8ef;
  --panel: #ffffff;
  --panel-soft: #f7fcf8;
  --text: #1d2f27;
  --muted: #66776d;
  --line: #d7e9dc;
  --green: #4f9f6f;
  --green-dark: #2f7552;
  --green-soft: #dff2e5;
  --blue: #5474c8;
  --blue-soft: #eef3ff;
  --mild: #9adf3a;
  --moderate: #ffad18;
  --severe: #ee2e2e;
  --warning: #936c2f;
  --danger: #a74747;
  --shadow: 0 18px 50px rgba(47, 117, 82, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(238, 248, 239, 0.92), rgba(246, 252, 247, 0.98)),
    radial-gradient(circle at 12% 10%, rgba(111, 174, 132, 0.18), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(102, 168, 126, 0.12), transparent 28%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(960px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 46px;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

#intro-screen,
.report-header,
.question-card,
.report-section,
.score-panel,
.modal-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

#intro-screen {
  padding: clamp(24px, 5vw, 52px);
  border-radius: 18px;
}

.brand-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green-dark);
  font-weight: 700;
}

.brand-note,
.intro-label,
.question-kicker,
.score-panel span {
  color: var(--muted);
  font-size: 0.92rem;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 16px;
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  max-width: 740px;
  color: #34463b;
  font-size: 1.08rem;
}

.notice {
  margin: 28px 0;
  padding: 18px 20px;
  border: 1px solid #c8e3cf;
  border-radius: 12px;
  background: var(--panel-soft);
}

.notice p {
  margin: 8px 0 0;
  color: #3d5145;
}

.intro-section,
.level-legend {
  margin: 22px 0;
  padding: clamp(18px, 4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 252, 248, 0.92);
}

.intro-section h2,
.level-legend h2 {
  color: var(--green-dark);
  font-size: 1.45rem;
}

.intro-section p {
  color: #3d5145;
}

.dimension-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.overview-card {
  padding: 16px;
  border: 1px solid #dce9e1;
  border-top: 4px solid var(--green);
  border-radius: 12px;
  background: #ffffff;
}

.overview-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green-dark);
  font-size: 1.05rem;
}

.overview-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.legend-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.legend-list div {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #35483d;
}

.legend-swatch {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 7px;
}

.level-normal {
  background: #93ee9c;
}

.level-mild {
  background: var(--mild);
}

.level-moderate {
  background: var(--moderate);
}

.level-severe {
  background: var(--severe);
}

.intro-grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0;
}

.intro-grid > div {
  min-height: 142px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247, 252, 248, 0.86);
}

.intro-grid > div:nth-child(4) {
  grid-column: 1 / -1;
  min-height: auto;
  padding: 14px 18px;
  background: rgba(247, 252, 248, 0.86);
  border-color: var(--line);
}

.intro-grid strong {
  display: block;
  margin: 4px 0 8px;
  font-size: 1.25rem;
}

.intro-grid p,
.source-note {
  margin-bottom: 0;
  color: var(--muted);
}

.access-panel {
  margin: 22px 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.access-panel.is-valid {
  border-color: #a9d6b7;
  background: #eff9f2;
}

.access-panel.is-invalid {
  border-color: #e6b9b9;
  background: #fff5f5;
}

.access-status-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.access-status-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.primary-btn {
  padding: 0 22px;
  color: #ffffff;
  background: var(--green-dark);
}

.primary-btn:hover {
  background: #276647;
}

.secondary-btn,
.ghost-btn {
  color: var(--green-dark);
  background: var(--green-soft);
}

.secondary-btn {
  padding: 0 22px;
}

.ghost-btn {
  min-width: 70px;
  padding: 0 14px;
}

.source-note {
  margin-top: 20px;
  font-size: 0.9rem;
}

.test-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 0 18px;
  background: rgba(238, 248, 239, 0.94);
  backdrop-filter: blur(10px);
}

.progress-wrap {
  flex: 1;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #d8eadf;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.question-card {
  min-height: 420px;
  padding: clamp(22px, 5vw, 44px);
  border-radius: 16px;
}

.question-card h2 {
  min-height: 92px;
  margin-bottom: 26px;
  font-size: clamp(1.45rem, 4.5vw, 2.45rem);
  line-height: 1.3;
  letter-spacing: 0;
}

.encouragement {
  margin: 0 0 22px;
  padding: 13px 16px;
  border: 1px solid #d5e7dc;
  border-radius: 12px;
  color: var(--green-dark);
  background: #eef8f2;
  text-align: center;
  font-weight: 700;
}

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

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #ffffff;
  text-align: left;
}

.option-btn:hover,
.option-btn.is-selected {
  border-color: var(--green);
  background: #eef9f1;
}

.option-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  color: var(--green-dark);
  background: var(--green-soft);
  font-weight: 800;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.nav-row button {
  flex: 1;
}

.report-header {
  color: #ffffff;
  background: linear-gradient(135deg, var(--green-dark), #68a97e 52%, #86b995);
  padding: clamp(22px, 5vw, 42px);
  border-radius: 16px;
  margin-bottom: 18px;
}

.report-header h1 {
  margin: 18px 0 10px;
}

.report-header p {
  color: rgba(255, 255, 255, 0.86);
}

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

.score-panel {
  min-height: 150px;
  padding: 18px;
  border-radius: 14px;
  text-align: center;
}

.score-panel strong {
  display: block;
  margin: 8px 0;
  font-size: 2.1rem;
  line-height: 1;
}

.score-panel p {
  margin: 0;
  color: var(--muted);
}

.main-score {
  background: #e8f7ed;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  min-height: 42px;
  padding: 4px 16px;
  border-radius: 13px;
  color: #ffffff;
  font-weight: 800;
}

.severity-normal {
  background: #79d982;
}

.severity-mild {
  background: var(--mild);
}

.severity-moderate {
  background: var(--moderate);
}

.severity-severe {
  background: var(--severe);
}

.report-section {
  padding: clamp(20px, 4vw, 32px);
  border-radius: 14px;
  margin-top: 18px;
}

.report-section h2 {
  margin-bottom: 14px;
  font-size: 1.35rem;
  color: var(--green-dark);
}

#radar-chart {
  width: 100%;
  max-width: 680px;
  height: auto;
  display: block;
  margin: 4px auto 22px;
}

.interpretation-section {
  border-left: 5px solid var(--green);
  background: linear-gradient(135deg, #f4fbf6, #f7fbff);
}

.interpretation-copy {
  color: #34463b;
  font-size: 1.04rem;
}

.interpretation-copy p {
  margin: 0;
}

.interpretation-copy p + p {
  margin-top: 18px;
}

.highlight {
  color: var(--green-dark);
  font-weight: 800;
}

.factor-table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.factor-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: center;
}

.factor-table th {
  padding: 14px 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green-dark), #73aa85);
  font-weight: 800;
}

.factor-table td {
  padding: 14px 12px;
  border-top: 1px solid #e5eee8;
}

.factor-table tr:nth-child(even) td {
  background: #f8fcf9;
}

.severity-pill {
  display: inline-flex;
  min-width: 74px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 4px 13px;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 800;
}

.warm-tip {
  margin: 18px 0 0;
  color: #44584c;
}

.authority-note {
  color: var(--muted);
}

.factor-explain-section {
  border-left: 5px solid var(--green-dark);
}

.factor-explain-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.factor-explain-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.factor-explain-card h3 {
  margin: 0 0 10px;
  color: #24392e;
  font-size: 1.12rem;
}

.factor-explain-card p {
  margin: 0;
  color: #42574a;
}

.factor-explain-card .factor-items {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.dimension-item {
  padding: clamp(18px, 4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff9df;
}

.dimension-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-weight: 800;
  font-size: 1.18rem;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dcece1;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.dimension-detail-block {
  margin-top: 20px;
}

.dimension-detail-block strong {
  display: block;
  margin-bottom: 8px;
  color: #23362c;
  font-size: 1.04rem;
}

.dimension-detail-block p,
.dimension-source,
.focus-card p {
  margin: 10px 0 0;
  color: #43574b;
}

.dimension-source {
  padding-top: 16px;
  border-top: 1px dashed #d9cc8c;
  color: #6f746d;
  font-size: 0.9rem;
}

.focus-card {
  padding: 16px;
  border-left: 4px solid var(--green-dark);
  border-radius: 12px;
  background: #f7fcf8;
}

.focus-card + .focus-card {
  margin-top: 12px;
}

.guidance-section {
  background: #f4faf6;
}

.guidance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.guidance-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.guidance-card strong {
  display: block;
  margin-bottom: 8px;
  color: #24392e;
  font-size: 1.08rem;
}

.guidance-card p {
  margin: 0;
  color: #4b5f53;
}

.source-box {
  background: #f8fcf9;
}

.source-box a {
  color: var(--green-dark);
  font-weight: 700;
}

.privacy-box {
  background: #f7fcf8;
}

.service-box {
  border-color: #ead889;
  background: #fff5bf;
  box-shadow: 0 18px 50px rgba(147, 108, 47, 0.16);
}

.service-box h2 {
  color: #7a5a16;
}

.service-box p {
  margin: 0;
  color: #4b421f;
  font-size: 1.08rem;
}

.service-box strong {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 2px 10px;
  border-radius: 9px;
  color: #ffffff;
  background: #d19b15;
  font-size: 1.14rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(29, 47, 39, 0.34);
}

.modal.is-open {
  display: flex;
}

.modal-card {
  position: relative;
  width: min(430px, 100%);
  padding: 26px;
  border-radius: 16px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #edf6f0;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 1.35rem;
}

.modal-card label {
  display: block;
  margin: 18px 0 8px;
  color: var(--muted);
  font-weight: 700;
}

.modal-card input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}

.modal-card input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(79, 159, 111, 0.14);
}

.error-text {
  min-height: 24px;
  margin: 8px 0 12px;
  color: var(--danger);
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 960px);
    padding-top: 16px;
  }

  #intro-screen,
  .question-card,
  .report-header,
  .report-section {
    border-radius: 14px;
  }

  .intro-grid,
  .summary-grid,
  .dimension-overview,
  .legend-list,
  .guidance-grid {
    grid-template-columns: 1fr;
  }

  .intro-grid > div,
  .score-panel {
    min-height: auto;
  }

  .test-topbar {
    gap: 10px;
  }

  .question-card {
    min-height: 520px;
  }

  .question-card h2 {
    min-height: 120px;
  }

  .factor-table {
    min-width: 520px;
  }

  .nav-row {
    position: sticky;
    bottom: 0;
    padding: 12px 0 2px;
    background: rgba(238, 248, 239, 0.94);
    backdrop-filter: blur(10px);
  }
}
