/* ==========================================================================
   vidtext · design system
   零构建，无外链字体。深色底 + 克制的高光，动效走 GPU 属性。
   ========================================================================== */

:root {
  /* 表面 */
  --bg: #050508;
  --bg-2: #08080D;
  --panel: #0B0B12;
  --panel-2: #101017;

  /* 墨色 */
  --ink: #F4F4F7;
  --ink-2: #A3A3AE;
  --ink-3: #6E6E7B;
  --ink-4: #4A4A55;

  /* 线 */
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .14);
  --line-3: rgba(255, 255, 255, .22);

  /* 品牌 */
  --violet: #8B5CF6;
  --violet-2: #B49BFF;
  --cyan: #22D3EE;
  --pink: #F472B6;
  --green: #34D399;
  --amber: #FBBF24;
  --red: #F87171;

  /* 圆角 */
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;

  /* 字体 */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  /* 缓动 */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-2: cubic-bezier(.4, 0, .2, 1);

  /* 容器 */
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

/* `hidden` 必须真的隐藏。.card 之类设了 display:flex，作者样式优先级高于浏览器
   自带的 [hidden]{display:none}，于是 hidden 元素照样铺在页面上（控制台的两个
   区块一度同时可见）。这条把语义拉回来。 */
[hidden] { display: none !important; }


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

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.022em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
img, svg { display: block; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(139, 92, 246, .38); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); }

/* ---------------------------------------------------------------- 背景层 */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  will-change: transform;
  animation: drift 26s var(--ease-2) infinite alternate;
}

.bg .b1 {
  width: 620px; height: 620px;
  top: -280px; left: 4%;
  background: radial-gradient(circle, rgba(124, 58, 237, .55), transparent 68%);
  animation-duration: 30s;
}

.bg .b2 {
  width: 520px; height: 520px;
  top: -180px; right: 2%;
  background: radial-gradient(circle, rgba(8, 145, 178, .45), transparent 68%);
  animation-duration: 36s;
  animation-delay: -8s;
}

.bg .b3 {
  width: 760px; height: 760px;
  top: 620px; left: 32%;
  background: radial-gradient(circle, rgba(219, 39, 119, .22), transparent 70%);
  animation-duration: 42s;
  animation-delay: -16s;
  opacity: .8;
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(40px, 60px, 0) scale(1.12); }
  100% { transform: translate3d(-30px, 30px, 0) scale(.94); }
}

/* 顶部网格，向下淡出 */
.bg .grid {
  position: absolute;
  inset: 0 0 auto;
  height: 900px;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 72% 62% at 50% 0%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse 72% 62% at 50% 0%, #000 10%, transparent 72%);
}

/* 颗粒感。没有这一层，深色渐变会显得很"塑料" */
.bg .noise {
  position: absolute;
  inset: 0;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.page { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- 布局 */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

.wrap-narrow { max-width: 760px; }

/* ---------------------------------------------------------------- 排版 */

.h1 {
  font-size: clamp(40px, 6.2vw, 76px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.035em;
}

.h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -.03em;
}

.h3 { font-size: 19px; font-weight: 600; letter-spacing: -.015em; }

.lede {
  font-size: clamp(15px, 1.5vw, 17.5px);
  color: var(--ink-2);
  line-height: 1.7;
}

.grad {
  background: linear-gradient(112deg, #FFFFFF 8%, var(--violet-2) 46%, var(--cyan) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.mono { font-family: var(--mono); }

/* 行内代码。之前没写这条，<code>source</code> 退化成一模一样的正文字，
   前后空格被吃掉，读起来就成了 "returns.source,quality" 这种错字。 */
code {
  font-family: var(--mono);
  font-size: .9em;
  padding: 1.5px 6px;
  margin: 0 1px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line-2);
  color: var(--ink);
  white-space: nowrap;
}

/* 中文没有单词边界，浏览器会在任意字之间断行，"占便/宜" 这种断法很难看。
   在宽屏用强制断行把断点推到标点处，窄屏交还给自动换行。 */
@media (max-width: 900px) { .br-wide { display: none; } }

/* ---------------------------------------------------------------- 徽标条 */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .03);
  font-size: 12.5px;
  color: var(--ink-2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pill .dot-live {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  animation: ping 2.4s var(--ease-2) infinite;
}

@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------------------------------------------------------------- 按钮 */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.005em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s var(--ease), background .18s, box-shadow .28s, border-color .18s, color .18s;
}

.btn:active { transform: scale(.975); }

.btn-primary {
  background: #FFFFFF;
  color: #07070C;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .9),
    0 10px 34px -12px rgba(139, 92, 246, .8),
    0 2px 10px -4px rgba(0, 0, 0, .6);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px #fff,
    0 16px 44px -12px rgba(139, 92, 246, .95),
    0 2px 12px -4px rgba(0, 0, 0, .7);
}

.btn-ghost {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-2);
  color: var(--ink);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, .08);
  border-color: var(--line-3);
  transform: translateY(-1px);
}

