:root {
  --paper: #fbf3e5;
  --paper-soft: rgba(255, 248, 236, 0.78);
  --ink: #17314f;
  --ink-muted: #6c7890;
  --clay: #de7d36;
  --clay-soft: #eda56f;
  --line: rgba(23, 49, 79, 0.15);
  --shadow: 0 18px 48px rgba(68, 52, 28, 0.13);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --hand: "Kaiti SC", "STKaiti", "Xingkai SC", "HanziPen SC", cursive;
  --sans: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 82% 8%, rgba(145, 176, 203, 0.22), transparent 26rem),
    radial-gradient(circle at 14% 92%, rgba(222, 125, 54, 0.1), transparent 24rem),
    linear-gradient(112deg, #fff8eb 0%, #fbf1df 58%, #f7eddb 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.32;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(23, 49, 79, 0.18) 0 1px, transparent 1.6px),
    radial-gradient(circle at 70% 70%, rgba(222, 125, 54, 0.2) 0 1px, transparent 1.6px);
  background-size: 58px 62px, 74px 68px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.front-page {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  width: min(1672px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 3.5vw, 54px) clamp(18px, 4vw, 70px) clamp(24px, 3vw, 44px);
}

.top-nav {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 4vw, 58px);
  align-items: center;
  min-height: 34px;
  color: var(--ink);
  font-family: var(--hand);
  font-size: clamp(1rem, 1.35vw, 1.24rem);
  letter-spacing: 0;
  animation: fadeSlide 720ms ease both;
}

.top-nav a {
  position: relative;
  padding: 4px 0 7px;
}

.top-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  border-radius: 999px;
  background: var(--clay);
  opacity: 0;
  transform: rotate(-3deg) scaleX(0.75);
  transition: opacity 180ms ease, transform 180ms ease;
}

.top-nav a:hover::after,
.top-nav a:focus-visible::after,
.top-nav a.is-active::after {
  opacity: 1;
  transform: rotate(-3deg) scaleX(1);
}

.top-nav a.is-active {
  color: var(--clay);
}

.cover-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.28fr);
  gap: clamp(22px, 3.2vw, 54px);
  align-items: center;
  min-height: calc(100vh - 88px);
}

.copy-side {
  position: relative;
  z-index: 3;
  padding-top: clamp(10px, 4.5vh, 46px);
  animation: fadeSlide 900ms ease 90ms both;
}

.title-block {
  width: min(640px, 100%);
}

.brush-title {
  margin: 0;
  font-family: var(--hand);
  font-size: clamp(3.9rem, 6.4vw, 6.8rem);
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: 0;
  white-space: nowrap;
}

.brush-title span {
  color: var(--clay);
}

.brush-rule {
  width: min(600px, 96%);
  height: 24px;
  margin: 12px 0 4px;
  border-top: 7px solid rgba(89, 119, 150, 0.58);
  border-radius: 100%;
  transform: rotate(-2deg);
  transform-origin: left center;
}

.subtitle {
  margin: 2px 0 22px 28px;
  color: var(--clay);
  font-family: var(--hand);
  font-size: clamp(1.38rem, 2.3vw, 2.25rem);
  letter-spacing: 0.03em;
}

.intro-copy {
  width: min(560px, 100%);
  margin: 0 0 clamp(26px, 3.8vw, 44px);
  color: #233b5a;
  font-family: var(--serif);
  font-size: clamp(0.98rem, 1.2vw, 1.15rem);
  line-height: 2.05;
}

.music-board {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) minmax(190px, 220px);
  gap: 16px;
  align-items: stretch;
  width: min(690px, 100%);
}

