:root {
  color-scheme: light dark;
  --brand: #32cd32;
  --brand-deep: #176b2c;
  --brand-soft: #e7f7e9;
  --page: #f5f8f3;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --ink: #193322;
  --muted: #607066;
  --line: #d8e4da;
  --line-strong: #bdd2c1;
  --shadow: 0 18px 48px rgba(38, 82, 45, 0.08);
  --radius-panel: 24px;
  --radius-control: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
  touch-action: manipulation;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 96% 0%, rgba(50, 205, 50, 0.12), transparent 24rem),
    var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

button,
select {
  font: inherit;
}

button,
label,
select {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-shell {
  width: min(100%, 700px);
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    calc(18px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))
    16px
    calc(28px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 202px;
  padding: 22px 22px 28px;
  border-radius: var(--radius-panel);
  color: #f9fff8;
  background: var(--brand-deep);
  box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
  position: absolute;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.hero::before {
  top: -76px;
  right: -34px;
  width: 194px;
  height: 194px;
  background: rgba(124, 225, 92, 0.36);
}

.hero::after {
  right: 52px;
  bottom: -96px;
  width: 176px;
  height: 176px;
  border: 30px solid rgba(255, 255, 255, 0.09);
}

.brand-name,
.hero-copy {
  position: relative;
  z-index: 1;
}

.brand-name {
  margin: 0;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.hero-copy {
  margin-top: 28px;
}

.hero-kicker {
  margin: 0 0 8px;
  color: #c9f5c7;
  font-size: 13px;
  font-weight: 760;
}

.hero h1 {
  max-width: 12em;
  margin: 0;
  font-size: clamp(31px, 9vw, 45px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-copy > p:last-child {
  max-width: 28rem;
  margin: 13px 0 0;
  color: rgba(249, 255, 248, 0.84);
  font-size: 15px;
  line-height: 1.65;
}

.panel,
.result-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px 18px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.section-heading > span {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  place-items: center;
  color: var(--brand-deep);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 820;
}

.section-heading h2 {
  margin: 1px 0 0;
  font-size: 21px;
  line-height: 1.35;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.degree-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  min-width: 0;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.degree-selector label {
  position: relative;
}

.degree-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.degree-selector label > span {
  display: grid;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 760;
  transition: border-color 150ms ease, background-color 150ms ease, transform 100ms ease;
}

.degree-selector input:checked + span {
  border-color: var(--brand);
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.degree-selector input:focus-visible + span {
  outline: 3px solid rgba(50, 205, 50, 0.24);
  outline-offset: 2px;
}

.degree-selector label:active > span {
  transform: scale(0.985);
}

.filter-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.code-guide {
  display: grid;
  gap: 9px;
  padding: 15px;
  border: 1px solid #c7dec9;
  border-radius: var(--radius-control);
  background: var(--brand-soft);
}

.code-guide > strong {
  color: var(--brand-deep);
  font-size: 14px;
  line-height: 1.45;
}

.code-guide > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #31523a;
  font-size: 12px;
}

.code-guide b {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.code-guide i {
  color: var(--muted);
  font-style: normal;
}

.code-guide p {
  margin: 0;
  color: #45624c;
  font-size: 12px;
  line-height: 1.55;
}

.select-field label {
  display: block;
  margin-bottom: 8px;
  color: #304b37;
  font-size: 14px;
  font-weight: 760;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

select {
  width: 100%;
  min-height: 52px;
  padding: 0 44px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  outline: none;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 15px;
  appearance: none;
}

select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(50, 205, 50, 0.13);
}

select:disabled {
  color: #89938b;
  background: #f1f3f0;
  opacity: 1;
}

.level-panel {
  scroll-margin-top: 14px;
}

.parent-card {
  margin-top: 18px;
  padding: 17px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface-soft);
}

.level-badge {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  font-size: 11px;
  font-weight: 800;
}

.selected-path {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.parent-card h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 7px 0 0;
  line-height: 1.4;
}

.parent-card h3 strong {
  color: var(--brand-deep);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 20px;
}

.parent-card h3 span {
  font-size: 18px;
}

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

.decision-button {
  display: grid;
  min-height: 84px;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--surface-soft);
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, transform 100ms ease;
}

.decision-button.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.decision-button:focus-visible {
  outline: 3px solid rgba(50, 205, 50, 0.24);
  outline-offset: 2px;
}

.decision-button:active {
  transform: scale(0.985);
}

.decision-title {
  color: var(--muted);
  font-size: 11px;
}

.decision-button strong {
  font-size: 14px;
  line-height: 1.4;
}

.child-field {
  margin-top: 16px;
}

.result-panel {
  padding: 20px 18px;
  scroll-margin-top: 14px;
}

.result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.result-level {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.result-panel h2 {
  margin: 14px 0 0;
  font-size: 24px;
  line-height: 1.35;
}

.result-path {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.result-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 17px;
}

.result-code {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-soft);
}

.result-code.is-primary {
  border-color: #b8dabd;
  background: var(--brand-soft);
}

.result-code span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.result-code strong {
  color: var(--brand-deep);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 21px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.result-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 17px 0 0;
}

.result-meta div {
  min-width: 0;
}

.result-meta dt {
  color: var(--muted);
  font-size: 11px;
}

.result-meta dd {
  margin: 4px 0 0;
  color: #304b37;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.review-note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #4c5f52;
  font-size: 12px;
  line-height: 1.6;
}

footer {
  padding: 18px 8px 2px;
  text-align: center;
}

footer p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

@media (min-width: 640px) {
  .app-shell {
    padding-right: 24px;
    padding-left: 24px;
  }

  .hero {
    min-height: 215px;
    padding: 28px 30px 34px;
  }

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

@media (max-width: 420px) {
  .result-codes,
  .result-meta {
    grid-template-columns: 1fr;
  }

  .decision-grid {
    gap: 8px;
  }

  .decision-button {
    min-height: 88px;
    padding: 11px;
  }
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --brand-deep: #69df73;
    --brand-soft: #16371f;
    --page: #101713;
    --surface: #18221b;
    --surface-soft: #1d2920;
    --ink: #e5f0e7;
    --muted: #a4b2a7;
    --line: #334438;
    --line-strong: #46614c;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  }

  body {
    background:
      radial-gradient(circle at 96% 0%, rgba(50, 205, 50, 0.08), transparent 24rem),
      var(--page);
  }

  .code-guide {
    border-color: #355a3d;
  }

  .code-guide > span,
  .code-guide p,
  .select-field label,
  .result-meta dd {
    color: #d2dfd4;
  }

  .code-guide b {
    background: rgba(255, 255, 255, 0.06);
  }

  select:disabled {
    color: #829086;
    background: #172019;
  }

  .result-code.is-primary {
    border-color: #3d6a45;
  }

  .review-note {
    color: #b6c5b8;
  }
}
