:root {
  color-scheme: light;
  --ink: #111722;
  --muted: #627083;
  --line: #e1dacd;
  --paper: #fffdf7;
  --page: #f3efe6;
  --black: #0d1422;
  --yellow: #ffd735;
  --teal: #068f83;
  --blue: #275da8;
  --red: #d74768;
  --green: #16825c;
  --shadow: 0 18px 42px rgba(13, 20, 34, 0.12);
  --shadow-soft: 0 10px 22px rgba(13, 20, 34, 0.07);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(13, 20, 34, 0.035) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(180deg, rgba(255, 215, 53, 0.38), rgba(243, 239, 230, 0) 250px),
    var(--page);
}

.report-shell,
.report-hero,
.status-strip,
.qa-panel,
.report-layout,
.panel,
.rank-row,
.change-card,
.qa-grid div,
.diagnostic-list div {
  min-width: 0;
}

button,
a {
  font: inherit;
}

.report-shell {
  width: min(1280px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 14px 0 180px;
}

.report-hero {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0 14px;
  background: linear-gradient(180deg, rgba(243, 239, 230, 0.97) 76%, rgba(243, 239, 230, 0));
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 4px;
  color: #526070;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
}

h2 {
  font-size: 22px;
  line-height: 1.1;
}

.hero-copy {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hero-actions a,
.hero-actions button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(13, 20, 34, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.88);
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
}

.hero-actions button {
  background: var(--black);
  color: white;
}

.status-strip {
  display: grid;
  grid-template-columns: minmax(250px, 1.15fr) repeat(3, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.status-strip article,
.qa-panel,
.notice-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow-soft);
}

.status-strip article {
  min-height: 92px;
  padding: 14px;
  border-top: 4px solid var(--teal);
}

.status-strip article span,
.status-strip article small,
.qa-grid span,
.diagnostic-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.status-strip article strong {
  display: block;
  margin: 7px 0 3px;
  font-size: clamp(21px, 2.1vw, 28px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.scan-status {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top-color: var(--blue);
}

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 7px rgba(255, 215, 53, 0.22);
}

.status-dot[data-tone="ok"] {
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(22, 130, 92, 0.16);
}

.status-dot[data-tone="bad"] {
  background: var(--red);
  box-shadow: 0 0 0 7px rgba(215, 71, 104, 0.16);
}

.up {
  color: var(--green);
}

.down {
  color: var(--red);
}

.flat {
  color: var(--ink);
}

.qa-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  margin-bottom: 12px;
  padding: 16px;
  border-left: 5px solid var(--black);
}

.qa-main p:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

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

.qa-grid div,
.diagnostic-list div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(13, 20, 34, 0.08);
  border-radius: 8px;
  background: #fffaf0;
}

.qa-grid strong,
.diagnostic-list strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.qa-grid small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.notice-card {
  margin-bottom: 12px;
  padding: 16px 18px;
  background: #fff4bf;
  box-shadow: none;
}

.notice-card strong {
  display: block;
  margin-bottom: 6px;
}

.notice-card p + p {
  margin-top: 4px;
}

.gap-panel {
  border-left: 5px solid var(--teal);
}

.gap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 180px) minmax(120px, 180px);
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}

.gap-main,
.gap-stat,
.gap-row {
  min-width: 0;
  padding: 13px;
  border: 1px solid #ebe3d5;
  border-radius: 8px;
  background: #fffaf0;
}

.gap-main h3 {
  margin: 0 0 7px;
  font-size: 24px;
  line-height: 1.1;
}

.gap-main p,
.gap-row p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.gap-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.gap-stat strong {
  display: block;
  margin-top: 9px;
  font-size: 28px;
  line-height: 1;
}

.gap-unresolved {
  display: grid;
  gap: 8px;
}

.gap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gap-row strong {
  display: block;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.gap-row span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--black);
  color: white;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 950;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
  gap: 12px;
  margin-bottom: 12px;
}

.panel {
  padding: 18px;
  margin-bottom: 12px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.rank-list,
.change-stack,
.diagnostic-list,
.scan-history {
  display: grid;
  gap: 9px;
}

.scan-history {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scan-run {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #ebe3d5;
  border-left: 5px solid #b8b0a1;
  border-radius: 8px;
  background: #fffaf0;
}

.scan-run.ok {
  border-left-color: var(--green);
}

.scan-run.warn {
  border-left-color: var(--yellow);
}

.scan-run.bad {
  border-left-color: var(--red);
}

.scan-run-main,
.scan-run-side {
  min-width: 0;
}

.scan-run-main strong,
.scan-run-side strong {
  display: block;
  margin-top: 5px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.scan-run small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.scan-run-side {
  text-align: right;
}

.run-badge {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--black);
  color: white;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 950;
}

.rank-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(92px, auto);
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid #ebe3d5;
  border-radius: 8px;
  background: #fffaf0;
}

.rank-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--black);
  color: white;
  font-weight: 950;
}

.rank-main {
  min-width: 0;
}

.item-title {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 950;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.item-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.delta {
  min-width: 104px;
  text-align: right;
  font-size: 18px;
  font-weight: 950;
}

.change-card {
  padding: 12px;
  border: 1px solid #ebe3d5;
  border-radius: 8px;
  background: #fffaf0;
}

.change-card strong {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.change-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.wide-table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

th,
td {
  padding: 11px 9px;
  border-bottom: 1px solid #ebe3d5;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

td:first-child {
  width: 48%;
  overflow: hidden;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

td:last-child,
th:last-child {
  text-align: right;
}

td:not(:first-child),
th:not(:first-child) {
  width: 13%;
}

.diagnostic-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.diagnostic-panel {
  margin-bottom: 0;
  scroll-margin-bottom: 160px;
}

body::after {
  display: block;
  height: 120px;
  content: "";
}

.empty-state {
  display: grid;
  min-height: 140px;
  place-items: center;
  border: 1px dashed #d8cfbd;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

@media (max-width: 920px) {
  .report-hero,
  .qa-panel,
  .report-layout,
  .gap-layout {
    display: block;
  }

  .hero-actions {
    justify-content: flex-start;
    margin-top: 16px;
  }

  .status-strip,
  .qa-grid,
  .diagnostic-list,
  .scan-history {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-panel {
    margin-bottom: 12px;
  }

  .qa-main {
    margin-bottom: 12px;
  }

  .gap-main,
  .gap-stat {
    margin-bottom: 10px;
  }
}

@media (max-width: 560px) {
  .report-shell {
    width: min(100% - 18px, 1200px);
    padding-top: 16px;
  }

  .status-strip,
  .qa-grid,
  .diagnostic-list,
  .scan-history {
    grid-template-columns: 1fr;
  }

  .scan-run {
    grid-template-columns: 1fr;
  }

  .scan-run-side {
    text-align: left;
  }

  .rank-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .delta {
    grid-column: 2;
    min-width: 0;
    text-align: left;
  }
}
