/* ============================================================
 * QVMConsole 官网 - 基础样式
 * reset / 排版 / 按钮 / 通用组件 / 滚动条 / 加载屏 / 光标光晕
 * ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, textarea, select { font-family: inherit; }
::selection { background: rgba(56, 189, 248, .28); color: var(--ink-1); }

/* 细滚动条，贴合通透风格 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(56, 189, 248, .45), rgba(139, 92, 246, .45));
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(56, 189, 248, .7), rgba(139, 92, 246, .7)); }

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

/* ---------- 布局容器 ---------- */
.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}
.section { position: relative; padding: 110px 0; }
.section-soft {
  background:
    radial-gradient(900px 480px at 12% 0%, rgba(45, 212, 191, .07), transparent 60%),
    radial-gradient(900px 520px at 88% 100%, rgba(139, 92, 246, .07), transparent 60%),
    var(--bg-soft);
}

/* ---------- 通用文字 ---------- */
.grad-text {
  background: var(--qvm-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mono { font-family: var(--font-mono); }

/* ---------- 区块标题 ---------- */
.section-header { max-width: 720px; margin: 0 auto 64px; text-align: center; }
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.section-tag::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--qvm-grad);
  box-shadow: 0 0 10px rgba(56, 189, 248, .8);
  animation: tagPulse 2.4s ease-in-out infinite;
}
@keyframes tagPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: .6; }
}
.section-title {
  margin-top: 18px;
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
}
.section-title .u-line { position: relative; white-space: nowrap; }
.section-title .u-line::after {
  content: "";
  position: absolute;
  left: 0; bottom: 4px;
  width: 100%; height: 10px;
  border-radius: 6px;
  background: var(--qvm-grad-soft);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .9s var(--ease-out) .25s;
}
.section-header.in-view .u-line::after { transform: scaleX(1); }
.section-subtitle { margin-top: 16px; font-size: 16.5px; color: var(--ink-3); }

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: transform .35s var(--ease-spring), box-shadow .35s ease, background .35s ease, color .35s ease, border-color .35s ease;
  will-change: transform;
  overflow: hidden;
}
.btn i { transition: transform .35s var(--ease-spring); }
.btn:hover i { transform: translateX(3px); }
.btn-lg { padding: 16px 36px; font-size: 16px; }

.btn-primary {
  color: #fff;
  background: var(--qvm-grad);
  background-size: 160% 160%;
  box-shadow: 0 10px 28px -8px rgba(56, 189, 248, .55), 0 4px 12px -4px rgba(139, 92, 246, .4);
}
.btn-primary::after {
  /* 流光扫过 */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .5) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform .8s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -8px rgba(56, 189, 248, .65), 0 6px 18px -4px rgba(139, 92, 246, .5); }
.btn-primary:hover::after { transform: translateX(120%); }

.btn-outline {
  color: var(--ink-1);
  background: var(--card);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover { transform: translateY(-2px); border-color: rgba(56, 189, 248, .6); box-shadow: var(--shadow-glow); }

/* ---------- 玻璃卡片 ---------- */
.glass {
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}

/* ---------- 截图框 + 缺图占位 ---------- */
.shot-frame {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card-solid);
  box-shadow: var(--shadow-lg);
}
/* 截图按原始宽高比完整展示，不裁切、不拉伸；容器高度由图片自然撑开 */
.shot-frame img { display: block; width: 100%; height: auto; }
/* 图片缺失时的占位（JS 检测后添加 .is-empty，隐藏 img 显示占位） */
.shot-frame.is-empty img { display: none; }
.shot-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 32px;
  background:
    radial-gradient(420px 240px at 20% 20%, rgba(45, 212, 191, .14), transparent 65%),
    radial-gradient(420px 260px at 80% 75%, rgba(139, 92, 246, .14), transparent 65%),
    repeating-linear-gradient(45deg, rgba(12, 20, 37, .025) 0 12px, transparent 12px 24px),
    var(--bg-soft);
}
.shot-frame.is-empty .shot-placeholder { display: flex; }
.shot-placeholder .ph-icon {
  width: 64px; height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 26px;
  color: #fff;
  background: var(--qvm-grad);
  box-shadow: var(--shadow-glow);
  animation: phFloat 3.2s ease-in-out infinite;
}
@keyframes phFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.shot-placeholder .ph-title { font-size: 16px; font-weight: 700; color: var(--ink-2); }
.shot-placeholder .ph-path {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-3);
  background: rgba(255, 255, 255, .7);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 5px 12px;
}

/* ---------- 页面加载屏 ---------- */
#pageLoader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: var(--bg);
  transition: opacity .6s ease, visibility .6s ease;
}
#pageLoader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-mark { position: relative; width: 92px; height: 92px; }
.loader-mark img { width: 100%; height: 100%; object-fit: contain; animation: loaderBreath 1.6s ease-in-out infinite; }
.loader-mark::before, .loader-mark::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--qvm-blue);
  border-right-color: var(--qvm-violet);
  animation: loaderSpin 1.2s linear infinite;
}
.loader-mark::after {
  inset: -26px;
  border-top-color: var(--qvm-teal);
  border-right-color: transparent;
  animation-duration: 2s;
  animation-direction: reverse;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }
@keyframes loaderBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(.92); } }
.loader-bar {
  width: 180px; height: 4px;
  border-radius: 4px;
  background: var(--bg-deep);
  overflow: hidden;
}
.loader-bar i {
  display: block;
  width: 40%; height: 100%;
  border-radius: 4px;
  background: var(--qvm-grad);
  animation: loaderSlide 1.1s var(--ease-in-out) infinite;
}
@keyframes loaderSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(460%); }
}
.loader-text { font-size: 13px; letter-spacing: .3em; color: var(--ink-3); text-indent: .3em; }

/* ---------- 光标光晕（仅精确指针设备启用） ---------- */
#cursorGlow {
  position: fixed;
  left: 0; top: 0;
  width: 520px; height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(56, 189, 248, .10) 0%, rgba(139, 92, 246, .07) 38%, transparent 68%);
  opacity: 0;
  transition: opacity .5s ease;
}
@media (pointer: fine) { #cursorGlow.on { opacity: 1; } }

/* ---------- 通用滚动入场（无 GSAP 时的兜底也可见） ---------- */
[data-reveal] { opacity: 0; transform: translateY(34px); }
.no-motion [data-reveal], [data-reveal].revealed { opacity: 1; transform: none; }

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