/*
 * Admin Panel Styles — 后台管理系统样式
 *
 * 结构：
 *   1. 设计变量    2. 基础    3. 登录页    4. 布局骨架（响应式核心）
 *   5. 侧边栏      6. 页头    7. 面板/表格 8. 表单与校验
 *   9. 按钮        10. 反馈（toast / modal / 空态） 11. 上传 12. 数据可视化
 *   13. 分页与工具条 14. 无障碍与动效降级
 */

/* ============================================================
   1. 设计变量
   ============================================================ */

:root {
  --admin-bg: #0f0f0f;
  --admin-bg-sidebar: #0a0a0a;
  --admin-bg-card: #161616;
  --admin-bg-hover: #1e1e1e;
  --admin-bg-raised: #1c1c1c;
  --admin-border: rgba(255, 215, 0, 0.15);
  --admin-border-soft: rgba(255, 255, 255, 0.07);
  --admin-gold: #ffd700;
  --admin-gold-light: #ffea80;
  --admin-text: #f5f5f5;
  --admin-text-secondary: #a0a0a0;
  --admin-text-muted: #6b6b6b;
  --admin-success: #22c55e;
  --admin-danger: #ef4444;
  --admin-warning: #f59e0b;
  --admin-info: #3b82f6;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 12px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-w-expanded: 240px;
  --sidebar-w-collapsed: 68px;
  --sidebar-w: var(--sidebar-w-expanded);
  --header-h: 60px;

  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 16px 48px rgba(0, 0, 0, 0.55);

  /* ---- 世界地图（ECharts canvas）----
     颜色只在这一层定义：JS 读取这些令牌后交给 ECharts，不在 JS 里写死色值。
     改动配色只改这里。 */
  --map-land: rgba(255, 255, 255, 0.055);      /* 无访问数据国家的底色 */
  --map-land-stroke: var(--admin-bg-card);     /* 国界：用卡片底色描边，形成缝隙感 */
  --map-land-hover: rgba(255, 255, 255, 0.16); /* 无数据国家悬浮 */
  --map-ramp-1: rgba(255, 215, 0, 0.22);       /* 访问量色阶 1（最低档） */
  --map-ramp-2: rgba(255, 215, 0, 0.45);
  --map-ramp-3: rgba(255, 215, 0, 0.7);
  --map-ramp-4: var(--admin-gold);             /* 访问量色阶 4（最高档） */
  --map-marker-stroke: var(--admin-bg);        /* 小地区圆点描边：把金点从金色大陆上分离 */
  --map-label-halo: rgba(0, 0, 0, 0.6);        /* 国家名标签的暗色描边/阴影：保证在深浅色块上都可读 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.icon { flex-shrink: 0; vertical-align: -0.125em; }

/* ============================================================
   2. 基础
   ============================================================ */

a { color: var(--admin-gold); text-decoration: none; }
a:hover { color: var(--admin-gold-light); }

::selection { background: rgba(255, 215, 0, 0.25); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 215, 0, 0.35); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 3000;
  padding: 10px 16px;
  background: var(--admin-gold);
  color: #0a0a0a;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { left: 16px; }

/* ============================================================
   3. 登录页
   ============================================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(255, 215, 0, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(255, 215, 0, 0.05) 0%, transparent 40%),
    var(--admin-bg);
  padding: 24px 20px;
}

.login-card {
  background: var(--admin-bg-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-pop);
}

.login-logo { text-align: center; margin-bottom: 28px; }

.login-logo-icon {
  width: 56px;
  height: 56px;
  background: var(--admin-gold);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: #0a0a0a;
  letter-spacing: 0.02em;
  margin: 0 auto 16px;
}

.login-logo h1 { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.1em; }
.login-subtitle { text-align: center; color: var(--admin-text-muted); font-size: 0.8rem; margin-top: 6px; }

.login-logo-icon.has-image { background: transparent; padding: 0; }
.login-logo-icon.has-image img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }

.login-form .form-group { margin-bottom: 18px; }
.login-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--admin-text-secondary);
  margin-bottom: 8px;
}

.login-input-wrap { position: relative; display: flex; align-items: center; }

.login-form input {
  width: 100%;
  padding: 12px 16px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border-soft);
  border-radius: var(--radius-sm);
  color: var(--admin-text);
  font-size: 0.95rem;
  transition: border-color var(--transition), background var(--transition);
}
.login-form input:focus {
  outline: none;
  border-color: var(--admin-gold);
  background: var(--admin-bg-hover);
}
.login-form input.is-invalid { border-color: var(--admin-danger); }
.login-input-wrap .toggle-password {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--admin-text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
}
.login-input-wrap .toggle-password:hover { color: var(--admin-gold); }
.login-input-wrap input { padding-right: 44px; }

.login-btn {
  width: 100%;
  padding: 13px 20px;
  background: var(--admin-gold);
  color: #0a0a0a;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-btn:hover:not(:disabled) { box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3); transform: translateY(-1px); }
.login-btn:disabled { opacity: 0.7; cursor: not-allowed; }

/* 验证码 | Captcha */
.login-captcha-row { display: flex; align-items: stretch; gap: 10px; }
.login-captcha-row input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
}
.captcha-box {
  flex-shrink: 0;
  width: 132px;
  height: 46px;
  border: 1px solid var(--admin-border-soft);
  border-radius: var(--radius-sm);
  background: var(--admin-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color var(--transition);
  user-select: none;
}
.captcha-box:hover,
.captcha-box:focus-visible { border-color: var(--admin-gold); outline: none; }
.captcha-box svg { display: block; width: 100%; height: 100%; }
.captcha-box .captcha-loading {
  font-size: 0.72rem;
  color: var(--admin-text-muted);
  padding: 0 8px;
  text-align: center;
  line-height: 1.3;
}
@media (max-width: 420px) {
  .login-captcha-row { flex-direction: column; gap: 8px; }
  .captcha-box { width: 100%; }
}

.login-message {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  margin-bottom: 16px;
  text-align: center;
  line-height: 1.45;
}
.login-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.login-message.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

/* ============================================================
   4. 布局骨架（响应式核心）
   ============================================================ */

.admin-layout {
  display: flex;
  min-height: 100vh;
  --sidebar-w: var(--sidebar-w-expanded);
}
.admin-layout.collapsed { --sidebar-w: var(--sidebar-w-collapsed); }

.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--admin-bg-sidebar);
  border-right: 1px solid var(--admin-border-soft);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 120;
  transition: width var(--transition), transform var(--transition);
}

