:root {
  --paper: #f6f6f6;
  --paper-deep: #e9e9ee;
  --ink: #282837;
  --ink-soft: #666878;
  --coral: #f04a91;
  --coral-dark: #ca2f72;
  --lemon: #ffc42e;
  --sage: #71a9d1;
  --white: #ffffff;
  --line: rgba(40, 40, 55, 0.16);
  --shadow: 0 18px 50px rgba(40, 40, 55, 0.12);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  min-width: 320px;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(240, 74, 145, 0.35);
  outline-offset: 3px;
}

.page-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  width: min(1180px, calc(100% - 3rem));
  margin: 0 auto;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 0.8rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--coral);
  border-radius: 50% 50% 42% 58% / 58% 42% 58% 42%;
  font-family: var(--serif);
  font-size: 1.15rem;
  transform: rotate(-7deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--serif);
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 0.18rem;
  color: var(--ink-soft);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
}

.archive-stamp {
  color: var(--coral-dark);
  font-family: var(--serif);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  transform: rotate(2deg);
}

.hero {
  position: relative;
  width: min(1180px, calc(100% - 3rem));
  min-height: 650px;
  margin: 0 auto;
  padding: 6.8rem 0 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: center;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow,
.section-kicker {
  margin: 0 0 1.15rem;
  color: var(--coral-dark);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.eyebrow span {
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--coral);
}

h1 {
  margin: 0;
  max-width: 800px;
  font-family: var(--serif);
  font-size: clamp(3.4rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.055em;
}

h1 em {
  position: relative;
  color: var(--coral);
  font-weight: inherit;
  font-style: normal;
}

h1 em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: -1%;
  bottom: -0.3rem;
  height: 0.5rem;
  background: url("data:image/svg+xml,%3Csvg width='400' height='12' viewBox='0 0 400 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 8C100 2 280 11 398 4' fill='none' stroke='%23df5d49' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
}

.hero-intro {
  max-width: 36rem;
  margin: 2.2rem 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

.record-visual {
  position: relative;
  justify-self: end;
  width: 390px;
  height: 390px;
  filter: drop-shadow(0 26px 32px rgba(20, 44, 47, 0.2));
  transform: rotate(6deg);
}

.record-disc {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 7px, rgba(255, 255, 255, 0.05) 8px 9px),
    radial-gradient(circle at 42% 37%, #365354 0, #142c2f 43%, #07181a 100%);
  animation: record-arrive 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.record-disc::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.record-label {
  width: 37%;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(circle at center, var(--ink) 0 6px, transparent 7px),
    var(--lemon);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(20, 44, 47, 0.2);
}

.record-label span {
  margin-bottom: 0.3rem;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 800;
}

.record-label small {
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.record-note {
  position: absolute;
  right: -0.7rem;
  bottom: 1.8rem;
  padding: 0.75rem 0.9rem;
  color: var(--paper);
  background: var(--coral);
  font-size: 0.54rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.14em;
  transform: rotate(-10deg);
  box-shadow: 5px 6px 0 var(--lemon);
}

.hero-stats {
  grid-column: 1 / -1;
  display: flex;
  gap: clamp(2rem, 7vw, 6rem);
  margin: 4.2rem 0 0;
  padding: 1.75rem 0 0;
  border-top: 1px solid var(--line);
}

.hero-stats div {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
}

.hero-stats dt {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.hero-stats dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.catalog {
  padding: 5.5rem max(1.5rem, calc((100% - 1180px) / 2)) 7rem;
  background:
    var(--paper);
  border-top: 1px solid var(--line);
}

.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.catalog h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.keyboard-hint {
  margin: 0 0 0.35rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

kbd {
  display: inline-grid;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  margin-right: 0.3rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--paper-deep);
  font-family: inherit;
}

.control-panel {
  position: relative;
  padding: 1.4rem;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 8px 8px 0 rgba(145, 169, 149, 0.28);
}

.control-panel::before {
  content: "SEARCH";
  position: absolute;
  top: -0.55rem;
  right: 1.4rem;
  padding: 0.15rem 0.5rem;
  color: var(--paper);
  background: var(--ink);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.search-field,
.filter-grid label {
  display: grid;
  gap: 0.5rem;
}

.search-field > span:first-child,
.filter-grid label > span {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.input-wrap {
  position: relative;
  display: block;
}

.input-wrap svg {
  position: absolute;
  top: 50%;
  left: 0.95rem;
  width: 19px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.8;
  stroke-linecap: round;
  transform: translateY(-50%);
  pointer-events: none;
}

input,
select {
  width: 100%;
  height: 48px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0;
}

input {
  padding: 0 1rem 0 2.9rem;
}

input::placeholder {
  color: #99a09a;
}

input:focus,
select:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
  outline: 0;
}

select {
  padding: 0 2.25rem 0 0.8rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%23142c2f' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 1.25rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr 1fr auto;
  gap: 0.8rem;
  align-items: end;
  margin-top: 1rem;
}

.reset-button {
  height: 48px;
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: 160ms ease;
}

.reset-button:hover {
  color: var(--white);
  background: var(--ink);
}

.reset-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#result-summary {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.88rem;
}

#result-summary strong {
  color: var(--coral-dark);
  font-size: 1.35rem;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.filter-chip {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.28rem 0.55rem;
  color: var(--ink);
  background: rgba(255, 196, 46, 0.22);
  border: 1px solid rgba(40, 40, 55, 0.12);
  font-size: 0.66rem;
}

.filter-chip button {
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.list-header,
.song-card {
  display: grid;
  grid-template-columns: minmax(280px, 2.2fr) minmax(160px, 1.2fr) 130px 74px 105px;
  gap: 1rem;
  align-items: center;
}

.list-header {
  padding: 0.7rem 1rem 0.7rem 4rem;
  color: var(--ink-soft);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.song-list {
  min-height: 18rem;
}

.song-card {
  position: relative;
  min-height: 98px;
  padding: 1rem 1rem 1rem 4rem;
  border-bottom: 1px solid var(--line);
  transition:
    background 180ms ease,
    transform 180ms ease;
  animation: card-enter 450ms both;
  animation-delay: min(calc(var(--i) * 22ms), 350ms);
  content-visibility: auto;
  contain-intrinsic-size: 98px;
}

.song-card:hover {
  z-index: 1;
  background: var(--paper);
  transform: translateX(4px);
}

.song-index {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  width: 2rem;
  color: #9aa49e;
  font-family: var(--serif);
  font-size: 0.7rem;
  text-align: center;
  transform: translateY(-50%) rotate(-90deg);
}

.song-primary {
  min-width: 0;
}

.song-title {
  max-width: 100%;
  padding: 0;
  color: var(--ink);
  background: none;
  border: 0;
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  cursor: pointer;
  transition: 160ms ease;
}

.song-title:hover {
  color: var(--coral-dark);
  text-decoration-color: var(--coral);
}

.song-artist {
  margin: 0.28rem 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 0.62rem;
  line-height: 1;
}

.tag.work-original {
  color: #8a3529;
  background: rgba(223, 93, 73, 0.1);
  border-color: rgba(223, 93, 73, 0.28);
}

.song-latest,
.song-count {
  font-family: var(--serif);
  font-size: 0.78rem;
}

.song-latest span,
.song-count span {
  display: block;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.song-count strong {
  color: var(--coral-dark);
  font-size: 1.5rem;
  line-height: 1;
}

.clip-link,
.history-link {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  color: var(--white);
  background: var(--ink);
  border: 1px solid var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: 160ms ease;
}

.clip-link:hover,
.history-link:hover {
  color: var(--ink);
  background: var(--lemon);
  border-color: var(--lemon);
}

.clip-link svg,
.history-link svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.no-link {
  color: #9aa49e;
  font-size: 0.68rem;
}

.loading-card {
  height: 98px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(
    100deg,
    transparent 35%,
    rgba(255, 255, 255, 0.8) 50%,
    transparent 65%
  );
  background-size: 220% 100%;
  animation: loading 1.4s infinite;
}

.empty-state {
  padding: 5rem 1rem;
  text-align: center;
  border-top: 1px solid var(--line);
}

.empty-state > span {
  display: inline-grid;
  width: 4.5rem;
  height: 4.5rem;
  place-items: center;
  color: var(--paper);
  background: var(--sage);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 2rem;
  transform: rotate(-8deg);
}

.empty-state h3 {
  margin: 1.2rem 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.5rem;
}

.empty-state p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.empty-state button {
  margin-top: 1.2rem;
  padding: 0.65rem 1rem;
  color: var(--white);
  background: var(--ink);
  border: 0;
  cursor: pointer;
}

footer {
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem max(1.5rem, calc((100% - 1180px) / 2));
  color: rgba(255, 255, 255, 0.72);
  background: var(--ink);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.song-dialog {
  width: min(760px, calc(100% - 2rem));
  max-height: min(860px, calc(100dvh - 2rem));
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  box-shadow: 0 28px 90px rgba(20, 20, 30, 0.42);
  overflow: hidden;
}

.song-dialog::backdrop {
  background: rgba(24, 24, 35, 0.72);
  backdrop-filter: blur(4px);
}

.dialog-shell {
  position: relative;
  max-height: min(860px, calc(100dvh - 2rem));
  overflow-y: auto;
}

.dialog-close {
  position: sticky;
  z-index: 4;
  top: 1rem;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 1rem 1rem -3.6rem auto;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.dialog-close svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.dialog-hero {
  position: relative;
  padding: 3.6rem 4rem 2.6rem;
  color: var(--paper);
  background:
    radial-gradient(circle at 83% 15%, rgba(240, 74, 145, 0.18), transparent 12rem),
    var(--ink);
  overflow: hidden;
}

.dialog-hero::after {
  content: "♫";
  position: absolute;
  right: 3.5rem;
  bottom: -2.7rem;
  color: rgba(255, 255, 255, 0.06);
  font-family: var(--serif);
  font-size: 10rem;
  line-height: 1;
  transform: rotate(-8deg);
}

.dialog-kicker {
  margin: 0 0 0.75rem;
  color: var(--lemon);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.dialog-hero h2 {
  position: relative;
  z-index: 1;
  max-width: 85%;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 6vw, 3.35rem);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.dialog-artist {
  position: relative;
  z-index: 1;
  margin: 0.75rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--serif);
}

.dialog-body {
  padding: 2rem 4rem 3.5rem;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metadata-grid div {
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--line);
}

.metadata-grid div:first-child {
  padding-left: 0;
}

.metadata-grid div:last-child {
  border-right: 0;
}

.metadata-grid dt {
  color: var(--ink-soft);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

.metadata-grid dd {
  margin: 0.35rem 0 0;
  font-family: var(--serif);
  font-size: 0.82rem;
  font-weight: 700;
}

.song-notes {
  margin: -0.7rem 0 2rem;
  padding: 0.75rem 1rem;
  color: var(--ink-soft);
  background: rgba(255, 196, 46, 0.16);
  border-left: 3px solid var(--lemon);
  font-size: 0.75rem;
  line-height: 1.6;
}

.history-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.history-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.history-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.history-list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list::before {
  content: "";
  position: absolute;
  top: 1.8rem;
  bottom: 1.8rem;
  left: 5.55rem;
  width: 1px;
  background: var(--line);
}

.history-item {
  position: relative;
  display: grid;
  grid-template-columns: 4.6rem 1fr auto;
  gap: 1.7rem;
  align-items: center;
  min-height: 76px;
  padding: 0.65rem 0;
  border-bottom: 1px dashed var(--line);
}

.history-date {
  font-family: var(--serif);
  font-size: 0.72rem;
  text-align: right;
}

.history-date strong {
  display: block;
  color: var(--coral-dark);
  font-size: 1rem;
}

.history-info {
  position: relative;
  min-width: 0;
}

.history-info::before {
  display: none;
}

.history-info strong {
  display: block;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-info span {
  display: block;
  margin-top: 0.22rem;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.58rem;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-empty {
  padding: 2rem;
  color: var(--ink-soft);
  background: rgba(113, 169, 209, 0.12);
  font-family: var(--serif);
  text-align: center;
}

.load-error {
  padding: 3rem;
  color: var(--coral-dark);
  background: rgba(240, 74, 145, 0.08);
  border: 1px solid rgba(240, 74, 145, 0.24);
  text-align: center;
}

.load-error strong {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--serif);
  font-size: 1.15rem;
}

@keyframes record-arrive {
  from {
    opacity: 0;
    transform: translateX(4rem) rotate(24deg) scale(0.82);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotate(0) scale(1);
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loading {
  to {
    background-position: -220% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  .hero {
    min-height: auto;
    padding-top: 5rem;
    grid-template-columns: 1fr 260px;
  }

  .record-visual {
    width: 280px;
    height: 280px;
  }

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

  .reset-button {
    grid-column: span 2;
  }

  .list-header {
    display: none;
  }

  .song-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .song-card {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.4rem;
    background: var(--white);
    border: 1px solid var(--line);
  }

  .song-card:hover {
    transform: translateY(-3px);
  }

  .song-index {
    top: 1.25rem;
    right: 1.2rem;
    left: auto;
    transform: none;
  }

  .song-primary {
    width: calc(100% - 2rem);
  }

  .song-tags {
    margin-top: 1rem;
  }

  .song-latest {
    margin-top: auto;
    padding-top: 1rem;
  }

  .song-count {
    position: absolute;
    right: 1.2rem;
    bottom: 1.4rem;
    text-align: right;
  }

  .song-link {
    margin-top: 0.8rem;
  }
}

@media (max-width: 700px) {
  .site-header {
    width: min(100% - 2rem, 1180px);
    min-height: 76px;
  }

  .archive-stamp {
    display: none;
  }

  .hero {
    width: min(100% - 2rem, 1180px);
    padding: 3.5rem 0 3.2rem;
    display: block;
    overflow: visible;
  }

  h1 {
    font-size: clamp(2.45rem, 10.2vw, 3.4rem);
  }

  .hero-intro {
    max-width: 82%;
    font-size: 0.92rem;
  }

  .record-visual {
    position: absolute;
    z-index: -1;
    top: 9.5rem;
    right: -5rem;
    width: 220px;
    height: 220px;
    opacity: 0.18;
    filter: none;
  }

  .record-note {
    display: none;
  }

  .hero-stats {
    gap: 0;
    justify-content: space-between;
    margin-top: 3.5rem;
  }

  .hero-stats div {
    display: block;
  }

  .hero-stats dt {
    font-size: 1.65rem;
  }

  .hero-stats dd {
    margin-top: 0.2rem;
  }

  .catalog {
    padding: 4rem 1rem 5rem;
  }

  .catalog-heading {
    align-items: start;
  }

  .keyboard-hint {
    display: none;
  }

  .control-panel {
    padding: 1rem;
    box-shadow: 5px 5px 0 rgba(145, 169, 149, 0.28);
  }

  .search-grid,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .reset-button {
    grid-column: auto;
  }

  .result-toolbar {
    display: block;
    padding: 1.1rem 0;
  }

  .active-filters {
    justify-content: flex-start;
    margin-top: 0.65rem;
  }

  .song-list {
    grid-template-columns: 1fr;
  }

  .song-card {
    min-height: 228px;
  }

  footer {
    display: block;
    min-height: 0;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  footer p {
    margin: 0.35rem 0;
  }

  .song-dialog {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: auto 0 0;
  }

  .dialog-shell {
    max-height: 92dvh;
  }

  .dialog-hero {
    padding: 3.5rem 1.3rem 2.2rem;
  }

  .dialog-body {
    padding: 1.4rem 1.3rem 3rem;
  }

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

  .metadata-grid div:nth-child(2) {
    border-right: 0;
  }

  .metadata-grid div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .metadata-grid div:nth-child(3) {
    padding-left: 0;
  }

  .history-item {
    grid-template-columns: 3.7rem 1fr;
    gap: 1.5rem;
    padding: 0.9rem 0;
  }

  .history-list::before {
    left: 4.55rem;
  }

  .history-link,
  .history-item > .no-link {
    grid-column: 2;
    justify-self: start;
    margin-top: -0.35rem;
  }

  .dialog-close {
    top: 0.7rem;
    margin-right: 0.7rem;
  }
}

.back-to-top {
  position: fixed;
  z-index: 30;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--white);
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  box-shadow:
    0 10px 28px rgba(40, 40, 55, 0.25),
    0 0 0 4px rgba(246, 246, 246, 0.88);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transform: translateY(12px) scale(0.88);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  background: var(--coral);
  transform: translateY(-3px) scale(1);
}

.back-to-top svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

@media (max-width: 700px) {
  .back-to-top {
    right: max(0.85rem, env(safe-area-inset-right));
    bottom: max(0.85rem, env(safe-area-inset-bottom));
    width: 46px;
    height: 46px;
  }
}

/* Compact songbook layout */
.catalog {
  min-height: 100vh;
  padding-top: 3.25rem;
}

.catalog-heading {
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1.35rem;
  border-bottom: 2px solid var(--ink);
}

.title-identity {
  display: flex;
  gap: 1rem;
  align-items: center;
  min-width: 0;
}

.title-gif {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  padding: 3px;
  object-fit: contain;
  background:
    linear-gradient(145deg, rgba(113, 169, 209, 0.2), rgba(240, 74, 145, 0.13)),
    var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 5px 6px 0 rgba(255, 196, 46, 0.3);
}

.catalog-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.catalog-heading .section-kicker {
  margin-bottom: 0.55rem;
}

.search-toggle {
  min-width: 104px;
  height: 46px;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.search-toggle:hover,
.search-toggle.is-active {
  color: var(--ink);
  background: var(--lemon);
  border-color: var(--lemon);
}

.search-toggle:hover {
  transform: translateY(-2px);
}

.search-toggle svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 5px 5px 0 rgba(113, 169, 209, 0.18);
}

.search-panel[hidden] {
  display: none;
}

.search-mode {
  height: 48px;
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--paper-deep);
  border-radius: 999px;
}

.search-mode button {
  min-width: 82px;
  padding: 0 0.9rem;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.search-mode button[aria-pressed="true"] {
  color: var(--white);
  background: var(--coral);
}

.unified-search-field {
  grid-template-columns: 1fr;
}

.filter-panel {
  padding: 1rem;
  background: rgba(233, 233, 238, 0.62);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.filter-panel .filter-grid {
  margin-top: 0;
}

.result-toolbar {
  min-height: 58px;
}

.song-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.song-card {
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.65rem 0.7rem 0.65rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 3px 0 rgba(40, 40, 55, 0.035);
  cursor: pointer;
  contain-intrinsic-size: 66px;
}

.song-card:hover {
  background: var(--paper);
  border-color: rgba(240, 74, 145, 0.42);
  transform: translateX(3px);
}

.song-primary {
  width: auto;
  min-width: 0;
}

.song-title {
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-link {
  margin: 0;
}

.clip-link {
  min-width: 74px;
  min-height: 42px;
  border-radius: 10px;
}

.loading-card {
  height: 66px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

@media (max-width: 980px) {
  .catalog {
    padding-top: 2.5rem;
  }

  .song-list {
    grid-template-columns: 1fr;
  }

  .song-card {
    min-height: 66px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 0.65rem 0.7rem 0.65rem 1rem;
  }

  .song-link {
    margin: 0;
  }
}

@media (max-width: 700px) {
  .catalog {
    padding-top: 1.75rem;
  }

  .catalog-heading {
    margin-bottom: 1rem;
  }

  .catalog-title {
    font-size: 2.35rem;
  }

  .title-identity {
    gap: 0.7rem;
  }

  .title-gif {
    width: 76px;
    height: 76px;
    border-radius: 19px;
  }

  .search-toggle {
    min-width: 92px;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }

  .search-mode button {
    flex: 1;
  }

  .filter-panel {
    padding: 0.85rem;
  }

  .song-card {
    min-height: 62px;
    border-radius: 12px;
  }

  .song-title {
    font-size: 0.94rem;
  }

  .clip-link {
    min-width: 68px;
    min-height: 40px;
  }
}

/* Compact modal card */
.song-dialog {
  width: min(640px, calc(100% - 2rem));
  max-height: min(760px, calc(100dvh - 2rem));
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(40, 40, 55, 0.28);
}

.song-dialog[open] {
  transform-origin: 50% 54%;
  animation: dialog-pop-in 360ms cubic-bezier(0.2, 0.9, 0.28, 1.18) both;
}

.song-dialog[open]::backdrop {
  animation: dialog-backdrop-in 240ms ease-out both;
}

@keyframes dialog-pop-in {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.9);
  }
  68% {
    opacity: 1;
    transform: translateY(-3px) scale(1.012);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dialog-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dialog-shell {
  max-height: min(760px, calc(100dvh - 2rem));
}

.dialog-close {
  top: 0.9rem;
  width: 38px;
  height: 38px;
  margin: 0.9rem 0.9rem -2.9rem auto;
  color: var(--ink);
  background: var(--paper-deep);
}

.dialog-close:hover {
  color: var(--white);
  background: var(--coral);
}

.dialog-hero {
  padding: 2rem 2rem 0.8rem;
  color: var(--ink);
  background: transparent;
  overflow: visible;
}

.dialog-hero::after {
  display: none;
}

.dialog-kicker {
  margin-bottom: 0.45rem;
  color: var(--coral-dark);
}

.dialog-hero h2 {
  max-width: calc(100% - 3rem);
  font-size: clamp(2rem, 5vw, 2.65rem);
}

.dialog-artist {
  color: var(--ink-soft);
}

.dialog-body {
  padding: 0.35rem 2rem 2rem;
}

.metadata-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.metadata-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.25rem 0.7rem;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.song-notes {
  margin: 0.8rem 0 0;
  border-radius: 8px;
}

.history-heading {
  margin: 1.25rem 0 0.75rem;
}

.history-list {
  display: grid;
  gap: 0.5rem;
}

.history-list::before {
  display: none;
}

.history-item {
  min-height: 60px;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: 0.9rem;
  padding: 0.55rem 0.65rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.history-date {
  text-align: center;
}

.history-info strong {
  font-size: 0.76rem;
}

.history-link {
  min-height: 36px;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
}

@media (max-width: 700px) {
  .song-dialog {
    width: calc(100% - 1rem);
    max-width: 640px;
    max-height: calc(100dvh - 1rem);
    margin: auto;
    border-radius: 20px;
  }

  .dialog-shell {
    max-height: calc(100dvh - 1rem);
  }

  .dialog-hero {
    padding: 1.6rem 1.1rem 0.7rem;
  }

  .dialog-body {
    padding: 0.35rem 1.1rem 1.4rem;
  }

  .metadata-tags {
    padding-bottom: 0.9rem;
  }

  .history-heading {
    margin-top: 1rem;
  }

  .history-item {
    min-height: 58px;
    grid-template-columns: 3.1rem minmax(0, 1fr) auto;
    gap: 0.55rem;
    padding: 0.5rem;
  }

  .history-link,
  .history-item > .no-link {
    grid-column: auto;
    margin: 0;
  }
}
