/* ============ 解家集团 · 管理后台 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f1f4f9;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #8a94a6;
  --line: #e6eaf2;
  --primary: #2f54eb;
  --primary-d: #1d39c4;
  --danger: #e5484d;
  --ok: #18a058;
  --warn: #d48806;
  --bad: #cf1322;
  --radius: 10px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
.muted { color: var(--muted); }
.ta-c { text-align: center; }
.req { color: var(--danger); margin-left: 2px; }
.hint { color: var(--muted); font-size: 12px; margin: 10px 0; }
.err { color: var(--danger); min-height: 18px; margin-top: 8px; font-size: 13px; }

/* ---------- 登录页 ---------- */
.fullview {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1d2b64 0%, #2f54eb 100%);
}
.card-login {
  background: #fff; border-radius: 16px; padding: 42px 46px; width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25); text-align: center;
}
.card-login .brand { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.card-login .sub { color: var(--muted); margin-bottom: 26px; }
.card-login p { color: var(--ink); line-height: 1.7; margin-bottom: 16px; }

/* ---------- 顶栏 / 布局 ---------- */
.topbar {
  height: 56px; background: #16213a; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.brand-s { font-weight: 700; font-size: 15px; letter-spacing: .5px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.me { color: #c8d0e8; margin-right: 6px; }

.layout { display: flex; min-height: calc(100vh - 56px); }
.sidenav {
  width: 200px; background: #fff; border-right: 1px solid var(--line);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: 8px; color: var(--ink); font-weight: 500;
}
.nav-item .ico { width: 20px; text-align: center; }
.nav-item:hover { background: #f0f3fb; color: var(--primary); }
.nav-item.active { background: var(--primary); color: #fff; }

.content { flex: 1; padding: 26px 30px; max-width: 1180px; }
.content h2 { font-size: 20px; margin-bottom: 18px; }
.content h3 { font-size: 15px; margin: 22px 0 10px; color: #4a5568; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.page-head h2 { margin-bottom: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; text-align: center;
}
.stat .num { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat .lbl { color: var(--muted); margin-top: 4px; font-size: 12px; }

.logs { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; min-height: 120px; }
.log-row { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.log-row:last-child { border-bottom: none; }
.log-time { color: var(--muted); margin-right: 8px; font-family: monospace; }

/* ---------- 表格 ---------- */
.table {
  width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: #f7f9fd; font-size: 12px; color: #5b6472; font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.table tr.inactive { opacity: .5; }
.table td.ops { white-space: nowrap; }
.table td.ops .btn { margin-right: 6px; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; background: #eef1f8; color: #5b6472; margin: 1px 2px;
}
.badge.ok   { background: #e6f7ef; color: var(--ok); }
.badge.off  { background: #f4f5f7; color: var(--muted); }
.badge.warn { background: #fdf4e4; color: var(--warn); }
.badge.bad  { background: #fdecec; color: var(--bad); }
.badge.star { background: #fff7dd; color: #ad6800; font-weight: 600; }

/* ---------- 按钮 / 输入 ---------- */
.btn {
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  padding: 8px 16px; font-size: 13px; background: #eef1f8; color: var(--ink);
  transition: .15s;
}
.btn:hover { filter: brightness(.96); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.ghost { background: transparent; border-color: #cdd4e4; color: #5b6472; }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.danger { background: #fdecec; color: var(--danger); }
.btn.ok { background: #e6f7ef; color: var(--ok); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn.lg { padding: 12px 22px; font-size: 15px; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.input, select, input[type="text"], input[type="password"] {
  border: 1px solid #d5dbe8; border-radius: 8px; padding: 9px 12px; font-size: 13px;
  background: #fff; color: var(--ink); outline: none; min-width: 200px;
}
.input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,84,235,.12); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px;
}
.modal {
  background: #fff; border-radius: 14px; width: 640px; max-width: 100%;
  max-height: 82vh; display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; }
.modal-head h3 { font-size: 17px; }
.modal-x { border: none; background: none; font-size: 17px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 16px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; }

.modal-body label { display: block; margin-bottom: 12px; font-size: 13px; color: #4a5568; }
.modal-body input, .modal-body select, .modal-body textarea {
  display: block; width: 100%; margin-top: 5px; min-width: 0;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
label.chk { display: flex; align-items: center; gap: 6px; }
label.chk input { width: auto; margin: 0; }

fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
fieldset legend { font-size: 12px; color: var(--muted); padding: 0 6px; }
fieldset label.chk { margin-bottom: 8px; font-size: 13px; }

/* ---------- 富文本编辑器 ---------- */
.rt-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  border: 1px solid #d5dbe8; border-bottom: none; border-radius: 8px 8px 0 0;
  padding: 8px 10px; background: #f7f9fd;
}
.rt-toolbar button {
  border: 1px solid #d5dbe8; background: #fff; border-radius: 6px;
  padding: 4px 10px; cursor: pointer; font-size: 12px; color: var(--ink);
}
.rt-toolbar button:hover { border-color: var(--primary); color: var(--primary); }
.rt-sep { width: 1px; height: 18px; background: #d5dbe8; margin: 0 4px; }
.rt-color { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.rt-color input[type="color"] { width: 26px; height: 24px; border: none; padding: 0; cursor: pointer; background: none; }
.rt-editor {
  border: 1px solid #d5dbe8; border-radius: 0 0 8px 8px; min-height: 200px;
  padding: 12px 14px; outline: none; background: #fff; line-height: 1.7;
}
.rt-editor:focus { border-color: var(--primary); }
.rt-editor h2 { font-size: 18px; margin: 10px 0 6px; }
.rt-editor h3 { font-size: 15px; margin: 8px 0 4px; }
.rt-editor blockquote {
  border-left: 3px solid var(--primary); background: #f7f9fd;
  padding: 8px 12px; margin: 8px 0; color: #4a5568;
}
.rt-editor ul { padding-left: 22px; }

/* ---------- 提示条 ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #16213a; color: #fff; padding: 11px 22px; border-radius: 10px;
  opacity: 0; transition: .25s; z-index: 200; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

/* ---------- 手机端 ---------- */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidenav { width: 100%; flex-direction: row; overflow-x: auto; padding: 8px; }
  .nav-item { white-space: nowrap; padding: 9px 12px; }
  .content { padding: 16px 12px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
  .actions { width: 100%; }
  .input { min-width: 0; flex: 1; }
}
