:root {
  color-scheme: light;
  --ink: #1d2528;
  --muted: #607078;
  --line: #dce4e5;
  --paper: #f7f4ed;
  --panel: #ffffff;
  --dark: #243233;
  --accent: #d94f2b;
  --accent-dark: #a7351a;
  --green: #2d7a5f;
  --yellow: #a96a00;
  --red: #b7352f;
  --shadow: 0 18px 48px rgba(31, 45, 47, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(247, 244, 237, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: var(--dark);
  color: #fff;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover {
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(46px, 8vw, 96px) clamp(18px, 5vw, 72px) 44px;
  align-items: center;
}

.hero-copy {
  max-width: 840px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 22px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 19px;
}

.hero-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--dark);
  border-radius: 7px;
  padding: 11px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(31, 45, 47, 0.12);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.secondary {
  background: transparent;
  color: var(--dark);
}

.button.full {
  width: 100%;
}

.hero-panel,
.form-card,
.result-panel,
.explain-grid article,
.method {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 22px;
}

.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.metric-value {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
}

.metric-label {
  color: var(--muted);
  font-weight: 700;
}

.hero-panel p {
  margin: 18px 0 0;
  color: var(--muted);
}

.checker,
.mode-explain,
.guides,
.method {
  margin: 28px clamp(18px, 5vw, 72px);
}

.checker {
  padding-top: 26px;
}

.section-heading {
  max-width: 880px;
  margin-bottom: 22px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 17px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.mode-button {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.mode-button strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 17px;
}

.mode-button span {
  color: var(--muted);
  font-size: 13px;
}

.mode-button.active {
  border-color: var(--accent);
  outline: 3px solid rgba(217, 79, 43, 0.14);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.form-card {
  padding: clamp(18px, 3vw, 28px);
}

.form-head {
  margin-bottom: 20px;
}

.form-head p {
  color: var(--muted);
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid #cfd9db;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

select {
  height: 46px;
  padding: 0 12px;
}

input {
  height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

.question-list {
  display: grid;
  gap: 14px;
  margin: 20px 0;
}

.preset-card,
.cost-card {
  display: grid;
  gap: 16px;
  margin: 20px 0;
  padding: 18px;
  border: 1px solid #e4d5c5;
  border-radius: 8px;
  background: #fff8ee;
}

.preset-card h3,
.cost-card h3 {
  margin-bottom: 4px;
}

.preset-card p,
.cost-card p {
  margin: 0;
  color: var(--muted);
}

.preset-card {
  border-color: #d7e0d8;
  background: #f4fbf5;
}

.textarea-label {
  margin-bottom: 18px;
}

.result-panel {
  min-height: 560px;
  padding: clamp(18px, 3vw, 28px);
}

.empty-state {
  display: grid;
  min-height: 420px;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  color: #fff;
  font-weight: 900;
}

.risk-badge.low {
  background: var(--green);
}

.risk-badge.medium {
  background: var(--yellow);
}

.risk-badge.high {
  background: var(--red);
}

.score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin: 18px 0 12px;
  align-items: center;
}

.score {
  font-size: 58px;
  font-weight: 950;
  line-height: 1;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ecec;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.result-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.result-block ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.result-block li {
  margin: 8px 0;
}

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

.number-card {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  padding: 12px;
}

.number-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 24px;
  line-height: 1.1;
}

.number-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafafa;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mode-explain {
  padding: 34px 0 6px;
}

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

.explain-grid article {
  padding: 18px;
  box-shadow: none;
}

.explain-grid p {
  color: var(--muted);
}

.guides {
  padding: 34px 0 6px;
}

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

.guide-card {
  display: block;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(31, 45, 47, 0.07);
}

.guide-card span {
  display: inline-flex;
  margin-bottom: 30px;
  color: var(--accent-dark);
  font-weight: 900;
}

.guide-card p {
  color: var(--muted);
}

.article {
  max-width: 920px;
  margin: 34px auto;
  padding: clamp(20px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.article h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.article h2 {
  margin-top: 34px;
  font-size: clamp(24px, 3vw, 32px);
}

.article p,
.article li {
  color: #425056;
  font-size: 17px;
}

.article ul,
.article ol {
  padding-left: 22px;
}

.article li {
  margin: 10px 0;
}

.article-cta {
  margin-top: 34px;
  padding: 18px;
  border-radius: 8px;
  background: #fff8ee;
  border: 1px solid #e4d5c5;
}

.method {
  padding: clamp(22px, 4vw, 38px);
}

.method-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
}

.method-list {
  margin: 0;
  padding-left: 20px;
}

.method-list li {
  margin-bottom: 10px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 50px;
  padding: 28px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media print {
  .topbar,
  .hero,
  .mode-grid,
  .risk-form,
  .mode-explain,
  .method,
  .footer,
  .result-actions {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .checker {
    margin: 0;
    padding: 0;
  }

  .tool-layout {
    display: block;
  }

  .result-panel {
    min-height: auto;
    border: 0;
    box-shadow: none;
  }
}

.footer p {
  margin: 0;
}

.footer div {
  display: flex;
  gap: 16px;
}

@media (max-width: 1080px) {
  .hero,
  .tool-layout,
  .method-layout {
    grid-template-columns: 1fr;
  }

  .mode-grid,
  .explain-grid,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding-top: 34px;
  }

  .mode-grid,
  .guide-grid,
  .explain-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .mode-button {
    min-height: auto;
  }

  .score-row {
    grid-template-columns: 1fr;
  }

  .number-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
  }
}
