:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #1c2128;
  --muted: #68707d;
  --line: rgba(0, 0, 0, 0.09);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --danger: #c0392b;
  --ok: #1a8f4c;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; font-size: 15px; letter-spacing: 0.2px; }
.brand:hover { color: var(--accent); }
.logout {
  font-size: 13px;
  color: var(--muted);
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.logout:hover { color: var(--danger); border-color: var(--danger); }

.wrap { max-width: 1000px; margin: 0 auto; padding: 28px 20px 60px; }
.page-title { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.page-sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile-head { display: flex; align-items: center; gap: 9px; }
.dot { width: 9px; height: 9px; border-radius: 3px; background: var(--accent); flex: none; }
.tile-title { font-weight: 600; font-size: 15px; }
.tile-desc { color: var(--muted); font-size: 13px; }

.gate-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gate-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gate-title { margin: 0; font-size: 20px; font-weight: 600; }
.gate-sub { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.gate-card form { display: flex; flex-direction: column; gap: 10px; }
.gate-label { font-size: 12px; color: var(--muted); }
.gate-input {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.gate-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gate-btn {
  margin-top: 6px;
  padding: 11px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.gate-btn:hover { filter: brightness(1.06); }
.gate-err { margin: 0; color: var(--danger); font-size: 13px; }

.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 108px;
}
.stat-num { font-size: 19px; font-weight: 600; }
.stat-label { font-size: 12px; color: var(--muted); }

.list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--accent-soft); }
.row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--muted); font-size: 12px; flex: none; }
.btn {
  font-size: 12px;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  flex: none;
}
.btn:hover { color: var(--accent); border-color: var(--accent); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.bad { color: var(--danger); }
.ok { color: var(--ok); }
.empty { color: var(--muted); font-size: 14px; padding: 24px 0; }

@media (max-width: 560px) {
  .wrap { padding: 20px 14px 48px; }
  .bar { padding: 12px 14px; }
  .row { flex-wrap: wrap; gap: 6px 12px; }
  .row-name { flex-basis: 100%; }
}
