/* ==========================================================================
   神罚 · liquid glass design system
   base.css — tokens / reset / ambient / glass / chips / controls
   ========================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
  /* surface */
  --bg-top: #f8f9fc;
  --bg: #eef1f7;
  --bg-bottom: #e5e9f2;

  /* ink */
  --ink: #0d1220;
  --ink-2: #404a61;
  --ink-3: #79829a;
  --ink-4: #a8afc1;

  /* light */
  --iris: #6d5cff;
  --mint: #2fd0b9;
  --rose: #ff9dbf;
  --amber: #ffc978;

  /* glass */
  --line: rgba(255, 255, 255, 0.78);
  --line-soft: rgba(255, 255, 255, 0.42);
  --glass-1: rgba(255, 255, 255, 0.52);
  --glass-2: rgba(255, 255, 255, 0.2);
  --glass-3: rgba(255, 255, 255, 0.12);
  --tint: rgba(255, 255, 255, 0.28);

  /* shape */
  --r-xl: 36px;
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --r-pill: 999px;

  /* rhythm — the whole point: room to breathe */
  --gutter: clamp(18px, 4.6vw, 56px);
  --gap: clamp(14px, 2.2vw, 26px);
  --section: clamp(68px, 9vw, 132px);

  /* depth */
  --shadow-soft: 0 30px 70px -38px rgba(17, 25, 54, 0.42);
  --shadow-lift: 0 46px 100px -44px rgba(17, 25, 54, 0.5);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

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

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  color-scheme: light;
  background-color: #f2f5fb;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: #e7ebf6;
  background-image:
    radial-gradient(120% 80% at 6% 0%, #e9efff 0%, rgba(233, 239, 255, 0) 58%),
    radial-gradient(95% 70% at 100% 8%, #e4fbf5 0%, rgba(228, 251, 245, 0) 55%),
    radial-gradient(110% 80% at 50% 100%, #f8e9f2 0%, rgba(248, 233, 242, 0) 62%),
    linear-gradient(175deg, #f3f6fd 0%, #e9edf8 46%, #e5eaf4 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, figure, blockquote {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(109, 92, 255, 0.22);
}

:focus-visible {
  outline: 2px solid rgba(109, 92, 255, 0.55);
  outline-offset: 3px;
  border-radius: 8px;
}

/* 手机上点按不要出现蓝色高亮/方框 */
@media (hover: none) {
  a,
  button,
  input,
  select,
  textarea,
  [tabindex] {
    -webkit-tap-highlight-color: transparent;
  }

  a:focus,
  button:focus,
  input:focus,
  select:focus,
  textarea:focus,
  a:focus-visible,
  button:focus-visible {
    outline: none;
    box-shadow: none;
  }
}

/* -------------------------------------------------------------- ambient */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: #eef1f7;
  background-image:
    radial-gradient(120% 80% at 6% 0%, #e9efff 0%, rgba(233, 239, 255, 0) 58%),
    radial-gradient(95% 70% at 100% 8%, #e4fbf5 0%, rgba(228, 251, 245, 0) 55%),
    radial-gradient(110% 80% at 50% 100%, #f8e9f2 0%, rgba(248, 233, 242, 0) 62%),
    linear-gradient(175deg, #f3f6fd 0%, #e9edf8 46%, #e5eaf4 100%);
}

.ambient__blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: 0.78;
  will-change: transform;
  animation: drift 30s var(--ease) infinite alternate;
}

.ambient__blob.b1 {
  width: 48vw;
  height: 48vw;
  min-width: 360px;
  min-height: 360px;
  top: -12vw;
  left: -8vw;
  background: radial-gradient(circle at 35% 35%, #7d95ff 0%, rgba(125, 149, 255, 0) 68%);
}

.ambient__blob.b2 {
  width: 42vw;
  height: 42vw;
  min-width: 320px;
  min-height: 320px;
  top: 22vh;
  right: -12vw;
  background: radial-gradient(circle at 50% 40%, #58e7d2 0%, rgba(88, 231, 210, 0) 66%);
  animation-duration: 32s;
  animation-delay: -6s;
}

.ambient__blob.b3 {
  width: 40vw;
  height: 40vw;
  min-width: 300px;
  min-height: 300px;
  bottom: -14vw;
  left: 16vw;
  background: radial-gradient(circle at 45% 45%, #ffa3c9 0%, rgba(255, 163, 201, 0) 64%);
  animation-duration: 38s;
  animation-delay: -14s;
}

.ambient__blob.b4 {
  width: 30vw;
  height: 30vw;
  min-width: 240px;
  min-height: 240px;
  top: 6vh;
  left: 44vw;
  background: radial-gradient(circle at 50% 50%, #ffcb84 0%, rgba(255, 203, 132, 0) 66%);
  opacity: 0.55;
  animation-duration: 44s;
  animation-delay: -20s;
}

/* frosted grain — keeps the glass from looking like flat plastic */
.ambient__grain {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.ambient__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 55%);
}

/* ------------------------------------------------------- interactive bg */
/* 斜向光带：随指针轻微位移 */
.ambient__rays {
  position: absolute;
  inset: -25%;
  opacity: 0.42;
  background: repeating-linear-gradient(
    118deg,
    rgba(255, 255, 255, 0.6) 0 1.5px,
    rgba(255, 255, 255, 0) 1.5px 82px
  );
  transform: translate3d(calc(var(--px, 0) * 16px), calc(var(--py, 0) * 16px), 0);
  transition: transform 0.6s var(--ease);
  will-change: transform;
  -webkit-mask-image: radial-gradient(78% 68% at 50% 42%, #000 18%, transparent 76%);
  mask-image: radial-gradient(78% 68% at 50% 42%, #000 18%, transparent 76%);
}

/* 细点阵：玻璃背后被折射时最容易看出来 */
.ambient__grid {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image: radial-gradient(rgba(23, 32, 60, 0.16) 1px, rgba(23, 32, 60, 0) 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(120% 110% at 50% 42%, #000 45%, transparent 92%);
  mask-image: radial-gradient(120% 110% at 50% 42%, #000 45%, transparent 92%);
}

/* 散景光点：从玻璃后面经过时会被折射拉弯 */
.ambient__bokeh {
  position: absolute;
  inset: 0;
}

.ambient__bokeh i {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: 0.45;
  will-change: transform;
  background: radial-gradient(
    circle at 40% 38%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(198, 212, 255, 0.6) 42%,
    rgba(198, 212, 255, 0) 72%
  );
  animation: floaty 19s ease-in-out infinite alternate;
}

.ambient__bokeh i:nth-child(1) { width: 130px; height: 130px; left: 12%; top: 22%; }
.ambient__bokeh i:nth-child(2) { width: 74px; height: 74px; left: 68%; top: 16%; animation-delay: -4s; }
.ambient__bokeh i:nth-child(3) { width: 96px; height: 96px; left: 46%; top: 44%; animation-delay: -8s; }
.ambient__bokeh i:nth-child(4) { width: 58px; height: 58px; left: 82%; top: 58%; animation-delay: -12s; }
.ambient__bokeh i:nth-child(5) { width: 110px; height: 110px; left: 24%; top: 72%; animation-delay: -16s; }

@keyframes floaty {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(26px, -20px, 0) scale(1.08); }
}

/* 指针柔光，跟随鼠标缓慢滑动 */
.ambient__cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 620px;
  height: 620px;
  margin: -310px 0 0 -310px;
  border-radius: 50%;
  opacity: 0.7;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(196, 210, 255, 0.32) 32%,
    rgba(255, 255, 255, 0) 66%
  );
  transform: translate3d(var(--cx, 50vw), var(--cy, 26vh), 0);
  will-change: transform;
}

/* 点击/触摸的涟漪 */
.ripple {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 30px rgba(120, 140, 255, 0.45), inset 0 0 24px rgba(255, 255, 255, 0.55);
  animation: rippleOut 1.1s var(--ease) forwards;
}

@keyframes rippleOut {
  from {
    transform: scale(0.5);
    opacity: 0.85;
  }
  to {
    transform: scale(24);
    opacity: 0;
  }
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(3vw, 4vh, 0) scale(1.08);
  }
  100% {
    transform: translate3d(-2vw, -3vh, 0) scale(0.96);
  }
}

/* ---------------------------------------------------------------- glass */
.glass {
  position: relative;
  isolation: isolate;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, var(--glass-1) 0%, var(--glass-2) 44%, rgba(255, 255, 255, 0.44) 100%);
  -webkit-backdrop-filter: blur(5px) saturate(160%) brightness(1.03) contrast(1.02);
  backdrop-filter: blur(5px) saturate(160%) brightness(1.03) contrast(1.02);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -18px 30px -26px rgba(17, 25, 54, 0.35);
}

/* 真实光线折射：SVG 位移滤镜把玻璃背后的画面扭折 */
html.has-refraction .glass--refract {
  -webkit-backdrop-filter: blur(3px) saturate(175%) brightness(1.06) contrast(1.02);
  backdrop-filter: blur(2px) saturate(170%) brightness(1.06) contrast(1.02) url(#liquid-glass);
}

/* 桌面性能足够，所有玻璃都带折射；移动端只保留关键表面 */
@media (hover: hover) and (pointer: fine) {
  /* 桌面也只用轻模糊，折射位移只留给关键表面，滚动才不卡 */
  html.has-refraction .glass {
    -webkit-backdrop-filter: blur(4px) saturate(160%) brightness(1.03);
    backdrop-filter: blur(4px) saturate(160%) brightness(1.03);
  }
}

/* 边缘透镜：只在玻璃边框内侧做更强的弯折 */
html.has-refraction .glass--lens::before {
  background:
    radial-gradient(
      340px circle at var(--mx, -30%) var(--my, -40%),
      rgba(255, 255, 255, 0.9),
      rgba(255, 255, 255, 0) 62%
    ),
    linear-gradient(158deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 42%),
    radial-gradient(120% 120% at 50% 50%, rgba(255, 255, 255, 0) 58%, rgba(178, 196, 255, 0.22) 100%);
}

/* specular sheen, drifts with the pointer (--mx / --my set from JS) */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 0.6s var(--ease);
  background:
    radial-gradient(
      340px circle at var(--mx, -30%) var(--my, -40%),
      rgba(255, 255, 255, 0.85),
      rgba(255, 255, 255, 0) 62%
    ),
    linear-gradient(158deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 42%);
}

/* refractive rim — a thin band where the light bends around the edge */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  padding: 1px;
  background: conic-gradient(
    from 200deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.08) 18%,
    rgba(255, 255, 255, 0.7) 38%,
    rgba(255, 255, 255, 0.05) 58%,
    rgba(255, 255, 255, 0.85) 78%,
    rgba(255, 255, 255, 0.95)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.75;
}

.glass--clear {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.2) 100%);
  -webkit-backdrop-filter: blur(30px) saturate(170%) brightness(1.05);
  backdrop-filter: blur(30px) saturate(170%) brightness(1.05);
}

.glass--ink {
  background: linear-gradient(150deg, rgba(16, 21, 34, 0.92) 0%, rgba(22, 28, 45, 0.88) 100%);
  border-color: rgba(255, 255, 255, 0.18);
  color: #eef2ff;
  box-shadow: 0 40px 90px -44px rgba(8, 12, 26, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.glass--ink::before {
  background: radial-gradient(
    320px circle at var(--mx, -30%) var(--my, -40%),
    rgba(140, 160, 255, 0.24),
    rgba(140, 160, 255, 0) 60%
  );
}

.glass--ink::after {
  opacity: 0.35;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass,
  .glass--clear {
    background: rgba(255, 255, 255, 0.86);
  }
  .glass--ink {
    background: rgba(16, 21, 34, 0.96);
  }
}

/* --------------------------------------------------------------- typography */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.h1 {
  font-size: clamp(2.8rem, 8vw, 5.9rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.12;
  font-weight: 660;
  letter-spacing: -0.03em;
}

.h3 {
  font-size: clamp(1.15rem, 1.9vw, 1.4rem);
  line-height: 1.25;
  font-weight: 640;
  letter-spacing: -0.02em;
}

.lede {
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 52ch;
}

.muted {
  color: var(--ink-3);
}

.tiny {
  font-size: 0.76rem;
  color: var(--ink-3);
}

.num {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------------- chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 2px rgba(17, 25, 54, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.chip--ink {
  color: #f4f6ff;
  background: linear-gradient(140deg, #151b2c, #2b3450);
  border-color: rgba(255, 255, 255, 0.14);
}

.chip--soft {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--ink-3);
}

.chip--mono {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(47, 208, 185, 0.18);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.86); }
}

/* --------------------------------------------------------------- buttons */
.btn {
  --btn-bg: rgba(255, 255, 255, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--btn-bg);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 12px 26px -18px rgba(17, 25, 54, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px -18px rgba(17, 25, 54, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn--primary {
  color: #f6f7ff;
  background: linear-gradient(140deg, #141a2b 0%, #232b45 55%, #313a5c 100%);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 40px -20px rgba(11, 16, 32, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn--primary:hover {
  box-shadow: 0 26px 50px -22px rgba(11, 16, 32, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 22px -18px rgba(17, 25, 54, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.9);
  color: var(--ink-2);
}

.btn--outline {
  background: transparent;
  border-color: rgba(17, 25, 54, 0.14);
  box-shadow: none;
  color: var(--ink-2);
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 22px -20px rgba(17, 25, 54, 0.4);
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---------------------------------------------------------------- fields */
.field {
  position: relative;
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--r-md);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 2px rgba(17, 25, 54, 0.06);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.field::placeholder {
  color: var(--ink-4);
}

.field:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(109, 92, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(109, 92, 255, 0.1);
}

select.field {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2379829a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* -------------------------------------------------------------- progress */
.progress-container {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: var(--r-pill);
  cursor: pointer;
  background: rgba(17, 25, 54, 0.09);
  box-shadow: inset 0 1px 2px rgba(17, 25, 54, 0.08);
  overflow: hidden;
  touch-action: none;
}

.progress-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1b2236, #46527a 70%, #6d5cff);
  transition: width 0.1s linear;
  pointer-events: none;
}

/* 拖动把手 */
.progress-fill::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 25, 54, 0.35);
  transform: translateY(-50%) scale(0);
  transition: transform 0.2s var(--ease);
}

.progress-container:hover .progress-fill::after,
.progress-container.is-dragging .progress-fill::after {
  transform: translateY(-50%) scale(1);
}

.progress-container.is-dragging {
  cursor: grabbing;
}

/* --------------------------------------------------------------- masonry */
.masonry {
  column-gap: var(--gap);
  column-count: 1;
}

.masonry > * {
  break-inside: avoid;
  margin-bottom: var(--gap);
}

@media (min-width: 620px) {
  .masonry {
    column-count: 2;
  }
}

@media (min-width: 1040px) {
  .masonry--3 {
    column-count: 3;
  }
}

/* ------------------------------------------------------------------ grid */
.grid {
  display: grid;
  gap: var(--gap);
}

.grid--cards {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid--two {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid--three {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* --------------------------------------------------------------- sections */
.section {
  padding-block: var(--section) 0;
}

.section:first-child {
  padding-top: 0;
}

.section__head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: clamp(26px, 4vw, 48px);
  max-width: 60ch;
}

.section__head--row {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  max-width: none;
}

.section__head p.muted {
  font-size: 0.94rem;
  line-height: 1.7;
}

/* ------------------------------------------------------------ animations */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@keyframes paneIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* -------------------------------------------------------------- utilities */
.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.stack {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
}

.wrap {
  flex-wrap: wrap;
}

.gap-sm { gap: 8px; }
.gap-md { gap: 14px; }
.gap-lg { gap: 22px; }

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

/* ------------------------------------------------------------ responsive */
@media (max-width: 640px) {
  .glass {
    --r-lg: 22px;
  }

  .ambient__blob {
    opacity: 0.62;
  }

  .btn {
    padding: 11px 20px;
  }
}

/* 触屏 / 小屏：安卓 WebView（OPPO、Via 等）做背景模糊必闪，
   统一改成「有色玻璃」——半透明 + 亮边 + 内阴影，不采样背景 */
@media (hover: none), (max-width: 680px) {
  .glass,
  html.has-refraction .glass,
  html.has-refraction .glass--refract {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-image: linear-gradient(
      152deg,
      rgba(255, 255, 255, 0.66) 0%,
      rgba(255, 255, 255, 0.36) 44%,
      rgba(255, 255, 255, 0.54) 100%
    );
    border-color: rgba(255, 255, 255, 0.88);
    box-shadow:
      0 20px 44px -34px rgba(17, 25, 54, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.95),
      inset 0 -16px 26px -22px rgba(17, 25, 54, 0.35);
  }

  html.has-refraction .glass--ink {
    background-image: linear-gradient(150deg, rgba(16, 21, 34, 0.95) 0%, rgba(26, 33, 51, 0.93) 100%);
  }

  html.has-refraction .dock,
  .dock {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-image: linear-gradient(
      150deg,
      rgba(255, 255, 255, 0.84) 0%,
      rgba(255, 255, 255, 0.68) 100%
    );
  }

  /* 静态高光，跟指针无关 */
  .glass::before {
    background:
      radial-gradient(120% 80% at 18% 0%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 55%),
      linear-gradient(158deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 40%);
  }

  /* mask 合成的装饰层在 WebView 里也容易花，直接隐藏 */
  .ambient__rays,
  .ambient__grid,
  .ambient__bokeh,
  .ambient__grain {
    display: none;
  }

  .ambient__vignette {
    opacity: 0.55;
  }

  .ambient__blob {
    opacity: 0.55;
  }
}

/* 需要真模糊时手动开：地址后加 ?glass=1 */
html.force-glass .glass,
html.force-glass .glass--refract {
  -webkit-backdrop-filter: blur(12px) saturate(180%) brightness(1.03);
  backdrop-filter: blur(12px) saturate(180%) brightness(1.03);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
/* 滚动中禁用背景模糊，杜绝安卓上的闪烁/撕裂 */
html.is-scrolling .glass,
html.is-scrolling .glass--refract,
html.is-scrolling .dock,
html.is-scrolling .playbar {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* 手机端背景光斑保持静止，避免每帧重新计算模糊 */
@media (hover: none), (pointer: coarse) {
  .ambient__blob {
    animation: none;
  }

  .ambient__rays {
    transition: none;
  }

  .ambient__cursor {
    display: none;
  }
}
/* 手机上关闭入场淡入：避免滚动时内容一块块浮现，看起来像闪烁 */
@media (hover: none), (pointer: coarse) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
/* ==================================================================
   精简模式：OPPO / vivo / 小米 / 微信等，backdrop-filter 会撕裂闪烁。
   这里不做背景采样，改用「有色玻璃」：半透明 + 固定高光 + 亮边 + 内阴影
   ================================================================== */
html.low-effects .glass,
html.low-effects .glass--refract,
html.low-effects .dock,
html.low-effects .playbar {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background-image: linear-gradient(
    152deg,
    rgba(255, 255, 255, 0.66) 0%,
    rgba(255, 255, 255, 0.36) 44%,
    rgba(255, 255, 255, 0.54) 100%
  ) !important;
  border-color: rgba(255, 255, 255, 0.88) !important;
  box-shadow:
    0 20px 44px -34px rgba(17, 25, 54, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -16px 26px -22px rgba(17, 25, 54, 0.35) !important;
}

/* 固定高光：不用 mask、不跟随指针 */
html.low-effects .glass::before {
  display: block !important;
  opacity: 1 !important;
  background:
    radial-gradient(120% 80% at 18% 0%, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(158deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 40%) !important;
}

/* 折射边用 mask 合成，这类浏览器会画错，去掉 */
html.low-effects .glass::after {
  display: none !important;
}

/* 深色卡片保持深色，配自己的冷色高光 */
html.low-effects .glass--ink {
  background-image: linear-gradient(150deg, rgba(16, 21, 34, 0.95) 0%, rgba(26, 33, 51, 0.93) 100%) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

html.low-effects .glass--ink::before {
  background: radial-gradient(120% 80% at 20% 0%, rgba(140, 160, 255, 0.24) 0%, rgba(140, 160, 255, 0) 60%) !important;
}

/* 导航和播放条再实一点，别让下面文字透上来 */
html.low-effects .dock,
html.low-effects .playbar {
  background-image: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(255, 255, 255, 0.66) 100%
  ) !important;
}

html.low-effects .ambient__blob {
  animation: none;
}

html.low-effects .ambient__rays,
html.low-effects .ambient__grid,
html.low-effects .ambient__bokeh,
html.low-effects .ambient__grain {
  display: none;
}

/* 固定条不要加 transform：OPPO WebView 里会让 fixed 错位 */
html.low-effects .dock-wrap,
html.low-effects .playbar-wrap {
  transform: none !important;
}

html.low-effects .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
