/* Novo 管理后台样式。
   配色沿用站点主题（蓝→青渐变 #1972df→#17abe5），让后台和前台看着是一家。
   面板作者请只用这里定义好的类，不要自己引入外部资源。 */

:root {
  --brand: #1972df;
  --brand-2: #17abe5;
  --ink: #16202c;
  --ink-2: #4a5766;
  --ink-3: #8794a3;
  --line: #e2e8f0;
  --bg: #f5f7fa;
  --card: #fff;
  --ok: #12855f;
  --ok-bg: #e6f6f0;
  --err: #c0392b;
  --err-bg: #fdecea;
  --warn: #a86b12;
  --warn-bg: #fdf4e3;
  --radius: 10px;
}

* { box-sizing: border-box; }

/* hidden 属性靠浏览器默认样式的 display:none 生效，而作者 CSS 优先级更高 ——
   下面那些 .login / .app / .modal 的 display:grid 会把 hidden 直接覆盖掉，
   导致登录页、主界面、确认框三层同时显示。必须显式兜住。 */
[hidden] { display: none !important; }

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

h2 { font-size: 20px; margin: 0 0 4px; }
h3 { font-size: 15px; margin: 0 0 10px; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-3); font-size: 13px; }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.login__box { width: 100%; max-width: 340px; background: var(--card);
  padding: 32px 28px; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.login__brand { font-size: 19px; font-weight: 700; }
.login__sub { margin: 4px 0 20px; }
.login__err { background: var(--err-bg); color: var(--err); padding: 9px 12px;
  border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

/* ---------- 布局 ---------- */
.app { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.side { background: #101b28; color: #cfd8e3; display: flex; flex-direction: column; }
.side__brand { padding: 18px 20px; font-weight: 700; color: #fff; font-size: 15px;
  border-bottom: 1px solid rgba(255,255,255,.08); }
.side__nav { flex: 1; padding: 10px 0; }
.side__nav a { display: block; padding: 10px 20px; color: #cfd8e3;
  text-decoration: none; font-size: 14px; border-left: 3px solid transparent; }
.side__nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.side__nav a.on { background: rgba(23,171,229,.16); color: #fff;
  border-left-color: var(--brand-2); }
.side__foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side__foot .muted { color: #8fa0b3; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 26px 30px; overflow-x: auto; }
.panel { max-width: 1100px; }

/* ---------- 卡片 / 表单 ---------- */
.card { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2);
  margin-bottom: 5px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; color: var(--ink); background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(23,171,229,.14); }
.field textarea { min-height: 90px; resize: vertical; }
.field--inline { display: inline-block; margin-right: 12px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 0; border-radius: 8px; cursor: pointer;
  font: inherit; font-weight: 500; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn--ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn--ghost:hover { background: #f3f6f9; filter: none; }
.btn--danger { background: var(--err); }
.btn--sm { padding: 5px 10px; font-size: 13px; }
.btn--block { width: 100%; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; color: var(--ink-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: #fafbfc; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 徽标 / 空态 ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: #eef2f6; color: var(--ink-2); }
.badge--on { background: var(--ok-bg); color: var(--ok); }
.badge--off { background: #eef2f6; color: var(--ink-3); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.empty { padding: 34px; text-align: center; color: var(--ink-3);
  border: 1px dashed var(--line); border-radius: var(--radius); background: #fff; }

/* ---------- 提示条 ---------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 16px; border-radius: 9px; font-size: 13.5px;
  box-shadow: 0 6px 20px rgba(0,0,0,.13); background: #fff;
  border-left: 3px solid var(--ink-3); max-width: 380px; }
.toast--ok { border-left-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.toast--err { border-left-color: var(--err); color: var(--err); background: var(--err-bg); }

/* ---------- 确认框 ---------- */
.modal { position: fixed; inset: 0; background: rgba(16,27,40,.5);
  display: grid; place-items: center; z-index: 200; padding: 20px; }
.modal__box { background: #fff; border-radius: 12px; padding: 24px;
  max-width: 420px; width: 100%; box-shadow: 0 16px 50px rgba(0,0,0,.25); }
.modal__msg { margin-bottom: 20px; white-space: pre-wrap; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .side__nav { display: flex; overflow-x: auto; padding: 0; }
  .side__nav a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .side__nav a.on { border-left: 0; border-bottom-color: var(--brand-2); }
  .main { padding: 18px 16px; }
}
