:root {
  --bg: #f2f5fb;
  --panel: #ffffff;
  --ink: #16233a;
  --muted: #6b7a93;
  --line: #dde5f2;
  --brand: #1f6feb;
  --brand-dark: #14512f;
  --on: #17864b;
  --off: #8a93a5;
  --bad: #c0392b;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 14px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}

h1 { font-size: 20px; margin: 2px 0 0; }
h2 { font-size: 18px; margin: 18px 0 10px; }
h3 { font-size: 16px; margin: 0 0 10px; }

.admin-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.admin-bar input { flex: 1 1 160px; min-width: 0; }
.admin-bar button { flex: 0 0 auto; white-space: nowrap; }

.admin-bar label { font-size: 13px; color: var(--muted); white-space: nowrap; }

input, select, textarea, button {
  font: inherit;
  color: inherit;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcff;
}

textarea { resize: vertical; min-height: 90px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(31, 111, 235, .35);
  border-color: var(--brand);
}

button {
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

button.ghost {
  background: #eef3fc;
  color: var(--brand);
}

button.danger { background: #fdecea; color: var(--bad); }

button:active { transform: translateY(1px); }

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.summary article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.summary span { display: block; font-size: 12px; color: var(--muted); }
.summary strong { font-size: 18px; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pick-row { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.pick-row input { width: auto; flex: 1 1 auto; min-width: 0; }

.tab {
  background: #e6ecf8;
  color: var(--muted);
  white-space: nowrap;
  padding: 8px 14px;
}

.tab.active { background: var(--brand); color: #fff; }

.notice {
  min-height: 20px;
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--on);
}

.notice.bad { color: var(--bad); }

.view.hidden, .hidden { display: none !important; }

.cards { display: flex; flex-direction: column; gap: 10px; }

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

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.badge.on { background: #e6f7ee; color: var(--on); }
.badge.off { background: #eef1f6; color: var(--off); }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.empty { color: var(--muted); text-align: center; padding: 22px 0; }

.field { margin-bottom: 10px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

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

.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0; }
.check input { width: auto; }

.login-box { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.qr-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.qr-wrap img { width: 200px; height: 200px; image-rendering: pixelated; display: block; }
.login-side { flex: 1 1 220px; min-width: 200px; }

.logs {
  background: #0f1729;
  color: #d6e2ff;
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 10px 0 0;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.chip {
  background: #e6ecf8; color: var(--muted); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 600;
}
.chip.active { background: var(--brand); color: #fff; }
.account-name { display: flex; align-items: center; gap: 8px; }
.row-check { width: 18px; height: 18px; accent-color: var(--brand); }

.import-row { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.import-row:last-child { border-bottom: 0; }

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.stat-row:last-child { border-bottom: 0; }
.stat-row span { color: var(--muted); }

@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
  .qr-wrap img { width: 240px; height: 240px; }
  h1 { font-size: 18px; }
}
