/* ======================================================== */
/* Lunvex Hub - 60FPS 极速稳定渲染引擎 (Zero GPU Drops)     */
/* ======================================================== */

/* 1. 工程师几何网格底座 */
body {
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(99, 102, 241, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
}

html.dark body {
  background-color: #07090E !important;
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* 顶部极光环境漫反射 (仅顶部一个图层) */
.apple-radial-light {
  background: radial-gradient(circle 800px at 50% -120px, rgba(99, 102, 241, 0.18), transparent 70%) !important;
  pointer-events: none;
}
.dark .apple-radial-light {
  background: radial-gradient(circle 900px at 50% -120px, rgba(99, 102, 241, 0.28), transparent 75%) !important;
}

/* 2. Raycast 聚光灯：原生高性能 CSS 渐变高光 (彻底移除 mask，0 掉帧 0 留白) */
.spotlight-card {
  position: relative;
  overflow: hidden;
  background-clip: padding-box;
}

.spotlight-card:hover {
  border-color: #818CF8 !important;
  box-shadow: 0 18px 40px -10px rgba(99, 102, 241, 0.30),
              0 0 0 1px rgba(129, 140, 248, 0.35) !important;
}

.dark .spotlight-card:hover {
  border-color: #818CF8 !important;
  box-shadow: 0 18px 44px -10px rgba(99, 102, 241, 0.45),
              0 0 22px -2px rgba(99, 102, 241, 0.45) !important;
}

/* 3. 卡片 hover 平滑上浮 */
.liquid-glass-card:hover {
  transform: translateY(-6px) !important;
}

/* 4. 全局鼠标流光光晕 - 轻量高性能图层 */
#global-mouse-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 620px;
  height: 620px;
  margin-top: -310px;
  margin-left: -310px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  will-change: transform;
}

body #global-mouse-glow {
  background: radial-gradient(circle 310px, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.09) 42%, transparent 72%);
}

html.dark #global-mouse-glow {
  background: radial-gradient(circle 310px, rgba(129, 140, 248, 0.28) 0%, rgba(139, 92, 246, 0.18) 44%, transparent 72%) !important;
  mix-blend-mode: screen;
}


/* ======================================================== */
/* 详情页长篇图文深度解析 - HTML 富文本排版 (Apple Pro Tier) */
/* ======================================================== */
.article-rich-text h3 {
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  margin-top: 1.8rem !important;
  margin-bottom: 0.8rem !important;
  letter-spacing: -0.015em !important;
}

.article-rich-text p {
  margin-bottom: 1rem !important;
  line-height: 1.75 !important;
  color: var(--text-secondary) !important;
}

.article-rich-text ul {
  list-style-type: disc !important;
  padding-left: 1.6rem !important;
  margin-bottom: 1.25rem !important;
}

.article-rich-text ol {
  list-style-type: decimal !important;
  padding-left: 1.6rem !important;
  margin-bottom: 1.25rem !important;
}

.article-rich-text li {
  margin-bottom: 0.5rem !important;
  line-height: 1.65 !important;
  color: var(--text-secondary) !important;
}

.article-rich-text strong {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}

.article-rich-text code {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.88em !important;
  padding: 0.2em 0.45em !important;
  border-radius: 6px !important;
  background: var(--spec-box-bg) !important;
  color: #6366F1 !important;
  border: 1px solid var(--card-border) !important;
}

.article-rich-text pre {
  background: var(--spec-box-bg) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: 14px !important;
  padding: 1rem 1.25rem !important;
  overflow-x: auto !important;
  margin: 1.2rem 0 !important;
}

.article-rich-text pre code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: #6366F1 !important;
}


/* ======================================================== */
/* 视觉增强层 (Cool Enhancements) — 仅 transform/opacity    */
/* 不新增 backdrop-filter 图层，避免滚动重绘白屏            */
/* ======================================================== */

/* 5. 卡片跟随鼠标聚光灯：JS 已写入 --mouse-x/--mouse-y */
.spotlight-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mouse-x, 50%) var(--mouse-y, 0%),
              rgba(255, 255, 255, 0.22), rgba(99, 102, 241, 0.10) 38%, transparent 66%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.spotlight-card:hover::after { opacity: 1; }
.dark .spotlight-card::after {
  background: radial-gradient(260px circle at var(--mouse-x, 50%) var(--mouse-y, 0%),
              rgba(165, 180, 252, 0.40), rgba(139, 92, 246, 0.18) 40%, transparent 68%);
}

/* 5b. 卡片 hover 斜向流光扫过 */
.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.22) 50%, transparent 68%);
  transform: translateX(-130%);
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}
.spotlight-card:hover::before { opacity: 1; transform: translateX(130%); }
.dark .spotlight-card::before {
  background: linear-gradient(115deg, transparent 32%, rgba(165, 180, 252, 0.28) 50%, transparent 68%);
}

