/* ============================================================
   秋辞社区 · 管理后台 高级增强层 v3
   ① 侧边栏高级液态玻璃（多层折射 + 噪点 + 镜面高光 + 极光背景）
   ② 实时头像组件（首字母渐变兜底 / 加载动效）
   ③ 全局动效（入场错峰 / 磁吸 / 水波纹 / 光标聚光 / 数字滚动…）
   放在 admin.css 之后加载，负责覆盖与增强
   ============================================================ */

/* ============================================================
   ① 侧边栏 · 高级液态玻璃
   ============================================================ */

/* --- 极光背景：侧边栏背后缓慢流动的彩色光晕，玻璃的“折射源” --- */
.sidebar { position: relative; isolation: isolate; }
.sidebar > * { position: relative; z-index: 2; }
.sidebar::before {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  overflow: hidden;
  background:
    radial-gradient(46% 22% at 14% 6%,  rgba(10, 132, 255, .42), transparent 74%),
    radial-gradient(40% 18% at 84% 26%, rgba(175, 82, 222, .34), transparent 74%),
    radial-gradient(50% 24% at 38% 56%, rgba(90, 200, 250, .30), transparent 74%),
    radial-gradient(36% 16% at 72% 84%, rgba(255, 45, 85, .20), transparent 74%),
    radial-gradient(32% 14% at 22% 72%, rgba(255, 149, 0, .14), transparent 74%);
  filter: blur(34px) saturate(155%);
  opacity: .9;
  /* 上下渐隐，像玻璃里流动的光而不是彩虹贴纸 */
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,.85) 45%, rgba(0,0,0,.55) 100%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,.85) 45%, rgba(0,0,0,.55) 100%);
  animation: auroraDrift 26s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes auroraDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(3%, -2%, 0) scale(1.08) rotate(1.5deg); }
  100% { transform: translate3d(-3%, 3%, 0) scale(1.04) rotate(-1.5deg); }
}
[data-theme="dark"] .sidebar::before { opacity: .72; filter: blur(20px) saturate(160%); }

/* --- 玻璃主体：分层叠加，模拟真实玻璃厚度 --- */
.sidebar {
  background:
    /* 顶部镜面高光 */
    linear-gradient(180deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .06) 22%, rgba(255, 255, 255, 0) 55%),
    /* 底部淡入的暗角，增加体积感 */
    linear-gradient(0deg, rgba(120, 130, 180, .10) 0%, rgba(255, 255, 255, 0) 30%),
    /* 主体半透明色（压低一点，让背后极光透上来） */
    rgba(255, 255, 255, .26);
  backdrop-filter: blur(32px) saturate(190%) brightness(1.06);
  -webkit-backdrop-filter: blur(32px) saturate(190%) brightness(1.06);
  border-right: 1px solid rgba(255, 255, 255, .5);
  box-shadow:
    1px 0 0 0 rgba(255, 255, 255, .35) inset,          /* 左内侧镜面线 */
    -18px 0 46px -18px rgba(31, 38, 75, .22),          /* 侧向投影 */
    0 0 0 .5px rgba(255, 255, 255, .28) inset;
  transition: margin .32s var(--ease), width .32s var(--ease), background .45s var(--ease), box-shadow .45s var(--ease);
}
[data-theme="dark"] .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, .02) 24%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(0deg, rgba(0, 0, 0, .35) 0%, rgba(255, 255, 255, 0) 32%),
    rgba(16, 19, 30, .62);
  backdrop-filter: blur(32px) saturate(170%) brightness(.95);
  -webkit-backdrop-filter: blur(32px) saturate(170%) brightness(.95);
  border-right-color: rgba(255, 255, 255, .09);
  box-shadow:
    1px 0 0 0 rgba(255, 255, 255, .07) inset,
    -18px 0 50px -18px rgba(0, 0, 0, .6),
    0 0 0 .5px rgba(255, 255, 255, .05) inset;
}

/* --- 玻璃噪点：细微颗粒，玻璃质感的关键 --- */
.sidebar::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .30;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
[data-theme="dark"] .sidebar::after { opacity: .18; }

