/* ============================================================
   落北社区 · 管理后台样式 v2
   液态玻璃 · 昼夜模式 · 高级动画 · 主题定制面板
   ============================================================ */

/* ---------- 设计变量（亮色默认） ---------- */
:root {
  /* 主题色（可被 JS 覆盖） */
  --accent: #0a84ff;
  --accent-2: #0066d6;
  --accent-soft: rgba(10, 132, 255, .22);

  /* 品牌金渐变 */
  --gold-1: #f7dd9e;
  --gold-2: #d4a53a;
  --gold-3: #b8860b;

  /* 表面 */
  --bg: #f2f3f7;
  --bg-grad: linear-gradient(135deg, #eef0f6 0%, #f6f7fb 50%, #ecedf4 100%);
  --card: rgba(255, 255, 255, .55);
  --card-solid: #ffffff;
  --line: rgba(0, 0, 0, .08);
  --line-strong: rgba(0, 0, 0, .12);
  --text: #1d1d1f;
  --text-2: #5a5a60;
  --muted: #6e6e73;
  --fill: #f2f2f7;
  --fill-2: #eaeaf0;

  /* 语义色 */
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, .10);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, .12);
  --orange: #ff9500;
  --orange-soft: rgba(255, 149, 0, .12);
  --purple: #af52de;
  --pink: #ff2d55;

  /* 玻璃 */
  --glass-blur: 24px;
  --glass-border: rgba(255, 255, 255, .55);
  --glass-shadow: 0 8px 32px rgba(31, 38, 75, .10);

  /* 形状 */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  /* 缓动 */
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-spring: cubic-bezier(.17, .9, .24, 1.18);

  --shadow-card: 0 12px 40px -16px rgba(31, 38, 75, .18);
  --shadow-soft: 0 4px 18px -6px rgba(31, 38, 75, .12);

  /* 盒子样式（border / shadow 切换） */
  --box-border: 1px solid var(--line);
  --box-shadow-var: none;
}

/* ---------- 暗色模式 ---------- */
[data-theme="dark"] {
  --bg: #0e1018;
  --bg-grad: radial-gradient(900px 500px at 78% -8%, rgba(40, 60, 130, .35) 0%, transparent 55%), radial-gradient(700px 400px at 10% 105%, rgba(120, 80, 200, .12) 0%, transparent 50%), linear-gradient(135deg, #0e1018 0%, #131622 55%, #191d2c 100%);
  --card: rgba(28, 31, 45, .42);
  --card-solid: #1c1f2d;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #f2f3f7;
  --text-2: #a0a4b5;
  --muted: #6c7085;
  --fill: rgba(255, 255, 255, .06);
  --fill-2: rgba(255, 255, 255, .10);
  --glass-border: rgba(255, 255, 255, .12);
  --glass-shadow: 0 8px 40px rgba(0, 0, 0, .45);
  --box-border: 1px solid var(--line);
  --shadow-card: 0 16px 50px -16px rgba(0, 0, 0, .55);
  --shadow-soft: 0 4px 18px -6px rgba(0, 0, 0, .45);
}

/* 盒子样式：边框 */
[data-box-style="border"] {
  --box-border: 1px solid var(--line-strong);
  --box-shadow-var: none;
}
/* 盒子样式：阴影 */
[data-box-style="shadow"] {
  --box-border: 1px solid transparent;
  --box-shadow-var: var(--shadow-soft);
}

/* 容器宽度：定宽 */
[data-container="fixed"] .content { max-width: 1280px; margin: 0 auto; }

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; max-width: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg-grad);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .3s var(--ease);
}
a { text-decoration: none; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局 ---------- */
.layout { display: flex; height: 100vh; overflow-x: hidden; max-width: 100vw; }
.sidebar {
  width: 232px;
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border-right: 1px solid var(--line);
  color: var(--text-2);
  display: flex; flex-direction: column; flex-shrink: 0;
  transition: margin .3s var(--ease), background .4s var(--ease);
}
[data-theme="dark"] .sidebar { background: rgba(20, 23, 34, .72); }
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 18px; border-bottom: 1px solid var(--line); }
.sidebar .brand .logo {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 6px 18px -4px var(--accent-soft);
  color: #fff;
}
.sidebar .brand .logo svg { width: 22px; height: 22px; stroke: #fff; }
.sidebar .brand .name { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: .5px; }
.sidebar .brand .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar nav .group { font-size: 11px; color: var(--muted); padding: 14px 12px 6px; letter-spacing: 2px; text-transform: uppercase; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px;
  border-radius: 12px; margin-bottom: 3px;
  color: var(--text-2); font-size: 14px; font-weight: 500;
  transition: all .25s var(--ease);
  cursor: pointer; position: relative;
}
.sidebar nav a .ico { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar nav a .ico svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }
.sidebar nav a:hover { background: var(--fill); color: var(--text); transform: translateX(2px); }
.sidebar nav a.active {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-soft));
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}
.sidebar nav a.active::before {
  content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.sidebar .foot { padding: 14px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------- 菜单风格 ---------- */
/* 图标侧边栏：窄栏 + 只显示图标 */
[data-menu="icon"] .sidebar { width: 72px; }
[data-menu="icon"] .sidebar .brand { justify-content: center; padding: 20px 0 16px; }
[data-menu="icon"] .sidebar .brand > div:not(.logo) { display: none; }
[data-menu="icon"] .sidebar nav { padding: 12px 8px; }
[data-menu="icon"] .sidebar nav .group { display: none; }
[data-menu="icon"] .sidebar nav a { justify-content: center; padding: 12px 0; }
[data-menu="icon"] .sidebar nav a span:not(.ico) { display: none; }
[data-menu="icon"] .sidebar nav a .badge { position: absolute; top: 6px; right: 10px; }
[data-menu="icon"] .sidebar .foot { display: none; }

/* 顶部菜单：隐藏侧边栏，导航移到顶部 */
.top-nav { display: none; }
[data-menu="top"] .sidebar { display: none; }
[data-menu="top"] .hamburger { display: none; }
[data-menu="top"] .topbar { flex-wrap: wrap; height: auto; min-height: 60px; padding: 8px 16px; gap: 8px; }
[data-menu="top"] .topbar > div:first-child { width: 100%; }
[data-menu="top"] .top-nav {
  width: 100%; display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px;
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
[data-menu="top"] .top-nav::-webkit-scrollbar { height: 0; }
[data-menu="top"] .top-nav a {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px;
  color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: all .25s var(--ease); cursor: pointer; flex-shrink: 0;
}
[data-menu="top"] .top-nav a svg { width: 16px; height: 16px; stroke: currentColor; }
[data-menu="top"] .top-nav a:hover { background: var(--fill); color: var(--accent); }
[data-menu="top"] .top-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.hamburger { display: inline-flex; align-items: center; justify-content: center; border: none; background: var(--fill); border: 1px solid var(--line); width: 38px; height: 38px; border-radius: 11px; color: var(--text-2); cursor: pointer; transition: all .25s var(--ease); }
.hamburger:hover { color: var(--accent); transform: rotate(90deg); }
.hamburger svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; overflow: hidden; }
.topbar {
  height: 60px;
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  position: sticky; top: 0; z-index: 10;
  overflow: visible;
  transition: background .4s var(--ease), backdrop-filter .3s var(--ease), box-shadow .3s var(--ease);
}
/* 液态玻璃高光边框 */
.topbar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background: linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 60%);
  border-bottom: 1px solid rgba(255,255,255,.18);
}
[data-theme="dark"] .topbar::before { background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 60%); border-bottom-color: rgba(255,255,255,.06); }
/* 滚动后增强玻璃感 */
.topbar.scrolled {
  background: var(--card);
  box-shadow: 0 4px 24px -8px rgba(31, 38, 75, .15);
}
.topbar .page-title { font-size: 17px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.topbar .topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar .icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--fill); border: 1px solid var(--line);
  color: var(--text-2); cursor: pointer;
  transition: all .25s var(--ease);
  flex-shrink: 0;
}
.topbar .icon-btn:hover { background: var(--fill-2); color: var(--accent); transform: translateY(-1px); }
.topbar .icon-btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; }
/* 管理员用户卡片 */
.admin-user {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px;
  background: var(--fill);
  border: 1px solid var(--line);
  border-radius: 28px;
  transition: all .3s var(--ease-spring);
  cursor: pointer;
  flex-shrink: 0;
}
.admin-user:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 14px -4px var(--accent-soft); }
.admin-avatar {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; position: relative;
}
.admin-avatar svg { width: 16px; height: 16px; stroke: #fff; }
.admin-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-avatar::after {
  content: ""; position: absolute; bottom: 0; right: 0;
  width: 8px; height: 8px; border-radius: 50%;
  background: #34c759; border: 2px solid var(--card);
}
.admin-info { display: flex; flex-direction: column; line-height: 1.3; }
.admin-name { font-weight: 700; font-size: 12px; color: var(--text); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-role { font-size: 9px; color: var(--accent); font-weight: 600; }
.topbar .btn-logout {
  border: none; background: var(--fill); color: var(--text-2);
  cursor: pointer; font-size: 12px; padding: 6px 10px; border-radius: 9px;
  transition: all .25s var(--ease); font-weight: 600;
  min-width: 40px; min-height: 34px;
  flex-shrink: 0;
}
.topbar .btn-logout:hover { background: var(--red-soft); color: var(--red); transform: scale(1.05); }

/* 超小屏隐藏部分图标 */
@media (max-width: 380px) {
  .topbar .page-title { max-width: 60px; font-size: 15px; }
  #themePanelBtn { display: none; }
  .admin-info { display: none; }
  .topbar .btn-logout { padding: 6px 8px; font-size: 11px; }
}
@media (min-width: 600px) {
  .topbar { padding: 0 26px; height: 64px; }
  .topbar .page-title { font-size: 18px; max-width: none; }
  .topbar .topbar-right { gap: 14px; }
  .topbar .icon-btn { width: 38px; height: 38px; }
  .admin-name { max-width: 80px; font-size: 13px; }
  .admin-avatar { width: 36px; height: 36px; }
}
.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 24px 26px; animation: content-in .5s var(--ease) both; word-break: break-word; }

@keyframes content-in { from { opacity: 0; transform: translateY(22px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- 玻璃卡片 ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: var(--box-border);
  box-shadow: var(--box-shadow-var), var(--shadow-card);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  animation: card-in .5s var(--ease) both;
  transition: background .4s var(--ease), border-color .4s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
  position: relative;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.25) 0%, transparent 40%);
  border: 1px solid rgba(255,255,255,.18);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
[data-theme="dark"] .card::before { background: linear-gradient(135deg, rgba(255,255,255,.08) 0%, transparent 40%); border-color: rgba(255,255,255,.06); }
.card:hover { transform: translateY(-2px); box-shadow: var(--box-shadow-var), 0 12px 32px -8px rgba(0,0,0,.12); }
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.card .card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.card .card-title { font-size: 15px; font-weight: 800; color: var(--text); }
.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: rgba(255, 255, 255, .12);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
  padding: 18px 16px;
  position: relative; overflow: hidden;
  animation: stat-in .5s var(--ease) both;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
[data-theme="dark"] .stat { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .08); }
.stat::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.3) 0%, transparent 45%);
  border: 1px solid rgba(255,255,255,.2);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