.track-list,
.player-card {
  border: 1px solid rgba(66, 67, 55, 0.13);
  border-radius: 8px;
  background: var(--paper-soft);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.track-list {
  display: grid;
  min-height: 270px;
  margin: 0;
  padding: 17px 28px;
  list-style: none;
  counter-reset: track;
}

.track-item {
  counter-increment: track;
  animation: riseIn 650ms cubic-bezier(0.18, 0.76, 0.22, 1) both;
}

.track-item:nth-child(1) {
  animation-delay: 190ms;
}

.track-item:nth-child(2) {
  animation-delay: 250ms;
}

.track-item:nth-child(3) {
  animation-delay: 310ms;
}

.track-item:nth-child(4) {
  animation-delay: 370ms;
}

.track-item:nth-child(5) {
  animation-delay: 430ms;
}

.track-button {
  display: grid;
  grid-template-columns: 34px 34px minmax(0, 1fr) 48px 20px;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0;
  color: var(--ink);
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: color 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.track-item:last-child .track-button {
  border-bottom: 0;
}

.track-button::before {
  content: counter(track, decimal-leading-zero);
  color: var(--clay);
  font-family: Georgia, serif;
  font-size: 1rem;
  line-height: 1;
}

.track-play {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(23, 49, 79, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.track-play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid currentColor;
}

.track-title {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.03rem, 1.25vw, 1.24rem);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.track-duration {
  color: rgba(23, 49, 79, 0.48);
  font-family: Georgia, serif;
  font-size: 0.9rem;
  text-align: right;
}

.track-menu {
  width: 4px;
  height: 19px;
  opacity: 0.34;
  background-image: radial-gradient(circle, currentColor 1.6px, transparent 1.7px);
  background-size: 4px 6px;
}

.track-button:hover,
.track-button:focus-visible {
  color: var(--clay);
  border-color: rgba(222, 125, 54, 0.35);
  outline: 0;
  transform: translateX(3px);
}

.track-item.is-active .track-button::before,
.track-item.is-active .track-title {
  color: var(--clay);
}

.track-item.is-active .track-play {
  color: var(--clay);
  border-color: rgba(222, 125, 54, 0.52);
}

.track-item.is-active.is-playing .track-play::before {
  width: 13px;
  height: 17px;
  margin: 0;
  border: 0;
  background:
    linear-gradient(currentColor, currentColor) left center / 4px 65% no-repeat,
    linear-gradient(currentColor, currentColor) center center / 4px 100% no-repeat,
    linear-gradient(currentColor, currentColor) right center / 4px 48% no-repeat;
  animation: bars 820ms ease-in-out infinite;
}

.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 270px;
  padding: 23px 20px 18px;
}

.mini-cover {
  position: relative;
  overflow: hidden;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #d7dfd1;
  box-shadow: inset 0 0 0 1px rgba(23, 49, 79, 0.1);
}

.mini-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.55);
}

.mini-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 6px;
  align-items: center;
  width: 100%;
  margin-top: 18px;
}

h1 {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.02rem, 1.35vw, 1.25rem);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.heart-button {
  width: 24px;
  height: 24px;
  padding: 0;
  color: rgba(222, 125, 54, 0.85);
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
}

.progress-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  width: 100%;
  margin: 16px 0 12px;
  color: rgba(23, 49, 79, 0.58);
  font-family: Georgia, serif;
  font-size: 0.76rem;
}

.progress {
  width: 100%;
  height: 22px;
  accent-color: var(--clay);
}

