@import url('https://fonts.googleapis.com/css2?family=LXGW+WenKai+TC&display=swap');

:root {
  --bg: #EEF3F6;
  --s: #fff;
  --s2: #DDE6EB;
  --ink: #263844;
  --muted: #657786;
  --line: #C9D5DD;
  --navy: #526C7D;
  --rose: #AABAC4;
  --mint: #7F9BA5;
  --shadow: 0 16px 45px #26394d16;
  --font: "LXGW WenKai TC", system-ui, sans-serif
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: radial-gradient(circle at 0 0, #fff, #EEF3F6 55%, #DDE7EC);
  color: var(--ink);
  font: 16px/1.5 var(--font)
}

button,
input,
select {
  font: inherit
}

button {
  cursor: pointer;
  border: 0
}

a,
a:visited,
a:hover,
a:active {
  text-decoration: none
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #7E98A8;
  outline-offset: 3px
}

.shell {
  max-width: 1440px;
  margin: auto;
  padding: 18px clamp(16px, 4vw, 54px) 50px
}

.top {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 26px
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-weight: 900;
  white-space: nowrap;
  text-decoration: none;
}

.logo-box {
  display: grid;
  place-items: center;
  width: 122px;
  height: 72px;
  border: 1px solid #D1DEE4;
  border-radius: 21px;
  background: #ffffffcc;
  box-shadow: 0 8px 20px #32445e13
}

.logo {
  width: 112px;
  height: 68px
}

.brand small {
  display: block;
  font: 700 8px system-ui;
  letter-spacing: .16em;
  color: #6E8492
}

.nav {
  display: flex;
  gap: 5px;
  flex: 1
}

.nav a {
  padding: 11px 15px;
  border-radius: 11px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 900
}

.nav a.active,
.nav a:hover {
  background: var(--s);
  color: var(--navy);
  box-shadow: 0 4px 13px #2536500d
}

.top-actions {
  display: flex;
  gap: 8px
}

.icon-btn {
  min-width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--s);
  color: var(--navy)
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin: 25px 0
}

.page-head h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  margin: 0;
  color: var(--navy)
}

.page-head p {
  margin: 9px 0 0;
  color: var(--muted)
}

.card {
  background: var(--s);
  border: 1px solid #fff;
  border-radius: 23px;
  box-shadow: var(--shadow);
  padding: 23px;
  min-width: 0
}

.grid {
  display: grid;
  gap: 18px
}

.cols {
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, .7fr)
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px
}

.section-title h2 {
  margin: 0;
  font-size: 20px
}

.muted {
  color: var(--muted);
  font-size: 13px
}

.btn {
  min-height: 44px;
  padding: 0 15px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-weight: 900
}

.btn.alt {
  background: var(--s2);
  color: var(--navy)
}

.btn.danger {
  background: #DDE7EB;
  color: #536D7A
}

.search {
  display: flex;
  gap: 10px;
  align-items: center;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #EEF3F6
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent
}

.chips {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin: 14px 0
}

.chip {
  white-space: nowrap;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 99px;
  background: var(--s2);
  color: var(--muted);
  font-weight: 900
}

.chip.active {
  background: var(--navy);
  color: #fff
}

.song-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0
}

.song {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 77px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  padding: 11px;
  border-radius: 15px;
  background: #f4f7f8;
  border: 1px solid transparent
}

.song:hover {
  border-color: #AFC1CB;
  background: #fff
}

.cover {
  display: grid;
  place-items: center;
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 13px;
  color: #fff;
  font-weight: 900
}

