:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #667085;
  --line: #d8dee7;
  --surface: #ffffff;
  --page: #f5f7fb;
  --teal: #027a7a;
  --blue: #2457a6;
  --red: #c43d32;
  --yellow: #e0a900;
  --green: #2b8a3e;
  --shadow: 0 18px 45px rgba(24, 32, 42, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 247, 251, 0.92)),
    repeating-linear-gradient(90deg, rgba(36, 87, 166, 0.07) 0 1px, transparent 1px 88px);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.header-inner,
.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  min-height: 116px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.cube-mark {
  width: 72px;
  height: 72px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 5px;
  border: 2px solid var(--ink);
  background: var(--ink);
  box-shadow: var(--shadow);
  transform: rotate(-5deg);
}

.cube-mark span {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(24, 32, 42, 0.2);
}

.cube-mark span:nth-child(1),
.cube-mark span:nth-child(5),
.cube-mark span:nth-child(9) {
  background: var(--yellow);
}

.cube-mark span:nth-child(2),
.cube-mark span:nth-child(6) {
  background: var(--teal);
}

.cube-mark span:nth-child(3),
.cube-mark span:nth-child(7) {
  background: var(--red);
}

.cube-mark span:nth-child(4),
.cube-mark span:nth-child(8) {
  background: var(--blue);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 920px;
  font-size: clamp(1.75rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 1.1rem;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-shell {
  padding: 26px 0 48px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.tab-button[aria-selected="true"] {
  border-color: var(--ink);
  color: #ffffff;
  background: var(--ink);
}

.overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.metric,
.top-card,
.table-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 92px;
  padding: 16px;
}

.metric-label,
.table-count {
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-value {
  margin-top: 8px;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 850;
  line-height: 1.1;
}

.top-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  gap: 18px;
  margin-bottom: 22px;
}

.top-card,
.table-section {
  padding: 18px;
}

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

.top-list {
  display: grid;
  gap: 10px;
}

.top-entry {
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.top-entry:last-child {
  border-bottom: 0;
}

.top-position {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--blue);
  font-weight: 850;
}

.top-entry:nth-child(1) .top-position {
  background: var(--yellow);
  color: var(--ink);
}

.top-entry:nth-child(2) .top-position {
  background: var(--teal);
}

.top-entry:nth-child(3) .top-position {
  background: var(--red);
}

.top-person {
  min-width: 0;
}

.top-person p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.top-person span {
  color: var(--muted);
  font-size: 0.86rem;
}

.top-score {
  min-width: 54px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font-weight: 850;
  background: #f8fafc;
}

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

.insight-item {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.insight-item p {
  color: var(--muted);
  font-size: 0.9rem;
}

.insight-item strong {
  display: block;
  margin-top: 8px;
  font-size: 1.65rem;
  line-height: 1;
}

.table-section {
  padding-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #ffffff;
  background: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

td {
  font-size: 0.94rem;
}

tbody tr:nth-child(even) {
  background: #f8fafc;
}

tbody tr:hover {
  background: #eef7f6;
}

td:first-child,
td:last-child {
  font-weight: 850;
}

.empty-state,
.status {
  color: var(--muted);
}

.status {
  margin-top: 14px;
  min-height: 1.5em;
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .header-inner {
    min-height: 96px;
    gap: 14px;
  }

  .cube-mark {
    width: 56px;
    height: 56px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .overview,
  .top-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .header-inner,
  .page-shell {
    width: min(100% - 20px, 1180px);
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

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

  .tab-button {
    width: 100%;
  }

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