/* 敏感词管理后台样式：简洁扁平风格，无第三方框架。 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6f8;
  color: #1f2937;
  line-height: 1.5;
}
a { color: #2563eb; text-decoration: none; }
button {
  cursor: pointer;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  transition: background .15s, border-color .15s;
}
button:hover { background: #f3f4f6; }
button.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
button.primary:hover { background: #1d4ed8; }
button.danger { color: #dc2626; border-color: #fca5a5; }
button.danger:hover { background: #fef2f2; }
input, textarea, select {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid #93c5fd; border-color: #93c5fd; }

/* 居中卡片（登录/绑定页） */
.center-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.card h1 { font-size: 20px; margin-bottom: 8px; }
.card p.sub { color: #6b7280; font-size: 14px; margin-bottom: 24px; }
.card button.primary { width: 100%; padding: 10px; font-size: 15px; }
.msg { margin-top: 16px; font-size: 14px; min-height: 20px; }
.msg.err { color: #dc2626; }
.msg.ok { color: #059669; }

/* 后台整体布局 */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.topbar .title { font-weight: 600; margin-right: auto; }
.layout { display: flex; height: calc(100vh - 53px); }
.sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.cat-item:hover { background: #f3f4f6; }
.cat-item.active { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.cat-item .count { color: #9ca3af; font-size: 12px; }
.cat-item.active .count { color: #2563eb; }

.content { flex: 1; padding: 20px; overflow-y: auto; }
.toolbar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.toolbar-row .grow { flex: 1; }
.word-list {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  max-height: 45vh;
  overflow-y: auto;
}
.word-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid #f3f4f6;
}
.word-row:last-child { border-bottom: none; }
.editor { margin-top: 16px; }
.editor textarea { width: 100%; height: 120px; resize: vertical; }
.editor .actions { margin-top: 8px; display: flex; gap: 8px; align-items: center; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-mask.hidden { display: none; }
.modal {
  background: #fff; border-radius: 12px; padding: 24px;
  width: 100%; max-width: 520px; max-height: 80vh; overflow-y: auto;
}
.modal h2 { font-size: 17px; margin-bottom: 16px; }
.modal .modal-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.modal table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal th, .modal td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #f3f4f6; }
.field { margin-bottom: 12px; text-align: left; }
.field label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 4px; }
.field input, .field select { width: 100%; }
.hint { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #6b7280; }
