:root {
  color-scheme: light;
  --ink: #171717;
  --paper: #ffffff;
  --wash: #eef8f0;
  --line: #d8ded6;
  --green: #1f8a55;
  --red: #d74141;
  --yellow: #f2c94c;
  --cyan: #18a7a7;
  --muted: #5f6760;
  --shadow: 0 18px 50px rgba(23, 23, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, #eef8f0 55%, #ffffff 100%);
  color: var(--ink);
}

button,
textarea,
select {
  font: inherit;
}

.topbar {
  min-height: 230px;
  padding: 34px clamp(18px, 4vw, 56px) 24px;
  border-bottom: 2px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(242, 201, 76, 0.22), transparent 54%),
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(31, 138, 85, 0.08) 14px 16px);
}

.topbar h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(34px, 7vw, 74px);
  line-height: 1.05;
}

.intro {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

main {
  padding: 28px clamp(18px, 4vw, 56px) 50px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 24px;
  align-items: start;
}

.case-panel,
.result-panel,
.persona-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.section-title h2,
.verdict-block h2 {
  margin: 0 0 16px;
  font-size: 28px;
  line-height: 1.2;
}

label,
legend {
  display: block;
  margin: 18px 0 8px;
  font-weight: 800;
}

textarea,
select {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 190px;
  padding: 14px;
  resize: vertical;
}

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

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

fieldset {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

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

.persona-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.persona-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

button {
  width: 100%;
  margin-top: 22px;
  min-height: 54px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

button:hover {
  background: var(--green);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.status-line {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.verdict-block {
  min-height: 230px;
}

#verdictText {
  color: var(--muted);
  line-height: 1.75;
}

.meter {
  height: 18px;
  margin: 22px 0 8px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  transition: width 450ms ease;
}

.score-line {
  margin: 0;
  font-weight: 800;
}

.actions {
  border-top: 2px solid var(--line);
  padding-top: 18px;
}

.actions ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
}

.council {
  margin-top: 34px;
}

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

.persona-card {
  display: grid;
  gap: 14px;
  min-height: 250px;
  padding: 18px;
}

.persona-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.persona-card:nth-child(2) .avatar {
  background: #baf4d2;
}

.persona-card:nth-child(3) .avatar {
  background: #b8edf0;
}

.persona-head h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.persona-head p,
.analysis {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.vote {
  justify-self: start;
  min-height: 34px;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 900;
}

.vote.good {
  background: #baf4d2;
}

.vote.warn {
  background: #ffe38a;
}

.vote.bad {
  background: #ffb3ae;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .topbar {
    min-height: 0;
    padding-top: 22px;
  }

  .topbar h1 {
    font-size: 42px;
  }

  .case-panel,
  .result-panel {
    padding: 18px;
  }

  .field-grid,
  .persona-picker {
    grid-template-columns: 1fr;
  }

  .section-title h2,
  .verdict-block h2 {
    font-size: 24px;
  }
}