.admin-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
  z-index: 110;
  border: none;
  padding: 0;
  cursor: pointer;
}
.sidebar-backdrop[hidden] { display: none; }

/* ---- 侧边栏内部 ---- */

.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid var(--admin-border-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--admin-gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #0a0a0a;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.sidebar-logo-img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 8px;
  background: var(--admin-bg-card);
  padding: 3px;
}

.sidebar-title { display: flex; flex-direction: column; overflow: hidden; white-space: nowrap; }
.sidebar-name { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; }
.sidebar-sub { font-size: 0.68rem; color: var(--admin-text-muted); letter-spacing: 0.04em; }
.admin-layout.collapsed .sidebar-title { opacity: 0; width: 0; }

.sidebar-close {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  color: var(--admin-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  align-items: center;
}
.sidebar-close:hover { color: var(--admin-text); }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 10px; }

.nav-group { margin-bottom: 14px; }
.nav-group-title {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--admin-text-muted);
  padding: 6px 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity var(--transition);
}
.admin-layout.collapsed .nav-group-title {
  opacity: 0;
  height: 8px;
  padding: 0;
  overflow: hidden;
}

.sidebar-menu { list-style: none; }
.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  color: var(--admin-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.sidebar-menu li a:hover { background: var(--admin-bg-hover); color: var(--admin-text); }
.sidebar-menu li a.active { background: rgba(255, 215, 0, 0.1); color: var(--admin-gold); }
.sidebar-menu li a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--admin-gold);
}

.sidebar-menu li a .menu-icon { width: 20px; display: flex; justify-content: center; font-size: 1rem; }
.nav-label { white-space: nowrap; overflow: hidden; transition: opacity var(--transition), width var(--transition); }
.admin-layout.collapsed .nav-label { opacity: 0; width: 0; }
.admin-layout.collapsed .sidebar-menu li a { justify-content: center; padding: 11px 8px; gap: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--admin-danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
}
.admin-layout.collapsed .nav-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  margin: 0;
  min-width: 8px;
  padding: 0 4px;
}

