/* ============ 通用 ============ */
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f7fa; color: #333; }

/* ============ 登录页 ============ */
.login-body { background: linear-gradient(135deg, #37474f 0%, #455a64 50%, #607d8b 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: #fff; border-radius: 12px; padding: 40px 36px; }
.login-logo { font-size: 56px; line-height: 1; margin-bottom: 8px; }

/* ============ Dashboard 主框架 ============ */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #2c3e50; color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-header h5 { color: #fff; margin: 0; font-size: 16px; }
.sidebar-header small { color: rgba(255,255,255,.6); display: block; margin-top: 4px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav .nav-item { display: block; padding: 12px 22px; color: rgba(255,255,255,.78); cursor: pointer; border-left: 3px solid transparent; user-select: none; }
.sidebar-nav .nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar-nav .nav-item.active { background: rgba(255,255,255,.08); color: #fff; border-left-color: #4caf50; }
.sidebar-nav .nav-item .icon { display: inline-block; width: 20px; margin-right: 8px; }
.sidebar-footer { padding: 16px 22px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: rgba(255,255,255,.5); }
.sidebar-footer .me { color: #fff; font-weight: 600; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: #fff; padding: 14px 28px; border-bottom: 1px solid #eef0f4; display: flex; align-items: center; justify-content: space-between; }
.topbar h4 { margin: 0; font-size: 18px; font-weight: 600; }
.content { padding: 24px 28px; flex: 1; }

/* ============ 表格/卡片 ============ */
.card-box { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.card-box + .card-box { margin-top: 18px; }
.table { background: #fff; }
.table th { font-weight: 600; background: #fafbfc; color: #555; }

/* ============ Toast ============ */
.toast-wrap { position: fixed; top: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast-msg { padding: 10px 18px; border-radius: 6px; color: #fff; font-size: 14px; min-width: 180px; box-shadow: 0 4px 12px rgba(0,0,0,.15); animation: toastIn .2s ease; }
.toast-success { background: #4caf50; }
.toast-error { background: #f44336; }
.toast-info { background: #2196f3; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ============ 表单 ============ */
.form-label { font-weight: 500; }
.required:after { content: ' *'; color: #f44336; }

/* ============ 通用工具类 ============ */
.muted { color: #999; }
.text-mono { font-family: 'SF Mono', Monaco, Consolas, monospace; }
.empty-tip { color: #999; padding: 40px 0; text-align: center; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: #e3f2fd; color: #1976d2; }
.tag.tag-warn { background: #fff3e0; color: #f57c00; }
.tag.tag-gray { background: #eceff1; color: #607d8b; }

/* ============ 小区专属码（列表缩略 + 预览） ============ */
.qrcode-cell { flex-wrap: wrap; }
.qr-thumb {
  width: 56px;
  text-align: center;
  cursor: pointer;
  border: 1px solid #e6e8eb;
  border-radius: 4px;
  padding: 4px;
  background: #fff;
  transition: box-shadow .15s;
}
.qr-thumb:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.qr-thumb img { display: block; width: 48px; height: 48px; object-fit: contain; }
.qr-thumb small { display: block; margin-top: 2px; font-size: 11px; color: #777; line-height: 1; }
.qr-preview-img { max-width: 100%; max-height: 70vh; border: 1px solid #eee; }
