/* Model Library v2 — orbiting logo ring */

/* ============================================================
   样式隔离契约（重要，请严格遵守）
   ------------------------------------------------------------
   ▸ 默认区块（无 @media 包裹）= Web 端（≥769px）基线
       - 改 Web 端时只动这里
       - 禁止在此处加任何只服务移动端的样式
   ▸ @media (max-width: 768px) { ... } = 移动端（≤768px）专属
       - 改移动端时只动 768 媒体查询块内的规则
       - 禁止修改默认区块的属性值；如需差异化，用 768 媒体查询块覆盖
   ▸ @media (max-width: 980px) 等其他断点 = Web 端的响应式微调
       - 属于 Web 范畴，调整移动端时不要动
   ▸ 新增移动端独有的 class/规则，统一写在文件末尾的 768 块内
   ============================================================ */

.section.model-library.ml2 {
  padding: 0 !important;
  background: #f5f6f8 !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.ml2-ripple-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.45;
}

/* Twinkling background dots */
.section.model-library.ml2::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(50, 80, 140, 0.35) 1px, transparent 1.8px);
  background-size: 110px 110px;
  background-position: 0 0;
  opacity: 0.55;
  animation: ml2-twinkle-a 4.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.section.model-library.ml2::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(50, 80, 140, 0.30) 1px, transparent 1.6px);
  background-size: 70px 70px;
  background-position: 30px 30px;
  opacity: 0.45;
  animation: ml2-twinkle-b 3.2s ease-in-out infinite;
  animation-delay: 1.1s;
  pointer-events: none;
  z-index: 0;
}
@keyframes ml2-twinkle-a {
  0%, 100% { opacity: 0.20; }
  50%      { opacity: 0.55; }
}
@keyframes ml2-twinkle-b {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.18; }
}
@media (prefers-reduced-motion: reduce) {
  .section.model-library.ml2::before,
  .section.model-library.ml2::after { animation: none; }
}
.ml2-crosshair-v, .ml2-crosshair-h {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.ml2-crosshair-v {
  left: 50%; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, rgba(160,170,185,0) 0%, rgba(160,170,185,0.22) 50%, rgba(160,170,185,0) 100%);
}
.ml2-crosshair-h {
  top: 72%; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, rgba(160,170,185,0) 0%, rgba(160,170,185,0.22) 50%, rgba(160,170,185,0) 100%);
}
.ml2-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 720px;
  height: 1250px;
  padding: 80px 48px;
  display: flex;
  align-items: center;
}
.ml2-text { position: relative; z-index: 10; max-width: 600px; }
.ml2-eyebrow {
  color: #0055FF;
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}
.ml2-title {
  font-size: 38px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0a0a0f;
  margin: 0 0 72px;
  text-wrap: pretty;
  width: 600px;
  max-width: 100%;
  text-align: left;
}
.ml2-title-highlight {
  color: #0055FF;
}
.ml2-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #0a0a0f;
  color: #fff;
  padding: 14px 26px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: background .2s;
}
.ml2-arrow { display: inline-block; transform: translate(1px, -1px); }