.sidebar-footer { border-top: 1px solid var(--admin-border-soft); padding: 12px 10px; }
.sidebar-home {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: 1px solid var(--admin-border-soft);
  border-radius: var(--radius-sm);
  color: var(--admin-text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.sidebar-home:hover { border-color: var(--admin-gold); color: var(--admin-gold); background: var(--admin-bg-hover); }
.sidebar-home .nav-label { white-space: nowrap; overflow: hidden; }
.admin-layout.collapsed .sidebar-home { justify-content: center; padding: 9px 8px; gap: 0; }

/* ---- 折叠轨悬浮提示（JS 定位，避免被滚动容器裁切） ---- */
.rail-tooltip {
  position: fixed;
  z-index: 300;
  background: var(--admin-bg-raised);
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  font-size: 0.78rem;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  box-shadow: var(--shadow-card);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s;
}
.rail-tooltip.is-visible { opacity: 1; }

/* ============================================================
   5. 页头
   ============================================================ */

.admin-header {
  height: var(--header-h);
  background: var(--admin-bg-card);
  border-bottom: 1px solid var(--admin-border-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--admin-text-secondary);
  cursor: pointer;
  font-size: 1.05rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.header-btn:hover { background: var(--admin-bg-hover); color: var(--admin-gold); border-color: var(--admin-border-soft); }
.header-burger { display: none; }

.admin-header-title {
  font-size: 0.98rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.admin-header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.admin-user {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.84rem;
  color: var(--admin-text-secondary);
  overflow: hidden;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.admin-user:hover { background: var(--admin-bg-hover); border-color: var(--admin-border-soft); }
.admin-user:hover .admin-user-name { color: var(--admin-text); }
.admin-user:focus-visible { outline: 2px solid var(--admin-gold); outline-offset: 1px; }
.admin-user-meta { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.admin-user-name { font-size: 0.82rem; font-weight: 600; color: var(--admin-text); white-space: nowrap; }
.admin-user-role { font-size: 0.68rem; color: var(--admin-text-muted); white-space: nowrap; }
.admin-user-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-gold);
  font-weight: 600;
  overflow: hidden;
}
.admin-user-avatar.sm { width: 26px; height: 26px; font-size: 0.75rem; }

/* 个人信息浮层（头像旁弹出，非模态） | User profile popover */
.admin-user-popover {
  position: fixed;
  z-index: 200;
  min-width: 264px;
  max-width: 320px;
  background: var(--admin-bg-card);
  border: 1px solid var(--admin-border-soft);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.30);
  padding: 18px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.admin-user-popover.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.admin-user-popover .popover-arrow {
  position: absolute;
  top: -6px;
  right: 20px;
  width: 11px;
  height: 11px;
  background: var(--admin-bg-card);
  border-left: 1px solid var(--admin-border-soft);
  border-top: 1px solid var(--admin-border-soft);
  transform: rotate(45deg);
}
.admin-user-popover .profile-card { padding-top: 2px; }
.admin-user-popover .modal-footer-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--admin-border-soft);
}
.admin-user-popover .modal-footer-actions .btn-danger-solid { width: 100%; }

/* 个人信息浮层内容（沿用） */
.profile-card { text-align: center; }
.profile-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 215, 0, 0.15);
  color: var(--admin-gold);
  font-size: 1.4rem;
  font-weight: 600;
}
.profile-name { font-size: 1.05rem; font-weight: 600; color: var(--admin-text); }
.profile-role { font-size: 0.8rem; color: var(--admin-text-muted); margin-bottom: 16px; }
.profile-info { margin: 0; text-align: left; border-top: 1px solid var(--admin-border-soft); }
.profile-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--admin-border-soft); }
.profile-row:last-child { border-bottom: none; }
.profile-row dt { color: var(--admin-text-muted); font-size: 0.84rem; margin: 0; }
.profile-row dd { color: var(--admin-text); font-size: 0.84rem; margin: 0; font-weight: 500; text-align: right; }
.profile-loading, .profile-empty { color: var(--admin-text-muted); text-align: center; padding: 20px 0; }

.admin-content { flex: 1; padding: 22px 24px 40px; }

/* ============================================================
   6. 面板
   ============================================================ */

.panel {
  background: var(--admin-bg-card);
  border: 1px solid var(--admin-border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-title { font-size: 0.94rem; font-weight: 600; }
.panel-desc { font-size: 0.76rem; color: var(--admin-text-muted); margin-top: 3px; line-height: 1.5; }
.panel-body { padding: 18px; }
.panel-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.panel-toolbar { flex: 1; min-width: 0; }
.toolbar-filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }

.filter-field { display: flex; flex-direction: column; gap: 5px; }
.filter-label { font-size: 0.7rem; color: var(--admin-text-muted); letter-spacing: 0.04em; }

.search-field { position: relative; display: flex; align-items: center; min-width: 220px; }
.search-field .search-icon {
  position: absolute;
  left: 12px;
  color: var(--admin-text-muted);
  pointer-events: none;
  display: flex;
}
.search-field .admin-input { padding-left: 36px; }

/* ============================================================
   7. 表格
   ============================================================ */

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.data-table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  background: var(--admin-bg);
  border-bottom: 1px solid var(--admin-border-soft);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--admin-border-soft);
  font-size: 0.84rem;
  vertical-align: middle;
}
.data-table tbody tr { transition: background 0.14s; }
.data-table tbody tr:hover { background: rgba(255, 215, 0, 0.035); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tr.is-unread { background: rgba(255, 215, 0, 0.045); }

.cell-id { color: var(--admin-text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; }
.cell-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; }
.cell-nowrap { white-space: nowrap; color: var(--admin-text-secondary); font-size: 0.8rem; }
.cell-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cell-center { text-align: center; }
.cell-muted { color: var(--admin-text-muted); }
.cell-contact { font-size: 0.78rem; color: var(--admin-text-secondary); line-height: 1.5; }

.dot-unread {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--admin-gold);
  margin-left: 6px;
  vertical-align: middle;
}

.table-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border-soft);
  display: block;
  background: var(--admin-bg);
}
.table-thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-text-muted);
  font-size: 1rem;
}

.table-actions { display: flex; gap: 6px; flex-wrap: nowrap; }

.user-cell { display: inline-flex; align-items: center; gap: 8px; }
.actor-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(255, 215, 0, 0.1);
  color: var(--admin-gold-light);
  font-size: 0.74rem;
  font-weight: 600;
}

