:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --panel-soft: #eef2ed;
  --text: #17211b;
  --muted: #5f6d65;
  --line: #d7ded8;
  --green: #0b7a53;
  --red: #c23832;
  --amber: #946000;
  --shadow: 0 12px 32px rgba(27, 43, 32, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 36px;
}

.report-panel,
.history-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.report-panel {
  padding: 22px;
}

.history-panel {
  align-self: start;
  padding: 18px;
}

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

#generatedAt {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.source-note {
  margin: 14px 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.section-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.section-title {
  margin: 0;
  padding: 10px 12px;
  background: var(--panel-soft);
  font-size: 16px;
}

.item-list {
  display: grid;
}

.report-item {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 12px;
  border-top: 1px solid var(--line);
}

.item-name {
  font-weight: 700;
  line-height: 1.45;
}

.item-text {
  margin: 0;
  color: #223129;
  line-height: 1.68;
  font-size: 15px;
}

.main-judgment {
  margin-top: 18px;
  padding: 15px 16px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #eef7f2;
}

.main-judgment span {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.main-judgment p {
  margin-bottom: 0;
  line-height: 1.65;
}

.history-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.history-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.history-button:hover,
.history-button.active {
  border-color: var(--green);
  background: #f1f8f4;
}

.history-button strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

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

.up {
  color: var(--red);
  font-weight: 700;
}

.down {
  color: var(--green);
  font-weight: 700;
}

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

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

  .report-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  #generatedAt {
    white-space: normal;
  }
}
