:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e2e5ea;
  --text: #1f2733;
  --muted: #78838f;
  --primary: #2f6bff;
  --danger: #d64545;
  --ok: #1f9d55;
}

* { box-sizing: border-box; }

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

.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: 8px 0 0; }

.center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  width: 340px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.card h1, .card h2 { margin: 0 0 16px; font-size: 18px; }

label { display: block; margin: 12px 0 4px; color: var(--muted); }

input, button, textarea {
  font: inherit;
}

input, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

textarea { resize: vertical; }

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  background: var(--primary);
  color: #fff;
}

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

button.small { padding: 5px 9px; font-size: 13px; }
button.danger { background: var(--danger); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 16px; margin: 0; }

.container { padding: 20px 24px; }

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar input { max-width: 320px; }
.toolbar #add-btn { margin-left: auto; }

.grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.grid th, .grid td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.grid th { background: #fafbfc; color: var(--muted); font-weight: 600; }
.grid tr:last-child td { border-bottom: none; }

.key {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: #f2f4f7;
  padding: 2px 6px;
  border-radius: 4px;
}

.remark {
  max-width: 220px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge.active { background: #e6f6ec; color: var(--ok); }
.badge.disabled { background: #fbeaea; color: var(--danger); }

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

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2733;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
}
