* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  color: #222;
  background: #fafafa;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
}
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
#who { font-size: 14px; color: #666; }
#who button { margin-left: 8px; }

button {
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  font: inherit;
}
button:hover { background: #f0f0f0; }
button.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
button.primary:hover { background: #1d4ed8; }
button.danger { background: #dc2626; color: #fff; border-color: #dc2626; }
button.danger:hover { background: #b91c1c; }

input[type=text], input[type=password], input[type=url] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font: inherit;
}

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f5f5f5; font-weight: 600; font-size: 13px; color: #555; }
td { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
td.actions { font-family: inherit; text-align: right; }
td.actions button { margin-left: 4px; }
tr:last-child td { border-bottom: none; }

.online  { color: #16a34a; }
.offline { color: #999; }

.card { background: #fff; border: 1px solid #ddd; border-radius: 4px; padding: 16px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px 0; font-size: 16px; }
.row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.row label { width: 100px; color: #666; font-size: 14px; }
.row input { flex: 1; }
.row code { font-family: ui-monospace, monospace; font-size: 13px; padding: 2px 6px; background: #f5f5f5; border-radius: 3px; }

.muted { color: #888; font-size: 13px; }
.error { color: #dc2626; font-size: 14px; padding: 8px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 4px; }

a, a:visited { color: #2563eb; text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }

#login-form {
  max-width: 320px;
  margin: 60px auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 24px;
}
#login-form h2 { margin-top: 0; }
#login-form .row { display: block; margin-bottom: 12px; }
#login-form label { display: block; margin-bottom: 4px; color: #666; font-size: 14px; }

/* device console tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid #ddd; margin-bottom: 16px; flex-wrap: wrap; }
.tab { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 16px; color: #555; }
.tab:hover { background: #f0f0f0; }
.tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
#dev-badge { font-size: 14px; font-weight: normal; }

/* ttyd 内嵌终端 */
.term { width: 100%; height: 520px; border: 1px solid #ddd; border-radius: 4px; background: #000; margin-top: 12px; }

/* 指标网格 */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.metric { background: #fff; border: 1px solid #ddd; border-radius: 4px; padding: 14px; }
.metric .l { font-size: 13px; color: #666; }
.metric .v { font-size: 26px; font-weight: 600; font-family: ui-monospace, monospace; margin: 4px 0; }
.metric .s { font-size: 12px; color: #999; font-weight: normal; }

/* 雷达实时流 */
.radar-log { background: #0b0b0b; color: #5fdc5f; font-family: ui-monospace, monospace; font-size: 12px; height: 240px; overflow: auto; padding: 10px; border-radius: 4px; margin: 0; white-space: pre-wrap; }