/* 骨架屏 */
.skeleton-row td { padding: 16px 14px; }
.skeleton-bar {
  display: block;
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.11) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 220% 100%;
  animation: skeleton 1.35s ease-in-out infinite;
}
@keyframes skeleton { 0% { background-position: 130% 0; } 100% { background-position: -30% 0; } }

/* ============================================================
   8. 表单与校验
   ============================================================ */

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-form-group { margin-bottom: 16px; }
.admin-form-group.span-2 { grid-column: 1 / -1; }

.admin-form-group label {
  display: block;
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--admin-text-secondary);
  margin-bottom: 7px;
}
.admin-form-group .req { color: var(--admin-danger); }

.admin-input, .admin-textarea, .admin-select {
  width: 100%;
  padding: 10px 13px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border-soft);
  border-radius: var(--radius-sm);
  color: var(--admin-text);
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color var(--transition), background var(--transition);
}
.admin-input:focus, .admin-textarea:focus, .admin-select:focus {
  outline: none;
  border-color: var(--admin-gold);
  background: var(--admin-bg-hover);
}
.admin-input:disabled, .admin-select:disabled, .admin-textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
}
.admin-input.is-invalid, .admin-textarea.is-invalid, .admin-select.is-invalid {
  border-color: var(--admin-danger);
  background: rgba(239, 68, 68, 0.05);
}
.admin-textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.admin-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.admin-input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7); cursor: pointer; }

.field-hint { font-size: 0.72rem; color: var(--admin-text-muted); margin-top: 6px; line-height: 1.5; }
.field-error {
  font-size: 0.74rem;
  color: #fca5a5;
  margin-top: 6px;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  line-height: 1.45;
}
.field-error[hidden] { display: none; }
.field-error::before { content: '!'; font-weight: 800; flex-shrink: 0; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.settings-grid .admin-form-group.span-2 { grid-column: 1 / -1; }

/* Logo 管理字段（系统设置页） */
.logo-field {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--admin-border-soft);
}
.logo-field:first-child { border-top: none; }
.logo-field-info { min-width: 0; }
.logo-field-label { font-weight: 600; color: var(--admin-text); font-size: 0.84rem; }
.logo-field-hint { font-size: 0.72rem; color: var(--admin-text-muted); margin-top: 2px; }
.logo-field-control { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.logo-preview {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  background: var(--admin-bg-sidebar); border: 1px solid var(--admin-border-soft);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview-empty { font-size: 0.62rem; color: var(--admin-text-muted); text-align: center; padding: 4px; line-height: 1.3; }
.logo-field-btns { display: flex; align-items: center; gap: 8px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--admin-border-soft);
  color: var(--admin-text-secondary); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 0.8rem; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-ghost:hover { border-color: var(--admin-gold); color: var(--admin-text); }
.btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }

/* 数据库连接在线状态徽标 */
.status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px var(--admin-border-soft); }
.status-badge--online { color: var(--admin-success); }
.status-badge--online .status-dot { background: var(--admin-success); }
.status-badge--offline { color: var(--admin-danger); }
.status-badge--offline .status-dot { background: var(--admin-danger); }
.tag-primary {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 100px;
  font-size: 0.64rem; font-weight: 600; letter-spacing: 0.03em;
  background: transparent; border: 1px solid var(--admin-border); color: var(--admin-gold);
}
.auto-refresh {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--admin-text-secondary); cursor: pointer; user-select: none;
}
.auto-refresh input { accent-color: var(--admin-gold); }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.55;
  margin-bottom: 16px;
}
.notice-warning {
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}
.notice-info {
  background: rgba(59, 130, 246, 0.09);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* ============================================================
   9. 按钮
   ============================================================ */

.btn-primary, .btn-secondary, .btn-danger, .btn-danger-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.3;
}
.btn-primary {
  background: var(--admin-gold);
  color: #0a0a0a;
  border: 1px solid var(--admin-gold);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--admin-border-soft);
  color: var(--admin-text-secondary);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--admin-text-secondary); color: var(--admin-text); }
.btn-secondary.is-active { border-color: var(--admin-gold); color: var(--admin-gold); background: rgba(255, 215, 0, 0.08); }

/* 修改本人密码 · 结果提示 */
.pw-msg { font-size: 0.82rem; line-height: 1.4; }
.pw-msg.pw-ok { color: var(--admin-success); }
.pw-msg.pw-err { color: var(--admin-danger); }