/* --- 品牌区：更强的磨砂，独立分层 --- */
.sidebar .brand {
  position: relative;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: glassSlideDown .7s var(--ease-spring) both;
}
[data-theme="dark"] .sidebar .brand { border-bottom-color: rgba(255, 255, 255, .07); }
.sidebar .brand::after {
  content: "";
  position: absolute; left: 16px; right: 16px; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .5;
  animation: edgeSweep 5.5s ease-in-out infinite;
}
@keyframes glassSlideDown {
  from { opacity: 0; transform: translateY(-14px); backdrop-filter: blur(0); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes edgeSweep {
  0%, 100% { transform: scaleX(.2); opacity: 0; }
  50%      { transform: scaleX(1);  opacity: .75; }
}

/* --- 品牌 Logo：极光描边 + 呼吸光晕 + 磁吸悬浮 --- */
.sidebar .brand .logo {
  position: relative;
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 8px 22px -6px var(--accent-soft), 0 0 0 1px rgba(255, 255, 255, .28) inset;
  overflow: visible;
  isolation: isolate;
  transition: transform .5s var(--ease-spring), box-shadow .4s var(--ease);
}
.sidebar .brand .logo::before {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 17px;
  background: conic-gradient(from 0deg, transparent 0deg, var(--accent) 90deg, var(--gold-2) 180deg, transparent 270deg);
  filter: blur(6px);
  opacity: .0;
  z-index: -1;
  animation: conicSpin 6s linear infinite;
  transition: opacity .4s var(--ease);
}
.sidebar .brand:hover .logo { transform: scale(1.1) rotate(-6deg); }
.sidebar .brand:hover .logo::before { opacity: .85; }
.sidebar .brand .logo::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(150deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 46%);
  pointer-events: none;
}
@keyframes conicSpin { to { transform: rotate(360deg); } }
.sidebar .brand .name {
  background: linear-gradient(92deg, var(--text) 20%, var(--accent) 50%, var(--text) 80%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: textShimmer 7s linear infinite;
}
@keyframes textShimmer { to { background-position: 220% 0; } }
.sidebar .brand .sub { letter-spacing: 1.2px; opacity: .8; }

/* --- 导航容器 --- */
.sidebar nav {
  padding: 14px 12px 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-soft) transparent;
}
.sidebar nav::-webkit-scrollbar { width: 5px; }
.sidebar nav::-webkit-scrollbar-track { background: transparent; }
.sidebar nav::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-soft), rgba(255, 255, 255, .18));
  border-radius: 99px;
  border: none;
}
.sidebar nav::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.sidebar nav .group {
  position: relative;
  padding: 16px 14px 8px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 2.4px;
  color: var(--muted); opacity: .7;
  animation: glassFadeIn .6s var(--ease) both;
}
.sidebar nav .group::before {
  content: "";
  position: absolute; left: 14px; top: 50%; width: 12px; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: translateY(-50%);
}

