/* ============================================================
   二次元轻 3D 氛围 · 全站 User_Syz（卡片层次、渐变天幕、侧栏景深）
   ============================================================ */

:root {
  --anime-3d-lift: 0 22px 44px rgba(99, 102, 241, 0.14),
    0 8px 16px rgba(15, 23, 42, 0.07),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset;
  --anime-3d-card-hover: 0 28px 56px rgba(236, 72, 153, 0.12),
    0 12px 28px rgba(99, 102, 241, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

/* 固定渐变天幕（不挡操作：z-index 最底层） */
body {
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 130% 90% at 8% -15%, rgba(167, 139, 250, 0.28), transparent 48%),
    radial-gradient(ellipse 110% 80% at 92% 5%, rgba(244, 114, 182, 0.22), transparent 46%),
    radial-gradient(ellipse 90% 55% at 50% 105%, rgba(56, 189, 248, 0.14), transparent 52%),
    radial-gradient(circle at 20% 60%, rgba(253, 224, 71, 0.06), transparent 35%);
  background-attachment: fixed;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse 130% 90% at 8% -15%, rgba(139, 92, 246, 0.32), transparent 48%),
    radial-gradient(ellipse 110% 80% at 92% 5%, rgba(236, 72, 153, 0.18), transparent 46%),
    radial-gradient(ellipse 90% 55% at 50% 105%, rgba(14, 165, 233, 0.1), transparent 52%),
    radial-gradient(circle at 75% 40%, rgba(244, 114, 182, 0.08), transparent 32%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.07) 0%, transparent 28%),
    radial-gradient(circle at 85% 70%, rgba(255, 182, 193, 0.06) 0%, transparent 30%);
  animation: animeSkyDrift 22s ease-in-out infinite alternate;
  opacity: 0.85;
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(167, 139, 250, 0.08) 0%, transparent 30%),
    radial-gradient(circle at 80% 65%, rgba(236, 72, 153, 0.06) 0%, transparent 28%);
  opacity: 1;
}

@keyframes animeSkyDrift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2%, 1%) scale(1.03); }
}

/* 仅保留定位锚点；勿加 z-index，否则会生成层叠上下文，trap 住内部的 fixed 弹窗，
   导致整块主内容区（含遮罩）永远压在侧栏 z-index 之下，导航/侧栏盖在遮罩上 */
.main-wrapper {
  position: relative;
}

/* 侧栏 / 顶栏：分层阴影模拟厚度 */
.sidebar {
  box-shadow:
    6px 0 32px rgba(99, 102, 241, 0.1),
    2px 0 0 rgba(255, 255, 255, 0.45) inset;
}

[data-theme="dark"] .sidebar {
  box-shadow:
    8px 0 40px rgba(0, 0, 0, 0.45),
    1px 0 0 rgba(167, 139, 250, 0.12) inset;
}

