/* 播音室遥控 —— 移动端深色主题，大按钮方便现场操作 */
:root {
  --bg: #0b0e14;
  --card: #151a24;
  --card2: #1c2331;
  --text: #e8ecf3;
  --dim: #8b93a3;
  --accent: #2dd45d;
  --accent-dim: #1d8a3f;
  --danger: #ff5c5c;
  --warn-bg: #3a2a12;
  --warn-text: #ffd28a;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body {
  max-width: 520px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 24px);
  min-height: 100vh;
}

.view[hidden] { display: none !important; }

/* ---------- 登录页 ---------- */
#view-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92vh;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid #232b3a;
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}

.logo {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  color: #0b0e14;
  background: linear-gradient(135deg, var(--accent), #19b3a6);
  border-radius: 50%;
}

.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card .sub { margin: 0 0 24px; color: var(--dim); font-size: 14px; }

#login-form input {
  width: 100%;
  padding: 14px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid #2a3345;
  background: var(--card2);
  color: var(--text);
  font-size: 16px;
  outline: none;
}
#login-form input:focus { border-color: var(--accent); }

.btn-primary {
  width: 100%;
  padding: 15px;
  margin-top: 6px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #0b0e14;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary:active { background: var(--accent-dim); }

.error { color: var(--danger); font-size: 14px; margin-top: 12px; }

/* ---------- 主界面 ---------- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 2px 10px;
}

.app-title { font-size: 18px; font-weight: 700; }

.status { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #666; display: inline-block; }
.dot.ok { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.dot.bad { background: var(--danger); }

.h-right { display: flex; align-items: center; gap: 10px; }
.user-name { color: var(--dim); font-size: 13px; }

.btn-ghost {
  background: transparent;
  border: 1px solid #2a3345;
  color: var(--dim);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.error-banner {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 8px 0;
  font-size: 14px;
  word-break: break-all;
}

/* ---------- 正在播放 ---------- */
.now-playing {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid #232b3a;
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-top: 8px;
}

.cover {
  flex: 0 0 72px;
  width: 72px; height: 72px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  color: #0b0e14;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.np-info { min-width: 0; }
.np-title {
  font-size: 19px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-artist { color: var(--dim); font-size: 14px; margin-top: 2px; }

/* ---------- 进度 ---------- */
.progress-row { padding: 14px 4px 2px; }
.progress-row input[type="range"] { width: 100%; }
.times {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ---------- 大按钮 ---------- */
.transport {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 18px 0;
}

.btn-round {
  width: 64px; height: 64px;
  border: none;
  border-radius: 50%;
  background: var(--card2);
  color: var(--text);
  font-size: 26px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.btn-round:active { transform: scale(.94); }

.btn-play {
  width: 84px; height: 84px;
  background: var(--accent);
  color: #0b0e14;
  font-size: 34px;
  box-shadow: 0 6px 18px rgba(45,212,93,.35);
}

/* ---------- 音量 ---------- */
.volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.volume-row input[type="range"] { flex: 1; }
.vol-icon { font-size: 18px; }
.vol-text {
  width: 40px;
  text-align: right;
  color: var(--dim);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 滑块统一样式 ---------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #2a3345;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #0b0e14;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #0b0e14;
  cursor: pointer;
}
input[type="range"]:disabled { opacity: .45; }

/* ---------- 播放列表 ---------- */
.playlist {
  background: var(--card);
  border: 1px solid #232b3a;
  border-radius: var(--radius);
  padding: 14px 12px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 10px;
}
.section-title { font-weight: 700; }
.pl-count { color: var(--dim); font-size: 13px; }
.loop-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
}
.loop-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

#pl-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: 10px;
  cursor: pointer;
  border-bottom: 1px solid #1c2331;
}
.pl-item:last-child { border-bottom: none; }
.pl-item:active { background: var(--card2); }

.pl-idx {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--card2);
  color: var(--dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.pl-item.active { background: var(--card2); }
.pl-item.active .pl-idx { background: var(--accent); color: #0b0e14; font-weight: 700; }
.pl-item.active .pl-title { color: var(--accent); font-weight: 700; }

.pl-main { min-width: 0; flex: 1; }
.pl-title {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-artist { color: var(--dim); font-size: 12px; margin-top: 1px; }

.pl-badge {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--warn-text);
  background: var(--warn-bg);
  border-radius: 6px;
  padding: 2px 8px;
}

/* ---------- 设置页 ---------- */
.card {
  background: var(--card);
  border: 1px solid #232b3a;
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 14px;
}
.card .section-title { padding: 0 0 12px; }
.card input, .card select {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid #2a3345;
  background: var(--card2);
  color: var(--text);
  font-size: 16px;
  outline: none;
}
.card input:focus, .card select:focus { border-color: var(--accent); }
.card select { -webkit-appearance: none; appearance: none; }

.msg {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 12px;
}
.msg.err { background: rgba(255, 92, 92, .12); color: var(--danger); }
.msg.ok  { background: rgba(45, 212, 93, .12); color: var(--accent); }

.pl-hint { color: var(--dim); font-size: 13px; margin: 0 0 12px; }

.user-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.um-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 4px;
  border-bottom: 1px solid #1c2331;
  font-size: 15px;
}
.um-add { border-top: 1px solid #1c2331; padding-top: 12px; }

/* 桌面端更宽时保持居中 */
@media (min-width: 560px) {
  body { border-left: 1px solid #1a2130; border-right: 1px solid #1a2130; }
}
