/* ============================================================
   Premium Motion · 2026-11-19
   北欧极简画布 × Rolala 的柔和氛围 × Apple 式滚动叙事。
   独立渐进增强层：不加载本文件时，原页面仍完整可用。
   ============================================================ */
:root {
  --pm-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pm-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --pm-fast: 220ms;
  --pm-medium: 460ms;
  --pm-slow: 640ms;
}

/* ---------- 创作首页：柔和、居中、留白 ---------- */
.cv2g {
  --pm-scroll: 0;
  --pm-x: 0;
  --pm-y: 0;
  position: relative;
  isolation: isolate;
  padding-top: clamp(54px, 7.5vh, 88px);
  overflow-x: hidden;
}
.cv2g-ambient {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: min(680px, 78vh);
  overflow: hidden;
  pointer-events: none;
  contain: layout paint;
  -webkit-mask-image: radial-gradient(ellipse 78% 78% at 50% 28%, #000 26%, transparent 100%);
  mask-image: radial-gradient(ellipse 78% 78% at 50% 28%, #000 26%, transparent 100%);
}
.cv2g-ambient i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(76px);
  opacity: .72;
  will-change: transform;
}
.cv2g-ambient i:nth-child(1) {
  width: 520px; height: 360px;
  left: calc(50% - 520px); top: -118px;
  background: rgba(218, 231, 234, .72);
  transform: translate3d(calc(var(--pm-x) * -18px), calc(var(--pm-y) * -12px + var(--pm-scroll) * .12px), 0);
}
.cv2g-ambient i:nth-child(2) {
  width: 560px; height: 390px;
  left: calc(50% - 40px); top: -138px;
  background: rgba(240, 220, 211, .66);
  transform: translate3d(calc(var(--pm-x) * 22px), calc(var(--pm-y) * 14px + var(--pm-scroll) * .18px), 0);
}
.cv2g-ambient i:nth-child(3) {
  width: 380px; height: 250px;
  left: calc(50% - 190px); top: 100px;
  background: rgba(232, 229, 212, .48);
  filter: blur(96px);
  opacity: .58;
  transform: translate3d(calc(var(--pm-x) * 10px), calc(var(--pm-y) * -8px + var(--pm-scroll) * -.08px), 0);
}
.cv2g-hero {
  max-width: 940px;
  text-align: center;
  transform: translate3d(0, calc(var(--pm-scroll) * -.09px), 0) scale(calc(1 - var(--pm-scroll) * .00009));
  transform-origin: 50% 22%;
  opacity: calc(1 - var(--pm-scroll) * .00065);
  will-change: transform, opacity;
}
.cv2g-hero .kicker {
  letter-spacing: .18em;
  font-weight: 600;
  color: var(--text3);
}
.cv2g-hero h2 {
  margin-top: 16px;
  font-size: clamp(40px, 5.1vw, 68px);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 650;
}
.cv2g-hero > p {
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text2);
  text-wrap: balance;
}
.cv2g-inputbar {
  max-width: 780px;
  margin: 36px auto 0;
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(31, 30, 26, .03), 0 16px 48px rgba(31, 30, 26, .07), 0 40px 90px rgba(31, 30, 26, .035);
  transition: border-color var(--pm-fast) ease, box-shadow var(--pm-medium) var(--pm-ease), transform var(--pm-medium) var(--pm-ease);
}
.cv2g-inputbar:focus-within {
  border-color: rgba(78, 78, 70, .38);
  box-shadow: 0 2px 3px rgba(31, 30, 26, .03), 0 20px 58px rgba(31, 30, 26, .095), 0 0 0 4px rgba(78, 78, 70, .045);
  transform: translateY(-2px);
}
.cv2g-inputbar textarea {
  min-height: 116px;
  padding: 24px 26px 14px;
  font-size: 16px;
  line-height: 1.7;
}
.cv2g-composebar { padding: 12px 14px 14px 20px; }
.cv2g-start {
  --pm-mx: 0px;
  --pm-my: 0px;
  min-height: 42px;
  padding-inline: 20px;
  transform: translate3d(var(--pm-mx), var(--pm-my), 0);
  transition: transform var(--pm-medium) var(--pm-spring), background var(--pm-fast) ease, box-shadow var(--pm-fast) ease;
  box-shadow: 0 5px 16px rgba(45, 45, 41, .12);
  will-change: transform;
}
.cv2g-start:hover { box-shadow: 0 8px 22px rgba(45, 45, 41, .17); }
.cv2g-start:active { transition-duration: 90ms; }
.cv2g-quick {
  justify-content: center;
  max-width: 820px;
  margin: 20px auto 0;
  row-gap: 10px;
}
.cv2g-quick button {
  padding: 5px 7px;
  border-radius: 999px;
  transition: color var(--pm-fast) ease, background var(--pm-fast) ease, transform var(--pm-fast) var(--pm-ease);
}
.cv2g-quick button:hover { background: rgba(78, 78, 70, .055); transform: translateY(-1px); }
.cv2g-sec { max-width: 1160px; }
.cv2g-grid { max-width: 1160px; }

