:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e1ec;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #15803d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
}

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

button.danger {
  background: var(--danger);
}

button.ghost {
  color: var(--text);
  background: #eef2f7;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.page {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.panel,
.login-panel {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
}

.login-panel {
  width: min(420px, calc(100vw - 32px));
  margin: 12vh auto;
}

.narrow {
  max-width: 760px;
}

.stack {
  display: grid;
  gap: 14px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: #0f3b24;
  background: #dcfce7;
  font-size: 13px;
  white-space: nowrap;
}

.alert {
  margin-top: 14px;
  border-radius: 6px;
  padding: 10px 12px;
  background: #e0f2fe;
}

.alert.error {
  color: #7f1d1d;
  background: #fee2e2;
}

.alert.success {
  color: #14532d;
  background: #dcfce7;
}

.hidden {
  display: none;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .topbar,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-form,
  .grid-form {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
