:root {
  color-scheme: dark;
  --bg: #0b0b0a;
  --surface: #151515;
  --surface-2: #1d1c1a;
  --line: #37322a;
  --line-strong: #665539;
  --text: #f4f0e7;
  --muted: #a8a096;
  --gold: #cba24a;
  --teal: #56b6a4;
  --red: #c45d4f;
  --white: #ffffff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: #0f0e0c;
}

.topbar__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 24px;
  align-items: center;
  max-width: 1400px;
  min-height: 132px;
  margin: 0 auto;
  padding: 22px 28px;
  position: relative;
}

.topbar__inner > div:first-child {
  padding-left: 15px;
  border-left: 3px solid var(--gold);
}

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

.presented-by {
  text-transform: none;
}

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

h1 {
  margin-bottom: 0;
  color: var(--white);
  font-size: 36px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 12px;
  font-size: 17px;
}

.poster {
  width: 96px;
  aspect-ratio: 1 / 1.18;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 10, 0.96);
  backdrop-filter: blur(12px);
}

.tabs__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 10px 28px;
  overflow-x: auto;
}

.next-actions {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(0, 1.4fr);
  gap: 28px;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px;
  border-bottom: 1px solid var(--line);
  background: #12110f;
}

.next-actions__intro h2 {
  margin-bottom: 7px;
  font-size: 24px;
}

.next-actions__intro > p:last-child {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

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

.next-action {
  display: grid;
  gap: 6px;
  min-height: 122px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.next-action:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: #211b10;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
}

.next-action--shanghai:hover { border-color: var(--teal); background: #111e1c; }
.next-action--regional { border-color: var(--gold); background: #241d10; }
.next-action--regional:hover { background: #302511; }
.next-action__status { color: var(--gold); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.next-action--shanghai .next-action__status { color: var(--teal); }
.next-action strong { font-size: 17px; line-height: 1.25; }
.next-action > span:last-child { color: var(--muted); font-size: 13px; }
.next-action__arrow { display: inline-block; margin-left: 3px; color: var(--text); transition: transform .18s ease; }
.next-action:hover .next-action__arrow { transform: translateX(4px); }

.tab,
.segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  line-height: 1;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.tab.is-active,
.segment.is-active {
  border-color: var(--gold);
  color: var(--white);
  background: #211b10;
}

.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 28px 48px;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

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

.controls {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 136px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--surface);
  color: var(--text);
}

.field input:focus,
.field select:focus {
  border-color: var(--gold);
}

.segmented {
  display: flex;
  gap: 6px;
  min-height: 40px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric {
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric__value {
  margin-top: 6px;
  color: var(--white);
  font-size: 26px;
  font-weight: 850;
}

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #181614;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td {
  color: var(--text);
  font-size: 14px;
}

tr:last-child td {
  border-bottom: 0;
}

.rank-row {
  transition: background 0.16s ease;
}

.rank-row:hover,
.rank-row.is-selected {
  background: #211d15;
}

.rank-cell {
  color: var(--gold);
  font-size: 20px;
  font-weight: 900;
  width: 74px;
}

.bar-name {
  min-width: 220px;
  color: var(--white);
  font-weight: 820;
}

.score {
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.score.high {
  color: var(--teal);
}

.score.penalty {
  color: var(--red);
}

.name-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.detail {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail__header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.detail__rank {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.detail__name {
  margin: 6px 0 0;
  color: var(--white);
  font-size: 24px;
}

.detail__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.mini-stat {
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.mini-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--white);
  font-size: 18px;
}

.detail-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.bar-meter {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
  margin: 9px 0;
  color: var(--muted);
  font-size: 13px;
}

.meter-track {
  height: 9px;
  overflow: hidden;
  border-radius: 8px;
  background: #29241c;
}

.meter-fill {
  width: var(--value);
  height: 100%;
  border-radius: 8px;
  background: var(--gold);
}

.comment-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-list li {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-2);
}

.comment-list small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-weight: 750;
}

.score-summary {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.summary-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary-block__inner {
  padding: 16px;
}

.distribution {
  display: grid;
  gap: 10px;
}

.dist-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.dist-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dist-bar {
  display: flex;
  height: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dist-segment {
  display: flex;
  min-width: 14px;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(0, 0, 0, 0.24);
  color: #0b0b0a;
  font-size: 11px;
  font-weight: 850;
}

.dist-segment:last-child {
  border-right: 0;
}

.bucket-0 {
  background: #7b2f2b;
}

.bucket-1 {
  background: #a5553a;
}

.bucket-2 {
  background: #c09243;
}

.bucket-3 {
  background: #86a55e;
}

.bucket-4 {
  background: #56b6a4;
}

.score-table td:last-child {
  white-space: normal;
  min-width: 260px;
}

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

.guide-section {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.guide-head {
  margin-bottom: 14px;
}

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

.guide-item {
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.guide-item h4 {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 15px;
}

.guide-item p,
.guide-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.guide-notes {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.guide-note {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11100e;
}

.guide-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--white);
  font-size: 14px;
}

.method-item {
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.method-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.formula {
  display: block;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f0e0c;
  color: var(--gold);
  overflow-x: auto;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1120px) {
  .ranking-layout,
  .score-summary {
    grid-template-columns: 1fr;
  }

  .detail {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .topbar__inner {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 18px;
  }

  .poster {
    display: none;
  }


  h1 {
    font-size: 32px;
  }

  .topbar__inner > div:first-child {
    padding-left: 12px;
    border-left-width: 2px;
  }

  .tabs__inner,
  .app {
    padding-left: 16px;
    padding-right: 16px;
  }

  .section-head {
    display: grid;
  }

  .next-actions {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 22px 16px;
  }

  .next-actions__buttons {
    grid-template-columns: 1fr;
  }

  .controls {
    width: 100%;
  }

  .field {
    min-width: min(100%, 180px);
    flex: 1;
  }

  .metrics,
  .method-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

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