/* 联系信息动态条目编辑器 */
.contact-entries { margin: 2px 0; }
.contact-entries-list { display: flex; flex-direction: column; gap: 14px; }
.ce-row { border: 1px solid var(--admin-border-soft); border-radius: 10px; padding: 14px 14px 10px; background: var(--admin-bg-raised); }
.ce-row--error { border-color: var(--admin-danger); }
.ce-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ce-field { display: flex; flex-direction: column; gap: 6px; }
/* 联系信息最后一格（地址）占满整行；仅作用于 .ce-grid，避免影响社交媒体的三列布局 */
.ce-grid > .ce-field:last-child { grid-column: 1 / -1; }
.ce-label { font-size: 0.82rem; color: var(--admin-text-secondary); }
.ce-req { color: var(--admin-danger); }
.ce-row-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 12px; }
.ce-error { font-size: 0.8rem; color: var(--admin-danger); }
.ce-empty { color: var(--admin-text-muted); font-size: 0.9rem; padding: 6px 2px; }
.contact-entries-actions { margin-top: 12px; }
/* 社交媒体条目：三列（平台 / 链接 / 图标） */
.se-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.1fr); gap: 12px; }
/* 条目操作区（第 N 条 + 上移 / 下移 / 删除） */
.ce-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ce-index { font-size: 0.78rem; color: var(--admin-text-muted); letter-spacing: 0.02em; }
.ce-row-ops { display: flex; align-items: center; gap: 8px; }
.ce-op { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; line-height: 1; }
.ce-op[disabled] { opacity: 0.4; cursor: not-allowed; }
.ce-hint { margin-left: 12px; font-size: 0.78rem; color: var(--admin-text-muted); }
/* 下拉选择后才出现的自定义输入框 / 上传行 */
.se-tgl { margin-top: 8px; }
.se-hidden { display: none !important; }
.se-icon-row { display: flex; align-items: center; gap: 8px; }
.se-icon-row .admin-input { flex: 1 1 auto; min-width: 0; }
.se-icon-preview { margin-top: 8px; }
.se-icon-thumb { width: 30px; height: 30px; object-fit: contain; border: 1px solid var(--admin-border-soft); border-radius: 6px; background: var(--admin-bg-hover); }
.contact-entries-actions { margin-top: 12px; display: flex; align-items: center; flex-wrap: wrap; }

@media (max-width: 1024px) { .ce-grid, .se-grid { grid-template-columns: 1fr; } }

.btn-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.1); }
.btn-danger-solid {
  background: var(--admin-danger);
  border: 1px solid var(--admin-danger);
  color: #fff;
}
.btn-danger-solid:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35); }
.btn-sm { padding: 7px 12px; font-size: 0.78rem; }

.btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled, .btn-danger-solid:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-spinner { display: inline-flex; align-items: center; animation: spin 0.85s linear infinite; }

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 4px;
  background: transparent;
  color: var(--admin-text-secondary);
  cursor: pointer;
  font-size: 0.73rem;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-action:hover { border-color: var(--admin-gold); color: var(--admin-gold); }
.btn-action.danger:hover { border-color: var(--admin-danger); color: var(--admin-danger); }
.btn-action.success:hover { border-color: var(--admin-success); color: var(--admin-success); }
.btn-action:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   10. 反馈：Toast / Modal / 空态
   ============================================================ */

.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--admin-bg-raised);
  border: 1px solid var(--admin-border-soft);
  box-shadow: var(--shadow-card);
  font-size: 0.83rem;
  line-height: 1.5;
  pointer-events: auto;
  animation: toast-in 0.22s ease-out;
}
.toast.is-leaving { animation: toast-out 0.2s ease-in forwards; }
.toast-icon { display: flex; flex-shrink: 0; margin-top: 1px; font-size: 1rem; }
.toast-msg { flex: 1; word-break: break-word; }
.toast-close {
  background: none;
  border: none;
  color: var(--admin-text-muted);
  cursor: pointer;
  padding: 0 2px;
  display: flex;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--admin-text); }
.toast-success { border-color: rgba(34, 197, 94, 0.4); }
.toast-success .toast-icon { color: var(--admin-success); }
.toast-error { border-color: rgba(239, 68, 68, 0.45); }
.toast-error .toast-icon { color: var(--admin-danger); }
.toast-warning { border-color: rgba(245, 158, 11, 0.45); }
.toast-warning .toast-icon { color: var(--admin-warning); }
.toast-info { border-color: rgba(59, 130, 246, 0.4); }
.toast-info .toast-icon { color: var(--admin-info); }

@keyframes toast-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(18px); } }

body.modal-open { overflow: hidden; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fade-in 0.16s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--admin-bg-card);
  border: 1px solid var(--admin-border-soft);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-pop);
  animation: modal-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal-md { max-width: 520px; }
.modal-lg { max-width: 780px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.modal-title { font-size: 0.98rem; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  color: var(--admin-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: var(--radius-sm);
}
.modal-close:hover { color: var(--admin-text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--admin-border-soft); flex-shrink: 0; }
.modal-footer-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.confirm-text { font-size: 0.88rem; line-height: 1.65; color: var(--admin-text-secondary); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-bottom: 18px; }
.detail-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.detail-label { font-size: 0.71rem; color: var(--admin-text-muted); letter-spacing: 0.04em; }
.detail-value { font-size: 0.86rem; word-break: break-word; }
.detail-message {
  background: var(--admin-bg);
  border: 1px solid var(--admin-border-soft);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.86rem;
  line-height: 1.7;
  max-height: 320px;
  overflow-y: auto;
}

.empty-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
}
.empty-block.is-error .empty-icon { color: var(--admin-danger); }
.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--admin-gold);
  opacity: 0.85;
}
.empty-title { font-size: 0.96rem; font-weight: 600; }
.empty-desc { font-size: 0.83rem; color: var(--admin-text-muted); max-width: 420px; line-height: 1.6; }
.empty-block .btn-primary { margin-top: 6px; }

