:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #162033;
  --muted: #667085;
  --line: #d9e0ea;
  --primary: #1867c0;
  --primary-dark: #0f4f96;
  --danger: #b42318;
  --warning: #b54708;
  --notice: #175cd3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

a { color: var(--primary); text-decoration: none; }

.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  color: var(--text);
}

.topbar nav {
  display: flex;
  gap: 16px;
  flex: 1;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

h1 { margin: 0 0 8px; font-size: 28px; }
h2 { margin: 0 0 16px; font-size: 18px; }
p { margin: 0; color: var(--muted); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.wide { max-width: 100%; }

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

th, td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #344054;
  background: #f8fafc;
  font-weight: 650;
}

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}

button:hover, .button-link:hover { background: var(--primary-dark); color: #fff; }

.secondary {
  background: #253858;
}

.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.upload-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

input[type="file"], input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

.alert, .success {
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.alert {
  background: #fef3f2;
  color: var(--danger);
  border: 1px solid #fecdca;
}

.success {
  background: #ecfdf3;
  color: #067647;
  border: 1px solid #abefc6;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef4ff;
  color: var(--notice);
}

.badge.critical { background: #fef3f2; color: var(--danger); }
.badge.warning { background: #fffaeb; color: var(--warning); }
.badge.notice { background: #eff8ff; color: var(--notice); }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eef2f7;
}

.login-panel {
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
}

.login-panel label {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  font-size: 14px;
  color: #344054;
}

.login-panel input, .login-panel button {
  width: 100%;
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
    gap: 10px;
  }
  .topbar nav { flex-wrap: wrap; }
  .page { padding: 18px; }
  .hero { align-items: flex-start; flex-direction: column; }
}
