/* ============================================================
   栖屿社区 · 管理后台样式
   企业高级风: 深色侧栏 + 鎏金渐变按钮 + 精致卡片
   ============================================================ */
:root {
  --gold-1: #f7dd9e;
  --gold-2: #d4a53a;
  --gold-3: #b8860b;
  --ink: #1a1d29;
  --ink-2: #2b2f45;
  --ink-3: #3a3f58;
  --bg: #f3f4f9;
  --card: #ffffff;
  --line: #e7e9f2;
  --text: #33384d;
  --muted: #8a90a6;
  --red: #e05b5b;
  --green: #2fa86b;
  --shadow: 0 6px 24px rgba(26, 29, 41, .08);
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { text-decoration: none; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9cde0; border-radius: 4px; }

/* ---------- 布局 ---------- */
.layout { display: flex; height: 100vh; }
.sidebar {
  width: 232px; background: linear-gradient(180deg, #1a1d29 0%, #232636 70%, #2b2113 100%);
  color: #c6cadb; display: flex; flex-direction: column; flex-shrink: 0; transition: margin .25s;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar .brand .logo { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: linear-gradient(135deg, #f7dd9e, #d4a53a, #b8860b); box-shadow: 0 4px 12px rgba(212,165,58,.35); }
.sidebar .brand .name { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: 1px; }
.sidebar .brand .sub { font-size: 11px; color: #8a90a6; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar nav .group { font-size: 11px; color: #6b7189; padding: 14px 12px 6px; letter-spacing: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; margin-bottom: 3px; color: #b6bacb; font-size: 14px; transition: .18s; cursor: pointer; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: linear-gradient(135deg, rgba(212,165,58,.28), rgba(184,134,11,.22)); color: #f7dd9e; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(212,165,58,.4); }
.sidebar nav a .ico { width: 20px; text-align: center; font-size: 16px; }
.sidebar .foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; color: #8a90a6; }

.hamburger { display: none; border: none; background: none; font-size: 22px; color: var(--ink); cursor: pointer; margin-right: 12px; }
@media (max-width: 768px) { .hamburger { display: inline-block; } }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; box-shadow: var(--shadow); }
.topbar .page-title { font-size: 18px; font-weight: 800; color: var(--ink); }
.topbar .user { display: flex; align-items: center; gap: 12px; }
.topbar .avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #f7dd9e, #b8860b); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.topbar .user .name { font-weight: 600; font-size: 13px; }
.topbar .btn-logout { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.topbar .btn-logout:hover { color: var(--red); }
.content { flex: 1; overflow-y: auto; padding: 24px 26px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px; }
.card .card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card .card-title { font-size: 15px; font-weight: 800; color: var(--ink); }
.card .card-title small { font-weight: 400; color: var(--muted); margin-left: 8px; font-size: 12px; }

/* ---------- 统计卡片 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -22px; top: -22px; width: 78px; height: 78px; border-radius: 50%; background: linear-gradient(135deg, rgba(212,165,58,.16), rgba(212,165,58,0)); }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 800; color: var(--ink); margin-top: 6px; }
.stat .value small { font-size: 13px; color: var(--gold-3); font-weight: 700; }
.stat .extra { font-size: 12px; color: var(--gold-3); margin-top: 4px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer; padding: 9px 18px; border-radius: 10px; font-size: 13px; font-weight: 700; transition: .18s; color: #fff; background: linear-gradient(135deg, var(--gold-1) 0%, var(--gold-2) 45%, var(--gold-3) 100%); box-shadow: 0 4px 12px rgba(184,134,11,.3); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(184,134,11,.42); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--gold-2); color: var(--gold-3); }
.btn.danger { background: linear-gradient(135deg, #f28b8b, #e05b5b, #c0392b); box-shadow: 0 4px 12px rgba(224,91,91,.28); }
.btn.small { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

/* ---------- 表格 ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=text], .toolbar select { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; font-size: 13px; outline: none; background: #fafbfe; min-width: 220px; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--gold-2); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid #f1f2f8; font-size: 13px; vertical-align: middle; }
.table tr:hover td { background: #fafbfe; }
.table .avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 8px; }
.table .thumb { width: 52px; height: 34px; border-radius: 6px; object-fit: cover; vertical-align: middle; }
.table .actions { display: flex; gap: 6px; }
.table .muted { color: var(--muted); }
.table .ellipsis { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 徽章 ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge.green { background: #e7f7ef; color: var(--green); }
.badge.red { background: #fdeeee; color: var(--red); }
.badge.gold { background: #fbf3dd; color: var(--gold-3); }
.badge.gray { background: #eef0f6; color: var(--muted); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.pager .btn { padding: 6px 14px; font-size: 12px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-item label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.form-item input[type=text], .form-item input[type=password], .form-item input[type=number], .form-item input[type=email], .form-item input[type=color], .form-item select, .form-item textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 13px; outline: none; background: #fafbfe; font-family: inherit; }
.form-item input:focus, .form-item textarea:focus, .form-item select:focus { border-color: var(--gold-2); background: #fff; }
.form-item textarea { min-height: 90px; resize: vertical; }
.form-item.full { grid-column: 1 / -1; }

/* ---------- 模态框 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 22, 33, .55); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(3px); }
.modal { background: #fff; border-radius: 16px; width: 560px; max-width: 92vw; max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: pop .2s; }
.modal.sm { width: 420px; }
.modal .m-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal .m-head h3 { font-size: 16px; color: var(--ink); }
.modal .m-close { border: none; background: none; font-size: 20px; color: var(--muted); cursor: pointer; }
.modal .m-body { padding: 20px 22px; }
.modal .m-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- 登录页 ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1a1d29 0%, #2b2f45 55%, #3a2f1d 100%); }
.login-card { width: 380px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 40px 36px; backdrop-filter: blur(10px); }
.login-card h1 { color: #fff; font-size: 22px; text-align: center; margin-bottom: 4px; letter-spacing: 2px; }
.login-card .logo { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 32px; background: linear-gradient(135deg, #f7dd9e, #d4a53a, #b8860b); box-shadow: 0 8px 24px rgba(212,165,58,.4); }
.login-card .sub { text-align: center; color: #8a90a6; font-size: 13px; margin-bottom: 26px; }
.login-card input { width: 100%; height: 46px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 0 16px; font-size: 14px; margin-bottom: 14px; background: rgba(255,255,255,.08); color: #fff; outline: none; }
.login-card input::placeholder { color: #6b7189; }
.login-card input:focus { border-color: var(--gold-2); }
.login-card .btn { width: 100%; height: 46px; font-size: 15px; letter-spacing: 6px; margin-top: 6px; }
.login-msg { color: #ff9b9b; font-size: 13px; margin-bottom: 10px; text-align: center; min-height: 18px; }

/* 空状态 */
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13px; }
.empty .emoji { font-size: 40px; margin-bottom: 10px; }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 50; height: 100%; margin-left: -232px; }
  .sidebar.open { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
}
