:root {
  --flow-bg: #101011;
  --flow-text: #f6f6ef;
  --flow-muted: rgba(246, 246, 239, 0.62);
  --flow-line: rgba(255, 255, 255, 0.14);
  --flow-green: #33f078;
  --flow-coral: #ff7a59;
  --flow-blue: #67d7ff;
  --flow-panel: rgba(18, 18, 20, 0.76);
  --flow-card: clamp(150px, 18vw, 250px);
  --flow-gap: clamp(26px, 4vw, 64px);
  --panel-padding: clamp(16px, 2.4vw, 26px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body.music-flow-page {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(51, 240, 120, 0.16), transparent 26%),
    linear-gradient(240deg, rgba(103, 215, 255, 0.13), transparent 30%),
    radial-gradient(circle at 78% 18%, rgba(255, 122, 89, 0.2), transparent 28vw),
    #101011;
  color: var(--flow-text);
  font-family: Inter, Geist, "HarmonyOS Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}

body.music-flow-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.68), transparent 86%);
}

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.flow-topbar {
  position: fixed;
  top: 20px;
  left: clamp(16px, 3vw, 42px);
  right: clamp(16px, 3vw, 42px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.34);
  backdrop-filter: blur(12px);
}

/* 导航外观与首页 `site-header home-nav` 保持一致 */
.flow-topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: max-content;
}

.flow-topbar .brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: rgba(0, 255, 0, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 0, 0.22), 0 0 24px rgba(0, 255, 0, 0.14);
}

.flow-topbar .brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flow-topbar .brand-name {
  display: block;
  color: #f5f5f0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
}

.flow-topbar .brand-note {
  display: block;
  color: #00ff00;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.flow-topbar .navbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.flow-topbar .navbar a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.35s ease, background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.flow-topbar .navbar a:hover,
.flow-topbar .navbar a.active {
  border-color: rgba(255, 255, 255, 0.82);
  background: #00ff00;
  color: #070707;
  box-shadow: 0 0 22px rgba(0, 255, 0, 0.32);
}

.flow-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(14px, 2vw, 28px);
  padding: clamp(112px, 13vh, 132px) 0 clamp(72px, 10vh, 120px);
}

.flow-title {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-inline: clamp(18px, 5vw, 70px);
  text-align: center;
}

.flow-title p,
.flow-title h1 {
  margin: 0;
}

.flow-title p {
  color: var(--flow-green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.flow-title h1 {
  max-width: 1100px;
  font-size: clamp(42px, 8vw, 104px);
  font-weight: 950;
  line-height: 0.86;
  letter-spacing: 0;
}

.flow-stage {
  display: grid;
  align-content: center;
  gap: 0;
}

.flow-viewport {
  width: 100%;
  overflow: hidden;
  padding: 36px 0 44px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.flow-viewport.is-dragging {
  cursor: grabbing;
}

.flow-viewport.is-throwing .flow-card {
  border-color: rgba(51, 240, 120, 0.42);
  transition-duration: 0.18s;
}

.flow-track {
  display: flex;
  align-items: center;
  gap: var(--flow-gap);
  width: max-content;
  padding-inline: var(--flow-gap);
  will-change: transform;
}

.flow-card {
  position: relative;
  flex: 0 0 var(--flow-card);
  width: var(--flow-card);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 0;
  background: #1b1b1d;
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  z-index: 1;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.36s ease, opacity 0.36s ease;
}

.flow-card:hover,
.flow-card.is-active {
  transform: translateY(-10px) scale(1.04);
  border-color: rgba(51, 240, 120, 0.72);
}

.flow-card.is-selected {
  z-index: 8;
  transform: translateY(-22px) scale(1.18);
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 38px 110px rgba(0, 0, 0, 0.58), 0 0 80px rgba(51, 240, 120, 0.28);
  opacity: 1;
}

.flow-card.is-zoomed {
  z-index: 10;
  transform: translateY(-30px) scale(1.34);
  border-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 48px 140px rgba(0, 0, 0, 0.68), 0 0 96px rgba(51, 240, 120, 0.34);
  opacity: 1;
}

.flow-card:not(.is-active) {
  opacity: 0.84;
}

.flow-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.84) contrast(1.03);
  pointer-events: none;
}

.cover-missing {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(51, 240, 120, 0.2), rgba(103, 215, 255, 0.12)),
    #18191b;
  color: rgba(255, 255, 255, 0.52);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.flow-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.52), transparent 54%);
  opacity: 0;
  transition: opacity 0.32s ease;
}

.flow-card.is-active::after,
.flow-card:hover::after,
.flow-card.is-selected::after,
.flow-card.is-zoomed::after {
  opacity: 1;
}

