* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #1f2329;
}

/* ---------- 登录 ---------- */
.login-body {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 320px;
  background: #fff;
  padding: 32px 28px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .08);
}
.login-card h1 { font-size: 18px; margin: 0 0 20px; text-align: center; }
.login-card label { display: block; margin-bottom: 14px; font-size: 13px; color: #646a73; }
.login-card input[type=text],
.login-card input[type=password] {
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  font-size: 14px;
}
button {
  background: #2b5cff;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
}
button:hover { background: #1f49d6; }
.login-card button { width: 100%; margin-top: 6px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 54px;
  background: #fff;
  border-bottom: 1px solid #ebedf0;
}
.brand { font-weight: 600; }
.spacer { flex: 1; }
.user { color: #646a73; font-size: 13px; }
.inline { display: inline; }
.link-btn { background: none; color: #2b5cff; padding: 4px 8px; font-size: 14px; text-decoration: none; cursor: pointer; }
.link-btn:hover { background: none; text-decoration: underline; }
.updated { color: #8a9099; font-size: 12px; }
.autorefresh { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #646a73; cursor: pointer; user-select: none; }
.autorefresh input { cursor: pointer; }
.autorefresh .countdown { color: #8a9099; font-variant-numeric: tabular-nums; }

/* ---------- 总览网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}
.card {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}
.card h2 { font-size: 15px; margin: 0 0 14px; }
.stats { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats th, .stats td { text-align: right; padding: 5px 6px; border-bottom: 1px solid #f0f1f3; }
.stats th:first-child, .stats td:first-child { text-align: left; color: #646a73; }
.unavailable { color: #c0392b; font-size: 13px; }

.config { margin-top: 14px; }
.config summary { cursor: pointer; font-size: 13px; color: #2b5cff; }
.config form { margin-top: 12px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.field span { color: #646a73; }
.field input[type=number], .field input[type=text] {
  width: 130px;
  padding: 6px 8px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  text-align: right;
}

/* ---------- flash ---------- */
.flash { padding: 9px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.flash.full { grid-column: 1 / -1; }
.flash.success { background: #e7f7ed; color: #1a7f37; }
.flash.error { background: #fdecec; color: #c0392b; }
