* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

.header {
  background: linear-gradient(135deg, #4a6cf7, #6c5ce7);
  color: #fff;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header h1 { font-size: 20px; font-weight: 600; }

.status {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
}
.status.connected { background: rgba(46,204,113,0.3); }

.layout {
  display: flex;
  max-width: 1200px;
  margin: 24px auto;
  gap: 20px;
  padding: 0 20px;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  height: fit-content;
}

.sidebar h2 { font-size: 15px; margin-bottom: 12px; color: #666; }

.device-list { list-style: none; }
.device-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.device-list li:hover { background: #f5f7ff; }
.device-list li.active { background: #eef1ff; }

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
}
.dot.online { background: #2ecc71; }

.name { font-weight: 500; font-size: 14px; }
.meta { font-size: 12px; color: #999; }

.badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}
.badge.warn { background: #fff3cd; color: #856404; }

.content { flex: 1; display: flex; flex-direction: column; gap: 16px; }

.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.card.highlight { border: 2px solid #f39c12; }

.card h3 { font-size: 16px; margin-bottom: 12px; }

.tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: normal;
}
.tag.online { background: #d4edda; color: #155724; }
.tag.offline { background: #f8d7da; color: #721c24; }

.info { font-size: 13px; color: #888; }
.hint { font-size: 13px; color: #666; margin-bottom: 12px; }

.row { display: flex; gap: 8px; }
.row input { flex: 1; }

input, textarea {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
}
input:focus, textarea:focus { border-color: #4a6cf7; }

button {
  background: #4a6cf7;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
}
button:hover { opacity: 0.9; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.small { font-size: 12px; padding: 4px 10px; margin-left: 8px; }

.btn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.form-group input, .form-group textarea { width: 100%; }

.log-list { max-height: 300px; overflow-y: auto; }
.log-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}
.log-type {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e9ecef;
  flex-shrink: 0;
}
.log-type.violation { background: #f8d7da; color: #721c24; }
.log-type.alert { background: #fff3cd; color: #856404; }
.log-msg { flex: 1; }
.log-time { color: #aaa; font-size: 12px; flex-shrink: 0; }

.empty, .empty-state { color: #999; font-size: 14px; text-align: center; padding: 20px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
}
.info-row { font-size: 13px; }
.info-label { color: #888; display: block; margin-bottom: 2px; }
.info-value { color: #333; word-break: break-all; }

.remote-hint .hint-list {
  margin: 8px 0 0 18px;
  font-size: 13px;
  color: #666;
  line-height: 1.8;
}
.remote-hint code {
  background: #f0f0f0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 100;
}