.empty-state { text-align: center; padding: 36px; color: var(--admin-text-muted); }

/* ============================================================
   11. 上传控件
   ============================================================ */

.upload-field { display: flex; flex-direction: column; gap: 12px; }

.upload-preview {
  position: relative;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  border: 1px dashed var(--admin-border);
  border-radius: var(--radius);
  background: var(--admin-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.upload-preview:hover, .upload-preview.is-dragover {
  border-color: var(--admin-gold);
  background: rgba(255, 215, 0, 0.04);
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--admin-text-muted);
  font-size: 0.76rem;
}
.upload-placeholder .icon { font-size: 1.8rem; }

.upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--admin-text);
  font-size: 0.78rem;
}
.upload-overlay[hidden] { display: none; }

.upload-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upload-trigger { cursor: pointer; }
.upload-controls .admin-input { flex: 1; min-width: 200px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  max-height: 52vh;
  overflow-y: auto;
}
.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--admin-border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: var(--admin-bg);
  transition: border-color var(--transition);
}
.gallery-item:hover { border-color: var(--admin-gold); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item.is-selected { border-color: var(--admin-gold); box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3); }
.gallery-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 0.68rem;
  padding: 3px 6px;
  text-align: center;
}

/* ============================================================
   12. 数据可视化
   ============================================================ */

.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 20px; }

.stat-card {
  background: var(--admin-bg-card);
  border: 1px solid var(--admin-border-soft);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  transition: border-color var(--transition);
}
.stat-card.is-clickable { cursor: pointer; }
.stat-card.is-clickable:hover { border-color: var(--admin-border); }
.stat-card-label { font-size: 0.72rem; color: var(--admin-text-muted); text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 8px; }
.stat-card-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-card-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 1.35rem;
  color: var(--admin-gold);
  opacity: 0.4;
}
.stat-sub { font-size: 0.74rem; color: var(--admin-text-muted); margin-top: 6px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; }
.bar-value { font-size: 0.72rem; color: var(--admin-text-secondary); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.025);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 0;
}
.bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--admin-gold) 0%, rgba(255, 215, 0, 0.28) 100%);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 0.4s ease;
}
.bar-label { font-size: 0.68rem; color: var(--admin-text-muted); white-space: nowrap; }

.dist-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.dist-head { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 6px; }
.dist-head strong { font-variant-numeric: tabular-nums; }
.dist-track { height: 6px; background: rgba(255, 255, 255, 0.06); border-radius: 4px; overflow: hidden; }
.dist-fill { display: block; height: 100%; background: var(--admin-gold); border-radius: 4px; transition: width 0.4s ease; }

/* ---- 访问来源：世界地图 + 国家排行 ---- */
/* 左宽右窄：地图承载空间分布，排行列表是精确读数 */
.grid-source {
  display: grid;
  /* 地图容器收窄一点、国家/地区列表加宽一点：约 57% : 43%（原 65% : 35%） */
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: stretch;
}
/* 让两栏等高：地图撑出高度，排行列表在等高容器内滚动 */
.grid-source > .panel { display: flex; flex-direction: column; }
.panel-body-flush { padding: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* 空态在等高容器里要「占满并垂直居中」，否则面板一加高就吊在顶部（实测偏心 -69.5px）。
   限定在 .grid-source 内，避免影响其它页面的 .empty-block。 */
.grid-source .panel-body-flush > .empty-block { flex: 1; }

/* 地图容器归 ECharts 所有：只设定尺寸，绝不用 innerHTML 替换其内容，
   否则会把 ZRender 创建的 canvas 一起清掉。加载/失败状态用上面的覆盖层表达。 */
/* 地图高度 = 本行的行高（.grid-source 两栏 stretch 等高），所以改这一个值
   就是「两个容器一起变高」。420px 由 300px 提高而来：配合 dashboard.js 的
   MAP_VERT_SCALE，1440 宽下地图由 282.6px 增至约 348px。 */
.map-wrap { position: relative; flex: 1 1 auto; min-height: 420px; }
.map-chart { position: absolute; inset: 0; }

.map-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
  background: var(--admin-bg-card);
}
.map-overlay[hidden] { display: none; }
.map-overlay .empty-icon { color: var(--admin-text-muted); font-size: 1.5rem; }
.map-overlay strong { font-size: 0.85rem; font-weight: 600; color: var(--admin-text); }
.map-overlay p {
  max-width: 36ch;
  font-size: 0.76rem;
  line-height: 1.65;
  color: var(--admin-text-muted);
}