.a {
  background: linear-gradient(135deg, #7992a7, #3e527d)
}

.b {
  background: linear-gradient(135deg, #B7C5CD, #8196A2)
}

.c {
  background: linear-gradient(135deg, #A8BEC7, #6E8795)
}

.d {
  background: linear-gradient(135deg, #B7C5C5, #758D99)
}

.song-text {
  min-width: 0;
  flex: 1
}

.song-name {
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.add {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--s2);
  color: var(--navy);
  font-size: 19px
}

.favorite {
  min-width: 42px;
  min-height: 42px;
  border-radius: 12px;
  background: var(--s2);
  color: var(--navy);
  font-size: 20px
}

.queue-item,
.file-row,
.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line)
}

.queue-item:last-child,
.file-row:last-child,
.setting-row:last-child {
  border: 0
}

.asset-progress {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--s2)
}

.asset-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--navy);
  transition: width .35s ease
}

.asset-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap
}

.asset-actions .queue-action:not(:first-child) {
  display: none
}

.queue-actions {
  display: flex;
  gap: 6px
}

.queue-action {
  min-height: 34px;
  padding: 0 9px;
  border-radius: 9px;
  background: var(--s2);
  color: var(--navy);
  font-size: 12px;
  font-weight: 900
}

.danger-action {
  margin-top: 8px;
  background: #f1dfe0;
  color: #8b4f55
}

.queue-item .song-text,
.file-row>div,
.setting-row>div {
  flex: 1
}

.badge {
  padding: 5px 8px;
  border-radius: 99px;
  background: #E1EBEF;
  color: #567384;
  font-size: 11px;
  font-weight: 900
}

.player {
  background: linear-gradient(145deg, #EAF1F4, #E2EAEE)
}

.media-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 14px;
  background: #d7e2e7
}

.media-player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0
}

.media-player:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
  background: #000
}

.media-player:fullscreen iframe {
  width: 100%;
  height: 100%;
}

.media-fullscreen {
  align-self: center;
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.media-player audio {
  display: block;
  width: 100%;
  min-height: 48px
}

.media-player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px
}

.audio-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px
}

.audio-controls input[type=range] {
  width: 120px
}

.audio-controls select {
  min-height: 34px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--s);
  color: var(--ink)
}

.mic-controls {
  border-top: 1px solid var(--line);
  padding-top: 10px
}

.mic-controls input[type=range] {
  width: 100px
}

.lyrics {
  text-align: center;
  padding: 15px 4px
}

.lyrics div {
  color: var(--muted);
  margin: 7px
}

.lyrics .current {
  color: var(--navy);
  font-size: 20px;
  font-weight: 900
}

.lyric-word {
  transition: color .12s ease, text-shadow .12s ease
}

.lyric-word.active {
  color: #C56B72;
  text-shadow: 0 0 8px #C56B7244
}

.progress {
  height: 5px;
  border-radius: 99px;
  background: #C7D6DE;
  overflow: hidden
}

.progress i {
  display: block;
  width: 38%;
  height: 100%;
  background: var(--navy)
}

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 17px
}

.round {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font-weight: 900
}

.round.play {
  width: 52px;
  height: 52px;
  background: var(--navy);
  color: #fff
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 175px;
  padding: 22px;
  border: 1px dashed #91A6B2;
  border-radius: 18px;
  background: #E9F0F3;
  text-align: center
}

.upload-zone input {
  display: none
}

.upload-zone label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  margin-top: 12px;
  text-align: center
}

.toolbar {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 17px
}

.setting-row input[type=range] {
  width: 160px
}

.empty {
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  text-align: center;
  color: var(--muted)
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  padding: 13px 16px;
  border-radius: 12px;
  background: #405968;
  color: #fff;
  opacity: 0;
  transform: translateY(20px);
  transition: .2s
}

.toast.show {
  opacity: 1;
  transform: none
}

.dark {
  --bg: #18222e;
  --s: #243342;
  --s2: #314558;
  --ink: #eef4f8;
  --muted: #bdc9d3;
  --line: #4b6073;
  --navy: #cad9ef;
  background: #18222e
}

.dark body {
  background: #18222e
}

.dark .card {
  border-color: #3d5266
}

.dark .song,
.dark .search,
.dark .upload-zone {
  background: #1c2936
}

