/* ============================================================
   V8娱乐 · 设计系统「云栖绘卷 CLOUDWEAVE」
   第一层：令牌 / 重置 / 基础排版 / 通用工具
   浅雾紫底 + 织带渐变 + 宋体大标题；所有变量以 --cw- 起首
   ============================================================ */

:root {
  color-scheme: light;

  /* 纸面与雾气 */
  --cw-mist: #f8f4fc;
  --cw-mist-2: #f1eaf9;
  --cw-cloud: #fffdfb;
  --cw-veil: rgba(255, 253, 251, 0.72);

  /* 墨色梯度 */
  --cw-ink: #1c1630;
  --cw-ink-2: #322a4b;
  --cw-muted: #6b6385;
  --cw-faint: #9b94b2;

  /* 主色：灵犀紫 / 桃夭橙 / 青鸾绿 / 金乌黄 */
  --cw-iris: #6c4ff2;
  --cw-iris-2: #9a7cff;
  --cw-iris-deep: #4a2fc4;
  --cw-peach: #ff8a5c;
  --cw-peach-2: #ffb08a;
  --cw-jade: #2fbfa0;
  --cw-gold: #e0ac3c;

  /* 渐变与光晕 */
  --cw-grad: linear-gradient(112deg, #6c4ff2 0%, #9a7cff 44%, #ff8a5c 100%);
  --cw-grad-soft: linear-gradient(140deg, rgba(108, 79, 242, 0.14), rgba(255, 138, 92, 0.12) 60%, rgba(47, 191, 160, 0.12));
  --cw-grad-ink: linear-gradient(150deg, #241b3d 0%, #1c1630 52%, #2a1f45 100%);

  /* 线条 / 阴影 */
  --cw-line: rgba(28, 22, 48, 0.12);
  --cw-line-2: rgba(28, 22, 48, 0.22);
  --cw-line-soft: rgba(28, 22, 48, 0.07);
  --cw-shadow: 0 30px 70px -34px rgba(48, 33, 102, 0.5);
  --cw-shadow-sm: 0 14px 34px -20px rgba(48, 33, 102, 0.42);
  --cw-shadow-xs: 0 6px 18px -12px rgba(48, 33, 102, 0.4);

  /* 圆角 */
  --cw-r-xl: 34px;
  --cw-r-lg: 24px;
  --cw-r-md: 16px;
  --cw-r-sm: 10px;
  --cw-r-pill: 999px;

  /* 栅格 */
  --cw-wrap: 1200px;
  --cw-gutter: clamp(18px, 4vw, 40px);

  /* 字体 */
  --cw-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --cw-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cw-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  /* 动效 */
  --cw-ease: cubic-bezier(0.22, 0.72, 0.18, 1);
  --cw-dur: 0.46s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--cw-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--cw-ink);
  background:
    radial-gradient(920px 520px at 6% -8%, rgba(154, 124, 255, 0.26), transparent 64%),
    radial-gradient(780px 460px at 98% 2%, rgba(255, 138, 92, 0.16), transparent 62%),
    radial-gradient(940px 720px at 52% 112%, rgba(47, 191, 160, 0.16), transparent 64%),
    var(--cw-mist);
  background-attachment: fixed;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(28, 22, 48, 0.14) 1px, transparent 1.5px);
  background-size: 26px 26px;
  opacity: 0.22;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 10%, #000 30%, transparent 86%);
  mask-image: radial-gradient(120% 90% at 50% 10%, #000 30%, transparent 86%);
}

.cw-head,
main,
.cw-foot {
  position: relative;
  z-index: 1;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  font-family: var(--cw-serif);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
}

h3 {
  font-size: clamp(1.15rem, 1.8vw, 1.42rem);
  line-height: 1.34;
}

h4 {
  font-size: 1.02rem;
  font-family: var(--cw-sans);
  font-weight: 700;
}

::selection {
  background: rgba(108, 79, 242, 0.22);
  color: var(--cw-ink);
}

:focus-visible {
  outline: 2px solid var(--cw-iris);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 通用布局工具 ---------------------------------------------------- */
.cw-wrap {
  width: 100%;
  max-width: var(--cw-wrap);
  margin-inline: auto;
  padding-inline: var(--cw-gutter);
}

.cw-wrap--narrow {
  max-width: 880px;
}

.cw-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.cw-skip {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--cw-r-pill);
  background: var(--cw-ink);
  color: #fff;
  font-size: 14px;
  transition: top 0.2s linear;
}

.cw-skip:focus {
  top: 14px;
}

.cw-grad {
  background: var(--cw-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.cw-mono {
  font-family: var(--cw-mono);
  font-size: 0.86em;
  letter-spacing: 0.04em;
}

.cw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  font-family: var(--cw-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cw-iris-deep);
}

.cw-eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.cw-lead {
  max-width: 62ch;
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  color: var(--cw-muted);
}

.cw-note {
  font-size: 13px;
  color: var(--cw-faint);
}

/* 入场动效（仅在 JS 就绪时生效，避免脚本失败导致正文不可见） */
html.cw-js [data-cw-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.72s var(--cw-ease), transform 0.72s var(--cw-ease);
  transition-delay: var(--cw-delay, 0ms);
}

html.cw-js [data-cw-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  html.cw-js [data-cw-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