.controls {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.icon-button,
.play-button,
.mode-button {
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  border: 0;
  background: transparent;
  transition: transform 180ms ease, color 180ms ease, background 180ms ease;
}

.icon-button {
  width: 28px;
  height: 28px;
}

.mode-button {
  min-width: 42px;
  height: 28px;
  padding: 0 9px;
  color: rgba(23, 49, 79, 0.74);
  border: 1px solid rgba(23, 49, 79, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  font-family: var(--serif);
  font-size: 0.78rem;
  line-height: 1;
}

.play-button {
  width: 46px;
  height: 46px;
  color: var(--ink);
  border-radius: 50%;
  background: var(--clay-soft);
}

.icon-button:hover,
.play-button:hover,
.mode-button:hover,
.icon-button:focus-visible,
.play-button:focus-visible,
.mode-button:focus-visible {
  color: var(--clay);
  outline: 0;
  transform: translateY(-2px);
}

.mode-button:hover,
.mode-button:focus-visible {
  border-color: rgba(222, 125, 54, 0.46);
  background: rgba(255, 255, 255, 0.54);
}

.play-button:hover,
.play-button:focus-visible {
  color: #fff;
  background: var(--ink);
}

.play-icon,
.prev-icon,
.next-icon {
  display: block;
  position: relative;
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 16px solid currentColor;
}

.is-playing .play-icon {
  width: 15px;
  height: 20px;
  margin-left: 0;
  border: 0;
  background:
    linear-gradient(currentColor, currentColor) left center / 5px 100% no-repeat,
    linear-gradient(currentColor, currentColor) right center / 5px 100% no-repeat;
}

.prev-icon,
.next-icon {
  width: 18px;
  height: 18px;
}

.prev-icon::before,
.prev-icon::after,
.next-icon::before,
.next-icon::after {
  position: absolute;
  top: 2px;
  content: "";
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.prev-icon::before {
  left: 0;
  border-right: 9px solid currentColor;
}

.prev-icon::after {
  left: 8px;
  border-right: 9px solid currentColor;
}

.next-icon::before {
  right: 8px;
  border-left: 9px solid currentColor;
}

.next-icon::after {
  right: 0;
  border-left: 9px solid currentColor;
}

.visual-side {
  position: relative;
  align-self: stretch;
  min-height: min(720px, calc(100vh - 96px));
  animation: imageReveal 1100ms ease 130ms both;
}

.front-reference {
  position: absolute;
  inset: -1% -3% -3% 0;
  width: 104%;
  height: 104%;
  object-fit: cover;
  object-position: 50% 48%;
  mix-blend-mode: multiply;
  filter: saturate(0.98) contrast(0.99);
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOnly {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes imageReveal {
  from {
    opacity: 0;
    transform: translateX(18px) scale(1.01);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes bars {
  0%,
  100% {
    opacity: 0.75;
    transform: scaleY(0.82);
  }

  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (max-width: 1120px) {
  .front-page {
    overflow: visible;
  }

  .cover-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: auto;
  }

  .copy-side {
    order: 2;
    padding-top: 0;
  }

  .visual-side {
    order: 1;
    min-height: 48vw;
    max-height: 520px;
    overflow: hidden;
    border: 1px solid rgba(66, 67, 55, 0.12);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .front-reference {
    inset: 0;
    width: 100%;
    height: 100%;
    object-position: 48% 50%;
  }

  .music-board,
  .title-block {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .front-page {
    padding: 18px 18px 148px;
  }

  .top-nav {
    gap: 22px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 10px;
    font-size: 1rem;
  }

  .visual-side {
    min-height: 72vw;
  }

  .copy-side {
    animation-name: fadeOnly;
    transform: none;
  }

  .brush-title {
    font-size: clamp(3.55rem, 19vw, 5.8rem);
    white-space: normal;
  }

  .subtitle {
    margin-left: 4px;
  }

  .intro-copy {
    font-size: 0.95rem;
    line-height: 1.85;
  }

  .music-board {
    display: block;
  }

  .track-list {
    min-height: 0;
    padding: 12px 16px;
  }

  .track-button {
    grid-template-columns: 30px 32px minmax(0, 1fr) 44px;
    gap: 10px;
    min-height: 54px;
  }

  .track-menu {
    display: none;
  }

  .track-title {
    font-size: 1rem;
  }

  .player-card {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 20;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: center;
    min-height: 0;
    padding: 13px 14px 11px;
    background: rgba(255, 248, 236, 0.94);
  }

  .mini-cover {
    width: 46px;
    height: 46px;
    grid-row: 1;
  }

  .mini-title-row {
    display: block;
    grid-column: 2;
    width: auto;
    margin: 0;
  }

  h1 {
    text-align: left;
    font-size: 1.05rem;
  }

  .heart-button {
    display: none;
  }

  .progress-row {
    grid-column: 1 / -1;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    margin: 4px 0 0;
  }

  .controls {
    grid-column: 3;
    grid-row: 1;
    gap: 8px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(23, 49, 79, 0.18);
    border-radius: 50%;
  }

  .play-button {
    width: 44px;
    height: 44px;
  }

  .mode-button {
    min-width: 40px;
    height: 32px;
    padding: 0 8px;
    font-size: 0.76rem;
  }
}

@media (max-width: 440px) {
  .track-duration {
    display: none;
  }

  .track-button {
    grid-template-columns: 30px 32px minmax(0, 1fr);
  }

  .player-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .icon-button {
    display: none;
  }

  .mode-button {
    min-width: 38px;
  }
}

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