:root {
  --bg: #0f1115;
  --card: #171a21;
  --line: #262b36;
  --text: #e8ecf3;
  --muted: #98a2b3;
  --accent: #3b82f6;
  --danger: #b45309;
  --ok: #16a34a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 0 32px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, "PingFang SC", "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.bar-title { font-weight: 600; }
.bar-right { display: flex; align-items: center; gap: 8px; }

main { padding: 12px; max-width: 720px; margin: 0 auto; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

h1 { font-size: 20px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; font-size: 18px; }
.right { text-align: right; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 14px; }

input {
  width: 100%;
  padding: 14px;
  font-size: 17px;
  color: var(--text);
  background: #0c0e12;
  border: 1px solid var(--line);
  border-radius: 10px;
}

button {
  min-height: 52px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  background: #1f242e;
  border: 1px solid var(--line);
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}

button:active { transform: scale(0.985); }
button[disabled] { opacity: 0.55; }

.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.warn { background: #7c2d12; border-color: #9a3412; }
.ghost { background: transparent; padding: 8px 12px; min-height: 40px; font-size: 14px; }
.big { width: 100%; min-height: 60px; font-size: 18px; margin-top: 8px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }

.chip, .pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #222834;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.pill.online { background: rgba(22, 163, 74, 0.18); border-color: var(--ok); color: #86efac; }
.pill.asleep { background: rgba(180, 83, 9, 0.18); border-color: var(--danger); color: #fdba74; }

.output {
  margin: 8px 0 0;
  padding: 12px;
  max-height: 45vh;
  overflow: auto;
  background: #0b0d11;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

.error { color: #fca5a5; margin: 10px 0 0; }

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.summary .item { background: #12151b; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.summary .k { color: var(--muted); font-size: 12px; }
.summary .v { font-size: 17px; font-weight: 600; margin-top: 2px; }

.footnote { text-align: center; margin-top: 16px; }
