* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", sans-serif;
  background: #111; color: #eee;
  /* 全屏 PWA 模式下内容会顶进灵动岛/状态栏，四边都留出安全区域 */
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
.hidden { display: none !important; }
.error { color: #f66; font-size: 14px; padding: 4px 16px; }

#login-overlay {
  position: fixed; inset: 0; background: #111; z-index: 20;
  display: flex; align-items: center; justify-content: center;
}
#login-form { display: flex; flex-direction: column; gap: 12px; width: 260px; }
#login-form h1 { text-align: center; font-size: 22px; margin-bottom: 8px; }

input, button {
  font-size: 16px; border-radius: 8px; border: 1px solid #444;
  background: #222; color: #eee; padding: 12px;
}
button { background: #2563eb; border: none; cursor: pointer; }

#add-form { display: flex; gap: 8px; padding: 16px 16px 4px; }
#add-form input { flex: 1; min-width: 0; }
#disk-usage { color: #888; font-size: 13px; padding: 4px 16px 8px; }

#track-list { list-style: none; }
.track {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid #222; cursor: pointer;
}
.track.playing { background: #1a2540; }
.track img { width: 72px; height: 40px; object-fit: cover; border-radius: 6px; background: #333; }
.track .meta { flex: 1; min-width: 0; }
.track .title {
  font-size: 15px; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.track .sub { font-size: 12px; color: #888; margin-top: 2px; }
.track.status-error .sub { color: #f66; }
.track button.small {
  padding: 6px 10px; font-size: 13px; background: #333; flex-shrink: 0;
}

#player-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: #1c1c1e; border-top: 1px solid #333;
}
.player-row { display: flex; align-items: center; gap: 8px; width: 100%; }
#seek {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; margin: 6px 0 0;
  padding: 0; border: none; border-radius: 2px;
  background: #333; outline: none;
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: #2563eb; border: none;
}
#seek::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #2563eb; border: none;
}
#player-cover { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; background: #333; }
#player-info { flex: 1; min-width: 0; }
#player-title {
  font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#player-time { font-size: 12px; color: #888; }
#player-bar button { padding: 10px 8px; font-size: 14px; background: #333; }
#btn-play { font-size: 18px; background: #2563eb; min-width: 48px; }
