:root {
  color-scheme: dark;
  --bg: #101014;
  --surface: #181921;
  --surface-2: #22242d;
  --surface-3: #151721;
  --line: #343743;
  --text: #f6f1ee;
  --muted: #b7b5c6;
  --muted-2: #858899;
  --pink: #ff4fa8;
  --cyan: #68d8ff;
  --amber: #ffc15f;
  --green: #84d48c;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(104, 216, 255, 0.08), transparent 320px),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

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

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

.site-header {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-header__image,
.site-header__shade {
  position: absolute;
  inset: 0;
}

.site-header__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-header__shade {
  background:
    linear-gradient(90deg, rgba(16, 16, 20, 0.96), rgba(16, 16, 20, 0.68) 58%, rgba(16, 16, 20, 0.9)),
    linear-gradient(0deg, rgba(16, 16, 20, 0.96), rgba(16, 16, 20, 0.24));
}

.site-header__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 500px);
  gap: 28px;
  align-items: end;
  width: min(1120px, calc(100% - 32px));
  min-height: 340px;
  margin: 0 auto;
  padding: 54px 0 28px;
}

body[data-route="song"] .site-header__content,
body[data-route="album"] .site-header__content {
  min-height: 230px;
  padding-top: 34px;
}

body[data-route="song"] .artist-identity,
body[data-route="song"] .stats {
  display: none;
}

.brand__eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(2.45rem, 5vw, 3.85rem);
  line-height: 1.05;
  letter-spacing: 0;
}

body[data-route="song"] h1,
body[data-route="album"] h1 {
  font-size: clamp(1.95rem, 4vw, 2.8rem);
}

.artist-identity {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  max-width: 720px;
  margin: 0 0 18px;
}

.artist-identity img {
  width: 72px;
  height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: #111219;
  object-fit: cover;
}

.artist-identity__text {
  min-width: 0;
}

.artist-identity__text p {
  margin-bottom: 4px;
}

#artistName {
  color: var(--text);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#artistProfile {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.official-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  grid-column: 2;
  min-width: 0;
  max-width: 100%;
  margin-top: 9px;
}

.official-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(10, 11, 14, 0.4);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 760;
  text-decoration: none;
}

.official-link:hover,
.official-link:focus-visible {
  border-color: rgba(104, 216, 255, 0.48);
  background: rgba(104, 216, 255, 0.12);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stats span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(10, 11, 14, 0.48);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}

.stats span {
  padding: 6px 11px;
}

.search-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(18, 19, 26, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.search-panel > label,
.filters span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.search-field {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 0 7px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111219;
}

.search-field svg,
.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder {
  color: var(--muted-2);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: var(--surface-2);
  color: var(--text);
}

.filters {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 10px;
}

.filters label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111219;
  color: var(--text);
  padding: 0 10px;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto 56px;
}

.route-view {
  min-width: 0;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 0 16px;
}

.panel-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.15;
}

.panel-kicker {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

#resultCount {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 760;
}

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

.album-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  min-height: 132px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.album-card:hover,
.album-card:focus-visible {
  border-color: rgba(104, 216, 255, 0.48);
  background: #1d2028;
  outline: 0;
}

.album-card__cover {
  width: 104px;
  height: 104px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: #111219;
  object-fit: cover;
}

.album-card__body {
  display: grid;
  align-content: start;
  min-width: 0;
}

.album-card__type {
  width: max-content;
  min-height: 24px;
  margin-bottom: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 193, 95, 0.34);
  border-radius: 999px;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 760;
}

.album-card__title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.album-card__subtitle,
.album-card__meta,
.album-card__matches {
  display: block;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-card__subtitle {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 0.78rem;
}

.album-card__meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.album-card__matches {
  margin-top: 7px;
  color: #f8dfe9;
  font-size: 0.78rem;
}

.empty-state {
  display: grid;
  place-content: center;
  min-height: 280px;
  padding: 36px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p {
  margin-bottom: 0;
}

.page-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  min-height: 54px;
  margin: -18px 0 12px;
  padding: 10px 0;
  background: linear-gradient(180deg, var(--bg) 68%, rgba(16, 16, 20, 0));
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 25, 33, 0.94);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 820;
  text-decoration: none;
}

.back-link::before {
  content: "<";
  margin-right: 8px;
  color: var(--cyan);
  font-weight: 900;
}

.back-link:hover,
.back-link:focus-visible {
  border-color: rgba(104, 216, 255, 0.48);
  background: var(--surface-2);
}

