:root {
  --paper: #f6f4ef;
  --paper-warm: #f0ede5;
  --ink: #2c2a25;
  --ink-light: #5a574e;
  --ink-faint: #8b877b;
  --rule: #d4d0c5;
  --rule-light: #e5e2d9;
  --accent: #c4553a;
  --table: #111217;
  --table-soft: #18191f;
  --table-rule: #30323a;
  --table-text: #f3f1eb;
  --table-muted: #b7b3aa;
  --cache-note: #9c4f1c;
  --error: #b42318;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
}

body {
  background-image:
    radial-gradient(ellipse at 18% 45%, rgba(210, 200, 180, 0.16) 0%, transparent 48%),
    radial-gradient(ellipse at 82% 16%, rgba(200, 190, 170, 0.11) 0%, transparent 42%);
  font-family: "Poppins", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
}

.report-page {
  width: calc(100% - 64px);
  max-width: 1880px;
  margin: 0 auto;
  padding: 54px 0 72px;
}

.sheet {
  width: 100%;
  background: transparent;
}

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  min-height: 118px;
  padding: 0 2px 24px;
  border-bottom: 1px solid var(--rule-light);
}

.title-block {
  min-width: 0;
}

.section-num {
  display: block;
  margin-bottom: 18px;
  color: var(--ink-faint);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-style: italic;
}

.metric-board {
  margin-top: 42px;
}

.detail-section {
  margin-top: 52px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.section-heading .section-num {
  margin-bottom: 6px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.section-note {
  padding-bottom: 3px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-align: right;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--rule-light);
  border-radius: 3px;
  background: var(--rule-light);
}

.metric-cell {
  min-height: 122px;
  padding: 24px 26px 22px;
  background: rgba(255, 255, 255, 0.62);
}

.metric-cell.accent {
  box-shadow: inset 0 2px 0 rgba(196, 85, 58, 0.72);
}

.metric-label {
  display: block;
  margin-bottom: 12px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.metric-value {
  display: block;
  color: var(--ink);
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(28px, 2.3vw, 38px);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-cell.accent .metric-value {
  color: var(--accent);
}

.metric-unit {
  margin-left: 7px;
  color: var(--ink-faint);
  font-family: "Poppins", "PingFang SC", sans-serif;
  font-size: 11px;
  font-weight: 400;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(30px, 2.5vw, 42px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.04em;
}

.report-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  padding-bottom: 5px;
}

.report-meta span {
  max-width: 420px;
  color: var(--cache-note);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: right;
}

.report-meta strong {
  color: var(--ink-light);
  font-family: Georgia, "Songti SC", serif;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.table-scroll {
  width: 100%;
  margin-top: 0;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid #26272e;
  border-radius: 3px;
  background: var(--table);
  box-shadow: 0 18px 42px rgba(31, 29, 25, 0.13);
  scrollbar-color: #76766f #24252b;
  scrollbar-width: thin;
}

.table-scroll::-webkit-scrollbar {
  height: 12px;
}

.table-scroll::-webkit-scrollbar-track {
  background: #24252b;
}

.table-scroll::-webkit-scrollbar-thumb {
  border: 3px solid #24252b;
  border-radius: 999px;
  background: #85857e;
}

table {
  width: 1890px;
  table-layout: fixed;
  border-collapse: collapse;
  border: 0;
  color: var(--table-text);
}

th,
td {
  min-height: 48px;
  padding: 12px 10px;
  border: 1px solid var(--table-rule);
  vertical-align: middle;
}

th {
  height: 64px;
  background: #0e0f13;
  color: var(--table-muted);
  font-family: "Poppins", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

td {
  background: var(--table);
  color: var(--table-text);
  font-family: "Poppins", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tbody tr:nth-child(even):not(.subtotal):not(.total) td {
  background: var(--table-soft);
}

tbody tr:not(.subtotal):not(.total):hover td {
  background: #222329;
}

td.text,
td.center,
td.num {
  text-align: center;
}

td.num {
  font-variant-numeric: tabular-nums;
  color: #dedbd3;
}

td.project-name {
  padding: 12px 16px;
  color: #ffffff;
  font-weight: 500;
  line-height: 1.5;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

tr.subtotal td {
  background: #26231f;
  color: #e9ddd3;
  font-weight: 500;
  border-top-color: rgba(196, 85, 58, 0.75);
}

tr.total td {
  background: #4b2b24;
  color: #ffffff;
  font-weight: 600;
  border-color: #714032;
}

.state {
  margin-top: 26px;
  padding: 48px 16px;
  border: 1px solid var(--rule-light);
  background: rgba(255, 255, 255, 0.48);
  font-size: 14px;
  text-align: center;
}

.state.error {
  color: var(--error);
}

@media (max-width: 900px) {
  .report-page {
    width: calc(100% - 24px);
    padding: 28px 0 44px;
  }

  .masthead {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    padding-bottom: 18px;
  }

  .section-num {
    margin-bottom: 12px;
  }

  .report-meta {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }

  .report-meta span {
    max-width: 70%;
    text-align: left;
  }

  .table-scroll {
    margin-top: 0;
  }

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

  .metric-cell {
    min-height: 108px;
    padding: 20px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .section-note {
    text-align: left;
  }
}

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