:root {
  --background: #ffffff;
  --surface: #f4f4f8;
  --surface-elevated: rgba(255, 255, 255, 0.94);

  --text: #18181b;
  --text-secondary: #71717a;
  --text-tertiary: #a1a1aa;

  --border: rgba(24, 24, 27, 0.09);
  --border-soft: rgba(24, 24, 27, 0.05);

  --accent: #6356d9;
  --accent-dark: #4738be;
  --accent-soft: rgba(99, 86, 217, 0.12);

  --heart: #e34d78;
  --youtube: #ff0033;

  --gradient:
    linear-gradient(135deg, #534ab7, #7f77dd, #bd5cc8);

  --lyric-font-size: 24px;
  --lyric-ruby-size: 12px;
  --lyric-translation-size: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  position: fixed;
  inset: 0;

  overflow: hidden;

  color: var(--text);
  background: #eeeeF5;

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans TC",
    "Noto Sans JP",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
}

[hidden] {
  display: none !important;
}

.app-container {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;

  width: 100%;
  max-width: 540px;
  margin: auto;

  overflow: hidden;

  background: var(--background);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
}

.screen {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.page {
  display: none;
  flex: 1;

  width: 100%;

  overflow-y: auto;
  overflow-x: hidden;

  padding-bottom:
    calc(200px + env(safe-area-inset-bottom));
}

.page.active {
  display: block;
}

.page-content {
  width: 100%;

  padding:
    calc(20px + env(safe-area-inset-top))
    20px
    30px;
}

.home-header,
.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 20px;
}

.greeting {
  margin-bottom: 4px;

  font-size: 25px;
  font-weight: 750;
}

.sub-greeting,
.page-heading p,
.library-heading p {
  margin: 4px 0 0;

  color: var(--text-secondary);
  font-size: 13px;
}

.header-logo {
  display: grid;
  place-items: center;

  width: 46px;
  height: 46px;

  color: var(--accent);
  background: var(--accent-soft);

  border-radius: 50%;
}

.header-logo i {
  font-size: 23px;
}

.hero-card {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 190px;
  padding: 24px;

  overflow: hidden;

  color: #fff;
  background: var(--gradient);

  border-radius: 28px;

  box-shadow:
    0 18px 45px rgba(94, 69, 190, 0.28);
}

.hero-card::before {
  position: absolute;
  top: -70px;
  right: -60px;

  width: 210px;
  height: 210px;

  content: "";

  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 2;

  width: 72%;
}

.hero-content small {
  font-weight: 700;
  letter-spacing: 1.2px;
  opacity: 0.75;
}

.hero-content h1 {
  margin: 8px 0;

  font-size: 25px;
  line-height: 1.2;
}

.hero-content p {
  margin: 0;

  font-size: 13px;
  line-height: 1.5;
  opacity: 0.82;
}

.hero-content button {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  margin-top: 17px;
  padding: 9px 15px;

  color: var(--accent-dark);
  background: #fff;

  border: none;
  border-radius: 999px;

  font-size: 13px;
  font-weight: 700;
}

.hero-decoration {
  position: relative;
  z-index: 2;

  display: grid;
  place-items: center;

  width: 72px;
  height: 72px;

  background: rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.hero-decoration i {
  font-size: 38px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin: 28px 0 14px;
}

.section-title {
  font-size: 18px;
  font-weight: 720;
}

.text-button {
  padding: 5px;

  color: var(--accent);
  background: none;
  border: none;

  font-size: 13px;
}

.album-row {
  display: flex;
  gap: 15px;

  width: 100%;

  overflow-x: auto;

  padding-bottom: 10px;

  scrollbar-width: none;
}

.album-row::-webkit-scrollbar,
.category-tabs::-webkit-scrollbar {
  display: none;
}

.album-card {
  flex: 0 0 142px;
  min-width: 0;
  cursor: pointer;
}

.album-thumb {
  position: relative;

  width: 142px;
  height: 142px;

  overflow: hidden;

  background: var(--gradient);
  border-radius: 20px;

  box-shadow:
    0 8px 24px rgba(24, 24, 27, 0.12);
}

.album-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-placeholder {
  display: grid;
  place-items: center;

  width: 100%;
  height: 100%;

  color: #fff;
  font-size: 38px;
}

.album-play-icon {
  position: absolute;
  right: 10px;
  bottom: 10px;

  display: grid;
  place-items: center;

  width: 38px;
  height: 38px;

  color: var(--text);
  background: rgba(255, 255, 255, 0.94);

  border-radius: 50%;

  box-shadow:
    0 6px 18px rgba(24, 24, 27, 0.2);
}

.album-card-name {
  margin-top: 9px;

  overflow: hidden;

  font-size: 14px;
  font-weight: 650;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-card-artist {
  margin-top: 3px;

  overflow: hidden;

  color: var(--text-secondary);
  font-size: 12px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-heading {
  margin-bottom: 20px;
}

.page-heading h2,
.library-heading h2 {
  margin: 0;

  font-size: 28px;
  font-weight: 750;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;
  padding: 13px 15px;

  background: var(--surface);

  border: 1px solid transparent;
  border-radius: 17px;
}

.search-box:focus-within {
  border-color: rgba(99, 86, 217, 0.35);
}

.search-box i {
  color: var(--text-secondary);
  font-size: 20px;
}

.search-box input {
  flex: 1;
  min-width: 0;

  color: var(--text);
  background: none;

  border: none;
  outline: none;
}

.clear-input-button {
  display: grid;
  place-items: center;

  width: 27px;
  height: 27px;

  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.06);

  border: none;
  border-radius: 50%;
}

.search-toolbar,
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  margin: 16px 0 12px;

  color: var(--text-secondary);
  font-size: 12px;
}

.sort-dropdown {
  max-width: 170px;
  padding: 8px 11px;

  color: var(--text);
  background: #fff;

  border: 1px solid var(--border);
  border-radius: 11px;
}

.filter-block {
  margin-bottom: 18px;
}

.filter-title {
  margin-bottom: 9px;

  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.category-tabs {
  display: flex;
  gap: 8px;

  width: 100%;
  overflow-x: auto;

  padding-bottom: 4px;

  scrollbar-width: none;
}

.cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  flex-shrink: 0;

  padding: 8px 14px;

  color: var(--text);
  background: var(--surface);

  border: none;
  border-radius: 999px;

  font-size: 13px;
  font-weight: 600;
}

.cat-btn.active {
  color: #fff;
  background: var(--accent);

  box-shadow:
    0 6px 16px rgba(99, 86, 217, 0.25);
}

.play-all-button {
  display: grid;
  place-items: center;

  width: 48px;
  height: 48px;

  color: #fff;
  background: var(--accent);

  border: none;
  border-radius: 50%;

  font-size: 22px;

  box-shadow:
    0 8px 22px rgba(99, 86, 217, 0.3);
}

.reset-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 8px 11px;

  color: var(--text-secondary);
  background: transparent;

  border: 1px solid var(--border);
  border-radius: 11px;
}

.custom-song-list,
.recent-list {
  width: 100%;
  margin: 0;
  padding: 0;

  list-style: none;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 5px;

  width: 100%;
  padding: 7px 5px;

  border-radius: 16px;
}

.track-item:hover {
  background: var(--surface);
}

.track-main {
  display: flex;
  align-items: center;
  gap: 13px;

  flex: 1;
  min-width: 0;

  padding: 4px;

  color: inherit;
  text-align: left;
  background: none;

  border: none;
}

.track-thumb {
  position: relative;

  display: grid;
  place-items: center;

  flex-shrink: 0;

  width: 52px;
  height: 52px;

  overflow: hidden;

  color: #fff;
  background: var(--gradient);

  border-radius: 13px;
}

.track-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-overlay {
  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  color: #fff;
  background: rgba(15, 13, 28, 0.54);

  opacity: 0;
}

.track-item:hover .track-overlay {
  opacity: 1;
}

.track-info {
  flex: 1;
  min-width: 0;
}

.track-name {
  overflow: hidden;

  font-size: 15px;
  font-weight: 650;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-meta {
  display: flex;
  align-items: center;
  gap: 6px;

  min-width: 0;
  margin-top: 4px;

  color: var(--text-secondary);
  font-size: 12px;
}

.track-meta > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-tag {
  flex-shrink: 0;

  padding: 2px 6px;

  color: var(--accent);
  background: var(--accent-soft);

  border-radius: 6px;

  font-size: 10px;
}

.track-favorite {
  display: grid;
  place-items: center;

  flex-shrink: 0;

  width: 40px;
  height: 40px;

  color: var(--text-tertiary);
  background: none;

  border: none;
  border-radius: 50%;

  font-size: 20px;
}

.track-favorite.active,
.favorite-button.active {
  color: var(--heart);
}

.empty-state {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;

  min-height: 180px;
  padding: 30px;

  color: var(--text-secondary);
  text-align: center;
}

.empty-state i {
  margin-bottom: 12px;

  color: var(--text-tertiary);
  font-size: 36px;
}

.empty-state strong {
  color: var(--text);
}

.empty-state span {
  margin-top: 5px;
  font-size: 12px;
}

.settings-card {
  overflow: hidden;

  background: var(--surface);
  border-radius: 22px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  padding: 18px;

  border-bottom: 1px solid var(--border-soft);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-column {
  align-items: stretch;
  flex-direction: column;
}

.setting-main {
  display: flex;
  align-items: center;
  gap: 13px;
}

.setting-icon {
  display: grid;
  place-items: center;

  flex-shrink: 0;

  width: 42px;
  height: 42px;

  color: var(--accent);
  background: var(--accent-soft);

  border-radius: 13px;
}

.setting-icon i {
  font-size: 21px;
}

.youtube-icon {
  color: var(--youtube);
  background: rgba(255, 0, 51, 0.1);
}

.setting-main h3 {
  margin: 0;
  font-size: 15px;
}

.setting-main p {
  margin: 4px 0 0;

  color: var(--text-secondary);
  font-size: 12px;
}

.range-setting {
  display: flex;
  align-items: center;
  gap: 13px;

  color: var(--text-secondary);
  font-size: 12px;
}

.range-setting input {
  flex: 1;
}

.switch {
  position: relative;

  display: inline-block;

  flex-shrink: 0;

  width: 48px;
  height: 28px;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;

  background: var(--text-tertiary);
  border-radius: 999px;

  transition: 0.25s;
}

.slider::before {
  position: absolute;
  bottom: 4px;
  left: 4px;

  width: 20px;
  height: 20px;

  content: "";

  background: #fff;
  border-radius: 50%;

  transition: 0.25s;
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.preview-card {
  margin-top: 16px;
  padding: 18px;

  background: var(--surface);
  border-radius: 20px;

  color: var(--text-secondary);
  font-size: 12px;
}

.preview-line {
  margin-top: 10px;
  padding: 16px;

  color: var(--text);
  text-align: center;
  background: #fff;

  border-radius: 15px;

  font-size: 22px;
  font-weight: 700;
}

.preview-line small {
  display: block;
  margin-top: 6px;
}

.youtube-notice {
  display: flex;
  gap: 14px;

  margin-top: 16px;
  padding: 18px;

  color: #fff;
  background:
    linear-gradient(135deg, #24242d, #46354f);

  border-radius: 22px;
}

.youtube-notice > i {
  color: var(--youtube);
  font-size: 34px;
}

.youtube-notice h3 {
  margin: 0;
}

.youtube-notice p {
  margin: 6px 0 0;

  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.5;
}

.bottom-nav {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 950;

  display: flex;

  padding:
    8px 6px
    calc(8px + env(safe-area-inset-bottom));

  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--border-soft);

  backdrop-filter: blur(22px);

  transition: 0.3s;
}

.bottom-nav.hidden {
  pointer-events: none;
  opacity: 0;
  transform: translateY(20px);
}

.nav-item {
  display: flex;
  align-items: center;
  flex: 1;
  flex-direction: column;
  gap: 3px;

  padding: 4px;

  color: var(--text-tertiary);
  background: none;

  border: none;
}

.nav-item i {
  font-size: 22px;
}

.nav-item span {
  font-size: 10px;
}

.nav-item.active {
  color: var(--accent);
}

.mini-player {
  position: absolute;
  right: 12px;
  bottom:
    calc(61px + env(safe-area-inset-bottom));
  left: 12px;
  z-index: 900;

  display: flex;
  align-items: center;
  gap: 12px;

  height: 62px;
  padding: 7px 10px;

  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 17px;

  box-shadow:
    0 10px 35px rgba(24, 24, 27, 0.14);

  backdrop-filter: blur(22px);

  transition: 0.3s;
}

.mini-player.hidden,
.mini-lyrics-bar.hidden {
  pointer-events: none;
  opacity: 0;
  transform: translateY(20px);
}

.mini-art {
  display: grid;
  place-items: center;

  flex-shrink: 0;

  width: 48px;
  height: 48px;

  overflow: hidden;

  color: #fff;
  background: var(--gradient);

  border-radius: 13px;
}

.mini-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-info {
  flex: 1;
  min-width: 0;
}

.mini-song,
.mini-artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-song {
  font-size: 14px;
  font-weight: 680;
}

.mini-artist {
  margin-top: 3px;

  color: var(--text-secondary);
  font-size: 11px;
}

.mini-controls {
  display: flex;
  gap: 2px;
}

.mini-controls button {
  display: grid;
  place-items: center;

  width: 38px;
  height: 38px;

  color: var(--text);
  background: none;

  border: none;
  border-radius: 50%;
}

.mini-controls i {
  font-size: 22px;
}

.mini-lyrics-bar {
  position: absolute;
  right: 12px;
  bottom:
    calc(131px + env(safe-area-inset-bottom));
  left: 12px;
  z-index: 890;

  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;

  min-height: 53px;
  padding: 7px 14px;

  overflow: hidden;

  text-align: center;

  background: rgba(245, 245, 249, 0.95);
  border: 1px solid var(--border-soft);
  border-radius: 15px;

  backdrop-filter: blur(14px);

  transition: 0.3s;
}

.mini-lyric-line,
.mini-lyric-trans {
  width: 100%;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-lyric-line {
  font-size: 14px;
  font-weight: 650;
}

.mini-lyric-line ruby {
  font-size: 14px;
}

.mini-lyric-line rt {
  font-size: 9px;
}

.mini-lyric-trans {
  margin-top: 3px;

  color: var(--text-secondary);
  font-size: 11px;
}

.hidden {
  display: none !important;
}

.now-playing-page {
  position: fixed;
  top: 100%;
  left: 0;
  z-index: 999999;

  width: 100%;
  height: 100%;

  overflow: hidden;

  background:
    linear-gradient(180deg, #f3effa, #fff 55%);

  transition:
    top 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.now-playing-page.active {
  top: 0;
}

.now-playing-background {
  position: absolute;
  inset: -40px;
  opacity: 0.2;
}

.now-playing-background::after {
  position: absolute;
  inset: 0;

  content: "";

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.3),
      #fff 52%
    );

  backdrop-filter: blur(45px);
}

.now-playing-background img {
  width: 100%;
  height: 55%;
  object-fit: cover;
}

.now-playing-content {
  position: relative;
  z-index: 1;

  display: flex;
  flex-direction: column;

  width: 100%;
  max-width: 540px;
  height: 100%;
  margin: auto;

  padding:
    calc(13px + env(safe-area-inset-top))
    23px
    calc(18px + env(safe-area-inset-bottom));

  overflow-y: auto;
}

.np-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 14px;
}

.np-header > button {
  display: grid;
  place-items: center;

  min-width: 40px;
  height: 40px;

  color: var(--text-secondary);
  background: none;

  border: none;
  border-radius: 999px;
}

.np-header > button:first-child i {
  font-size: 28px;
}

.np-header > span {
  font-size: 13px;
  font-weight: 750;
}

.mode-button {
  display: flex !important;
  align-items: center;
  gap: 6px;

  padding: 0 12px !important;

  color: var(--accent) !important;
  background: rgba(255, 255, 255, 0.74) !important;

  border: 1px solid var(--border) !important;
}

.youtube-player-wrapper {
  flex-shrink: 0;

  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 18px;

  overflow: hidden;

  background: #000;
  border-radius: 20px;

  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.25);

  transition: 0.3s;
}

.youtube-player-wrapper.compact {
  max-width: 260px;
  margin-right: auto;
  margin-left: auto;

  border-radius: 16px;
}

.youtube-player-wrapper iframe,
#youtube-player {
  width: 100%;
  height: 100%;
}

.song-info {
  margin-bottom: 14px;
}

.song-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.song-title-row h1 {
  margin: 0;

  overflow: hidden;

  font-size: 23px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-title-row p {
  margin: 5px 0 0;

  overflow: hidden;

  color: var(--text-secondary);
  font-size: 14px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-title-row > div {
  min-width: 0;
}

.favorite-button {
  display: grid;
  place-items: center;

  flex-shrink: 0;

  width: 45px;
  height: 45px;

  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.72);

  border: 1px solid var(--border);
  border-radius: 50%;

  font-size: 22px;
}

.song-badges {
  display: flex;
  gap: 7px;

  margin-top: 12px;
}

.song-badges span {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  padding: 5px 9px;

  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.74);

  border: 1px solid var(--border-soft);
  border-radius: 999px;

  font-size: 11px;
  font-weight: 600;
}

.youtube-badge i {
  color: var(--youtube);
}

input[type="range"] {
  width: 100%;
  height: 5px;

  background: rgba(24, 24, 27, 0.13);
  border-radius: 999px;
  outline: none;

  appearance: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;

  background: var(--text);
  border-radius: 50%;

  appearance: none;
  -webkit-appearance: none;
}

.progress-area {
  margin-bottom: 12px;
}

.time-labels {
  display: flex;
  justify-content: space-between;

  margin-top: 7px;

  color: var(--text-tertiary);
  font-family: monospace;
  font-size: 11px;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 13px;
}

.control-button {
  display: grid;
  place-items: center;

  width: 43px;
  height: 43px;

  color: var(--text-secondary);
  background: none;

  border: none;
  border-radius: 50%;
}

.control-button i {
  font-size: 25px;
}

.control-button.active {
  color: var(--accent);
}

.main-play-button {
  display: grid;
  place-items: center;

  width: 66px;
  height: 66px;

  color: #fff;
  background: var(--text);

  border: none;
  border-radius: 50%;

  box-shadow:
    0 10px 28px rgba(24, 24, 27, 0.24);
}

.main-play-button i {
  font-size: 29px;
}

.secondary-controls {
  display: flex;
  align-items: center;
  gap: 10px;

  margin-bottom: 14px;
}

.secondary-controls > button {
  flex-shrink: 0;

  color: var(--text-secondary);
  background: none;

  border: none;
}

.secondary-controls > button i {
  font-size: 20px;
}

.speed-button {
  min-width: 48px;
  padding: 5px 8px;

  background: var(--surface) !important;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 700;
}

.lyrics-wrapper {
  flex: 1;

  min-height: 220px;
  padding: 15px;

  overflow-y: auto;

  background: rgba(244, 244, 248, 0.8);
  border: 1px solid var(--border-soft);
  border-radius: 22px;

  scroll-behavior: smooth;
}

.lyrics-wrapper.focus {
  min-height: 55vh;
}

.lyric-line {
  display: block;

  width: 100%;
  margin: 17px 0;
  padding: 10px 8px;

  color: rgba(24, 24, 27, 0.3);
  text-align: center;
  background: none;

  border: none;
  border-radius: 14px;

  transition: 0.25s;
}

.lyric-original {
  display: block;

  font-size: var(--lyric-font-size);
  font-weight: 720;
  line-height: 2;

  overflow-wrap: anywhere;
}

.lyric-line.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);

  transform: scale(1.025);

  box-shadow:
    0 7px 22px rgba(24, 24, 27, 0.05);
}