[data-theme="dark"] .stat::before { background: linear-gradient(135deg, rgba(255,255,255,.08) 0%, transparent 45%); border-color: rgba(255,255,255,.06); }
.stat:hover { transform: translateY(-3px); border-color: var(--accent-soft); box-shadow: var(--shadow-card); }
.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));
  pointer-events: none; animation: stat-glow 4s var(--ease) infinite;
}
@keyframes stat-glow { 0%, 100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.15); opacity: 1; } }
.stat:nth-child(1) { animation-delay: .02s; }
.stat:nth-child(2) { animation-delay: .06s; }
.stat:nth-child(3) { animation-delay: .10s; }
.stat:nth-child(4) { animation-delay: .14s; }
.stat:nth-child(5) { animation-delay: .18s; }
.stat:nth-child(6) { animation-delay: .22s; }
.stat:nth-child(7) { animation-delay: .26s; }
.stat:nth-child(8) { animation-delay: .30s; }
@keyframes stat-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 800; color: var(--text); margin-top: 6px; transition: color .25s var(--ease); }
.stat:hover .value { color: var(--accent); }
.stat .value small { font-size: 13px; color: var(--gold-3, #b8860b); font-weight: 700; }
.stat .extra { font-size: 12px; color: var(--gold-3, #b8860b); margin-top: 4px; font-weight: 600; }

/* ---------- 按钮 ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer;
  padding: 10px 18px; border-radius: 11px; font-size: 13px; font-weight: 700;
  transition: transform .25s var(--ease-spring), box-shadow .3s var(--ease), filter .25s var(--ease); color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 6px 16px -6px var(--accent-soft);
  animation: btn-pop .35s var(--ease-spring) both;
}
@keyframes btn-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px -6px var(--accent-soft); filter: brightness(1.06); }
.btn:active:not(:disabled) { animation: btn-press .35s var(--ease-spring) both; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
/* 按下三段弹回: 下压 → 回弹过冲 → 回归, 比 scale(.96) 单帧更有"啪"的弹感 */
@keyframes btn-press {
  0%   { transform: scale(1); }
  35%  { transform: scale(.94); }
  70%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}
/* 涟漪效果 */
.btn::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0;
  border-radius: 50%; background: rgba(255,255,255,.35);
  transform: translate(-50%, -50%); transition: width .5s var(--ease), height .5s var(--ease), opacity .6s var(--ease);
  opacity: 0; pointer-events: none;
}
.btn:active:not(:disabled)::after { width: 220px; height: 220px; opacity: 1; transition: 0s; }
.btn.ghost {
  background: var(--card); color: var(--text);
  border: 1px solid var(--line-strong); box-shadow: none;
  backdrop-filter: blur(var(--glass-blur));
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn.danger {
  background: linear-gradient(135deg, #ff6b6b, var(--red));
  box-shadow: 0 6px 16px -6px rgba(255, 59, 48, .4);
}
.btn.danger:hover:not(:disabled) { box-shadow: 0 12px 26px -6px rgba(255, 59, 48, .5); }
.btn.small { padding: 7px 13px; font-size: 12px; border-radius: 9px; }

/* ---------- 表格 ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; animation: fade-down .4s var(--ease) both; }
@keyframes fade-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.toolbar input[type=text], .toolbar select {
  height: 40px; border: 1px solid var(--line-strong); border-radius: 11px;
  padding: 0 14px; font-size: 13px; outline: none; background: var(--fill);
  color: var(--text); min-width: 220px; transition: all .25s var(--ease);
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--accent); background: var(--card-solid); box-shadow: 0 0 0 3px var(--accent-soft); transform: translateY(-1px); }
.table { width: 100%; border-collapse: collapse; table-layout: auto; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: relative; }
.table th::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent-soft), transparent); transform: scaleX(0); transition: transform .35s var(--ease); transform-origin: left; }
.table th:hover::after { transform: scaleX(1); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; text-align: left; transition: background .2s; word-break: break-word; max-width: 200px; }
/* 表格外层滚动容器(列多时不溢出) */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap > .table { min-width: 540px; }
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* ---------- 反馈管理 ---------- */
.fb-toolbar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; padding:10px 0 12px; border-bottom:1px solid var(--line); margin-bottom:12px; }
.fb-toolbar .muted { margin-left:auto; font-size:12px; }
.fb-cell .fb-title { font-weight:600; font-size:13px; margin-bottom:2px; }
.fb-cell .fb-preview { font-size:12px; max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fb-detail { line-height:1.8; }
.fb-detail .fb-row { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:6px; }
.fb-detail .fb-user { display:flex; align-items:center; gap:10px; }
.fb-detail .fb-meta { font-size:12px; margin-bottom:10px; }
.fb-detail .fb-title-lg { font-weight:700; font-size:15px; margin-bottom:8px; }
.fb-detail .fb-content-box { background:var(--bg-2,#f5f7fa); padding:12px 14px; border-radius:8px; white-space:pre-wrap; word-break:break-word; font-size:14px; margin-bottom:12px; }
.fb-detail .fb-reply-box { background:rgba(10,132,255,.08); border-left:3px solid var(--accent); padding:12px 14px; border-radius:8px; margin-top:8px; }
.fb-detail .fb-reply-head { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.fb-detail .fb-reply-content { white-space:pre-wrap; word-break:break-word; font-size:14px; }
.fb-detail .fb-no-reply { font-size:13px; padding:10px; text-align:center; background:var(--bg-2,#f5f7fa); border-radius:8px; }
.fb-batch-list { max-height:420px; overflow-y:auto; padding-right:4px; }
.fb-batch-item { border:1px solid var(--line); border-radius:8px; padding:10px 12px; margin-bottom:10px; }
.fb-batch-head { font-size:13px; margin-bottom:4px; }
.fb-batch-content { background:var(--bg-2,#f5f7fa); padding:8px 10px; border-radius:6px; font-size:12px; margin-bottom:8px; white-space:pre-wrap; word-break:break-word; }
.fb-batch-item textarea { width:100%; resize:vertical; }
.table tr { transition: background .2s; }
.table tbody tr { animation: row-in .4s var(--ease) both; }
@keyframes row-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
.table tbody tr:nth-child(1) { animation-delay: .02s; }
.table tbody tr:nth-child(2) { animation-delay: .05s; }
.table tbody tr:nth-child(3) { animation-delay: .08s; }
.table tbody tr:nth-child(4) { animation-delay: .11s; }
.table tbody tr:nth-child(5) { animation-delay: .14s; }
.table tbody tr:nth-child(6) { animation-delay: .17s; }
.table tbody tr:nth-child(7) { animation-delay: .20s; }
.table tbody tr:nth-child(8) { animation-delay: .23s; }
.table tbody tr:nth-child(9) { animation-delay: .26s; }
.table tbody tr:nth-child(10) { animation-delay: .29s; }
.table tbody tr:hover td { background: var(--accent-soft); }
.table tbody tr:hover .avatar-sm { transform: scale(1.1) rotate(-4deg); }
.table .avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 10px; border: 2px solid var(--card-solid); box-shadow: 0 2px 8px rgba(0,0,0,.12); transition: transform .3s var(--ease-spring); cursor: pointer; }
.table .thumb { width: 52px; height: 34px; border-radius: 8px; object-fit: cover; vertical-align: middle; transition: transform .3s var(--ease); }
.table tbody tr:hover .thumb { transform: scale(1.08); }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table .muted { color: var(--muted); }
.table .ellipsis { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .user-cell { display: flex; align-items: center; gap: 10px; }
.table .user-cell-info { min-width: 0; }
.table .user-cell-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }

/* ---------- 徽章 ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 12px; font-weight: 700; position: relative; animation: badge-in .4s var(--ease-spring) both; }
@keyframes badge-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); animation: badge-in .4s var(--ease-spring) both, badge-pulse 2s var(--ease) infinite .4s; }
@keyframes badge-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,59,48,.4); } 50% { box-shadow: 0 0 0 4px rgba(255,59,48,0); } }
.badge.gold { background: var(--orange-soft); color: var(--orange); }
.badge.gray { background: var(--fill); color: var(--muted); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--muted); animation: fade-down .4s var(--ease) .1s both; }
.pager .btn { padding: 7px 14px; font-size: 12px; }
.pager .btn:hover:not(:disabled) { transform: translateY(-2px) rotate(-2deg); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-item { animation: form-item-in .4s var(--ease) both; }
@keyframes form-item-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.form-item:nth-child(1) { animation-delay: .03s; }
.form-item:nth-child(2) { animation-delay: .06s; }
.form-item:nth-child(3) { animation-delay: .09s; }
.form-item:nth-child(4) { animation-delay: .12s; }
.form-item:nth-child(5) { animation-delay: .15s; }
.form-item:nth-child(6) { animation-delay: .18s; }
.form-item label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; transition: color .25s var(--ease); }
.form-item:focus-within label { color: var(--accent); }
.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-strong); border-radius: 11px;
  padding: 11px 14px; font-size: 13px; outline: none; background: var(--fill);
  color: var(--text); font-family: inherit; transition: all .25s var(--ease);
}
.form-item input:focus, .form-item textarea:focus, .form-item select:focus {
  border-color: var(--accent); background: var(--card-solid); box-shadow: 0 0 0 3px var(--accent-soft); transform: translateY(-1px);
}
.form-item textarea { min-height: 90px; resize: vertical; }
.form-item.full { grid-column: 1 / -1; }

/* ---------- QQ 头像预览(编辑用户弹窗) ---------- */
.qq-preview-wrap { width: 60px; height: 60px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 2px solid var(--accent); box-shadow: 0 4px 14px -4px var(--accent); transition: transform .3s var(--ease-spring); }
.qq-preview-wrap:hover { transform: scale(1.06) rotate(3deg); }
.qq-preview { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .3s var(--ease); }

/* ---------- 高级开关（Toggle） ---------- */
.switch {
  --w: 48px; --h: 28px;
  position: relative; display: inline-block; width: var(--w); height: var(--h); flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--fill-2);
  border-radius: 999px;
  transition: background .3s var(--ease);
  border: 1px solid var(--line-strong);
}
.switch .slider::before {
  content: ""; position: absolute;
  height: 22px; width: 22px; left: 3px; top: 50%; transform: translateY(-50%);
  background: #fff; border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2), 0 0 0 1px rgba(0, 0, 0, .05);
  transition: transform .3s var(--ease-spring), background .3s var(--ease);
}
.switch input:checked + .slider {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}
.switch input:checked + .slider::before { transform: translate(20px, -50%); }
.switch input:focus + .slider { box-shadow: 0 0 0 3px var(--accent-soft); }

/* 带标签的开关行 */
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.switch-row .switch-label { font-size: 13px; color: var(--text-2); font-weight: 500; }

/* ---------- 模态框（玻璃） ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .4);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: mask-in .25s var(--ease) both;
}
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border-radius: var(--radius-lg);
  width: 560px; max-width: 92vw; max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35);
  border: 1px solid var(--line-strong);
  animation: modal-in .35s var(--ease-spring) both;
  position: relative;
}
/* 关闭动画: JS 加 .modal-out 后等 200ms 再 remove() */
.modal.modal-out { animation: modal-out .22s var(--ease) both; pointer-events: none; }
@keyframes modal-out {
  to { transform: scale(.96) translateY(14px); opacity: 0; }
}
[data-theme="dark"] .modal { background: rgba(30, 32, 48, .72); }
.modal::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 45%);
  border: 1px solid rgba(255,255,255,.14);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
@keyframes modal-in { from { transform: scale(.92) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal.sm { width: 420px; }
.modal .m-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal .m-head h3 { font-size: 16px; color: var(--text); font-weight: 800; }
.modal .m-close {
  width: 32px; height: 32px; border-radius: 10px;
  border: none; background: var(--fill); color: var(--muted); cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: all .25s var(--ease-spring); flex-shrink: 0;
}
.modal .m-close:hover { background: var(--red-soft); color: var(--red); transform: rotate(90deg) scale(1.08); }
.modal .m-body { padding: 22px 24px; flex: 1; overflow-y: auto; min-height: 0; }
.modal .m-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; top: 24px; left: 50%; transform: translate(-50%, -20px) scale(.92);
  color: #fff; font-size: 14px; font-weight: 600;
  padding: 12px 24px 12px 20px; border-radius: 16px;
  opacity: 0; pointer-events: none; z-index: 200;
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: opacity .3s var(--ease), transform .4s var(--ease-spring);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .4);
  border: 1px solid rgba(255, 255, 255, .25);
  display: flex; align-items: center; gap: 10px;
  max-width: 86vw;
}
#toast::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; flex-shrink: 0; box-shadow: 0 0 10px rgba(255,255,255,.8);
}
#toast.is-show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#toast.toast-success { background: linear-gradient(135deg, rgba(52,199,89,.92), rgba(48,176,78,.92)); }
#toast.toast-error { background: linear-gradient(135deg, rgba(255,59,48,.92), rgba(220,40,30,.92)); }
#toast.toast-info { background: linear-gradient(135deg, rgba(10,132,255,.92), rgba(0,102,214,.92)); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--muted); padding: 44px 0; font-size: 13px; animation: fade-down .5s var(--ease) both; }
.empty .ico-empty {
  width: 56px; height: 56px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--fill); border-radius: 16px; color: var(--muted);
  animation: empty-float 3s var(--ease) infinite;
  box-shadow: 0 8px 20px -8px rgba(0,0,0,.12);
}
@keyframes empty-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(3deg); } }
.empty .ico-empty svg { width: 26px; height: 26px; stroke: currentColor; stroke-width: 1.8; fill: none; }

/* ============================================================
   UI 升级: 骨架屏 / 按钮 loading / 字段内联错误 / 移动端表格转卡片 / 暗色图片适配 / 场景化空状态
   ============================================================ */

/* ---------- 骨架屏 (shimmer) ---------- */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--fill); border-radius: 8px;
  display: inline-block; vertical-align: middle;
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg,
    transparent 0%, rgba(255,255,255,.45) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shimmer 1.4s var(--ease) infinite;
}
[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg,
    transparent 0%, rgba(255,255,255,.08) 50%, transparent 100%);
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* 行级骨架: 模拟表格行 */
.sk-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sk-row .sk-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.sk-row .sk-line { height: 12px; border-radius: 6px; }
.sk-row .sk-line.w-sm { width: 60px; }
.sk-row .sk-line.w-md { width: 120px; }
.sk-row .sk-line.w-lg { width: 200px; flex: 1; }

/* 卡片骨架 */
.sk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.sk-card { background: var(--card); backdrop-filter: blur(var(--glass-blur)); border-radius: var(--radius); border: var(--box-border); padding: 18px; }
.sk-card .sk-title { height: 14px; width: 60%; margin-bottom: 14px; }
.sk-card .sk-num { height: 28px; width: 40%; margin-bottom: 10px; }
.sk-card .sk-foot { height: 10px; width: 80%; }

/* ---------- 按钮 loading 态 ---------- */
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading .btn-text { opacity: 0; }
.btn .btn-spinner {
  position: absolute; top: 50%; left: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; display: none;
  animation: spin .6s linear infinite;
}
.btn.ghost .btn-spinner { border-color: var(--line-strong); border-top-color: var(--accent); }
.btn.danger .btn-spinner { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
.btn.is-loading .btn-spinner { display: block; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ---------- 字段内联错误 ---------- */
.form-item.has-error input,
.form-item.has-error textarea,
.form-item.has-error select {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px var(--red-soft) !important;
  animation: shake-soft .4s var(--ease);
}
@keyframes shake-soft {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.form-item .field-error {
  display: none; margin-top: 6px;
  font-size: 12px; color: var(--red);
  align-items: center; gap: 4px;
  animation: fade-down .25s var(--ease) both;
}
.form-item.has-error .field-error { display: flex; }
.form-item.has-error .field-error::before { content: '⚠'; font-size: 13px; }

/* ---------- 移动端: 表格转卡片视图 ---------- */
@media (max-width: 768px) {
  .table-wrap.is-card { overflow: visible; }
  .table-wrap.is-card > .table { min-width: 0; }
  .table-wrap.is-card > .table thead { display: none; }
  .table-wrap.is-card > .table tbody tr {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px 12px; padding: 12px 14px; margin-bottom: 10px;
    background: var(--card); backdrop-filter: blur(var(--glass-blur));
    border: var(--box-border); border-radius: 12px;
    border-bottom: 1px solid var(--line);
  }
  .table-wrap.is-card > .table tbody td {
    display: flex; flex-direction: column; gap: 3px;
    border: none; padding: 0; font-size: 13px;
  }
  .table-wrap.is-card > .table tbody td::before {
    content: attr(data-label); font-size: 11px;
    color: var(--muted); text-transform: uppercase; letter-spacing: .5px;
  }
  .table-wrap.is-card > .table tbody td[data-label="操作"],
  .table-wrap.is-card > .table tbody td[data-full] { grid-column: 1 / -1; }
  .table-wrap.is-card > .table tbody td[data-label="操作"] .actions { justify-content: flex-end; }
}

/* ---------- 暗色模式: 内容区图片自动适配 ---------- */
[data-theme="dark"] .post-content img,
[data-theme="dark"] .fb-content-box img,
[data-theme="dark"] .ad-content img,
[data-theme="dark"] .modal img:not(.avatar-sm):not(.mp-cover) {
  filter: brightness(.92) contrast(1.05);
  border-radius: 8px;
}

/* ---------- 场景化空状态 ---------- */
.empty.is-scene { padding: 56px 20px; }
.empty.is-scene .ico-empty {
  width: 72px; height: 72px; margin-bottom: 18px;
  border-radius: 20px; background: var(--accent-soft);
  color: var(--accent);
}
.empty.is-scene .ico-empty svg { width: 34px; height: 34px; stroke-width: 1.6; }
.empty .empty-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty .empty-hint { font-size: 12px; color: var(--muted); }

/* ---------- 移动端 toast 贴顶 ---------- */
@media (max-width: 600px) {
  #toast {
    top: 12px !important; bottom: auto !important;
    left: 12px !important; right: 12px !important;
    transform: translate(0, -20px); width: auto !important;
    max-width: none;
  }
  #toast.is-show { transform: translate(0, 0) scale(1); }
}

/* ---------- 表格行 hover 强化 ---------- */
.table tbody tr { transition: background .2s var(--ease), box-shadow .15s var(--ease); position: relative; }
.table tbody tr:hover {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ---------- 链接/可点击元素统一指针 ---------- */
[data-view], [data-rep], [data-del], [data-act], .np-item, .btn, a, .switch, .tabbar a { cursor: pointer; }

/* ---------- 可访问性: 键盘焦点环 ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible { outline-offset: 2px; }

/* ---------- 滚动条: 暗色模式更明显 ---------- */
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 4px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); }

/* ---------- 统计卡片明细弹窗 ---------- */
.stat-detail-summary { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-detail-summary .sd-item { flex: 1; min-width: 90px; background: var(--fill); border-radius: 12px; padding: 14px 16px; text-align: center; }
.stat-detail-summary .sd-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-detail-summary .sd-value { font-size: 22px; font-weight: 700; color: var(--accent); }
.stat-detail-list { max-height: 50vh; overflow-y: auto; border-top: 1px solid var(--line); margin-top: 4px; }
.stat-detail-list .sd-loading { text-align: center; color: var(--muted); padding: 28px 0; font-size: 13px; }
.stat-detail-list .sd-row { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.stat-detail-list .sd-row:last-child { border-bottom: none; }
.stat-detail-list .sd-col { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.stat-detail-list .sd-col.sd-time { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.stat-detail-list .sd-muted { color: var(--muted); }

/* ---------- 通知面板内公告项(合并到上方,复用全部/未读/已读标签) ---------- */
.np-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; padding: 4px 0; }
.np-item { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--fill); border-left: 3px solid var(--accent); cursor: pointer; transition: background .2s var(--ease), transform .15s var(--ease); }
.np-item:hover { background: var(--blue-soft, rgba(0,122,255,.08)); transform: translateX(2px); }
.np-item.np-item-warning { border-left-color: #ff9500; }
.np-item.np-item-danger { border-left-color: var(--red); }
.np-item.np-item-success { border-left-color: #34c759; }
.np-item.np-item-read { opacity: .62; border-left-color: var(--muted); }
.np-item-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent); }
.np-item-main { flex: 1; min-width: 0; }
.np-item-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-item-content { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.5; }
.np-item-time { font-size: 10px; color: var(--muted); flex-shrink: 0; margin-top: 2px; }
.np-unread-tag { font-size: 9px; padding: 1px 5px; border-radius: 8px; background: var(--red-soft, rgba(255,59,48,.12)); color: var(--red); font-weight: 600; flex-shrink: 0; }
.np-cnt { display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 2px; border-radius: 8px; background: var(--fill); color: var(--muted); font-size: 10px; font-weight: 600; }
.np-tab.active .np-cnt { background: var(--accent); color: #fff; }

/* ---------- 公告详情 modal ---------- */
.announce-detail { padding: 4px 2px; }
.ad-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ad-dot { width: 8px; height: 8px; border-radius: 50%; }
.ad-type { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.ad-time { font-size: 11px; color: var(--muted); margin-left: auto; }
.ad-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 10px; line-height: 1.4; }
.ad-content { font-size: 13px; color: var(--text); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* ---------- 主题定制面板 ---------- */
.theme-panel-mask {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: mask-in .25s var(--ease) both;
}
.theme-panel {
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  width: 460px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .4);
  animation: modal-in .35s var(--ease-spring) both;
}
.theme-panel .tp-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.theme-panel .tp-head h3 { font-size: 17px; font-weight: 800; color: var(--text); }
.theme-panel .tp-body { padding: 22px 24px; }
.theme-panel .tp-section { margin-bottom: 24px; }
.theme-panel .tp-section:last-child { margin-bottom: 0; }
.theme-panel .tp-label { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px; }

/* 主题风格 / 菜单风格预览卡 */
.tp-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tp-card {
  border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 10px;
  cursor: pointer; transition: all .25s var(--ease); background: var(--fill);
  text-align: center;
}
.tp-card:hover { transform: translateY(-2px); }
.tp-card.active { border-color: var(--accent); background: var(--accent-soft); }
.tp-preview {
  height: 56px; border-radius: 10px; overflow: hidden; position: relative;
  background: #fff; margin-bottom: 8px; display: flex;
}
[data-theme="dark"] .tp-preview { background: #1c1f2d; }
.tp-preview .tp-bar { width: 22%; background: var(--accent-soft); border-right: 1px solid var(--line); }
.tp-preview .tp-main { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.tp-preview .tp-line { height: 6px; background: var(--fill-2); border-radius: 3px; }
.tp-preview .tp-line.accent { background: var(--accent); width: 40%; }
.tp-card .tp-name { font-size: 12px; font-weight: 600; color: var(--text-2); }
.tp-card.active .tp-name { color: var(--accent); }

/* 主题色圆点 */
.tp-colors { display: flex; gap: 12px; flex-wrap: wrap; }
.tp-color {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; transition: all .25s var(--ease);
  position: relative;
}
.tp-color:hover { transform: scale(1.12); }
.tp-color.active { border-color: var(--text); transform: scale(1.1); }
.tp-color.active::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%;
  border: 2px solid #fff;
}

/* 分段控件（盒子样式 / 容器宽度） */
.tp-segment {
  display: flex; background: var(--fill); border-radius: 12px; padding: 4px; gap: 4px;
}
.tp-seg {
  flex: 1; padding: 10px; text-align: center; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: all .25s var(--ease);
}
.tp-seg.active { background: var(--card-solid); color: var(--text); box-shadow: var(--shadow-soft); }

/* ---------- 登录页（液态玻璃 · iOS 风） ---------- */
body.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-grad);
  position: relative; overflow: hidden;
}
/* 登录页背景光斑 */
body.login-page::before, body.login-page::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .6; z-index: 0;
  animation: float 12s ease-in-out infinite;
}
body.login-page::before {
  width: 400px; height: 400px; top: -100px; left: -100px;
  background: var(--accent-soft);
}
body.login-page::after {
  width: 350px; height: 350px; bottom: -120px; right: -80px;
  background: radial-gradient(circle, var(--orange-soft), transparent 70%);
  animation-delay: -6s;
}
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -30px); } }
.login-wrap { width: 100%; max-width: 400px; padding: 24px; position: relative; z-index: 1; }
.login-card {
  background: var(--card);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 42px 36px;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .25);
  animation: login-in .6s var(--ease-spring) both;
}
@keyframes login-in { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.login-logo {
  width: 68px; height: 68px; border-radius: 20px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px -8px var(--accent-soft);
  color: #fff;
  animation: badge-in .6s var(--ease-spring) both;
}
@keyframes badge-in { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
.login-logo svg { width: 34px; height: 34px; stroke: #fff; }
.login-title { text-align: center; font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: .5px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 28px; }
.login-field {
  height: 54px; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; margin-bottom: 14px;
  background: var(--fill); border-radius: 14px;
  border: 1.5px solid transparent;
  transition: all .3s var(--ease);
}
.login-field:focus-within {
  background: var(--card-solid); border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.login-field .field-ico { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.login-field .field-ico svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }
.login-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font-size: 16px; color: var(--text); font-family: inherit;
}
.login-field input::placeholder { color: var(--muted); }
.login-btn {
  width: 100%; height: 52px; margin-top: 10px;
  border: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 2px;
  transition: all .25s var(--ease);
  box-shadow: 0 12px 28px -8px var(--accent-soft);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -8px var(--accent-soft); filter: brightness(1.05); }
.login-btn:active { transform: scale(.98); }
.login-btn:disabled { opacity: .6; transform: none; }
.login-err {
  display: none; background: var(--red-soft); border: 1px solid rgba(255, 59, 48, .3);
  color: var(--red); font-size: 13px; padding: 11px 14px; border-radius: 12px; margin-bottom: 14px;
  animation: shake .4s var(--ease);
}
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
.login-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; line-height: 1.8; }
.login-tip code { background: var(--fill); padding: 2px 6px; border-radius: 6px; color: var(--text-2); }
.loader { display: none; text-align: center; color: var(--accent); font-size: 13px; margin-top: 12px; font-weight: 600; }

/* ---------- 响应式 ---------- */
@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; }
  .tp-cards { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 减弱动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============================================================
   汉堡按钮 · Q弹动画
   ============================================================ */
.hamburger {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  border: none; background: var(--fill); color: var(--text-2);
  cursor: pointer; transition: all .25s var(--ease);
  flex-shrink: 0;
}
.hamburger:hover { background: var(--fill-2); color: var(--accent); }
.hamburger svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; transition: transform .4s var(--ease-spring); }
.hamburger.ham-pop svg { animation: ham-spring .4s var(--ease-spring); }
@keyframes ham-spring {
  0% { transform: scale(1) rotate(0); }
  40% { transform: scale(1.3) rotate(90deg); }
  70% { transform: scale(.9) rotate(90deg); }
  100% { transform: scale(1) rotate(0); }
}

/* 侧边栏菜单项 Q弹 */
.sidebar nav a.nav-pop { animation: nav-pop .4s var(--ease-spring); }
@keyframes nav-pop {
  0% { transform: scale(1); }
  40% { transform: scale(.94); }
  70% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* ============================================================
   标签栏
   ============================================================ */
.tabbar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 10px;
  background: var(--fill); color: var(--text-2);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  cursor: pointer; transition: all .28s var(--ease);
  border: 1px solid transparent;
  animation: tab-in .35s var(--ease-spring) both;
}
@keyframes tab-in { from { opacity: 0; transform: translateY(-6px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.tab:hover { background: var(--fill-2); color: var(--text); }
.tab.active {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-soft));
  color: var(--accent); border-color: var(--accent-soft);
  box-shadow: 0 4px 12px -4px var(--accent-soft);
}
.tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.tab.active .tab-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.tab-close {
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; line-height: 1;
  color: var(--muted); transition: all .2s;
}
.tab-close:hover { background: var(--red-soft); color: var(--red); }

/* ============================================================
   欢迎卡片
   ============================================================ */
.welcome-card {
  position: relative;
  background: linear-gradient(135deg, var(--accent-soft), rgba(255,255,255,.6));
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 22px;
  display: flex; align-items: center; justify-content: space-between;
  overflow: hidden;
  animation: card-in .55s var(--ease-spring) both;
  box-shadow: var(--box-shadow-var), 0 12px 40px -16px var(--accent-soft);
}
[data-theme="dark"] .welcome-card {
  background: linear-gradient(135deg, rgba(10,132,255,.18), rgba(28,28,30,.6));
}
.welcome-glow {
  position: absolute; top: -60px; right: -40px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  animation: glow-pulse 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glow-pulse { 0%,100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.15); opacity: 1; } }
.welcome-left { flex: 1; position: relative; z-index: 1; }
.welcome-greet {
  font-size: 26px; font-weight: 800; color: var(--text);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.welcome-emoji { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; animation: wave 2.5s ease-in-out infinite; transform-origin: 70% 70%; color: var(--accent); }
.welcome-emoji svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 2; fill: none; }
@keyframes wave {
  0%,60%,100% { transform: rotate(0); }
  10%,30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(14deg); }
  50% { transform: rotate(-4deg); }
}
.welcome-name { color: var(--accent); }
.welcome-badge-row { margin-top: 10px; }
.welcome-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 999px;
  background: linear-gradient(135deg, #ffd700, #ff9500);
  color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: 0 4px 12px -4px rgba(255,149,0,.4);
  animation: badge-shine 3s ease-in-out infinite;
}
.welcome-badge svg { width: 14px; height: 14px; stroke: #fff; }
@keyframes badge-shine {
  0%, 100% { box-shadow: 0 4px 12px -4px rgba(255,149,0,.4); }
  50% { box-shadow: 0 4px 20px -2px rgba(255,215,0,.6); }
}
.welcome-desc { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.7; max-width: 560px; }
.welcome-actions { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; }
.welcome-btn { padding: 10px 20px; }
.welcome-btn svg { width: 16px; height: 16px; }
.welcome-btn.ghost {
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); box-shadow: none;
}
.welcome-btn.ghost:hover { background: var(--fill-2); }
.welcome-right { position: relative; z-index: 1; flex-shrink: 0; margin-left: 20px; }
.welcome-avatar {
  width: 96px; height: 96px; border-radius: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 16px 40px -10px var(--accent-soft);
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.welcome-avatar svg { width: 48px; height: 48px; stroke: #fff; }

/* ============================================================
   统计卡片图标 + 彩色主题 + 数值刷新闪烁
   ============================================================ */
.stat { display: flex; align-items: center; gap: 14px; }
.stat-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); flex-shrink: 0;
  transition: transform .3s var(--ease-spring);
}
.stat:hover .stat-icon { transform: scale(1.12) rotate(-5deg); }
.stat-icon svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; fill: none; }
.stat-body { flex: 1; min-width: 0; }
/* 8 个卡片各自配色 */
.stat-c1 .stat-icon { background: rgba(0,122,255,.12); color: #007aff; }
.stat-c2 .stat-icon { background: rgba(0,199,90,.12); color: #34c759; }
.stat-c3 .stat-icon { background: rgba(255,149,0,.12); color: #ff9500; }
.stat-c4 .stat-icon { background: rgba(175,82,222,.12); color: #af52de; }
.stat-c5 .stat-icon { background: rgba(255,59,48,.12); color: #ff3b30; }
.stat-c6 .stat-icon { background: rgba(90,200,250,.12); color: #5ac8fa; }
.stat-c7 .stat-icon { background: rgba(255,45,85,.12); color: #ff2d55; }
.stat-c8 .stat-icon { background: rgba(255,204,0,.14); color: #ffcc00; }
.stat-c1:hover { border-color: rgba(0,122,255,.4); box-shadow: 0 8px 24px -8px rgba(0,122,255,.3); }
.stat-c2:hover { border-color: rgba(52,199,89,.4); box-shadow: 0 8px 24px -8px rgba(52,199,89,.3); }
.stat-c3:hover { border-color: rgba(255,149,0,.4); box-shadow: 0 8px 24px -8px rgba(255,149,0,.3); }
.stat-c4:hover { border-color: rgba(175,82,222,.4); box-shadow: 0 8px 24px -8px rgba(175,82,222,.3); }
.stat-c5:hover { border-color: rgba(255,59,48,.4); box-shadow: 0 8px 24px -8px rgba(255,59,48,.3); }
.stat-c6:hover { border-color: rgba(90,200,250,.4); box-shadow: 0 8px 24px -8px rgba(90,200,250,.3); }
.stat-c7:hover { border-color: rgba(255,45,85,.4); box-shadow: 0 8px 24px -8px rgba(255,45,85,.3); }
.stat-c8:hover { border-color: rgba(255,204,0,.4); box-shadow: 0 8px 24px -8px rgba(255,204,0,.3); }
.stat .value { transition: color .3s; }
.stat .value.flash { animation: value-flash .6s ease; }
@keyframes value-flash { 0% { color: var(--accent); text-shadow: 0 0 8px var(--accent-soft); } 100% { color: inherit; text-shadow: none; } }

/* 编辑用户弹窗 - 复选框行 */
.ck-row { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--text-2); padding: 6px 8px; border-radius: 8px; transition: background .2s var(--ease); }
.ck-row:hover { background: var(--fill); color: var(--text); }
.ck-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.ck-row input[type=checkbox]:checked + span { color: var(--accent); font-weight: 600; }

/* 图片加载失败占位 */
.img-fallback { display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--fill); border-radius: inherit; }
.img-fallback svg { width: 50%; height: 50%; opacity: .4; }
.img-fallback-avatar { width: 100%; height: 100%; border-radius: 50%; background: linear-gradient(135deg, var(--accent-soft), var(--fill)); color: var(--accent); }
.img-fallback-avatar svg { width: 60%; height: 60%; opacity: .6; }
.img-fallback-image { width: 100%; height: 110px; border-radius: 8px; }

/* 趋势图容器 */
.trend-chart {
  width: 100%; padding: 8px 0 0; position: relative;
}
.trend-svg {
  width: 100%; height: auto; max-height: 220px; display: block; overflow: visible;
}
.trend-svg path { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: trend-draw 1.2s var(--ease) forwards; }
.trend-svg .trend-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 4; }
.trend-svg circle { opacity: 0; animation: trend-pop .4s var(--ease-spring) forwards; }
.trend-svg circle:nth-child(1) { animation-delay: .3s; }
.trend-svg circle:nth-child(2) { animation-delay: .4s; }
.trend-svg circle:nth-child(3) { animation-delay: .5s; }
.trend-svg circle:nth-child(4) { animation-delay: .6s; }
.trend-svg circle:nth-child(5) { animation-delay: .7s; }
.trend-svg circle:nth-child(6) { animation-delay: .8s; }
.trend-svg circle:nth-child(7) { animation-delay: .9s; }
.trend-svg circle:hover { r: 7; filter: drop-shadow(0 0 6px var(--accent)); }
@keyframes trend-draw { to { stroke-dashoffset: 0; } }
@keyframes trend-pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; } }
.trend-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent-soft); }

/* ---------- 最新注册用户列表 ---------- */
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: 14px; transition: all .3s var(--ease);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  animation: user-in .4s var(--ease) both;
}
.user-item:hover { background: var(--fill-2); border-color: var(--accent-soft); transform: translateX(4px); box-shadow: 0 4px 16px -6px var(--accent-soft); }
@keyframes user-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
.user-item:nth-child(1) { animation-delay: .05s; }
.user-item:nth-child(2) { animation-delay: .1s; }
.user-item:nth-child(3) { animation-delay: .15s; }
.user-item:nth-child(4) { animation-delay: .2s; }
.user-item:nth-child(5) { animation-delay: .25s; }
.user-avatar-wrap { position: relative; flex-shrink: 0; width: 44px; height: 44px; }
.user-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 2px solid var(--card-solid);
}
.user-avatar-default {
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.user-avatar-default svg { width: 22px; height: 22px; }
.user-avatar-img {
  position: absolute; top: 0; left: 0;
}
.user-status-dot {
  position: absolute; bottom: 2px; right: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #34c759; border: 2px solid var(--card-solid); z-index: 2;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.user-uid { font-size: 11px; color: var(--muted); font-family: monospace; }
.user-time { font-size: 12px; color: var(--text-2); font-weight: 500; white-space: nowrap; }

/* 内容切换动画增强 */
.content.content-in { animation: content-in .45s var(--ease) both; }

/* 侧边栏在桌面端也可折叠 */
@media (min-width: 769px) {
  .sidebar { transition: margin-left .35s var(--ease), width .35s var(--ease); }
  .layout.sidebar-collapsed .sidebar { margin-left: -232px; }
  .layout.sidebar-collapsed .main { margin-left: 0; }
}
/* 移动端遮罩 */
.sidebar-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; backdrop-filter: blur(2px); opacity: 0; transition: opacity .3s; }
.sidebar-mask.show { display: block; opacity: 1; }
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 50; height: 100%; margin-left: -232px; transition: margin-left .35s var(--ease); }
  .sidebar.open { margin-left: 0; }
}
/* 侧边栏入场动画 */
@keyframes nav-fade {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   主题切换旋转动画
   ============================================================ */
.theme-icon { transition: transform .5s var(--ease-spring); }
.theme-icon.theme-spin { animation: theme-spin .6s var(--ease-spring); }
@keyframes theme-spin {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(180deg) scale(1.25); }
  100% { transform: rotate(360deg) scale(1); }
}