.map-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px 14px;
}
.map-legend { display: flex; align-items: center; gap: 5px; }
.map-legend-label { font-size: 0.68rem; color: var(--admin-text-muted); }
.map-legend-swatch {
  width: 16px;
  height: 10px;
  border-radius: 2px;
  /* 与地图色阶一一对应：图例不是装饰，是真实分档 */
  background: var(--map-ramp-1);
}
.map-legend-swatch[data-level="2"] { background: var(--map-ramp-2); }
.map-legend-swatch[data-level="3"] { background: var(--map-ramp-3); }
.map-legend-swatch[data-level="4"] { background: var(--map-ramp-4); }
.map-hint { font-size: 0.68rem; color: var(--admin-text-muted); }
/* 未归因说明独占一行，不与「悬浮查看…」挤在一起 */
.map-unattributed { flex-basis: 100%; margin-top: 2px; }

.source-list { list-style: none; flex: 1; min-height: 0; overflow-y: auto; }
.source-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--admin-border-soft);
  transition: background var(--transition);
}
.source-item:last-child { border-bottom: none; }
.source-item.is-hover { background: var(--admin-bg-hover); }
.source-item.is-flash { background: rgba(255, 215, 0, 0.12); }
.source-flag {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.source-flag.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-text-muted);
  font-size: 0.9rem;
}
.source-code {
  width: 24px;
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--admin-text-secondary);
  font-variant-numeric: tabular-nums;
}
.source-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.83rem;
}
.source-track {
  width: 56px;
  height: 5px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.source-fill { display: block; height: 100%; background: var(--admin-gold); border-radius: 3px; }
.source-count {
  min-width: 46px;
  text-align: right;
  font-weight: 600;
  font-size: 0.83rem;
  font-variant-numeric: tabular-nums;
}
.source-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--admin-border-soft);
  font-size: 0.78rem;
  color: var(--admin-text-secondary);
}
.source-note { font-size: 0.72rem; color: var(--admin-text-muted); }

.trash-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.trash-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border-soft);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  color: var(--admin-text-secondary);
}
.trash-list a:hover { border-color: var(--admin-border); color: var(--admin-text); }
.trash-list strong { color: var(--admin-warning); font-variant-numeric: tabular-nums; }
.trash-hint, .trash-empty { font-size: 0.76rem; color: var(--admin-text-muted); margin-top: 10px; line-height: 1.6; }
.trash-empty { display: flex; align-items: center; gap: 8px; margin-top: 0; color: var(--admin-success); }

.summary-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--admin-bg-card);
  border: 1px solid var(--admin-border-soft);
  border-radius: 100px;
  font-size: 0.78rem;
}
.summary-chip .chip-label { color: var(--admin-text-muted); }
.summary-chip strong { color: var(--admin-gold); font-variant-numeric: tabular-nums; font-size: 0.88rem; }

/* 权限矩阵 */
.matrix-table { min-width: 560px; }
.matrix-table td:first-child { min-width: 250px; }
.matrix-zh { display: block; color: var(--admin-text-muted); font-size: 0.74rem; margin-top: 2px; }
.mark { display: inline-flex; }
.mark.yes { color: var(--admin-success); }
.mark.no { color: rgba(255, 255, 255, 0.18); }