.flow-card span {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  overflow: hidden;
  color: #fff;
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 900;
  line-height: 1;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.flow-card.is-active span,
.flow-card:hover span,
.flow-card.is-selected span,
.flow-card.is-zoomed span {
  opacity: 1;
  transform: translateY(0);
}

.flow-card.skeleton {
  background:
    linear-gradient(110deg, transparent 0 30%, rgba(255, 255, 255, 0.1) 42%, transparent 54%),
    linear-gradient(135deg, rgba(51, 240, 120, 0.3), rgba(103, 215, 255, 0.2)),
    #1b1b1d;
  background-size: 220% 100%, 100% 100%, 100% 100%;
  animation: skeleton-sweep 1.4s linear infinite;
}

@keyframes skeleton-sweep {
  to {
    background-position: -220% 0, 0 0, 0 0;
  }
}

.flow-panel {
  position: relative;
  z-index: 40;
  width: min(1040px, calc(100vw - 34px));
  margin: 6px auto 0;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) auto minmax(240px, 1fr);
  gap: clamp(14px, 2.2vw, 28px);
  align-items: center;
  max-height: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0 var(--panel-padding);
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--flow-panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, -8px, 0) scale(0.98);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.flow-panel.is-visible {
  max-height: min(72vh, 620px);
  overflow: auto;
  padding: var(--panel-padding);
  border-color: var(--flow-line);
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

.panel-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.panel-meta > span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  color: var(--flow-green);
  font-weight: 900;
}

.panel-meta h2 {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-size: clamp(22px, 3vw, 42px);
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-meta p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 9px 0 0;
  color: var(--flow-muted);
  font-size: 13px;
}

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

.control-button {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background 0.24s ease, color 0.24s ease, transform 0.24s ease;
}

.control-button:hover {
  background: var(--flow-green);
  color: #050505;
  transform: translateY(-2px);
}

.play-button {
  min-width: 78px;
  padding-inline: 14px;
  background: #fff;
  color: #101011;
  font-size: 13px;
  font-weight: 900;
}

.progress-block {
  display: grid;
  gap: 7px;
}

.time-row {
  display: flex;
  justify-content: space-between;
  color: var(--flow-muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-block input,
.volume-block input {
  width: 100%;
  accent-color: var(--flow-green);
}

.volume-block {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--flow-muted);
  font-size: 12px;
  font-weight: 900;
}

.player-notice {
  grid-column: 1 / -1;
  min-height: 22px;
  margin: 0;
  color: var(--flow-coral);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.native-player {
  grid-column: 1 / -1;
  min-height: 86px;
}

.native-player .aplayer {
  margin: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: #161616;
  box-shadow: none;
}

.native-player .aplayer.aplayer-withlist .aplayer-list {
  max-height: 180px !important;
}

.lyric-block {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.lyric-block p,
.lyric-block strong {
  margin: 0;
}

.lyric-block p {
  min-height: 22px;
  color: rgba(246, 246, 239, 0.42);
  font-size: 13px;
}

.lyric-block strong {
  min-height: 30px;
  color: var(--flow-green);
  font-size: clamp(17px, 2.2vw, 27px);
  font-weight: 900;
  line-height: 1.35;
}

@media (max-width: 860px) {
  :root {
    --flow-card: clamp(140px, 48vw, 220px);
    --flow-gap: 24px;
  }

  body.music-flow-page {
    overflow-y: auto;
  }

  .flow-topbar {
    gap: 12px;
    padding: 10px 12px;
  }

  .flow-topbar .brand-mark {
    width: 46px;
    height: 46px;
  }

  .flow-topbar .brand-name {
    font-size: 15px;
  }

  .flow-topbar .navbar {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .flow-topbar .navbar::-webkit-scrollbar {
    display: none;
  }

  .flow-topbar .navbar a {
    min-height: 36px;
    padding-inline: 13px;
    font-size: 13px;
  }

  .flow-shell {
    min-height: 100vh;
    padding-top: 104px;
  }

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

  .panel-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .flow-topbar {
    left: 10px;
    right: 10px;
    border-radius: 24px;
  }

  .flow-topbar .brand-note {
    display: none;
  }

  .flow-topbar .brand-mark {
    width: 40px;
    height: 40px;
  }

  .flow-topbar .navbar a {
    min-height: 34px;
    padding-inline: 11px;
    font-size: 12px;
  }

  .flow-title {
    justify-items: start;
    text-align: left;
  }

  .flow-title h1 {
    font-size: clamp(50px, 18vw, 86px);
  }

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

  .panel-meta > span {
    width: 44px;
    height: 44px;
  }

  .panel-meta h2 {
    white-space: normal;
  }
}

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