/* 通知红点 */
.icon-btn { position: relative; }
.badge-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--card);
  animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, .5); }
  50% { box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
}

/* 顶栏按钮统一点击动画 */
.icon-btn:active { transform: scale(.88); }
.icon-btn svg { transition: transform .3s var(--ease-spring); }
.icon-btn:hover svg { transform: scale(1.12); }

/* ============================================================
   标签下拉菜单
   ============================================================ */
.tab { position: relative; }
.tab-menu-btn {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px;
  color: var(--muted); transition: all .2s; margin-left: 2px;
}
.tab-menu-btn:hover { background: var(--fill-2); color: var(--text); }
.tab-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 100;
  min-width: 150px; padding: 6px;
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-card);
  animation: dropdown-in .25s var(--ease-spring) both;
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-8px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.tab-dropdown .td-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13px; color: var(--text-2); font-weight: 500;
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.tab-dropdown .td-item:hover { background: var(--fill); color: var(--accent); }
.tab-dropdown .td-item svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; }
.tab-dropdown .td-item.danger:hover { background: var(--red-soft); color: var(--red); }
.tab-dropdown .td-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* ============================================================
   通知面板
   ============================================================ */
.notify-panel {
  position: absolute; top: 64px; right: 16px; z-index: 200;
  width: 340px; max-width: calc(100vw - 32px);
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  opacity: 0; visibility: hidden;
  transform: translateY(-12px) scale(.96);
  transition: opacity .25s var(--ease), transform .3s var(--ease-spring), visibility .25s;
}
.notify-panel.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.np-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
}
.np-title { font-size: 16px; font-weight: 700; color: var(--text); }
.np-markread {
  font-size: 12px; color: var(--accent); cursor: pointer;
  padding: 4px 10px; border-radius: 6px; transition: background .2s;
}
.np-markread:hover { background: var(--accent-soft); }
.np-tabs {
  display: flex; gap: 4px; padding: 0 14px 10px;
  border-bottom: 1px solid var(--line);
}
.np-tab {
  padding: 7px 14px; border-radius: 8px; font-size: 13px;
  color: var(--muted); cursor: pointer; font-weight: 500;
  transition: all .2s;
}
.np-tab:hover { color: var(--text); }
.np-tab.active { color: var(--accent); background: var(--accent-soft); }
.np-body { min-height: 180px; padding: 24px 18px; }
.np-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); }
.np-empty svg { width: 56px !important; height: 56px !important; max-width: 56px; max-height: 56px; opacity: .4; animation: empty-float 3s ease-in-out infinite; }
@keyframes empty-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.np-empty p { font-size: 14px; margin: 0; }
.np-footer { padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.np-viewall {
  width: 100%; padding: 11px; border: none; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-size: 14px;
  font-weight: 600; cursor: pointer; transition: all .25s var(--ease-spring);
}
.np-viewall:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.np-viewall:active { transform: scale(.97); }

/* ============================================================
   语言下拉
   ============================================================ */
.lang-dropdown {
  position: absolute; top: 64px; right: 60px; z-index: 200;
  min-width: 160px; max-height: 320px; overflow-y: auto; padding: 6px;
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-card);
  opacity: 0; visibility: hidden;
  transform: translateY(-8px) scale(.95);
  transition: all .25s var(--ease-spring);
}
.lang-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.lang-dropdown::-webkit-scrollbar { width: 5px; }
.lang-dropdown::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.ld-item {
  padding: 10px 14px; border-radius: 8px; font-size: 14px;
  color: var(--text-2); cursor: pointer; font-weight: 500;
  display: flex; align-items: center; gap: 8px; transition: all .2s;
}
.ld-item:hover { background: var(--fill); color: var(--accent); transform: translateX(3px); }
.ld-item.active { color: var(--accent); background: var(--accent-soft); }
.ld-item.active::after { content: '✓'; margin-left: auto; }