/* --- 导航项：玻璃胶囊 + 高光扫过 --- */
.sidebar nav a {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-bottom: 4px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  transition:
    transform .34s var(--ease-spring),
    background .3s var(--ease),
    border-color .3s var(--ease),
    box-shadow .35s var(--ease),
    color .25s var(--ease);
  animation: navItemIn .55s var(--ease-spring) both;
  will-change: transform;
}
@keyframes navItemIn {
  from { opacity: 0; transform: translateX(-18px) scale(.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
/* 覆盖 admin.css 的 nav-fade：内联样式用的是这个名字，这里换成更高级的入场 */
@keyframes nav-fade {
  from { opacity: 0; transform: translateX(-20px) scale(.94); filter: blur(4px); }
  60%  { opacity: 1; filter: blur(0); }
  to   { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}
@keyframes nav-pop {
  0%   { transform: translateX(4px) scale(1); }
  35%  { transform: translateX(0) scale(1.07); }
  100% { transform: translateX(0) scale(1); }
}
@keyframes glassFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: .7; transform: translateY(0); }
}

/* 悬停：磨砂玻璃 + 高光扫过 */
.sidebar nav a::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  background: rgba(255, 255, 255, .42);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
[data-theme="dark"] .sidebar nav a::before { background: rgba(255, 255, 255, .08); }
.sidebar nav a:hover {
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, .55);
  box-shadow: 0 8px 22px -12px rgba(31, 38, 75, .35), 0 0 0 .5px rgba(255, 255, 255, .3) inset;
  color: var(--text);
}
[data-theme="dark"] .sidebar nav a:hover { border-color: rgba(255, 255, 255, .13); }
.sidebar nav a:hover::before { opacity: 1; }

/* 悬停时掠过的高光条 */
.sidebar nav a::after {
  content: "";
  position: absolute; top: 0; left: -120%; z-index: -1;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
}
.sidebar nav a:hover::after { animation: sheenSweep .85s var(--ease) forwards; }
@keyframes sheenSweep {
  from { left: -120%; }
  to   { left: 160%; }
}

/* 选中：液态玻璃药丸 + 流动光带 + 发光指示条 */
.sidebar nav a.active {
  color: var(--accent);
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent-soft) 0%, rgba(255, 255, 255, .30) 50%, var(--accent-soft) 100%);
  background-size: 220% 100%;
  border-color: rgba(255, 255, 255, .6);
  box-shadow:
    0 10px 26px -12px var(--accent-soft),
    0 0 0 1px var(--accent-soft) inset,
    0 1px 0 0 rgba(255, 255, 255, .5) inset;
  animation: activeFlow 6s ease-in-out infinite;
}
[data-theme="dark"] .sidebar nav a.active {
  background: linear-gradient(120deg, var(--accent-soft) 0%, rgba(255, 255, 255, .07) 50%, var(--accent-soft) 100%);
  background-size: 220% 100%;
  border-color: rgba(255, 255, 255, .12);
}
@keyframes activeFlow {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.sidebar nav a.active::before { opacity: 1; background: transparent; }

/* 左侧发光指示条 */
.sidebar nav a.active::after {
  content: "";
  position: absolute; left: 0; top: 50%;
  left: -1px;
  width: 3.5px; height: 0;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px 2px var(--accent-soft), 0 0 4px var(--accent);
  transform: translateY(-50%);
  animation: barGrow .6s var(--ease-spring) forwards, barBreathe 3s ease-in-out 0.6s infinite;
  left: 0;
}
@keyframes barGrow { to { height: 22px; } }
@keyframes barBreathe {
  0%, 100% { box-shadow: 0 0 10px 1px var(--accent-soft); }
  50%      { box-shadow: 0 0 18px 3px var(--accent-soft); }
}
.sidebar nav a.active .ico { color: var(--accent); filter: drop-shadow(0 0 6px var(--accent-soft)); }
.sidebar nav a.active span { animation: textShimmerSoft 3.5s linear infinite; }
@keyframes textShimmerSoft { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }

/* --- 底部版本徽章 --- */
.sidebar .foot {
  position: relative;
  padding: 16px 20px 18px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, .34);
  display: flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .sidebar .foot { border-top-color: rgba(255, 255, 255, .07); }
.sidebar .foot::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 0 rgba(52, 199, 89, .55);
  animation: livePulse 2.4s ease-out infinite;
  flex-shrink: 0;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 199, 89, .5); }
  70%  { box-shadow: 0 0 0 9px rgba(52, 199, 89, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}

/* --- 图标模式：悬浮提示 --- */
[data-menu="icon"] .sidebar { width: 78px; }
[data-menu="icon"] .sidebar nav a { justify-content: center; padding: 13px 0; }
[data-menu="icon"] .sidebar nav a::after { display: none; }
[data-menu="icon"] .sidebar nav a span:not(.ico) { display: none; }
[data-menu="icon"] .sidebar nav a:hover { transform: none; }
[data-menu="icon"] .sidebar nav a::before {
  content: attr(data-title);
  position: absolute; left: calc(100% + 12px); top: 50%;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  color: var(--text);
  background: var(--card-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translateY(-50%) scale(.9);
  transform-origin: left center;
  opacity: 0; pointer-events: none;
  transition: opacity .22s var(--ease), transform .28s var(--ease-spring);
  z-index: 60;
}
[data-menu="icon"] .sidebar nav a:hover::before { opacity: 1; transform: translateY(-50%) scale(1); }
[data-menu="icon"] .sidebar .brand::after,
[data-menu="icon"] .sidebar .foot { display: none; }

/* --- 移动端抽屉：弹性滑入 + 遮罩模糊 --- */
@media (max-width: 768px) {
  .sidebar {
    width: 254px;
    box-shadow: 24px 0 60px -20px rgba(0, 0, 0, .45);
  }
  .sidebar.open { animation: drawerIn .42s var(--ease-spring); }
  @keyframes drawerIn {
    0%   { transform: translateX(-100%) scale(.96); opacity: .4; }
    60%  { transform: translateX(6px) scale(1.005); opacity: 1; }
    100% { transform: translateX(0) scale(1); opacity: 1; }
  }
  .sidebar-mask.show { animation: maskIn .34s var(--ease); }
  @keyframes maskIn { from { opacity: 0; backdrop-filter: blur(0); } to { opacity: 1; backdrop-filter: blur(6px); } }
  .sidebar nav a { padding: 13px 14px; }
  .sidebar nav a:hover { transform: none; }
}

/* --- 顶部菜单模式：把同一套高级玻璃搬到顶栏导航 --- */
[data-menu="top"] .top-nav a {
  position: relative; overflow: hidden;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 15px;
  transition: transform .3s var(--ease-spring), background .3s var(--ease), box-shadow .3s var(--ease), color .2s;
}
[data-menu="top"] .top-nav a::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, .4);
  opacity: 0; border-radius: inherit; transition: opacity .3s var(--ease);
}
[data-theme="dark"] [data-menu="top"] .top-nav a::before { background: rgba(255, 255, 255, .08); }
[data-menu="top"] .top-nav a:hover { transform: translateY(-2px); color: var(--accent); }
[data-menu="top"] .top-nav a:hover::before { opacity: 1; }
[data-menu="top"] .top-nav a.active {
  background: var(--accent-soft);
  border-color: rgba(255, 255, 255, .5);
  box-shadow: 0 6px 18px -8px var(--accent-soft), 0 1px 0 0 rgba(255, 255, 255, .5) inset;
}
[data-menu="top"] .top-nav a svg { transition: transform .35s var(--ease-spring); }
[data-menu="top"] .top-nav a:hover svg { transform: scale(1.22) rotate(-8deg); }