.dark .player {
  background: linear-gradient(145deg, #2a3b4e, #403943)
}

.dark .logo-box {
  background: #2d4051;
  border-color: #52667a
}

.room-page .page-head {
  padding: 30px;
  border-radius: 25px;
  background: linear-gradient(125deg, #556F82, #849EAE 58%, #B8C8D1);
  color: #fff;
  box-shadow: var(--shadow)
}

.room-page .page-head h1,
.room-page .page-head p {
  color: #fff
}

.room-page {
  background: radial-gradient(circle at 85% 0, #D9E2E6, #edf2f5 38%, #e6edf1)
}

.songs-page {
  background: #F3F7F9
}

.songs-page .page-head {
  padding: 30px;
  border-left: 7px solid #8fa8bb;
  background: #E8F0F4;
  border-radius: 0 24px 24px 0
}

.songs-page .card {
  box-shadow: none;
  border-color: var(--line)
}

.mine-page {
  background: linear-gradient(135deg, #F3F7F9, #E7EEF1)
}

.mine-page .page-head {
  padding: 30px;
  background: #F4F8FA;
  border: 1px solid #D5E0E5;
  border-radius: 24px
}

.settings-page {
  background: #EAF1F4
}

.settings-page .shell {
  max-width: 1120px
}

.settings-page .page-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line)
}

.room-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin: 0 0 18px
}

.sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 99px;
  background: #f1e6d9;
  color: #8b6d4f;
  font-size: 12px;
  font-weight: 900
}

.sync-status[data-online="true"] {
  background: #e0ece7;
  color: #4f7868
}

.room-code {
  color: var(--navy);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: .14em
}

.room-dialog {
  width: min(460px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--s);
  color: var(--ink);
  box-shadow: 0 24px 70px #26394d40
}

.room-dialog::backdrop {
  background: #26394d73;
  backdrop-filter: blur(3px)
}

.room-dialog form {
  display: grid;
  gap: 12px;
  padding: 24px
}

.qr-dialog form {
  justify-items: center
}

.qr-dialog .section-title {
  width: 100%
}

.qr-dialog canvas {
  max-width: 100%;
  border-radius: 12px;
  background: #fff
}

.room-dialog .section-title {
  margin-bottom: 4px
}

.room-dialog label {
  font-weight: 900
}

.room-dialog input {
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink)
}

.dialog-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--s2);
  color: var(--navy);
  font-size: 23px;
  line-height: 1
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 6px
}

@media(max-width:900px) {
  .cols {
    grid-template-columns: 1fr
  }

  .top {
    flex-wrap: wrap
  }

  .nav {
    order: 3;
    width: 100%;
    overflow: auto
  }
}

@media(max-width:620px) {
  .shell {
    padding: 10px 14px calc(98px + env(safe-area-inset-bottom))
  }

  .top {
    min-height: 65px
  }

  .top-actions {
    margin-left: auto
  }

  .logo-box {
    width: 80px;
    height: 51px
  }

  .logo {
    width: 75px;
    height: 48px
  }

  .brand>span:last-child {
    font-size: 13px
  }

  .nav {
    position: fixed;
    z-index: 10;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 6px;
    background: #fffffff2;
    border: 1px solid var(--line);
    border-radius: 17px;
    box-shadow: 0 14px 30px #26394d2a
  }

  .dark .nav {
    background: #243342f2
  }

  .nav a {
    min-width: 0;
    text-align: center;
    padding: 10px 3px;
    font-size: 12px;
    white-space: nowrap
  }

  .page-head {
    align-items: start;
    flex-direction: column
  }

  .room-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px
  }

  .room-actions .sync-status {
    grid-column: 1 / -1;
    justify-content: center
  }

  .room-actions .btn {
    width: 100%;
    min-width: 0
  }

  .room-page .grid.cols,
  .room-page .grid.cols > * {
    width: 100%;
    min-width: 0
  }

  .song-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0
  }

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

  .setting-row input[type=range] {
    width: 100%
  }
}
