:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --text: #171a1d;
  --muted: #65707a;
  --line: #dfe4df;
  --ink: #22313f;
  --blue: #3267d6;
  --green: #138a62;
  --amber: #c77d1a;
  --red: #b84a3d;
  --shadow: 0 16px 40px rgba(25, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(246, 247, 244, 0) 260px),
    var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

button,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 4vw, 48px) 20px;
  border-bottom: 1px solid var(--line);
}

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

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

h1 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.score-note {
  min-width: 128px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.score-note span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.score-note strong {
  display: block;
  margin-top: 2px;
  font-size: 28px;
  line-height: 1;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 24px clamp(18px, 4vw, 48px);
}

.rank-panel,
.compare-panel,
.detail-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.detail-panel {
  margin: 0 clamp(18px, 4vw, 48px) 44px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head.compact {
  padding: 16px;
}

.panel-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.sort-control select {
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--text);
}

.rank-list {
  display: grid;
  gap: 0;
}

.cpu-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 128px 112px;
  gap: 16px;
  align-items: center;
  min-height: 104px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.cpu-row:last-child {
  border-bottom: 0;
}

.cpu-row:hover,
.cpu-row.active {
  background: #f8faf8;
}

.rank-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.cpu-name {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.cpu-name h3 {
  font-size: 20px;
  line-height: 1.2;
}

.cpu-name span {
  color: var(--muted);
  font-size: 13px;
}

.cpu-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.bar-wrap {
  margin-top: 12px;
  height: 8px;
  background: #e8ece8;
}

.bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.score-block {
  text-align: right;
}

.score-block strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.score-block span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.compare-toggle {
  height: 38px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

.compare-toggle.selected {
  border-color: var(--green);
  background: var(--green);
}

.ghost-button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.compare-slots {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.slot {
  min-height: 54px;
  padding: 10px 12px;
  border: 1px dashed #c9d0ca;
  color: var(--muted);
  font-size: 13px;
}

.slot.filled {
  border-style: solid;
  color: var(--text);
}

.slot strong {
  display: block;
  font-size: 16px;
}

.compare-result {
  padding: 16px;
}

.compare-result.empty {
  color: var(--muted);
  font-size: 14px;
}

.compare-table,
.metric-table {
  width: 100%;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td,
.metric-table th,
.metric-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-size: 13px;
  vertical-align: top;
}

.compare-table th:first-child,
.compare-table td:first-child,
.metric-table th:first-child,
.metric-table td:first-child {
  text-align: left;
}

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

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

.detail-content {
  padding: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 20px;
}

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

.spec-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.spec-item span {
  color: var(--muted);
}

.section-title {
  margin-bottom: 12px;
  font-size: 15px;
}

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

.detail-stack {
  display: grid;
  gap: 18px;
}

.empty-detail {
  color: var(--muted);
  min-height: 110px;
  display: grid;
  place-items: center;
}

.note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

  .compare-panel {
    order: -1;
  }

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

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

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

  .score-block {
    text-align: left;
    grid-column: 2;
  }

  .compare-toggle {
    grid-column: 2;
    width: 100%;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