/* ============================================================
   ② 实时头像组件
   结构：.av > .av-fb(首字母渐变) + .av-img(真实头像,加载成功后淡入)
   ============================================================ */
.av {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: visible;
  flex-shrink: 0;
  vertical-align: middle;
  background: none;
  isolation: isolate;
}
.av::before {
  content: "";
  position: absolute; inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, var(--accent) 120deg, transparent 240deg);
  opacity: 0;
  transition: opacity .35s var(--ease);
  animation: conicSpin 4.5s linear infinite;
  z-index: -1;
}
.av:hover::before { opacity: 1; }
.av > .av-fb {
  position: absolute; inset: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; line-height: 1;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  letter-spacing: 0;
  background:
    linear-gradient(135deg,
      hsl(var(--av-h, 210) 85% 62%) 0%,
      hsl(calc(var(--av-h, 210) + 40) 80% 50%) 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3) inset;
  transition: opacity .45s var(--ease), transform .45s var(--ease-spring), filter .3s;
  user-select: none;
}
.av:hover > .av-fb { transform: scale(1.08); filter: saturate(1.2); }
.av > .av-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0;
  transform: scale(.82);
  transition: opacity .45s var(--ease), transform .55s var(--ease-spring);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3) inset;
}
.av > .av-img.av-ready { opacity: 1; transform: scale(1); }
.av.av-has-img > .av-fb { opacity: 0; }
.av.av-has-img:hover > .av-img { transform: scale(1.06); }
.av > .av-ring {
  position: absolute; right: -1px; bottom: -1px;
  width: 26%; height: 26%; min-width: 9px; min-height: 9px;
  border-radius: 50%;
  background: #34c759;
  border: 2px solid var(--card-solid);
  box-shadow: 0 0 8px rgba(52, 199, 89, .7);
  animation: ringPulse 2.6s ease-in-out infinite;
  z-index: 2;
}
@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, .6); }
  50%      { box-shadow: 0 0 0 5px rgba(52, 199, 89, 0); }
}
/* 尺寸档位（字号必须显式给，百分比是按父级字号算的） */
.av-xs { width: 26px; height: 26px; }
.av-xs > .av-fb { font-size: 11px; }
.av-sm { width: 32px; height: 32px; }
.av-sm > .av-fb { font-size: 13px; }
.av { width: 40px; height: 40px; }
.av > .av-fb { font-size: 16px; }
.user-item .av, .user-avatar-wrap .av { width: 44px; height: 44px; }
.user-item .av > .av-fb, .user-avatar-wrap .av > .av-fb { font-size: 18px; }
.av-lg { width: 56px; height: 56px; }
.av-lg > .av-fb { font-size: 22px; }
.av-xl { width: 88px; height: 88px; }
.av-xl > .av-fb { font-size: 34px; }
.av-preview { width: 64px; height: 64px; }
.av-preview > .av-fb { font-size: 25px; }
/* 表格单元格内联 */
.av-cell { margin-right: 0; }
.table .av { box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
/* 用户行 */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .av { box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.user-item .av { box-shadow: 0 3px 10px rgba(0, 0, 0, .14); }
.qq-preview-wrap {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--fill);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .4s var(--ease-spring), box-shadow .3s;
}
.qq-preview-wrap:hover { transform: scale(1.06); box-shadow: 0 8px 24px -8px var(--accent-soft); }
.qq-preview-wrap .av { width: 100%; height: 100%; }
.qq-preview-wrap .av::before { display: none; }
.qq-preview-wrap .av > .av-ring { display: none; }


/* ============================================================
   ③ 全局动效
   ============================================================ */

/* --- 滚动进度条 --- */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0;
  z-index: 9999;
  background: linear-gradient(90deg, var(--accent), var(--gold-2), var(--accent-2));
  background-size: 200% 100%;
  box-shadow: 0 0 12px var(--accent-soft);
  transition: width .08s linear, opacity .3s;
  animation: barFlow 3s linear infinite;
  border-radius: 0 3px 3px 0;
  pointer-events: none;
}
@keyframes barFlow { to { background-position: 200% 0; } }
.scroll-progress.done { opacity: 0; }