/* 移动端适配 */
@media (max-width: 600px) {
  .notify-panel { right: 10px; left: 10px; width: auto; max-width: none; }
  .lang-dropdown { right: 10px; min-width: 140px; }
}

/* ============================================================
   公告管理
   ============================================================ */
.announce-item {
  padding: 14px 16px; margin-bottom: 10px;
  background: var(--fill); border-radius: 12px;
  border: 1px solid var(--line);
  transition: all .3s var(--ease-spring);
  animation: announce-in .4s var(--ease-spring) both;
}
@keyframes announce-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.announce-item:hover { transform: translateX(4px); box-shadow: var(--shadow-card); border-color: var(--accent); }
.announce-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.announce-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; flex-wrap: wrap; }
.announce-tag {
  padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.tag-info { background: rgba(10,132,255,.12); color: #0a84ff; }
.tag-success { background: rgba(52,199,89,.12); color: #34c759; }
.tag-warning { background: rgba(255,149,0,.12); color: #ff9500; }
.tag-danger { background: rgba(255,59,48,.12); color: #ff3b30; }
.announce-title { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 80px; }
.announce-time { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.announce-content { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--text-2); line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.announce-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn.sm { padding: 6px 14px; font-size: 12px; }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }

/* ===== 音乐配置卡片 ===== */
.music-empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.music-empty svg { width: 56px; height: 56px; margin-bottom: 14px; opacity: .4; }
.music-empty p { font-size: 13px; }

.music-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.music-card {
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 16px;
  padding: 16px;
  transition: all .3s var(--ease-spring);
  animation: music-in .4s var(--ease-spring) both;
}
[data-theme="dark"] .music-card { background: rgba(30,32,48,.45); border-color: rgba(255,255,255,.08); }
@keyframes music-in {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.music-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,.1); border-color: var(--accent); }
.music-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.music-card-num {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.music-card-info { flex: 1; min-width: 0; }
.music-card-name { font-size: 15px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-card-id { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: 'SF Mono', monospace; }
.music-card-cat {
  font-size: 11px; padding: 4px 12px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.music-card-actions { display: flex; gap: 8px; }
.music-card-actions .btn { flex: 1; justify-content: center; display: flex; align-items: center; gap: 5px; }

.music-modal .form-item { margin-bottom: 16px; }
.music-modal .form-item label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-2); }
.music-modal input {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--fill);
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.music-modal input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* select 样式 */
select {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color .2s;
}
select:focus { border-color: var(--accent); }
textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--text); font-size: 14px; outline: none;
  resize: vertical; font-family: inherit;
  transition: border-color .2s;
}
textarea:focus { border-color: var(--accent); }



