:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --text: #e8eaed;
  --muted: #9aa3b2;
  --accent: #ffc857;
  --line: #2a2f3a;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(26, 29, 36, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #252932;
}
.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--err);
}
.status-pill.ok .dot {
  background: var(--ok);
}
.layout {
  display: grid;
  gap: 16px;
  padding: 16px 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
  grid-template-columns: 1fr;
}
.layout.control {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) {
  .layout.control {
    grid-template-columns: 1fr;
  }
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.card.glow-living.on {
  box-shadow: 0 0 24px rgba(255, 200, 87, 0.15);
}
.card.glow-bedroom.on {
  box-shadow: 0 0 20px rgba(255, 200, 87, 0.1);
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.card-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.card-title span.sub {
  font-size: 12px;
  color: var(--muted);
}
.panel-title {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}
.log-list,
.queue-list {
  max-height: 220px;
  overflow-y: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}
.log-line {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  color: #c5cad3;
}
.log-line.warn {
  color: var(--warn);
}
.log-line.error {
  color: var(--err);
}
.queue-row {
  display: grid;
  grid-template-columns: 56px 72px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  text-align: center;
}
.badge.pending {
  background: rgba(251, 191, 36, 0.2);
  color: var(--warn);
}
.badge.running {
  background: rgba(96, 165, 250, 0.2);
  color: #60a5fa;
}
.badge.done {
  background: rgba(74, 222, 128, 0.2);
  color: var(--ok);
}
.badge.failed {
  background: rgba(248, 113, 113, 0.2);
  color: var(--err);
}
.voice-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.voice-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: #252932;
  color: var(--accent);
  cursor: pointer;
  position: relative;
}
.voice-btn.recording {
  animation: pulse 1.2s ease infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 200, 87, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 200, 87, 0);
  }
}
.text-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.text-row input {
  flex: 1;
  background: #12151a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
}
.text-row button,
.voice-row button.send {
  background: var(--accent);
  color: #1a1200;
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
}
.span-2 {
  grid-column: span 2;
}
@media (max-width: 900px) {
  .span-2 {
    grid-column: span 1;
  }
}

/* Room scene */
.room-scene {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-height: 420px;
}
.room-box {
  position: relative;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1e2430 0%, #141820 100%);
  padding: 20px;
  transition: box-shadow 0.3s;
}
.room-box.highlight {
  box-shadow: 0 0 0 3px rgba(108, 155, 207, 0.7);
}
.room-label {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}
.lamp {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #3a3f4b;
  margin: 20px auto;
  transition: background 0.3s, box-shadow 0.3s, opacity 0.3s;
  opacity: 0.35;
}
.lamp.on {
  opacity: 1;
  background: radial-gradient(circle at 30% 30%, #fff9e6, #ffc857);
  box-shadow: 0 0 40px rgba(255, 200, 87, 0.55);
}
.fan-icon {
  width: 64px;
  height: 64px;
  margin: 24px auto;
  border: 3px solid #2ec4b6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fan-blades {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #2ec4b6, #1a936f, #2ec4b6);
  animation: spin 0s linear infinite;
}
.fan-blades.spin {
  animation-duration: 0.8s;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.curtain-track {
  height: 120px;
  margin-top: 20px;
  position: relative;
  background: #0d1016;
  border-radius: 8px;
  overflow: hidden;
}
.curtain-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: linear-gradient(90deg, #6c9bcf, #4cc9f0);
  transition: transform 0.45s ease;
}
.curtain-panel.left {
  left: 0;
  transform-origin: left;
}
.curtain-panel.right {
  right: 0;
  transform-origin: right;
}