/* --- 顶部请求加载条 --- */
.req-bar {
  position: fixed; top: 0; left: 0;
  height: 2.5px; width: 0;
  z-index: 10000;
  background: linear-gradient(90deg, transparent, var(--accent), var(--gold-2), transparent);
  background-size: 60% 100%;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: width .25s var(--ease), opacity .25s;
  box-shadow: 0 0 10px var(--accent-soft);
}
.req-bar.on { opacity: 1; }
.req-bar.run { width: 78% !important; animation: reqIndeterminate 1.1s var(--ease) infinite; }
.req-bar.done { width: 100% !important; opacity: 0; transition: width .2s ease, opacity .45s ease .1s; }
@keyframes reqIndeterminate {
  0%   { background-position: -60% 0; }
  100% { background-position: 160% 0; }
}

/* --- 水波纹 --- */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: radial-gradient(circle, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .18) 45%, transparent 70%);
  pointer-events: none;
  animation: rippleOut .68s cubic-bezier(.22, .8, .3, 1) forwards;
  mix-blend-mode: overlay;
  z-index: 0;
}
@keyframes rippleOut {
  to { transform: scale(2.6); opacity: 0; }
}
[data-theme="dark"] .ripple {
  background: radial-gradient(circle, rgba(255, 255, 255, .38) 0%, rgba(255, 255, 255, .1) 45%, transparent 70%);
}

/* --- 光标聚光（仅桌面端） --- */
.cursor-glow {
  position: fixed;
  width: 380px; height: 380px;
  margin: -190px 0 0 -190px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
  opacity: 0;
  transition: opacity .5s var(--ease);
  will-change: transform;
}
body.cursor-on .cursor-glow { opacity: .75; }

/* --- 点击任意可点元素都有反馈 --- */
[data-anim],
.btn,
.icon-btn,
.sidebar nav a,
.tab,
.td-item,
.ld-item,
.np-tab,
.hamburger,
.user-item,
.tp-card,
.tp-color,
.tp-seg,
.action-btn,
.swatch {
  -webkit-tap-highlight-color: transparent;
}
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, .28) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform .6s var(--ease);
  pointer-events: none;
}
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: scale(.94) !important; }
.btn.small:active { transform: scale(.9) !important; }