ruby {
  ruby-align: center;
}

rt {
  color: var(--accent);
  font-size: var(--lyric-ruby-size);
}

.translation {
  display: block;

  margin-top: 5px;

  color: var(--text-secondary);
  font-size: var(--lyric-translation-size);
  line-height: 1.5;
}

.translation.hidden {
  display: none;
}

.lyrics-message {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 9px;

  min-height: 170px;

  color: var(--text-secondary);
  text-align: center;
  font-size: 13px;
}

.lyrics-message i {
  font-size: 30px;
}

.loader {
  width: 25px;
  height: 25px;

  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;

  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999999;

  display: flex;
  align-items: flex-end;
  justify-content: center;

  background: rgba(12, 12, 18, 0.48);

  opacity: 0;
  pointer-events: none;

  transition: 0.28s;
}

.sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.sheet-content {
  width: 100%;
  max-width: 540px;
  padding:
    20px 22px
    calc(20px + env(safe-area-inset-bottom));

  background: #fff;

  border-radius: 26px 26px 0 0;

  transform: translateY(100%);
  transition: 0.3s;
}

.sheet-backdrop.active .sheet-content {
  transform: translateY(0);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-header h3 {
  margin: 0;
}

.sheet-header button {
  display: grid;
  place-items: center;

  width: 38px;
  height: 38px;

  color: var(--text-secondary);
  background: none;

  border: none;
}

.speed-display {
  margin: 25px 0;

  color: var(--accent);
  text-align: center;

  font-size: 34px;
  font-weight: 750;
}

.speed-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;

  margin-top: 22px;
}

