:root {
  color-scheme: light;
  --paper: #f6f1e9;
  --ink: #1c1814;
  --muted: #635950;
  --rule: #c9beb1;
  --accent: #a83310;
  --accent-hover: #85280e;
  --sans: system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}
body:has(.player:not([hidden])) { padding-bottom: 90px; }
a { color: inherit; text-underline-offset: .25em; }
button, input { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled { opacity: .65; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: absolute; z-index: 3; padding: 10px; background: var(--paper); }
.shell { width: min(100% - clamp(32px, 7vw, 104px), 1380px); margin-inline: auto; }

.masthead, .site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.masthead { min-height: 74px; border-bottom: 1px solid var(--ink); }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .44em;
  font-size: clamp(16px, 2.45vw, 30px);
  font-weight: 550;
  letter-spacing: .015em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark b { font-weight: 850; }
.wordmark span { color: var(--accent); }
nav { display: flex; align-items: center; gap: clamp(14px, 3.3vw, 50px); }
nav a { font-size: clamp(12px, 1.36vw, 16px); font-weight: 640; white-space: nowrap; text-decoration: none; }
nav a:hover, .primary-link { color: var(--accent); text-decoration: underline; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
  border-bottom: 1px solid var(--ink);
}
.hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-block: clamp(25px, 6vw, 88px);
  padding-right: 12px;
}
h1, h2, p { margin: 0; }
h1 {
  font-size: clamp(38px, 5.55vw, 83px);
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: 1.1;
  text-wrap: balance;
}
.hero-copy p {
  margin-top: .65em;
  font: 500 clamp(16px, 2.05vw, 28px)/1.4 var(--serif);
}
.action {
  display: inline-flex;
  align-items: center;
  gap: 1.4em;
  padding: .72em 1.05em;
  margin-top: clamp(21px, 4vw, 50px);
  color: #fff;
  background: var(--accent);
  font-size: clamp(14px, 1.45vw, 18px);
  font-weight: 660;
  text-decoration: none;
}
.action:hover { background: var(--accent-hover); }
.action span { font-size: 1.2em; }
.hero-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 52% center; }

