:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e3e6ea;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 360px; padding: 28px; }
.login-card h1 { font-size: 20px; margin: 0 0 20px; }
.login-card input { margin-bottom: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 12px; }

/* 布局 */
.topbar {
  display: flex; align-items: center; gap: 18px;
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 0 20px; height: 56px; position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 16px; }
.topbar nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tab {
  padding: 8px 14px; border: none; background: transparent; cursor: pointer;
  border-radius: 8px; color: var(--muted); white-space: nowrap; font-size: 14px;
}
.tab.active { background: #eef2ff; color: var(--primary); font-weight: 600; }
.whoami { color: var(--muted); font-size: 13px; }

main { padding: 20px; max-width: 1100px; margin: 0 auto; }

/* 组件 */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 16px; font-size: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input, select, textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; min-width: 140px;
}
button {
  padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 14px; font-weight: 600;
}
button:hover { background: var(--primary-dark); }
button.secondary { background: #eef2ff; color: var(--primary); }
button.small { padding: 4px 10px; font-size: 12px; font-weight: 500; }
button:disabled { opacity: .5; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-weight: 600; background: #fafbfc; }
tr:hover td { background: #f9fafb; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge.ok { background: #dcfce7; color: var(--success); }
.badge.warn { background: #fef3c7; color: var(--warning); }
.badge.gray { background: #f3f4f6; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.stat .num { font-size: 28px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; }

pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow: auto; font-size: 12px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 99; }
.landing { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.landing-cards { display: flex; gap: 20px; flex-wrap: wrap; }
.landing-card { width: 260px; padding: 28px; text-align: center; cursor: pointer; }
.landing-card h2 { margin: 0 0 10px; }
.landing-card p { color: var(--muted); margin: 0; }
