:root {
  --bg: #f3f8ff;
  --ink: #132239;
  --muted: #4e6078;
  --line: rgba(255, 255, 255, 0.48);
  --glass: rgba(255, 255, 255, 0.34);
  --shadow: 0 24px 60px rgba(16, 34, 60, 0.18);
  --accent: #0f8b8d;
  --accent-2: #f2a541;
  --danger: #c62828;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans TC", sans-serif;
  color: var(--ink);
}

body {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 18%, #e0f7ff 0%, transparent 44%),
    radial-gradient(circle at 88% 14%, #ffe8d1 0%, transparent 48%),
    linear-gradient(160deg, #f2f8ff 0%, #eef9f7 50%, #fef4e5 100%);
  overflow-x: hidden;
}

body.locked .app {
  display: none !important;
}

body.locked {
  overflow: hidden;
}

.bg-layer {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(14px);
  z-index: -1;
}

.bg-layer-a {
  width: 420px;
  height: 420px;
  background: rgba(64, 184, 197, 0.24);
  top: -120px;
  left: -80px;
  animation: floatA 9s ease-in-out infinite;
}

.bg-layer-b {
  width: 360px;
  height: 360px;
  background: rgba(242, 165, 65, 0.2);
  right: -90px;
  bottom: -80px;
  animation: floatB 11s ease-in-out infinite;
}

@keyframes floatA {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(24px, 18px);
  }
}

@keyframes floatB {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-16px, -20px);
  }
}

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 1200;
}

.overlay.active {
  display: grid;
}

.auth-card,
.loading-card {
  width: min(460px, 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo,
.logo-square {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 139, 141, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-logo img,
.logo-square img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.brand-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

h1,
h2,
h3,
.loading-title {
  font-family: "Manrope", sans-serif;
}

h1 {
  margin: 18px 0 8px;
  font-size: 1.42rem;
}

.hint {
  margin: 0;
  color: var(--muted);
}

.auth-form {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

input,
button,
audio {
  width: 100%;
  border-radius: var(--radius-sm);
}

input {
  height: 44px;
  border: 1px solid rgba(19, 34, 57, 0.16);
  background: rgba(255, 255, 255, 0.86);
  padding: 0 14px;
  font: inherit;
  color: var(--ink);
}

input:focus {
  outline: 2px solid rgba(15, 139, 141, 0.22);
  border-color: rgba(15, 139, 141, 0.45);
}

button {
  height: 44px;
  border: 0;
  background: linear-gradient(135deg, var(--accent), #1fa3a6);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

button:active {
  transform: translateY(0);
}

.error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 0.92rem;
}

.loading-card {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
}

.disclaimer-card {
  width: min(560px, 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  gap: 12px;
}

.disclaimer-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.disclaimer-line {
  margin: 0;
  line-height: 1.65;
  color: var(--ink);
}

.disclaimer-line a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.disclaimer-line a:hover {
  text-decoration: underline;
}

.disclaimer-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.96rem;
  color: var(--muted);
}

.disclaimer-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.guide-card {
  width: min(620px, 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  gap: 10px;
}

.guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guide-head h3 {
  margin: 0;
  font-size: 1.2rem;
}

.guide-close,
.menu-btn {
  width: auto;
  min-width: 90px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.guide-close {
  background: rgba(19, 34, 57, 0.1);
  color: var(--ink);
}

.guide-intro {
  margin: 0;
  color: var(--muted);
}

.guide-title {
  margin: 6px 0 0;
  font-weight: 700;
}

.guide-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 4px;
  color: var(--ink);
}

.logo-spin-wrap {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.48);
}

.logo-square {
  animation: rotatePulse 1.3s ease-in-out infinite;
}

@keyframes rotatePulse {
  0% {
    transform: rotate(0deg) scale(0.9);
  }
  45% {
    transform: rotate(90deg) scale(1.05);
  }
  100% {
    transform: rotate(180deg) scale(0.9);
  }
}

.loading-title {
  margin: 4px 0 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.loading-text {
  margin: 0;
  color: var(--muted);
}

.app {
  width: min(1160px, 94vw);
  margin: 26px auto 30px;
  display: grid;
  gap: 14px;
  animation: reveal 0.46s ease;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar {
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-right {
  margin-left: auto;
}

.menu-btn {
  background: linear-gradient(135deg, #2f80ed, #1fa3a6);
}

.topbar-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 139, 141, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.topbar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 1.4rem;
}

.topbar-actions {
  width: min(320px, 100%);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.list-card {
  border-radius: var(--radius-lg);
  padding: 18px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.panel-title {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 0.88rem;
  color: var(--muted);
}

#nowTitle {
  margin: 8px 0 4px;
  font-size: 1.3rem;
}

.muted {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.player-controls {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.topbar-actions {
  width: 100%;
  margin-bottom: 12px;
}

.badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), #ff7f50);
}

.track-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
  max-height: 58vh;
  overflow: auto;
}

.track-item {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.58);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  gap: 12px;
}

.track-item.active {
  border-color: rgba(15, 139, 141, 0.42);
  box-shadow: inset 0 0 0 1px rgba(15, 139, 141, 0.24);
}

.track-text {
  min-width: 0;
}

.track-title {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-file {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-btn {
  width: auto;
  min-width: 74px;
  padding: 0 12px;
}

.empty {
  display: none;
  margin: 14px 0 0;
  color: var(--muted);
}

@media (max-width: 920px) {
  .list-card {
    max-width: none;
  }

  .track-list {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .auth-card,
  .loading-card,
  .topbar,
  .list-card {
    border-radius: 20px;
  }

  .auth-card,
  .loading-card {
    padding: 22px;
  }

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

  .topbar-right {
    margin-left: 0;
  }

  .menu-btn {
    width: 100%;
  }
}