.ml2-ring-wrap {
  position: absolute;
  right: 200px;
  top: 50%;
  transform: translateY(-50%);
  width: 820px; height: 820px;
  z-index: 1;
}
.ml2-fade {
  position: absolute; inset: 0;
  overflow: visible;
}
.ml2-fade::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  background: linear-gradient(to right, #f5f6f8 0%, rgba(245, 246, 248, 0.92) 18%, rgba(245, 246, 248, 0.55) 38%, rgba(245, 246, 248, 0.15) 58%, rgba(245, 246, 248, 0) 75%);
}
.ml2-ring {
  position: absolute; left: 50%; top: 50%;
  width: 700px; height: 700px;
  margin-left: -350px; margin-top: -350px;
  transform: rotate(0deg);
  will-change: transform;
  z-index: 3;
}
.ml2-circle {
  position: absolute;
  left: 50%; top: 50%;
  width: 700px; height: 700px;
  margin-left: -350px; margin-top: -350px;
  border-radius: 50%;
  border: 1px solid #d8e0ec;
  z-index: 1;
}
.ml2-orb {
  position: absolute;
  left: 50%; top: 50%;
  width: 92px; height: 92px;
  margin-left: -46px; margin-top: -46px;
  transform: rotate(var(--a)) translateY(-350px) rotate(calc(-1 * var(--a)));
  will-change: transform;
}
.ml2-orb-inner {
  width: 100%; height: 100%;
  transform: rotate(0deg) scale(1);
  will-change: transform;
}
.ml2-orb-content {
  width: 100%; height: 100%;
  background: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 32px rgba(20, 30, 60, 0.10), 0 2px 6px rgba(20, 30, 60, 0.04);
  overflow: hidden;
}
.ml2-orb-content img { width: 56%; height: 56%; object-fit: contain; }
.ml2-orb.dark .ml2-orb-content { background: #ffffff; }
.ml2-orb.dark .ml2-orb-content img { filter: none; }

/* Pill-shaped track frame — sits behind the orbs */
.ml2-track {
  position: absolute;
  left: 50%; top: 50%;
  width: 340px; height: 144px;
  margin-left: 70px; margin-top: -72px;
  border-radius: 9999px;
  border: 1px solid #d8e0ec;
  background: linear-gradient(180deg, rgba(220, 233, 255, 0.18), rgba(220, 233, 255, 0)), #f5f6f8;
  pointer-events: none;
  z-index: 2;
}

/* Spin button */
.ml2-spin-btn {
  position: absolute;
  left: 50%; top: 50%;
  width: 120px; height: 120px;
  margin-left: 86px; margin-top: -60px;
  border-radius: 50%;
  border: 1px solid rgba(10, 10, 15, 0.06);
  background: #ffffff;
  color: #0a0a0f;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(20, 30, 60, 0.08), 0 1px 3px rgba(20, 30, 60, 0.04);
  z-index: 20;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ml2-spin-btn svg { width: 56px; height: 56px; overflow: visible; }
.ml2-spin-btn svg circle {
  fill: #0a0a0f;
  transform-box: fill-box;
  transform-origin: center;
  animation: wave-pulse 1.8s cubic-bezier(.45, 0, .15, 1) infinite;
}
.ml2-spin-btn svg circle[cy="30.9997"] { animation-delay: 0.00s; }
.ml2-spin-btn svg circle[cy="17.3903"] { animation-delay: 0.10s; }
.ml2-spin-btn svg circle[cy="3.78049"] { animation-delay: 0.20s; }

@keyframes wave-pulse {
  0%, 75%, 100% { transform: translateY(0)   scale(1);    opacity: 0.92; }
  25%           { transform: translateY(-2px) scale(1.18); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ml2-spin-btn svg circle { animation: none !important; }
}
.ml2-spin-btn:hover { transform: scale(1.06); box-shadow: 0 6px 18px rgba(20, 30, 60, 0.12); }
.ml2-spin-btn:active { transform: scale(0.94); }
.ml2-spin-btn.boost svg { animation: ml2-btn-pulse .5s ease; }
@keyframes ml2-btn-pulse {
  0% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-4px); opacity: .55; }
  100% { transform: translateY(0); opacity: 1; }
}

@media (max-width: 980px) {
  .ml2-stage { padding: 60px 24px; min-height: 640px; height: auto; }
  .ml2-text { max-width: 420px; }
  .ml2-title { font-size: 30px; }
  .ml2-ring-wrap { right: -180px; width: 680px; height: 680px; }
  .ml2-ring { width: 580px; height: 580px; margin-left: -290px; margin-top: -290px; }
  .ml2-orb { transform: rotate(var(--a)) translateY(-290px) rotate(calc(-1 * var(--a))); }
  .ml2-spin-btn { margin-left: 100px; }
}

/* ─────────── ≤768: Figma 224:69039 — 转盘置顶居中，文案在下 ─────────── */
@media (max-width: 768px) {
  .section.model-library.ml2 {
    min-height: 0;
    overflow-x: clip;
  }

  .ml2-stage {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 56px var(--h5-page-x, 20px) 72px;
    min-height: 0;
    height: auto;
    gap: 40px;
  }

  .ml2-crosshair-v,
  .ml2-crosshair-h { display: none; }

  /*
   * 转盘容器：375×284（Figma）
   * --ml2-h5-d: 轨道直径 326px @375，按视口等比缩小
   * --ml2-h5-cy: 圆心距顶 82px @375（≈25.2% 直径），露出下半弧
   */
  .ml2-ring-wrap {
    --ml2-h5-d: min(87.2vw, 326px);
    --ml2-h5-r: calc(var(--ml2-h5-d) / 2);
    --ml2-h5-cy: calc(var(--ml2-h5-d) * 0.251);

    position: relative !important;
    right: auto !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100%;
    max-width: 375px;
    height: min(75.73vw, 284px);
    margin: 0 auto;
    order: 1;
    flex: 0 0 auto;
    overflow: hidden;
  }

  .ml2-fade {
    inset: 0;
  }

  .ml2-fade::after {
    background: linear-gradient(
      to bottom,
      #f5f6f8 0%,
      rgba(245, 246, 248, 0.92) 12%,
      rgba(245, 246, 248, 0.65) 28%,
      rgba(245, 246, 248, 0.28) 46%,
      rgba(245, 246, 248, 0) 58%,
      rgba(245, 246, 248, 0) 100%
    );
  }

  .ml2-circle { display: none; }

  .ml2-ring {
    width: var(--ml2-h5-d);
    height: var(--ml2-h5-d);
    left: 50%;
    top: var(--ml2-h5-cy);
    margin-left: calc(var(--ml2-h5-d) / -2);
    margin-top: calc(var(--ml2-h5-d) / -2);
  }

  .ml2-orb {
    width: 64px;
    height: 64px;
    margin-left: -32px;
    margin-top: -32px;
    transform: rotate(var(--a)) translateY(calc(var(--ml2-h5-r) * -1)) rotate(calc(-1 * var(--a)));
  }

  .ml2-track { display: none !important; }

  .ml2-spin-btn {
    display: flex !important;
    left: 50%;
    top: var(--ml2-h5-cy);
    width: 64px;
    height: 64px;
    margin-left: -32px;
    margin-top: -32px;
    border: 1px solid rgba(10, 10, 15, 0.06);
    background: #fff;
    box-shadow: 0 8px 24px rgba(20, 30, 60, 0.10), 0 2px 6px rgba(20, 30, 60, 0.04);
    cursor: default;
    transform: none !important;
  }
  .ml2-spin-btn svg { width: 28px; height: 28px; }

  /* Text & CTA below, centered */
  .ml2-text {
    order: 2;
    position: relative;
    max-width: 100%;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0;
    flex: 0 0 auto;
  }
  .ml2-eyebrow {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 8px;
  }
  .section.model-library.ml2 h2.ml2-title {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 72px;
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.24;
    letter-spacing: -0.025em;
  }
  .ml2-btn {
    align-self: center;
    height: 56px;
    padding: 0 32px;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
  }
}
