:root {
  --bg: #f4efe4;
  --panel: rgba(255, 251, 245, 0.92);
  --text: #15313d;
  --muted: #5e746d;
  --accent: #113c4a;
  --accent-2: #d26a37;
  --border: rgba(17, 60, 74, 0.12);
  --shadow: 0 22px 60px rgba(17, 60, 74, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(210, 106, 55, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(17, 60, 74, 0.18), transparent 28%),
    linear-gradient(180deg, #f7f0e3 0%, #efe9de 100%);
  min-height: 100vh;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.04;
}

.subtext {
  max-width: 680px;
  font-size: 17px;
  color: var(--muted);
}

.hero-card,
.panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 22px;
  display: grid;
  gap: 14px;
}

.metric {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(17, 60, 74, 0.07), rgba(210, 106, 55, 0.08));
}

.metric span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.metric strong {
  font-size: 16px;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  padding: 22px;
}

.dashboard {
  animation: reveal 0.32s ease-out;
}

.panel-head h2 {
  margin: 0 0 6px;
}

.panel-head p {
  margin: 0 0 18px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  font-size: 14px;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(17, 60, 74, 0.16);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
}

textarea {
  resize: vertical;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #1c6075);
  box-shadow: 0 12px 30px rgba(17, 60, 74, 0.24);
}

.btn.secondary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), #e28f57);
  box-shadow: 0 12px 30px rgba(210, 106, 55, 0.24);
}

.btn.ghost {
  color: var(--accent);
  background: rgba(17, 60, 74, 0.08);
}

.status-line {
  margin: 14px 0 0;
  color: var(--muted);
}

.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 60, 74, 0.08);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.pair-box {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  margin-bottom: 16px;
}

.pair-status {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(45, 149, 95, 0.18);
  background: rgba(45, 149, 95, 0.08);
  color: #20694a;
  line-height: 1.6;
}

.pair-status strong {
  display: block;
  margin-bottom: 4px;
}

.pair-actions {
  margin-bottom: 16px;
}

.device-list,
.history-list {
  display: grid;
  gap: 12px;
}

.device-card,
.history-item,
.preview-box {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(17, 60, 74, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.device-card strong,
.history-item strong {
  display: block;
  margin-bottom: 6px;
}

.device-meta,
.history-meta {
  color: var(--muted);
  font-size: 13px;
}

.status-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-online {
  background: rgba(45, 149, 95, 0.14);
  color: #20694a;
}

.status-offline {
  background: rgba(176, 63, 47, 0.12);
  color: #923c2d;
}

.status-paired {
  background: rgba(17, 60, 74, 0.08);
  color: var(--accent);
}

.preview-box {
  margin-top: 14px;
  color: var(--muted);
}

.history-item img {
  margin-top: 12px;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(17, 60, 74, 0.12);
}

.hidden {
  display: none;
}

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

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

  .pair-box {
    grid-template-columns: 1fr;
  }
}