.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 15px; border-radius: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* 渐变描边按钮，用于次级强调 */
.btn-glow {
  background: linear-gradient(180deg, rgba(139, 92, 246, .22), rgba(34, 211, 238, .1));
  border: 1px solid rgba(180, 155, 255, .38);
  color: #EFE9FF;
}
.btn-glow:hover {
  border-color: rgba(180, 155, 255, .7);
  box-shadow: 0 0 28px -6px rgba(139, 92, 246, .55);
  transform: translateY(-1px);
}

/* ---------------------------------------------------------------- 玻璃卡 */

.glass {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .018));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* 顶边高光：一条 1px 的渐变，是这类卡片"贵"的关键 */
.glass::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .32), transparent);
  pointer-events: none;
}

/* 鼠标跟随光斑，由 ui.js 写入 --mx / --my */
.spot::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(
    380px circle at var(--mx, 50%) var(--my, 50%),
    rgba(139, 92, 246, .16),
    transparent 62%
  );
  opacity: 0;
  transition: opacity .4s var(--ease-2);
  pointer-events: none;
}

.spot:hover::after { opacity: 1; }

/* ---------------------------------------------------------------- 导航 */

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}

.nav.stuck {
  background: rgba(5, 5, 8, .72);
  border-bottom-color: var(--line);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
}

.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
}

/* 字标：上白下灰的微渐变比纯白更"立"。
   padding-right 是为了补负字距，否则最后一个字母会被裁掉半像素 */
.wordmark {
  padding-right: 2px;
  background: linear-gradient(180deg, #fff 25%, #B4B4C6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 不支持 background-clip: text 的环境（含部分高对比度模式）退回纯色，
   否则文字会变成透明——那才是最惨的失败形态 */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .wordmark { background: none; color: var(--ink); }
}

.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--violet), #4C1D95 60%, var(--cyan));
  box-shadow: 0 0 18px -4px rgba(139, 92, 246, .8), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.brand-mark svg { width: 15px; height: 15px; }

/* 页脚品牌降一档，避免和导航抢注意力 */
.foot-col .brand { font-size: 19px; gap: 10px; }
.foot-col .brand-mark { width: 27px; height: 27px; border-radius: 8px; }
.foot-col .brand-mark svg { width: 13px; height: 13px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.nav-links a { transition: color .16s; }
.nav-links a:hover { color: var(--ink); }

.nav-right { display: flex; align-items: center; gap: 12px; }

/* ---------------------------------------------------------------- 页脚 */

.foot {
  border-top: 1px solid var(--line);
  margin-top: 100px;
  padding: 48px 0 40px;
  color: var(--ink-3);
  font-size: 13px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 40px;
}

.foot-col h4 {
  font-size: 11.5px;
  font-family: var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 14px;
  font-weight: 500;
}

.foot-col li { margin-bottom: 9px; }
.foot-col a:hover { color: var(--ink-2); }

.foot-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-4);
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- 入场动画 */

/* 只有确认 JS 活着才隐藏，否则 JS 挂了整页会变成空白 */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity .85s var(--ease) var(--d, 0s),
    transform .85s var(--ease) var(--d, 0s);
}

.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- 通用小件 */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.tag {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(139, 92, 246, .12);
  border: 1px solid rgba(139, 92, 246, .22);
  color: #C9B8FF;
  margin: 3px 4px 3px 0;
}

.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hr {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
  border: 0;
  margin: 0;
}

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 900px) {
  .nav-links { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .foot-grid { grid-template-columns: 1fr; }
  .btn { height: 40px; }
  /* 小屏留给品牌的空间有限，字标降一档但仍明显大于正文字号 */
  .brand { font-size: 19px; gap: 9px; }
  .brand-mark { width: 27px; height: 27px; border-radius: 8px; }
  .brand-mark svg { width: 13px; height: 13px; }
}

/* 尊重系统的减弱动效设置。这一条不做，会有一批用户直接关掉页面 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
