:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #647067;
  --line: #d8e1dc;
  --paper: #fbfdfb;
  --panel: #ffffff;
  --green: #1f6f50;
  --green-dark: #0f4532;
  --gold: #c58a2b;
  --blue: #315d8c;
  --red: #b94b3e;
  --shadow: 0 20px 48px rgba(21, 47, 35, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

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

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

.brand img {
  width: 172px;
  max-width: 42vw;
  height: auto;
}

.brand div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand strong {
  font-size: 17px;
  white-space: nowrap;
}

.brand span,
.top-actions a,
.fineprint,
.field-hint {
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.top-actions a {
  border: 1px solid var(--line);
  padding: 8px 12px;
  background: #fff;
}

main {
  display: grid;
  gap: 28px;
  padding: 28px clamp(16px, 4vw, 54px) 44px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.control-panel,
.result-panel,
.methods > div,
.recommend-card,
.analysis-strip,
.major-detail {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.control-panel {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.panel-title,
.methods > div {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  background: #e7f2ec;
  color: var(--green-dark);
  border: 1px solid #c8dfd3;
  font-weight: 800;
}

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

h1 {
  font-size: 25px;
  line-height: 1.25;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  font-size: 17px;
  line-height: 1.35;
}

.panel-title p,
.methods p,
.major-detail p,
.empty-state p {
  color: var(--muted);
  line-height: 1.75;
  margin-top: 8px;
}

label {
  display: grid;
  gap: 8px;
  color: #2c3931;
  font-size: 14px;
  font-weight: 700;
}

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

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 111, 80, 0.14);
}

.two-cols,
.form-actions,
.data-tools,
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

button,
.import-label,
#downloadPoster {
  min-height: 44px;
  border: 1px solid #bfd0c8;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 800;
}

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

button:hover,
.import-label:hover,
#downloadPoster:hover,
.top-actions a:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(24, 57, 41, 0.12);
}

.import-label input {
  display: none;
}

.fineprint {
  line-height: 1.6;
}

.field-hint {
  line-height: 1.6;
  border: 1px solid #dbe8e1;
  background: #f5faf7;
  padding: 10px 12px;
}

.result-panel {
  min-height: 620px;
  overflow: hidden;
}

.empty-state {
  display: grid;
  grid-template-columns: 46% 1fr;
  min-height: 620px;
}

.empty-state img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.empty-state > div {
  display: grid;
  align-content: center;
  padding: 36px;
}

.results {
  display: grid;
  gap: 18px;
  padding: 24px;
}

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

.result-head p {
  color: var(--muted);
  line-height: 1.7;
  margin-top: 8px;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.analysis-strip {
  padding: 16px;
  box-shadow: none;
}

.analysis-strip b {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.band-section {
  display: grid;
  gap: 12px;
}

.band-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-left: 4px solid var(--green);
  background: #f5faf7;
  padding: 12px 14px;
}

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

.recommend-list {
  display: grid;
  gap: 14px;
}

.recommend-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 18px;
  padding: 18px;
  box-shadow: none;
}

.recommend-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

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

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

.badge.safe {
  background: var(--blue);
}

.plain-name,
.risk,
.record {
  color: var(--muted);
  line-height: 1.65;
  margin-top: 8px;
}

.record {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 8px;
}

.record span {
  background: #f4f7f5;
  border: 1px solid var(--line);
  padding: 8px;
}

.major-detail {
  padding: 14px;
  background: #fbfcfb;
  box-shadow: none;
}

.major-detail ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: #31423a;
  line-height: 1.6;
}

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

.methods > div {
  padding: 20px;
  box-shadow: none;
}

.notice {
  border: 1px solid #eadbbd;
  background: #fffaf0;
  color: #72551d;
  padding: 14px;
  line-height: 1.7;
}

.poster-modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 30;
  background: rgba(12, 22, 17, 0.62);
  padding: 22px;
}

.poster-modal.open {
  display: grid;
}

.poster-shell {
  position: relative;
  display: grid;
  gap: 12px;
  max-width: min(96vw, 520px);
  max-height: 94vh;
}

.poster-shell canvas {
  width: 100%;
  height: auto;
  max-height: 82vh;
  background: #fff;
  box-shadow: var(--shadow);
}

.close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  min-height: 40px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

#downloadPoster {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

@media (max-width: 980px) {
  .workspace,
  .methods,
  .empty-state,
  .recommend-card {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar,
  .result-head {
    display: grid;
  }

  .top-actions,
  .result-actions {
    justify-content: start;
  }

  .two-cols,
  .form-actions,
  .data-tools,
  .summary-grid,
  .record {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 22px;
  }

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

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .control-panel,
  .methods,
  .result-actions,
  .poster-modal {
    display: none !important;
  }

  main,
  .workspace,
  .result-panel,
  .results {
    display: block;
    padding: 0;
    box-shadow: none;
    border: 0;
  }

  .recommend-card {
    break-inside: avoid;
    margin-bottom: 12px;
  }
}