/* 6. 顶部滚动进度条 */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 4px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #6366F1, #8B5CF6, #22D3EE);
  background-size: 200% 100%;
  z-index: 70;
  pointer-events: none;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.85), 0 0 4px rgba(34, 211, 238, 0.6);
  animation: progressShift 2.4s linear infinite;
}
@keyframes progressShift { to { background-position: 200% 0; } }

/* 7. 悬浮回到顶部按钮 */
#scroll-top {
  position: fixed;
  right: 1.25rem; bottom: 1.25rem;
  width: 46px; height: 46px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.25);
  color: #6366F1;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
  z-index: 70;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#scroll-top.show { opacity: 1; transform: translateY(0) scale(1); }
#scroll-top:hover { background: rgba(99, 102, 241, 0.12); }

/* 8. Hero 流动极光（3 个模糊光斑，缓慢漂移，置于文字下层） */
.hero-aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
  /* 底部垂直无缝羽化，彻底消除生硬的水平截断切线 */
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.85) 65%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.85) 65%, transparent 100%);
}
.hero-aurora span {
  position: absolute;
  width: 52vmax; height: 52vmax;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.48;
  background: radial-gradient(circle, var(--c), transparent 62%);
}
.hero-aurora .a1 {
  --c: rgba(99, 102, 241, 0.55);
  top: -22%; left: -14%;
  animation: aurora1 20s ease-in-out infinite alternate;
}
.hero-aurora .a2 {
  --c: rgba(139, 92, 246, 0.50);
  top: -14%; right: -16%;
  animation: aurora2 26s ease-in-out infinite alternate;
}
.hero-aurora .a3 {
  --c: rgba(34, 211, 238, 0.42);
  bottom: -28%; left: 28%;
  width: 44vmax; height: 44vmax;
  animation: aurora3 30s ease-in-out infinite alternate;
}
@keyframes aurora1 { to { transform: translate3d(14vmax, 8vmax, 0) scale(1.18); } }
@keyframes aurora2 { to { transform: translate3d(-12vmax, 10vmax, 0) scale(1.12); } }
@keyframes aurora3 { to { transform: translate3d(8vmax, -10vmax, 0) scale(1.2); } }

/* 9. 滚动渐入（卡片 / 区块）— 仅在 .js 启用时隐藏，安全回退可见 */
.js .resource-card,
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .resource-card.in-view,
.js [data-reveal].in-view {
  opacity: 1;
  transform: none;
}

/* 10. Hero 标题流动渐变文字 */
#hero-title {
  background: linear-gradient(100deg, #1D1D1F 0%, #6366F1 30%, #8B5CF6 45%, #22D3EE 60%, #1D1D1F 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: titleShift 6s linear infinite;
}
.dark #hero-title {
  background: linear-gradient(100deg, #F5F5F7 0%, #818CF8 30%, #C4B5FD 45%, #67E8F9 60%, #F5F5F7 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: titleShift 6s linear infinite;
  filter: drop-shadow(0 0 18px rgba(129, 140, 248, 0.35));
}
@keyframes titleShift { to { background-position: 220% center; } }

/* 11. 动效偏好：关闭时一切从简，内容立即可见 */
@media (prefers-reduced-motion: reduce) {
  .hero-aurora span { animation: none; }
  #hero-title { animation: none; background: none; color: var(--text-primary); -webkit-text-fill-color: var(--text-primary); }
  .js .resource-card,
  .js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}


/* 官方回到顶部悬浮胶囊：绝对 Fixed 悬浮，最高层级，平滑浮现 */
#lunvex-back-to-top {
  position: fixed !important;
  bottom: 28px !important;
  right: 28px !important;
  z-index: 999999 !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 9999px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  border: 1.5px solid rgba(99, 102, 241, 0.45) !important;
  background: #FFFFFF !important;
  color: #6366F1 !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 0 15px rgba(99, 102, 241, 0.25) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(16px) scale(0.92) !important;
  transition: opacity 0.25s ease, transform 0.25s ease !important;
}

html.dark #lunvex-back-to-top {
  background: #1C1C1E !important;
  border-color: rgba(129, 140, 248, 0.4) !important;
  color: #818CF8 !important;
  box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(99, 102, 241, 0.3) !important;
}

#lunvex-back-to-top.show {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

#lunvex-back-to-top:hover {
  transform: translateY(-2px) scale(1.08) !important;
  border-color: #6366F1 !important;
}

#lunvex-back-to-top:active {
  transform: scale(0.95) !important;
}