.chart, .method { scroll-margin-top: 20px; }
.chart { margin-top: clamp(25px, 4vw, 48px); }
.chart-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
h2 {
  font-size: clamp(27px, 3.45vw, 44px);
  font-weight: 850;
  letter-spacing: -.04em;
  line-height: 1.12;
}
.search { display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--rule); }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search input { width: clamp(105px, 15vw, 190px); padding: 8px 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.search-icon {
  display: block;
  position: relative;
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.search-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  right: -4px;
  bottom: -2px;
  background: currentColor;
  transform: rotate(45deg);
}
.chart-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  margin-block: 18px 12px;
}
.chart-choices { display: flex; gap: 7px; }
.chart-choices button {
  min-height: 38px;
  padding: 5px 12px;
  border: 1px solid var(--rule);
  background: transparent;
  font-size: 14px;
}
.chart-choices button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chart-choices button:hover { border-color: var(--ink); }
.snapshot { color: var(--muted); font-size: 13px; }
.chart-columns, .track {
  display: grid;
  grid-template-columns: clamp(26px, 6.15vw, 85px) minmax(0, 1fr) clamp(60px, 15vw, 200px) clamp(36px, 7vw, 92px);
  align-items: center;
  column-gap: clamp(7px, 2vw, 26px);
  padding-inline: clamp(0px, 1.3vw, 16px);
}
.chart-columns {
  min-height: 39px;
  color: var(--muted);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 13px;
  font-weight: 640;
}
.chart-columns span:nth-child(3) { text-align: right; }
.chart-columns span:last-child { text-align: center; }
.tracks { list-style: none; margin: 0; padding: 0; }
.track { min-height: 81px; border-bottom: 1px solid var(--rule); }
.track:hover, .track.is-playing { background: #eee6d9; }
.rank {
  font-size: clamp(17px, 3vw, 34px);
  font-weight: 770;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.055em;
}
.rank[data-leading] { color: var(--accent); }
.track-info { display: flex; gap: clamp(8px, 1.95vw, 25px); align-items: center; min-width: 0; }
.cover {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: clamp(38px, 6vw, 66px);
  aspect-ratio: 1;
  background: #e3d8c7;
}
.cover::before {
  content: "";
  width: 66%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #b15c32 0 16%, #272016 17% 26%, #4b3b2e 27% 29%, #272016 30% 53%, #4b3b2e 54% 56%, #272016 57% 100%);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.song { min-width: 0; padding-block: 9px; overflow-wrap: anywhere; }
.track-title { display: inline-block; font-size: clamp(14px, 1.8vw, 22px); line-height: 1.25; font-weight: 750; text-decoration: none; }
.track-title[href]:hover { text-decoration: underline; }
.artist { display: block; margin-top: 4px; color: var(--muted); font-size: clamp(11px, 1.25vw, 14px); }
.score { justify-self: end; font-size: clamp(11px, 1.5vw, 18px); font-variant-numeric: tabular-nums; }
.change { display: block; text-align: right; color: var(--muted); font-size: 11px; }
.preview {
  display: grid;
  place-items: center;
  justify-self: center;
  width: clamp(34px, 4vw, 44px);
  aspect-ratio: 1;
  padding: 0;
  border: 1.3px solid currentColor;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  font-size: 16px;
}
.preview:hover, .preview[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.play-icon::before {
  display: block;
  content: "";
  margin-left: 3px;
  border-block: 6px solid transparent;
  border-left: 10px solid currentColor;
}
.preview[aria-pressed="true"] .play-icon::before {
  width: 10px;
  height: 12px;
  margin-left: 0;
  border: 0;
  border-inline: 3px solid currentColor;
}
.no-preview { justify-self: center; color: var(--muted); }
.chart-status { padding-block: 22px; color: var(--muted); }
.chart-status button { margin-left: .65em; border: 1px solid var(--rule); padding: .2em .6em; background: transparent; }

.method {
  margin-top: clamp(36px, 6vw, 72px);
  padding-block: 26px 32px;
  border-top: 1px solid var(--ink);
}
.method h2 { font-size: clamp(21px, 2.3vw, 29px); }
.method p { max-width: 52rem; margin-top: 9px; color: var(--muted); font-size: 14px; }
.source-links a { display: inline-block; margin-right: 18px; }
.site-footer { border-top: 1px solid var(--rule); min-height: 82px; }
.site-footer .wordmark { font-size: 15px; }

.player { position: fixed; inset: auto 0 0; z-index: 2; background: var(--ink); color: var(--paper); box-shadow: 0 -3px 12px #2719082e; padding-bottom: env(safe-area-inset-bottom); }
.player-inner { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.player-title { min-width: 0; flex: 1; }
.player-title span { display: block; color: #edac8e; font-size: 11px; }
.player-title strong { display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.transport { display: flex; align-items: center; gap: 8px; width: min(60%, 430px); }
.transport .preview, .close-player {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--paper);
  background: transparent;
  border: 1px solid #ffffff80;
  border-radius: 50%;
}
.transport .preview:hover, .transport .preview[aria-pressed="true"] { color: var(--ink); background: var(--paper); }
.transport input { min-width: 24px; width: 100%; accent-color: #edac8e; }
.play-time { flex: none; color: #ddd0c5; font-size: 12px; font-variant-numeric: tabular-nums; }
.close-player { font-size: 23px; line-height: 1; }
.player :focus-visible { outline-color: #edac8e; }

@media (max-width: 670px) {
  .masthead { min-height: 57px; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 27px 0 24px; }
  h1 { font-size: clamp(39px, 10vw, 63px); }
  .hero-photo { height: auto; aspect-ratio: 1.95; }
  .track { min-height: 66px; }
  .chart-choices button, .snapshot { font-size: 12px; }
  .search { gap: 8px; }
  .search input { font-size: 13px; }
  .player-inner { gap: 8px; }
  .transport { gap: 4px; }
  .transport .preview, .close-player { width: 34px; height: 34px; }
  .play-time { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