/* ---------- 入场与滚动显现：JS 添加类，无 JS 时内容默认可见 ---------- */
.cv2g.pm-hero-ready .kicker,
.cv2g.pm-hero-ready .cv2g-hero h2,
.cv2g.pm-hero-ready .cv2g-hero > p,
.cv2g.pm-hero-ready .cv2g-inputbar,
.cv2g.pm-hero-ready .cv2g-quick {
  animation: pm-hero-enter var(--pm-slow) var(--pm-ease) both;
}
.cv2g.pm-hero-ready .cv2g-hero h2 { animation-delay: 55ms; }
.cv2g.pm-hero-ready .cv2g-hero > p { animation-delay: 105ms; }
.cv2g.pm-hero-ready .cv2g-inputbar { animation-delay: 165ms; }
.cv2g.pm-hero-ready .cv2g-quick { animation-delay: 215ms; }
@keyframes pm-hero-enter {
  from { opacity: 0; translate: 0 24px; }
  to { opacity: 1; translate: 0 0; }
}
.pm-reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity var(--pm-medium) var(--pm-ease), transform var(--pm-slow) var(--pm-ease);
  transition-delay: var(--pm-delay, 0ms);
}
.pm-reveal.pm-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ---------- 卡片：轻微景深，不做夸张倾斜 ---------- */
@media (hover: hover) and (pointer: fine) {
  .cv2g-case.pm-inview,
  .cv2g-proj.pm-inview {
    transform: perspective(1000px) translate3d(0, var(--pm-lift, 0px), 0) rotateX(var(--pm-rx, 0deg)) rotateY(var(--pm-ry, 0deg));
    transform-style: preserve-3d;
    transition: opacity var(--pm-medium) var(--pm-ease), transform var(--pm-medium) var(--pm-ease), box-shadow var(--pm-medium) var(--pm-ease);
    transition-delay: var(--pm-delay, 0ms);
    will-change: transform;
  }
  .cv2g-case.pm-inview:hover,
  .cv2g-proj.pm-inview:hover {
    --pm-lift: -6px;
    transition-delay: 0ms;
    box-shadow: 0 18px 42px rgba(31, 30, 26, .09);
  }
  .cv2g-case.pm-inview .cv2g-cimg,
  .cv2g-proj.pm-inview .cv2g-thumb { transform: translateZ(8px); }
  .cv2g-case .cv2g-cimg img,
  .cv2g-proj .cv2g-thumb > img { transition: transform 560ms var(--pm-ease); }
  .cv2g-case:hover .cv2g-cimg img,
  .cv2g-proj:hover .cv2g-thumb > img { transform: scale(1.045); }
}

/* ---------- 工作区导航：一个连续移动的底色 ---------- */
.workspace-tabs { position: relative; isolation: isolate; }
.pm-nav-glider {
  position: absolute;
  z-index: -1;
  left: 5px; top: 5px; bottom: 5px;
  width: 1px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .07);
  transform: translate3d(var(--pm-nav-x, 0px), 0, 0) scaleX(var(--pm-nav-w, 48));
  transform-origin: left center;
  transition: transform 360ms var(--pm-spring);
  pointer-events: none;
}
.workspace-tabs > a,
.workspace-tabs > a.on,
.workspace-tabs > a.active { position: relative; background: transparent; box-shadow: none; }
.workspace-tabs > a { transition: color var(--pm-fast) ease, transform var(--pm-fast) var(--pm-ease); }
.workspace-tabs > a:active { transform: scale(.96); }