.speed-presets button {
  padding: 10px;

  color: var(--text);
  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 12px;
}

@media (min-width: 760px) {
  .app-container {
    max-width: 760px;
  }

  .now-playing-content {
    max-width: 680px;
  }

  .album-card {
    flex-basis: 165px;
  }

  .album-thumb {
    width: 165px;
    height: 165px;
  }
}

/* ===== 控制鍵與字幕跟隨修正 ===== */
.now-playing-content {
  scroll-padding-top: calc(64px + env(safe-area-inset-top));
  overscroll-behavior-y: contain;
}

.np-header {
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
  padding: 4px 0 8px;
  background: rgba(248, 246, 252, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.controls {
  flex-shrink: 0;
  min-height: 72px;
  padding: 0 2px;
}

.control-button,
.main-play-button {
  visibility: visible !important;
  opacity: 1 !important;
}

.control-button i,
.main-play-button i,
.mini-controls i {
  display: inline-block;
  font-family: "tabler-icons" !important;
  font-style: normal;
  line-height: 1;
}

.main-play-button i {
  color: #fff !important;
  font-size: 32px;
}

.lyrics-wrapper {
  min-height: 220px;
  max-height: min(48vh, 430px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scroll-behavior: smooth;
}

.lyric-line {
  scroll-margin-block: 40%;
}

.lyrics-wrapper.focus {
  min-height: 52vh;
  max-height: 62vh;
}

.youtube-player-wrapper {
  min-height: 200px;
}

@media (max-height: 760px) {
  .youtube-player-wrapper { max-height: 34vh; }
  .lyrics-wrapper { min-height: 180px; max-height: 38vh; }
}


/* =========================================================
   Polished player chrome and unified controls — final overrides
========================================================= */

/* Rounded floating header instead of a sharp full-width strip */
.np-header {
  position: sticky;
  top: calc(6px + env(safe-area-inset-top));
  z-index: 40;
  flex-shrink: 0;
  min-height: 54px;
  margin: 0 0 14px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(99, 86, 217, 0.10);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(41, 36, 72, 0.09);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
}

.np-header > button:first-child {
  width: 38px;
  min-width: 38px;
  height: 38px;
  background: rgba(99, 86, 217, 0.07);
}

.mode-button {
  min-height: 38px;
  padding: 0 13px !important;
  background: rgba(99, 86, 217, 0.09) !important;
  border-color: rgba(99, 86, 217, 0.12) !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}

/* Main vertical order in video mode */
.now-playing-page:not(.lyrics-only-mode) .np-header { order: 0; }
.now-playing-page:not(.lyrics-only-mode) .youtube-player-wrapper { order: 1; }
.now-playing-page:not(.lyrics-only-mode) .song-info { order: 2; }
.now-playing-page:not(.lyrics-only-mode) .lyrics-wrapper {
  order: 3;
  flex: 1 1 auto;
  min-height: 190px;
  max-height: min(38vh, 360px);
  margin-bottom: 12px;
}
.now-playing-page:not(.lyrics-only-mode) .player-control-deck { order: 4; }

/* A single balanced control surface */
.player-control-deck {
  flex-shrink: 0;
  width: 100%;
  padding: 13px 15px 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(24, 24, 27, 0.06);
  border-radius: 22px;
  box-shadow: 0 12px 34px rgba(24, 24, 27, 0.09);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.player-control-deck .progress-area {
  width: 100%;
  margin: 0 0 8px;
}

.player-control-deck .controls {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  margin: 0;
  padding: 0 6px;
}

.player-control-deck .control-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.player-control-deck .control-button:hover {
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.player-control-deck .main-play-button {
  width: 62px;
  height: 62px;
  box-shadow: 0 10px 26px rgba(24, 24, 27, 0.20);
}

/* Volume is centered below the transport controls, not stranded at the left */
.player-control-deck .secondary-controls {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 46px;
  height: 38px;
  margin: 4px auto 0;
  padding: 4px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  box-shadow: none;
  transition: width .26s ease, background .2s ease, box-shadow .2s ease;
}
.player-control-deck .secondary-controls:hover,
.player-control-deck .secondary-controls:focus-within {
  width: min(100%, 330px);
  justify-content: flex-start;
  gap: 9px;
  padding: 4px 9px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(24, 24, 27, 0.09);
}
.player-control-deck #volume-button {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
}
.player-control-deck #volume-bar,
.player-control-deck .speed-button {
  width: 0;
  min-width: 0;
  margin: 0;
  padding-right: 0;
  padding-left: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-7px);
  transition: width .25s ease, min-width .25s ease, opacity .18s ease, transform .25s ease;
}
.player-control-deck .secondary-controls:hover #volume-bar,
.player-control-deck .secondary-controls:focus-within #volume-bar {
  width: min(195px, 42vw);
  min-width: 92px;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.player-control-deck .secondary-controls:hover .speed-button,
.player-control-deck .secondary-controls:focus-within .speed-button {
  width: auto;
  min-width: 46px;
  padding: 5px 8px;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

/* Lyrics-only mode: lyrics fill the page; bottom left play, bottom right progress */
.now-playing-page.lyrics-only-mode .youtube-player-wrapper,
.now-playing-page.lyrics-only-mode .song-info { display: none !important; }
.now-playing-page.lyrics-only-mode .now-playing-content {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px 12px;
  overflow: hidden;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.now-playing-page.lyrics-only-mode .np-header {
  grid-column: 1 / -1;
  grid-row: 1;
  margin-bottom: 0;
}
.now-playing-page.lyrics-only-mode .lyrics-wrapper {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 0;
  max-height: none;
  margin: 0;
  overflow-y: auto;
}
.now-playing-page.lyrics-only-mode .player-control-deck {
  display: contents;
}
.now-playing-page.lyrics-only-mode .player-control-deck .controls {
  grid-column: 1;
  grid-row: 3;
  width: 54px;
  min-height: 54px;
  padding: 0;
}
.now-playing-page.lyrics-only-mode .player-control-deck .controls .control-button,
.now-playing-page.lyrics-only-mode .player-control-deck .secondary-controls {
  display: none !important;
}
.now-playing-page.lyrics-only-mode .player-control-deck .main-play-button {
  display: grid !important;
  width: 52px;
  height: 52px;
}
.now-playing-page.lyrics-only-mode .player-control-deck .progress-area {
  grid-column: 2;
  grid-row: 3;
  align-self: center;
  min-width: 0;
  margin: 0;
}

@media (max-height: 760px) {
  .now-playing-page:not(.lyrics-only-mode) .lyrics-wrapper {
    min-height: 145px;
    max-height: 27vh;
  }
  .player-control-deck { padding: 9px 13px 8px; }
  .player-control-deck .controls { min-height: 56px; }
  .player-control-deck .main-play-button { width: 54px; height: 54px; }
}