.topbar {
  box-shadow:
    0 10px 36px rgba(15, 23, 42, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

[data-theme="dark"] .topbar {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

/* 内容卡片：微 3D 抬起 + 内高光 */
.card,
.stat-card {
  transform: translateZ(0);
  transition:
    transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1),
    box-shadow 0.38s ease,
    border-color 0.25s ease;
  box-shadow: var(--shadow-sm), 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.card:hover,
.stat-card:hover {
  transform: translateY(-6px) scale(1.012);
  box-shadow: var(--anime-3d-lift);
  border-color: rgba(167, 139, 250, 0.28);
}

.page-header-card {
  transition:
    transform 0.35s cubic-bezier(0.34, 1.45, 0.64, 1),
    box-shadow 0.35s ease;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.12), 0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.page-header-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(168, 85, 247, 0.2), 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.page-header-icon-bg {
  box-shadow:
    0 4px 14px rgba(168, 85, 247, 0.35),
    0 2px 0 rgba(255, 255, 255, 0.35) inset;
}

/* 个人中心（样式在 user-center.css 中定义，此处叠轻 3D，故 ZeroHead 中 anime-3d 需排在 user-center 之后） */
.profile-avatar-card,
.profile-quick-stats,
.profile-nav,
.profile-section,
.profile-log-wrapper {
  transform: translateZ(0);
  transition:
    transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1),
    box-shadow 0.38s ease,
    border-color 0.25s ease;
}

.profile-avatar-card:hover,
.profile-quick-stats:hover,
.profile-section:hover,
.profile-log-wrapper:hover {
  transform: translateY(-6px) scale(1.012);
  box-shadow: var(--anime-3d-lift);
  border-color: rgba(236, 72, 153, 0.24);
}

.profile-nav:hover {
  transform: translateY(-4px) scale(1.006);
  box-shadow: var(--anime-3d-lift);
  border-color: rgba(167, 139, 250, 0.26);
}

/* 账号绑定 / 安全设置等列表行：与整块 profile-section 同风格的轻放大（幅度略小于外框卡片） */
.profile-setting-item {
  transform: translateZ(0);
  transition:
    transform 0.32s cubic-bezier(0.34, 1.45, 0.64, 1),
    box-shadow 0.32s ease,
    background 0.25s ease;
}

.profile-setting-item:hover {
  transform: translateY(-3px) scale(1.006);
  box-shadow:
    0 12px 28px rgba(99, 102, 241, 0.1),
    0 4px 10px rgba(15, 23, 42, 0.06);
}

/* ============================================================
   用户中心各页卡片：与 profile-section（含「账号绑定」所在区块）同款微抬起 + 轻放大
   使用 .main-wrapper 限定在用户中心骨架内，避免影响后台与其它页面
   ============================================================ */

.main-wrapper .record-card,
.main-wrapper .domain-stat-card,
.main-wrapper .domain-panel,
.main-wrapper .record-panel,
.main-wrapper .purchase-domain-card,
.main-wrapper .details-stat-card,
.main-wrapper .details-card,
.main-wrapper .recharge-card,
.main-wrapper .dash-stat-card,
.main-wrapper .chart-panel,
.main-wrapper .announcement-panel,
.main-wrapper .record-type-item,
.main-wrapper .welcome-banner,
.main-wrapper .domain-item,
.main-wrapper .notification-item,
.main-wrapper .empty-state {
  transform: translateZ(0);
  transition:
    transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1),
    box-shadow 0.38s ease,
    border-color 0.25s ease;
}

.main-wrapper .record-card:hover,
.main-wrapper .domain-stat-card:hover,
.main-wrapper .domain-panel:hover,
.main-wrapper .record-panel:hover,
.main-wrapper .purchase-domain-card:hover,
.main-wrapper .details-stat-card:hover,
.main-wrapper .details-card:hover,
.main-wrapper .recharge-card:hover,
.main-wrapper .dash-stat-card:hover,
.main-wrapper .chart-panel:hover,
.main-wrapper .announcement-panel:hover,
.main-wrapper .record-type-item:hover,
.main-wrapper .welcome-banner:hover,
.main-wrapper .domain-item:hover,
.main-wrapper .notification-item:hover,
.main-wrapper .empty-state:hover {
  transform: translateY(-6px) scale(1.012);
  box-shadow: var(--anime-3d-lift);
  border-color: rgba(167, 139, 250, 0.28);
}

[data-theme="dark"] .main-wrapper .record-card:hover,
[data-theme="dark"] .main-wrapper .domain-stat-card:hover,
[data-theme="dark"] .main-wrapper .domain-panel:hover,
[data-theme="dark"] .main-wrapper .record-panel:hover,
[data-theme="dark"] .main-wrapper .purchase-domain-card:hover,
[data-theme="dark"] .main-wrapper .details-stat-card:hover,
[data-theme="dark"] .main-wrapper .details-card:hover,
[data-theme="dark"] .main-wrapper .recharge-card:hover,
[data-theme="dark"] .main-wrapper .dash-stat-card:hover,
[data-theme="dark"] .main-wrapper .chart-panel:hover,
[data-theme="dark"] .main-wrapper .announcement-panel:hover,
[data-theme="dark"] .main-wrapper .record-type-item:hover,
[data-theme="dark"] .main-wrapper .welcome-banner:hover,
[data-theme="dark"] .main-wrapper .domain-item:hover,
[data-theme="dark"] .main-wrapper .notification-item:hover,
[data-theme="dark"] .main-wrapper .empty-state:hover {
  border-color: rgba(236, 72, 153, 0.26);
}

/* 登录注册页：玻璃卡片悬浮感 */
.auth-page .auth-card {
  transform: translateZ(0);
  transition:
    transform 0.4s cubic-bezier(0.34, 1.45, 0.64, 1),
    box-shadow 0.4s ease;
  box-shadow:
    var(--auth-card-shadow, 0 20px 25px rgba(0, 0, 0, 0.15)),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.auth-page .auth-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow:
    var(--auth-card-hover-shadow, 0 25px 35px rgba(0, 0, 0, 0.18)),
    0 0 0 1px rgba(167, 139, 250, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.55) inset;
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }

  .card:hover,
  .stat-card:hover,
  .page-header-card:hover,
  .auth-page .auth-card:hover,
  .profile-avatar-card:hover,
  .profile-quick-stats:hover,
  .profile-nav:hover,
  .profile-section:hover,
  .profile-log-wrapper:hover,
  .profile-setting-item:hover {
    transform: none;
  }

  .main-wrapper .record-card:hover,
  .main-wrapper .domain-stat-card:hover,
  .main-wrapper .domain-panel:hover,
  .main-wrapper .record-panel:hover,
  .main-wrapper .purchase-domain-card:hover,
  .main-wrapper .details-stat-card:hover,
  .main-wrapper .details-card:hover,
  .main-wrapper .recharge-card:hover,
  .main-wrapper .dash-stat-card:hover,
  .main-wrapper .chart-panel:hover,
  .main-wrapper .announcement-panel:hover,
  .main-wrapper .record-type-item:hover,
  .main-wrapper .welcome-banner:hover,
  .main-wrapper .domain-item:hover,
  .main-wrapper .notification-item:hover,
  .main-wrapper .empty-state:hover {
    transform: none;
  }
}

/* 登录/注册页：在原有渐变上叠一层二次元光晕（加载于 login.css 之后） */
body.auth-page {
  background:
    radial-gradient(ellipse 120% 75% at 6% 8%, rgba(167, 139, 250, 0.26), transparent 48%),
    radial-gradient(ellipse 100% 65% at 94% 92%, rgba(244, 114, 182, 0.2), transparent 46%),
    radial-gradient(circle at 50% 50%, rgba(253, 224, 71, 0.06), transparent 42%),
    var(--auth-bg);
  background-attachment: fixed;
}