.album-detail,
.reader {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.album-detail {
  padding: 18px;
}

.album-detail__hero,
.reader__top {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.album-detail__cover,
.reader__cover {
  width: 136px;
  height: 136px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #111219;
  object-fit: cover;
}

.album-detail__body,
.reader__top > div {
  min-width: 0;
}

.album-detail__group,
.reader__group {
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 0.9rem;
  font-weight: 820;
}

.album-detail h2,
.reader h2 {
  margin-bottom: 8px;
  font-size: clamp(1.75rem, 4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.album-detail__subtitle,
.album-detail__meta,
.reader__meta,
.reader__subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.album-detail__subtitle,
.reader__subtitle {
  margin-bottom: 6px;
  color: #f8dfe9;
}

.album-detail__meta,
.reader__meta {
  margin-bottom: 12px;
}

.album-song-list {
  display: grid;
  gap: 8px;
  padding-top: 18px;
}

.song-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.song-button:hover,
.song-button:focus-visible {
  border-color: rgba(104, 216, 255, 0.42);
  background: #20232b;
  outline: 0;
}

.song-button__title,
.song-button__meta {
  display: block;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-button__title {
  font-size: 1rem;
  font-weight: 800;
}

.song-button__meta {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 0.82rem;
}

.official-tracks {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 0.82rem;
}

.official-tracks summary {
  min-height: 42px;
  padding-top: 14px;
  cursor: pointer;
  font-weight: 780;
}

.official-tracks ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0 0 2px;
  list-style: none;
}

.official-tracks li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.official-tracks__title,
.official-tracks__ja {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.official-tracks__title {
  color: var(--text);
}

.official-tracks__ja {
  margin-top: 1px;
  color: var(--muted-2);
}

.reader {
  padding: 24px;
}

.reader__actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.reader__link {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.reader__link:hover,
.reader__link:focus-visible {
  border-color: rgba(104, 216, 255, 0.42);
  background: var(--surface-2);
}

.lyrics {
  display: grid;
  gap: 34px;
  padding-top: 28px;
}

.stanza {
  display: grid;
  gap: 16px;
}

.line-pair {
  display: grid;
  gap: 7px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.line-pair p {
  overflow-wrap: anywhere;
  margin: 0;
  line-height: 1.78;
}

.line-pair__original {
  color: var(--text);
  font-family: "Noto Sans JP", "Noto Sans TC", sans-serif;
  font-size: 1.03rem;
}

.line-pair__translation {
  color: #f8dfe9;
  font-size: 1.12rem;
  font-weight: 650;
}

.reader[data-view="original"] .line-pair__translation,
.reader[data-view="translation"] .line-pair__original {
  display: none;
}

.reader[data-view="translation"] .line-pair__translation {
  color: var(--text);
}

mark {
  border-radius: 4px;
  background: rgba(255, 193, 95, 0.32);
  color: inherit;
}

@media (max-width: 920px) {
  .site-header__content {
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: end;
    min-height: 0;
    padding-top: 34px;
  }

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

  .album-detail__hero,
  .reader__top {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .album-detail__cover,
  .reader__cover {
    width: 112px;
    height: 112px;
  }

  .reader__actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--bg);
  }

  .site-header__content {
    width: min(100% - 20px, 1120px);
    padding: 24px 0 16px;
  }

  body[data-route="song"] .site-header__content,
  body[data-route="album"] .site-header__content {
    min-height: 0;
    padding-top: 18px;
  }

  h1,
  body[data-route="album"] h1 {
    margin-bottom: 12px;
    font-size: 2.08rem;
  }

  body[data-route="song"] .site-header__content {
    gap: 10px;
    padding: 14px 0 12px;
  }

  body[data-route="song"] .brand__eyebrow {
    margin-bottom: 4px;
  }

  body[data-route="song"] h1 {
    margin-bottom: 0;
    font-size: 1.52rem;
  }

  body[data-route="song"] .search-panel {
    gap: 8px;
    padding: 10px;
    box-shadow: none;
  }

  body[data-route="song"] .search-panel > label,
  body[data-route="song"] .search-field,
  body[data-route="song"] .filters label:first-child {
    display: none;
  }

  body[data-route="song"] .filters {
    grid-template-columns: 1fr;
  }

  .artist-identity {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .artist-identity img {
    width: 58px;
    height: 58px;
  }

  #artistName {
    font-size: 0.92rem;
  }

  #artistProfile {
    font-size: 0.8rem;
  }

  .official-links {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, max-content);
    gap: 6px;
    margin-top: 0;
  }

  .official-link {
    min-height: 27px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .stats {
    gap: 6px;
  }

  .stats span {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 0.76rem;
  }

  .search-panel {
    padding: 12px;
  }

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

  .app-shell {
    width: min(100% - 20px, 1120px);
    margin-top: 12px;
    margin-bottom: 38px;
  }

  .panel-heading {
    min-height: 52px;
    padding-bottom: 10px;
  }

  .panel-heading h2 {
    font-size: 1.38rem;
  }

  .album-card {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    min-height: 110px;
    padding: 10px;
  }

  .album-card__cover {
    width: 86px;
    height: 86px;
  }

  .album-card__title {
    font-size: 0.96rem;
  }

  .album-card__meta {
    margin-top: 7px;
  }

  .page-nav {
    min-height: 52px;
    margin: -12px 0 8px;
    padding: 8px 0;
  }

  .back-link {
    min-height: 40px;
    font-size: 0.86rem;
  }

  .album-detail,
  .reader {
    margin-inline: -1px;
  }

  .album-detail {
    padding: 14px;
  }

  .album-detail__hero,
  .reader__top {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 16px;
  }

  .album-detail__cover,
  .reader__cover {
    width: 88px;
    height: 88px;
  }

  .album-detail h2,
  .reader h2 {
    font-size: 1.52rem;
    line-height: 1.14;
  }

  .album-detail__group,
  .reader__group {
    margin-bottom: 5px;
    font-size: 0.82rem;
  }

  .album-detail__subtitle,
  .album-detail__meta,
  .reader__meta,
  .reader__subtitle {
    font-size: 0.82rem;
  }

  .song-button {
    min-height: 56px;
    padding: 8px;
  }

  .song-button__meta {
    font-size: 0.78rem;
  }

  .reader {
    padding: 14px;
  }

  .reader__actions {
    gap: 7px;
  }

  .reader__link {
    min-height: 38px;
    font-size: 0.8rem;
  }

  .lyrics {
    gap: 30px;
    padding-top: 22px;
  }

  .stanza {
    gap: 14px;
  }

  .line-pair {
    gap: 6px;
    padding-bottom: 15px;
  }

  .line-pair p {
    line-height: 1.82;
  }

  .line-pair__original {
    font-size: 0.98rem;
  }

  .line-pair__translation {
    font-size: 1.08rem;
  }
}

@media (max-width: 380px) {
  .official-links {
    grid-template-columns: repeat(2, max-content);
  }

  .album-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .album-card__cover {
    width: 74px;
    height: 74px;
  }
}