/* ---------- 画布：只给反馈，不干扰平移、缩放与拖拽 ---------- */
.cv2-node.pm-node-enter .cv2-nbody {
  animation: pm-node-enter 400ms var(--pm-ease) both;
}
@keyframes pm-node-enter {
  from { opacity: 0; transform: scale(.965); }
  to { opacity: 1; transform: scale(1); }
}
.cv2-nbody {
  transition: box-shadow var(--pm-medium) var(--pm-ease), border-color var(--pm-fast) ease, background var(--pm-fast) ease;
}
@media (hover: hover) and (pointer: fine) {
  .cv2-node:not(.selected):hover .cv2-nbody {
    border-color: rgba(78, 78, 70, .28);
    box-shadow: 0 10px 30px rgba(31, 30, 26, .09);
  }
}
.cv2-modelpop.show {
  animation: pm-pop-enter 260ms var(--pm-ease) both;
  transform-origin: 50% 0;
}
.cv2-ctx.show,
.cv2-slash.show,
.cv2-dockmenu.show { animation: pm-pop-enter 240ms var(--pm-ease) both; }
@keyframes pm-pop-enter {
  from { opacity: 0; transform: translateY(-7px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cv2-mp-item,
.cv2-ctxitem,
.cv2-slashmenu-item { transition: background var(--pm-fast) ease, transform var(--pm-fast) var(--pm-ease); }
.cv2-mp-item:active,
.cv2-ctxitem:active,
.cv2-slashmenu-item:active { transform: scale(.985); }
.cv2-genpanel { animation: pm-panel-enter 360ms var(--pm-ease) both; }
@keyframes pm-panel-enter {
  from { opacity: 0; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}
.cv2-gp-run,
.cv2-submit,
.cv2-tbtn,
.cv2-nact,
.cv2-zoomdock button {
  transition: transform var(--pm-fast) var(--pm-ease), background var(--pm-fast) ease, color var(--pm-fast) ease, border-color var(--pm-fast) ease;
}
.cv2-gp-run:active,
.cv2-submit:active,
.cv2-tbtn:active,
.cv2-nact:active,
.cv2-zoomdock button:active { transform: scale(.91); }
.cv2-composer-input:focus { box-shadow: inset 0 0 0 1px rgba(78, 78, 70, .08); }

/* ---------- 全局可访问性与按压反馈 ---------- */
.btn, .iconbtn, .btn-theme, .ws-item, .gallery-filter button {
  transition: transform var(--pm-fast) var(--pm-ease), background var(--pm-fast) ease, color var(--pm-fast) ease, border-color var(--pm-fast) ease, box-shadow var(--pm-fast) ease;
}
.btn:active, .iconbtn:active, .btn-theme:active, .ws-item:active { transform: scale(.965); }
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
::selection { background: rgba(78, 78, 70, .16); color: var(--text); }

/* ---------- 响应式 ---------- */
@media (min-width: 1500px) {
  .cv2g-hero { max-width: 1000px; }
  .cv2g-inputbar { max-width: 820px; }
}
@media (max-width: 900px) {
  .cv2g { padding-top: 48px; }
  .cv2g-hero h2 { font-size: clamp(38px, 7vw, 58px); }
  .cv2g-inputbar { max-width: 720px; }
}
@media (max-width: 640px) {
  .cv2g { padding: 36px 16px 72px; }
  .cv2g-hero h2 { margin-top: 12px; font-size: clamp(34px, 10vw, 44px); }
  .cv2g-hero > p { margin-top: 14px; font-size: 14px; }
  .cv2g-inputbar { margin-top: 28px; border-radius: 20px; }
  .cv2g-inputbar textarea { min-height: 108px; padding: 20px 20px 12px; }
  .cv2g-composebar { padding: 10px 12px 12px 16px; flex-wrap: nowrap; gap: 8px; }
  .cv2g-composehint { display: none; }
  .cv2g-mchips { flex-wrap: nowrap; gap: 4px; }
  .cv2g-mchip { position: relative; flex: 0 0 34px; width: 34px; height: 34px; padding: 0; justify-content: center; }
  .cv2g-mchip span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cv2g-start { padding-inline: 16px; flex-shrink: 0; }
  .cv2g-quick { margin-top: 16px; }
  .cv2-qsep { display: none; }
  .cv2g-quick button { background: rgba(255, 255, 255, .42); padding: 6px 10px; }
  .cv2g-ambient { height: 540px; }
  .cv2g-ambient i { filter: blur(58px); }
  .cv2g-ambient i:nth-child(1) { left: -260px; }
  .cv2g-ambient i:nth-child(2) { left: 30%; }
}

/* ---------- 减弱动效：内容立即可读，保留静态氛围与状态色 ---------- */
@media (prefers-reduced-motion: reduce) {
  .cv2g-hero,
  .cv2g-ambient i,
  .cv2g-start,
  .cv2g-case.pm-inview,
  .cv2g-proj.pm-inview,
  .pm-reveal,
  .pm-reveal.pm-inview {
    transform: none !important;
    translate: none !important;
  }
  .cv2g-hero { opacity: 1 !important; }
  .pm-reveal { opacity: 1 !important; }
  .cv2g.pm-hero-ready .kicker,
  .cv2g.pm-hero-ready .cv2g-hero h2,
  .cv2g.pm-hero-ready .cv2g-hero > p,
  .cv2g.pm-hero-ready .cv2g-inputbar,
  .cv2g.pm-hero-ready .cv2g-quick,
  .cv2-node.pm-node-enter .cv2-nbody,
  .cv2-modelpop.show,
  .cv2-ctx.show,
  .cv2-slash.show,
  .cv2-dockmenu.show,
  .cv2-genpanel { animation: none !important; }
  .pm-nav-glider { transition: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
