:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #69747d;
  --line: #dce5df;
  --paper: #fbfdfb;
  --panel: #ffffff;
  --jade: #0f766e;
  --jade-dark: #0b534d;
  --cinnabar: #b45309;
  --blue: #315f88;
  --gold: #b7791f;
  --shadow: 0 18px 55px rgba(22, 42, 38, 0.12);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(244, 250, 246, 0.92), rgba(250, 252, 251, 1)),
    #f8fbf9;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--jade);
  text-decoration: none;
}

a:hover {
  color: var(--jade-dark);
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 24px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.seal {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid #9f2f20;
  color: #9f2f20;
  background: #fff;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.brand p,
.brand h1,
.source-note,
.page-foot {
  margin: 0;
}

.brand p {
  color: var(--muted);
  font-size: 13px;
}

.brand h1 {
  margin-top: 3px;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.source-note {
  max-width: 300px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.app-surface {
  display: grid;
  grid-template-columns: minmax(340px, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: stretch;
}

.tool-side,
.result-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.tool-side {
  overflow: hidden;
}

.brush-visual {
  display: block;
  width: 100%;
  height: clamp(150px, 25vw, 240px);
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 14px 14px 0;
}

.tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #f6faf8;
  cursor: pointer;
}

.tab.is-active {
  border-color: rgba(15, 118, 110, 0.48);
  color: #fff;
  background: var(--jade);
}

.panel {
  padding: 16px 14px 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

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

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: rgba(15, 118, 110, 0.68);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.primary-action {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--jade);
  cursor: pointer;
  font-weight: 700;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--jade-dark);
}

.result-side {
  min-height: 620px;
  padding: 22px;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

#result-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

#result-title {
  margin: 0;
  font-size: clamp(25px, 3.2vw, 38px);
  line-height: 1.12;
  letter-spacing: 0;
}

.score-ring {
  display: grid;
  width: 98px;
  height: 98px;
  flex: 0 0 auto;
  place-items: center;
  border: 8px solid rgba(15, 118, 110, 0.16);
  border-top-color: var(--jade);
  border-right-color: #d97706;
  border-radius: 50%;
  background: #fff;
}

.score-ring span {
  display: block;
  margin-top: 7px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.score-ring small {
  margin-top: -16px;
  color: var(--muted);
  font-size: 12px;
}

.result-body {
  display: grid;
  gap: 16px;
  padding-top: 18px;
}

.summary-grid,
.metrics-grid,
.candidate-grid {
  display: grid;
  gap: 12px;
}

.summary-grid {
  grid-template-columns: repeat(3, 1fr);
}

.metrics-grid {
  grid-template-columns: repeat(2, 1fr);
}

.summary-item,
.metric,
.candidate,
.grid-table,
.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.summary-item {
  padding: 13px;
}

.summary-item span,
.metric-label,
.candidate-meta,
.message,
.grid-cell span {
  color: var(--muted);
  font-size: 13px;
}

.summary-item strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.metric {
  padding: 14px;
}

.metric-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.metric-value {
  font-weight: 800;
}

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

.bar i {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--jade), #d97706);
}

.grid-table {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  overflow: hidden;
}

.grid-cell {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 12px 10px;
  border-right: 1px solid var(--line);
}

.grid-cell:last-child {
  border-right: 0;
}

.grid-cell strong {
  font-size: 22px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  color: var(--jade-dark);
  background: #eef8f5;
  font-size: 13px;
}

.candidate-grid {
  grid-template-columns: repeat(2, 1fr);
}

.candidate {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.candidate-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.candidate-title strong {
  font-size: 25px;
}

.candidate-title span {
  color: var(--cinnabar);
  font-weight: 800;
}

.candidate-meta {
  line-height: 1.65;
}

.message {
  padding: 15px;
  line-height: 1.7;
}

.page-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  padding: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100vw - 20px, 680px);
    padding-top: 18px;
  }

  .masthead,
  .app-surface {
    display: grid;
  }

  .source-note {
    max-width: none;
    text-align: left;
  }

  .app-surface {
    grid-template-columns: 1fr;
  }

  .result-side {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .masthead {
    gap: 12px;
  }

  .brand {
    align-items: flex-start;
  }

  .seal {
    width: 46px;
    height: 46px;
    font-size: 24px;
  }

  .form-grid,
  .summary-grid,
  .metrics-grid,
  .candidate-grid,
  .grid-table {
    grid-template-columns: 1fr;
  }

  .result-toolbar {
    align-items: flex-start;
  }

  .score-ring {
    width: 78px;
    height: 78px;
    border-width: 7px;
  }

  .score-ring span {
    font-size: 23px;
  }

  .grid-cell {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .grid-cell:last-child {
    border-bottom: 0;
  }
}