/* ============================================================
   13. 分页与标签页
   ============================================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--admin-border-soft);
  flex-wrap: wrap;
}
.pagination:empty { display: none; }
.pagination-info { font-size: 0.79rem; color: var(--admin-text-muted); }
.pagination-info strong { color: var(--admin-text); font-variant-numeric: tabular-nums; }
.pagination-controls { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--admin-border-soft);
  border-radius: var(--radius-sm);
  color: var(--admin-text-secondary);
  cursor: pointer;
  font-size: 0.79rem;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  transition: all 0.15s;
}
.page-btn .icon { font-size: 0.85rem; }
.page-btn:hover:not(:disabled) { border-color: var(--admin-gold); color: var(--admin-gold); }
.page-btn.active { background: var(--admin-gold); border-color: var(--admin-gold); color: #0a0a0a; font-weight: 700; }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-size-select { width: auto; min-width: 104px; height: 32px; padding: 0 30px 0 10px; font-size: 0.78rem; }

.tabs {
  display: flex;
  gap: 3px;
  border-bottom: 1px solid var(--admin-border-soft);
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab {
  padding: 9px 15px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--admin-text-muted);
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab:hover { color: var(--admin-text-secondary); }
.tab.active { color: var(--admin-gold); border-bottom-color: var(--admin-gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panels .admin-form-group:last-child { margin-bottom: 0; }

/* ============================================================
   14. 工具类 / 无障碍 / 动效降级
   ============================================================ */

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--admin-border-soft);
  border-top-color: var(--admin-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

:focus-visible {
  outline: 2px solid var(--admin-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   响应式断点
   ============================================================ */

/* 中等屏幕：自动收起为图标轨（折叠状态由 JS 依据断点初始化，可手动覆盖） */
@media (max-width: 1279px) {
  .admin-content { padding: 20px 18px 36px; }
}

@media (max-width: 1024px) {
  .settings-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  /* 地图与排行改为上下堆叠；等高拉伸会让列表被压扁，故解除拉伸并限高 */
  .grid-source { grid-template-columns: 1fr; align-items: start; }
  .source-list { max-height: 320px; }
  /* 堆叠后地图不再被等高拉伸，给一个平板下的固定高度 */
  .map-wrap { min-height: 320px; }
  /* Logo 字段改为上下排列，避免窄屏挤压预览与按钮 */
  .logo-field { flex-direction: column; align-items: flex-start; }
  .logo-field-control { width: 100%; justify-content: space-between; }
}

/* 抽屉模式：< 768px */
@media (max-width: 767px) {
  .admin-layout,
  .admin-layout.collapsed { --sidebar-w: 0px; }

  .admin-sidebar {
    width: 282px;
    max-width: 86vw;
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 120;
  }
  .admin-layout.drawer-open .admin-sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-pop);
  }

  /* 抽屉内始终显示完整文字，忽略折叠态 */
  .admin-layout.collapsed .nav-label,
  .admin-layout.collapsed .nav-group-title,
  .admin-layout.collapsed .sidebar-title {
    opacity: 1;
    width: auto;
    height: auto;
  }
  .admin-layout.collapsed .sidebar-menu li a { justify-content: flex-start; padding: 9px 14px; gap: 12px; }
  .admin-layout.collapsed .sidebar-home { justify-content: flex-start; padding: 9px 14px; gap: 12px; }
  .admin-layout.collapsed .nav-badge { position: static; margin-left: auto; padding: 2px 6px; min-width: 20px; }
  .admin-layout.collapsed .nav-group-title { padding: 6px 14px; }

  .admin-main { margin-left: 0; }
  .header-burger { display: flex; }
  .header-collapse { display: none; }
  .sidebar-close { display: flex; }
  .admin-content { padding: 14px 12px 32px; }
  .admin-header { padding: 0 12px; gap: 8px; }
  .admin-header-title { font-size: 0.9rem; }
  .admin-user-role { display: none; }
  .admin-user-name { max-width: 88px; overflow: hidden; text-overflow: ellipsis; }

  .stats-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card-value { font-size: 1.5rem; }
  .stat-card-icon { font-size: 1.1rem; top: 12px; right: 12px; }

  .form-row { grid-template-columns: 1fr; gap: 0; }
  .panel-header { padding: 12px 14px; }
  .panel-body { padding: 14px; }
  .panel-actions { width: 100%; }
  .panel-actions .btn-primary, .panel-actions .btn-secondary { flex: 1; }
  .toolbar-filters { width: 100%; }
  .filter-field, .search-field { width: 100%; min-width: 0; }
  .filter-field .admin-select { width: 100% !important; }

  .pagination { padding: 12px 14px; justify-content: center; }
  .pagination-info { width: 100%; text-align: center; }
  .page-size-select { width: 100%; }
  .pagination-controls { order: -1; }

  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 94vh;
  }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }
  .modal-footer-actions { flex-direction: column-reverse; }
  .modal-footer-actions button { width: 100%; }

  .detail-grid { grid-template-columns: 1fr; }
  .upload-preview { max-width: 100%; }
  .upload-controls { flex-direction: column; align-items: stretch; }
  .upload-controls .admin-input { min-width: 0; }

  .toast-container { top: 10px; right: 10px; left: 10px; max-width: none; }
  .summary-chips { gap: 8px; }
  .summary-chip { padding: 6px 11px; font-size: 0.74rem; }

  .login-card { padding: 32px 22px 28px; }
  .bar-chart { height: 150px; gap: 6px; }
  .map-wrap { min-height: 220px; }
}

@media (max-width: 420px) {
  .stats-cards { grid-template-columns: 1fr; }
  .btn-sm { padding: 6px 10px; }
  .map-wrap { min-height: 190px; }
}

/* ============================================================
   15. Banner管理（排序控件 / 启用停用开关 / 链接单元格）
   ============================================================ */

.cell-link {
  color: var(--admin-gold-light);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}
.cell-link:hover { border-bottom-color: var(--admin-gold-light); }

.sort-controls { display: inline-flex; flex-direction: column; gap: 3px; }
.btn-action.btn-icon { padding: 3px 6px; line-height: 0; }
.btn-action.btn-icon svg { width: 12px; height: 12px; }

.status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 100px;
  background: transparent;
  color: var(--admin-text-secondary);
  font-size: 0.73rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.status-toggle-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--admin-text-muted);
  transition: background var(--transition), box-shadow var(--transition);
}
.status-toggle:hover { border-color: var(--admin-gold); color: var(--admin-gold); }
.status-toggle.is-on { color: var(--admin-success); border-color: rgba(34, 197, 94, 0.35); }
.status-toggle.is-on .status-toggle-dot {
  background: var(--admin-success);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.55);
}
.status-toggle.is-on:hover { border-color: var(--admin-danger); color: var(--admin-danger); }
.status-toggle.is-on:hover .status-toggle-dot {
  background: var(--admin-danger);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}
.status-toggle:disabled { opacity: 0.5; cursor: not-allowed; }