/* --- 图标按钮：磁吸 + 旋转 --- */
.icon-btn { position: relative; transition: transform .35s var(--ease-spring), background .25s, color .25s, box-shadow .3s; }
.icon-btn:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 8px 20px -8px var(--accent-soft); }
.icon-btn:active { transform: scale(.88) !important; }
.icon-btn svg { transition: transform .4s var(--ease-spring); }
.icon-btn:hover svg { transform: rotate(12deg) scale(1.1); }

/* --- 卡片 3D 倾斜 + 跟随高光 --- */
.card, .stat {
  transform-style: preserve-3d;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), background .4s var(--ease);
}
.card:hover, .stat:hover { transform: translateY(-4px); }

/* --- 表格行错峰入场 --- */
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
/* 表头不参与错峰（浏览器会把裸 <tr> 也塞进 tbody，用 :not(:has(th)) 排除） */
.table tbody tr:not(:has(> th)) { animation: rowIn .45s var(--ease) both; }
@supports not selector(tr:has(> th)) {
  .table tbody tr { animation: rowIn .45s var(--ease) both; }
}
.table tbody tr:nth-of-type(1)  { animation-delay: .02s; }
.table tbody tr:nth-of-type(2)  { animation-delay: .05s; }
.table tbody tr:nth-of-type(3)  { animation-delay: .08s; }
.table tbody tr:nth-of-type(4)  { animation-delay: .11s; }
.table tbody tr:nth-of-type(5)  { animation-delay: .14s; }
.table tbody tr:nth-of-type(6)  { animation-delay: .17s; }
.table tbody tr:nth-of-type(7)  { animation-delay: .2s; }
.table tbody tr:nth-of-type(8)  { animation-delay: .23s; }
.table tbody tr:nth-of-type(9)  { animation-delay: .26s; }
.table tbody tr:nth-of-type(10) { animation-delay: .29s; }
.table tbody tr:nth-of-type(n+11) { animation-delay: .32s; }
.table tbody tr { transition: background .25s var(--ease), transform .3s var(--ease-spring); }
.table tbody tr:hover { background: var(--fill); transform: translateX(3px); }
.table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table tbody tr:hover th { color: var(--accent); }

/* --- 列表项错峰（用户列表 / 动态 / 公告 …） --- */
@keyframes listItemIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.stagger > * { animation: listItemIn .5s var(--ease-spring) both; }
.stagger > *:nth-child(1)  { animation-delay: .03s; }
.stagger > *:nth-child(2)  { animation-delay: .07s; }
.stagger > *:nth-child(3)  { animation-delay: .11s; }
.stagger > *:nth-child(4)  { animation-delay: .15s; }
.stagger > *:nth-child(5)  { animation-delay: .19s; }
.stagger > *:nth-child(6)  { animation-delay: .23s; }
.stagger > *:nth-child(7)  { animation-delay: .27s; }
.stagger > *:nth-child(8)  { animation-delay: .31s; }
.stagger > *:nth-child(9)  { animation-delay: .35s; }
.stagger > *:nth-child(10) { animation-delay: .39s; }
.stagger > *:nth-child(n+11) { animation-delay: .42s; }

/* --- 徽章 / 标签 弹入 --- */
@keyframes badgePop {
  0%   { opacity: 0; transform: scale(.4) rotate(-12deg); }
  60%  { opacity: 1; transform: scale(1.15) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.badge, .tag-info, .tag-success, .tag-warning, .tag-danger { animation: badgePop .45s var(--ease-spring) both; }

/* --- 统计卡：悬停光点跟随 --- */
.stat { position: relative; overflow: hidden; }
.stat::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 62%);
  opacity: 0; transition: opacity .35s var(--ease);
  pointer-events: none;
}
.stat:hover::after { opacity: 1; }
.stat:hover .stat-icon { transform: scale(1.18) rotate(-8deg) translateY(-3px); }
.stat .stat-icon { transition: transform .5s var(--ease-spring); }
.stat .value { transition: transform .35s var(--ease-spring); }
.stat:hover .value { transform: scale(1.04); }

