:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: #172033;
  background: #f2f5f9;
  --accent: #0878ff;
  --accent-2: #00bfae;
  --line: #dfe5ee;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  color: white;
  background: var(--accent);
  cursor: pointer;
}
button:hover { filter: brightness(0.95); }
button.secondary { color: #344054; background: #e9eef5; }
button.danger { background: #e5484d; }
input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
h1, h2, p { margin-top: 0; }
.muted { color: #7a8699; }
.error { min-height: 1.2em; color: #d93036; }
.notice { padding: 10px 14px; border: 1px solid #ffd3d5; border-radius: 8px; color: #a21b22; background: #fff1f1; }
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 10%, #dceaff, transparent 42%),
    radial-gradient(circle at 90% 80%, #d9fff9, transparent 36%), #f4f7fb;
}
.login-card {
  width: min(400px, 100%);
  padding: 34px;
  border: 1px solid white;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 80px rgba(31, 58, 106, 0.16);
}
.login-card label { display: grid; gap: 7px; margin: 15px 0; }
.login-card button { width: 100%; margin-top: 8px; }
.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  font-size: 25px;
  font-weight: 800;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
}
.app-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 24px auto 60px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
header h1 { margin-bottom: 4px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.stats article, .panel, dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 8px 30px rgba(28, 52, 90, 0.06);
}
.stats article { padding: 18px; display: grid; gap: 8px; }
.stats strong { font-size: 28px; }
.panel { padding: 20px; margin-bottom: 16px; }
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-title h2 { margin-bottom: 4px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 12px 10px; border-top: 1px solid var(--line); text-align: left; }
th { color: #69768a; font-size: 13px; font-weight: 600; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; }
.badge.online { color: #087849; background: #dff8ea; }
.badge.offline { color: #6c7480; background: #edf0f4; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions button { padding: 6px 9px; font-size: 12px; }
.button-link { display: inline-block; padding: 6px 9px; font-size: 12px; text-decoration: none; color: #344054; border-radius: 8px; background: #e9eef5; }
.empty { padding: 28px; text-align: center; color: #7a8699; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { max-width: 260px; }
.user-list { margin-top: 16px; display: grid; gap: 8px; }
.user-item { padding: 10px 12px; border-radius: 8px; background: #f5f7fa; }
dialog { width: min(700px, calc(100% - 30px)); padding: 22px; }
dialog::backdrop { background: rgba(15, 25, 45, 0.45); }
pre {
  overflow-wrap: anywhere;
  padding: 14px;
  border-radius: 8px;
  background: #f2f5f9;
}
.chat-messages {
  height: 320px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 8px;
  background: #f6f8fb;
}
.chat-message { margin-bottom: 10px; }
.chat-message strong { display: block; font-size: 12px; color: #69768a; }

@media (max-width: 720px) {
  .app-shell { width: calc(100% - 20px); margin-top: 10px; }
  header, .panel-title { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: 1fr; }
  .login-card { padding: 24px; }
}
