/* hellomao 私人导航 —— 全站样式（纯手写，改这个文件就换外观） */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #e7e8ee;
  --text: #26262b;
  --muted: #8b8b95;
  --accent: #3b6ef0;
  --danger: #d94f3d;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; font-size: 14px; }
button { cursor: pointer; }

/* ============ 登录页 ============ */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #f7f8fa 0%, #eef0f4 100%);
}
.gate-card {
  width: 360px;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 36px 30px 22px;
  box-shadow: 0 10px 40px rgba(20, 25, 40, .07);
}
.gate-brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.gate-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #3b6ef0, #7a4bf0);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.gate-title { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.gate-sub { text-align: center; color: var(--muted); font-size: 12.5px; margin: 8px 0 26px; }
.gate input {
  width: 100%; height: 42px; padding: 0 13px; margin-bottom: 10px;
  border: 1px solid #e2e3e9; border-radius: 9px; background: #fafafb; color: var(--text);
  outline: none; transition: .15s;
}
.gate input:focus { border-color: #b9c6e8; background: #fff; box-shadow: 0 0 0 3px rgba(59, 110, 240, .08); }
.gate button {
  width: 100%; height: 42px; border: 0; border-radius: 9px; margin-top: 6px;
  background: #24242a; color: #fff; font-weight: 500; transition: .15s;
}
.gate button:hover { background: #000; }
.gate button:disabled { opacity: .55; cursor: default; }
.gate-err { min-height: 18px; color: var(--danger); font-size: 12.5px; text-align: center; margin-top: 10px; }
.gate-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid #f1f1f4;
  text-align: center; font-size: 12px; color: #b3b3bb;
}
.gate-foot a:hover { color: #6c6c78; }

/* ============ 主框架 ============ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 228px; flex: 0 0 228px;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
  background: linear-gradient(135deg, #3b6ef0, #7a4bf0);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 11.5px; color: var(--muted); }

.menu { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.menu a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 8px; color: #4a4a54; font-size: 13.5px;
  transition: .12s;
}
.menu a:hover { background: #f4f5f8; color: var(--text); }
.menu a.active { background: #eef2fe; color: var(--accent); font-weight: 500; }
.menu a .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; flex: 0 0 6px; }

.sidebar-foot { padding: 12px 18px; border-top: 1px solid #f1f1f4; font-size: 11.5px; color: #b3b3bb; }
.sidebar-foot a:hover { color: #6c6c78; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 28px 6px; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(180deg, var(--bg) 72%, rgba(244, 245, 247, 0));
}
.search {
  display: flex; align-items: center; flex: 1; max-width: 460px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 0 6px 0 14px; height: 38px; transition: .15s;
}
.search:focus-within { border-color: #c3cfea; box-shadow: 0 0 0 3px rgba(59, 110, 240, .07); }
.search select {
  border: 0; background: transparent; color: var(--muted); outline: none; font-size: 13px; padding-right: 4px;
}
.search input { flex: 1; border: 0; outline: none; background: transparent; padding: 0 8px; min-width: 0; }
.search button { border: 0; background: #f2f3f6; border-radius: 14px; height: 28px; padding: 0 12px; color: #55555f; }
.search button:hover { background: #e8eaf0; }

.userbox { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.userbox .link, .userbox button {
  border: 1px solid var(--line); background: #fff; border-radius: 16px;
  padding: 5px 12px; color: #55555f; font-size: 12.5px;
}
.userbox .link:hover, .userbox button:hover { border-color: #ccd2e0; color: var(--text); }

.content { padding: 8px 28px 40px; max-width: 1400px; width: 100%; }
.group { margin-top: 26px; scroll-margin-top: 70px; }
.group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.group-head h2 {
  font-size: 13px; font-weight: 600; color: #6c6c78; margin: 0;
  letter-spacing: .04em;
}
.group-head .count { font-size: 11.5px; color: #b3b3bb; }
.group-head::after { content: ""; flex: 1; height: 1px; background: #ebecf1; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 12px; }
.card {
  display: flex; align-items: center; gap: 11px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; transition: .15s; min-width: 0;
}
.card:hover { border-color: #d5dae6; box-shadow: 0 6px 18px rgba(22, 28, 45, .07); transform: translateY(-1px); }
.avatar {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 15px;
}
.card-body { min-width: 0; display: block; }
.card-title { display: block; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-desc { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }

.footer {
  margin-top: auto; padding: 18px 28px 26px;
  font-size: 12px; color: #b3b3bb; border-top: 1px solid #ececf1;
}
.footer a:hover { color: #6c6c78; }
.empty { color: var(--muted); font-size: 13px; padding: 40px 0; text-align: center; }

/* ============ 后台管理 ============ */
.admin-top {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.admin-top .t { font-weight: 600; font-size: 15px; }
.admin-top .spacer { flex: 1; }
.admin-top .dirty { font-size: 12px; color: #c07c1a; }
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 7px 13px; color: #4a4a54; font-size: 13px; transition: .12s;
}
.btn:hover { border-color: #ccd2e0; color: var(--text); }
.btn.primary { background: #24242a; border-color: #24242a; color: #fff; }
.btn.primary:hover { background: #000; }
.btn.primary:disabled { opacity: .45; cursor: default; }
.btn.danger { color: var(--danger); border-color: #f0d9d5; }
.btn.danger:hover { background: #fdf3f1; }
.btn.sm { padding: 4px 9px; font-size: 12px; }

.admin-body { display: flex; align-items: flex-start; gap: 18px; padding: 20px 24px 60px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid #f1f1f4; font-weight: 600; font-size: 13.5px;
}
.panel-head .spacer { flex: 1; }
.panel-body { padding: 12px 14px; }

.col-groups { width: 260px; flex: 0 0 260px; }
.col-main { flex: 1; min-width: 0; }

.glist { display: flex; flex-direction: column; gap: 2px; }
.glist .g {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 8px; font-size: 13.5px; color: #4a4a54;
}
.glist .g:hover { background: #f6f7f9; }
.glist .g.on { background: #eef2fe; color: var(--accent); font-weight: 500; }
.glist .g .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glist .g .ops { display: flex; gap: 2px; opacity: 0; }
.glist .g:hover .ops, .glist .g.on .ops { opacity: 1; }
.icon-btn {
  border: 0; background: transparent; color: #9a9aa4; padding: 2px 4px;
  border-radius: 5px; line-height: 1; font-size: 12px;
}
.icon-btn:hover { background: #e9ebf1; color: var(--text); }

.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid #f4f4f7; font-size: 13px;
}
.row:last-child { border-bottom: 0; }
.row .avatar { width: 28px; height: 28px; flex: 0 0 28px; font-size: 12px; }
.row .info { flex: 1; min-width: 0; }
.row .info b { font-weight: 600; font-size: 13px; }
.row .info small { display: block; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .ops { display: flex; gap: 3px; opacity: .35; }
.row:hover .ops { opacity: 1; }

.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select {
  height: 38px; padding: 0 11px; border: 1px solid #e3e4ea; border-radius: 8px;
  background: #fff; outline: none; color: var(--text);
}
.field input:focus, .field select:focus { border-color: #b9c6e8; box-shadow: 0 0 0 3px rgba(59, 110, 240, .08); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 11.5px; color: #b3b3bb; }
.tabs { display: flex; gap: 6px; }
.tabs button {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 6px 12px; font-size: 13px; color: #55555f;
}
.tabs button.on { background: #24242a; border-color: #24242a; color: #fff; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(10px);
  background: #24242a; color: #fff; padding: 9px 16px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b43c2c; }

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  .menu { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 12px; }
  .menu a { white-space: nowrap; }
  .sidebar-foot { display: none; }
  .topbar { padding: 14px 16px 4px; flex-wrap: wrap; }
  .content { padding: 4px 16px 30px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .admin-body { flex-direction: column; }
  .col-groups { width: 100%; flex: none; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