/* --- 文本渐显（进入视口） --- */
.reveal { opacity: 0; transform: translateY(20px); }
.reveal.reveal-in {
  animation: revealIn .7s var(--ease-spring) forwards;
  animation-delay: var(--rd, 0s);
}
@keyframes revealIn {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- 输入框聚焦流光 --- */
input, textarea, select { position: relative; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 18px -4px var(--accent-soft) !important;
  animation: inputGlow .6s var(--ease-spring);
}
@keyframes inputGlow {
  0%   { box-shadow: 0 0 0 0 var(--accent-soft), 0 0 0 0 var(--accent-soft); }
  50%  { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0), 0 0 22px -2px var(--accent-soft); }
  100% { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 18px -4px var(--accent-soft); }
}

/* --- 开关拨动 + 光点 --- */
.switch .slider { transition: background .3s var(--ease); }
.switch input:checked + .slider { animation: switchOn .5s var(--ease-spring); }
@keyframes switchOn {
  0% { transform: scale(1); } 45% { transform: scale(1.14); } 100% { transform: scale(1); }
}

/* --- Toast：玻璃弹入 + 图标 --- */
#toast { will-change: transform, opacity; }

/* --- 模态：入场缩放 + 背景模糊推进 --- */
@keyframes backdropIn { from { opacity: 0; backdrop-filter: blur(0); } to { opacity: 1; backdrop-filter: blur(10px); } }
.modal-mask { animation: backdropIn .3s var(--ease) both; }

/* --- 分页按钮 --- */
.pager .btn { transition: transform .3s var(--ease-spring), box-shadow .3s; }
.pager .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -8px var(--accent-soft); }
.pager .btn:active { transform: scale(.9); }

/* --- 标签栏：切页时的滑动高亮 --- */
.tab { position: relative; transition: transform .35s var(--ease-spring), background .3s, color .25s, box-shadow .3s; }
.tab:hover { transform: translateY(-2px); }
.tab:active { transform: scale(.94); }
.tab.active { box-shadow: 0 6px 18px -8px var(--accent-soft); }
.tab.active::after {
  content: "";
  position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: edgeSweep 3s ease-in-out infinite;
}

/* --- 空状态：呼吸 --- */
.empty, .ico-empty { animation: breatheSoft 3.6s ease-in-out infinite; }
@keyframes breatheSoft { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }

/* --- 音乐播放器悬浮 --- */
.mp-toggle { transition: transform .4s var(--ease-spring), box-shadow .3s; }
.mp-toggle:hover { transform: scale(1.12) rotate(6deg); }

/* --- 数字滚动高亮 --- */
@keyframes numFlash {
  0%   { text-shadow: 0 0 0 transparent; }
  40%  { text-shadow: 0 0 18px var(--accent); }
  100% { text-shadow: 0 0 0 transparent; }
}
.flash { animation: numFlash .7s var(--ease); }

/* --- 通用：可点击元素磁吸倾斜（JS 加 .tilt） --- */
.tilt { transition: transform .28s var(--ease-spring); will-change: transform; }
.tilt-tilt { transform: perspective(700px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)) translateZ(6px); }

/* --- 页面切换出场 --- */
.content.content-out { animation: contentOut .2s var(--ease) both; }
@keyframes contentOut {
  to { opacity: 0; transform: translateY(-10px) scale(.99); }
}

/* --- 弹层打开时：背景后退 + 轻微失焦，制造景深 --- */
.layout, .topbar {
  transition: transform .45s var(--ease), filter .45s var(--ease);
}
body.modal-open .layout {
  transform: scale(.982) translateY(-4px);
  filter: blur(1.4px) saturate(.9);
}
body.modal-open .cursor-glow { opacity: 0 !important; }
.modal-mask, .theme-panel-mask { z-index: 300; }

/* --- 加载骨架微光 --- */
@keyframes skeletonShimmer { 0% { background-position: -320px 0; } 100% { background-position: 320px 0; } }

/* --- 尊重系统「减少动态效果」 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
/* --- 手动关闭动效（外观定制面板里可切换） --- */
[data-motion="off"] *,
[data-motion="off"] *::before,
[data-motion="off"] *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .08s !important;
}
[data-motion="off"] .cursor-glow,
[data-motion="off"] .ripple { display: none !important; }
