:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --border: #e3e7ee;
  --text: #1f2733;
  --muted: #7a8699;
  --primary: #2f6bff;
  --primary-dark: #1f4fd8;
  --green: #18a058;
  --red: #e5484d;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(24,160,88,.15); }
.conn { display: flex; align-items: center; gap: 12px; }

.badge { padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.badge-on { background: #e6f7ee; color: var(--green); }
.badge-off { background: #fdeaea; color: var(--red); }
.count { color: var(--muted); font-size: 13px; }

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  padding: 20px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.panel-head h2 { font-size: 16px; }

.sel-actions { display: flex; gap: 8px; }
.btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.device-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.device-list .empty { color: var(--muted); font-size: 14px; text-align: center; padding: 30px 0; }

.device-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.device-item:hover { border-color: var(--primary); }
.device-item.selected {
  border-color: var(--primary);
  background: #f0f5ff;
  box-shadow: 0 0 0 2px rgba(47,107,255,.12);
}
.device-item .check {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; flex-shrink: 0;
  transition: all .15s;
}
.device-item.selected .check { background: var(--primary); border-color: var(--primary); }
.device-item .info { flex: 1; min-width: 0; }
.device-item .name { font-weight: 600; font-size: 15px; }
.device-item .id { font-size: 12px; color: var(--muted); margin-top: 2px; }
.device-item .online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

.control { display: flex; flex-direction: column; gap: 16px; }
.talk-area { display: flex; flex-direction: column; gap: 16px; }
.card { border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.6; }

.btn-talk {
  width: 100%;
  padding: 22px 0;
  font-size: 20px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: 2px;
}
.btn-talk:hover { background: var(--primary-dark); }
.btn-talk:active, .btn-talk.active { background: var(--red); transform: scale(.99); }

.music-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.music-row input[type=file] { font-size: 13px; max-width: 260px; }
.music-status { margin-top: 10px; font-size: 13px; color: var(--muted); }

.monitor-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vol { width: 160px; accent-color: var(--primary); }

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

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}
