:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #1f2329;
  --muted: #8a9099;
  --line: #e8eaed;
  --primary: #1677ff;
  --primary-dark: #0f5fd6;
  --danger: #e5484d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

.hidden { display: none !important; }

/* 登录页 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 340px;
  background: var(--panel);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 8px 30px rgba(20, 30, 50, 0.08);
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
}

.sub {
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 24px;
}

.login-card label {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 13px;
}

.login-card input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
}

.login-card input:focus {
  border-color: var(--primary);
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

button.primary {
  width: 100%;
  height: 40px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

button.primary:hover { background: var(--primary-dark); }

button.small { width: auto; height: 32px; padding: 0 14px; }

button.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  height: 32px;
  padding: 0 14px;
}

button.ghost:hover { border-color: var(--primary); color: var(--primary); }

.msg {
  margin-top: 12px;
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
}

/* 顶栏 */
.topbar {
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { font-weight: 700; font-size: 16px; }

.top-actions { display: flex; align-items: center; gap: 14px; }

.ghost-link { color: var(--primary); text-decoration: none; }
.ghost-link:hover { text-decoration: underline; }

.whoami { color: var(--muted); }

/* 主体 */
.main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

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

.card-label { color: var(--muted); font-size: 13px; }

.card-value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 8px;
}

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

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

.panel-head h2 { font-size: 15px; margin: 0; }

.tools { display: flex; gap: 8px; }

.tools input {
  height: 32px;
  width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
}

.tools input:focus { border-color: var(--primary); }

.chart { width: 100%; height: 260px; }

/* 表格 */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th { color: var(--muted); font-weight: 500; }

tbody tr:hover { background: #fafbfc; }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef0f3;
  display: block;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.tag.on { background: #e8f5ec; color: #12813c; }
.tag.off { background: #f2f3f5; color: #8a9099; }

.ops { display: flex; gap: 8px; }

.link-btn {
  background: none;
  color: var(--primary);
  padding: 0;
  font-size: 13px;
}

.link-btn.danger { color: var(--danger); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}

.muted { color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .tools input { width: 140px; }
  .topbar { padding: 0 14px; }
  .main { padding: 14px; }
}
