/* ==========================================================================
   New homepage hero visual — scoped to .hero-viz only
   Text, page background and the rest of the public site stay untouched.
   ========================================================================== */
.hero-viz {
  --vz-cream: #f7f4e9;
  --vz-ink: #183e2c;
  --vz-green: #245b3e;
  --vz-green-light: #6e9d76;
  --vz-gold: #e6b75f;
  --vz-line: rgba(31, 72, 48, .14);
  position: relative;
  width: 100%;
  max-width: 760px;
  height: 560px;
  margin-inline: auto;
  perspective: 1200px;
  z-index: 2;
  overflow: visible;
}
.hero-viz * { box-sizing: border-box; }
.hero-viz .visual-inner {
  position: absolute;
  width: 680px;
  height: 560px;
  left: 50%;
  top: 50%;
  transform:
    translate(calc(-50% - var(--viz-nudge, 0px) + var(--scene-x, 0px)), calc(-50% + var(--scene-y, 0px)))
    scale(var(--viz-fit, .82));
  transform-origin: center;
  transition: transform .35s ease-out;
}
.hero-viz .aura {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}
.hero-viz .aura-one {
  width: 420px;
  height: 420px;
  right: 2%;
  top: 5%;
  background: radial-gradient(circle, rgba(126, 172, 127, .24), rgba(136, 177, 136, 0) 68%);
}
.hero-viz .aura-two {
  width: 300px;
  height: 300px;
  left: 9%;
  bottom: 0;
  background: radial-gradient(circle, rgba(224, 194, 121, .11), transparent 70%);
}
.hero-viz .orbit-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.hero-viz .orbit-lines path {
  stroke: rgba(60, 105, 70, .23);
  stroke-width: 2;
}
.hero-viz .orbit-lines .orbit-highlight {
  stroke: rgba(72, 117, 79, .35);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 290 800;
  animation: hzvOrbitTrace 9s linear infinite;
}
.hero-viz .orbit-lines .orbit-dash {
  stroke: rgba(255, 255, 255, .7);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 3 18;
}

.hero-viz .video-card {
  position: absolute;
  z-index: 2;
  width: 345px;
  left: 62px;
  top: 155px;
  padding: 8px;
  border-radius: 25px;
  background: rgba(248, 248, 231, .78);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 30px 60px rgba(39, 75, 45, .17), inset 0 0 0 1px rgba(56, 96, 57, .06);
  transform: translate(var(--video-x, 0px), var(--video-y, 0px)) rotate(-8deg);
  transition: transform .4s ease-out;
  backdrop-filter: blur(8px);
}
.hero-viz .video-frame {
  height: 231px;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #97b8a0;
}
.hero-viz .video-frame img,
.hero-viz .video-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.hero-viz .video-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10, 30, 19, .48));
  pointer-events: none;
}
.hero-viz .video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--vz-green);
  background: rgba(255, 253, 245, .92);
  box-shadow: 0 8px 25px rgba(19, 44, 27, .15);
  cursor: pointer;
  transition: transform .25s, background .25s;
}
.hero-viz .video-play::before {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: inherit;
  animation: hzvPlayPulse 2.5s ease-out infinite;
}
.hero-viz .video-play:hover {
  transform: translate(-50%, -50%) scale(1.08);
  background: #fff;
}
.hero-viz .video-play:focus-visible {
  outline: 3px solid rgba(230, 183, 95, .65);
  outline-offset: 4px;
}
.hero-viz .play-triangle {
  display: block;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
  margin-left: 3px;
}
.hero-viz .video-meta {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, .86);
  font-size: 7px;
  letter-spacing: 1.2px;
}

.hero-viz .qr-scene {
  position: absolute;
  z-index: 4;
  right: 40px;
  top: 9px;
  width: 280px;
  height: 490px;
  transform: translate(var(--qr-x, 0px), var(--qr-y, 0px));
  transition: transform .45s ease-out;
}
.hero-viz .qr-backplate {
  position: absolute;
  left: -5px;
  top: 73px;
  width: 318px;
  height: 365px;
  border-radius: 37px;
  transform: rotate(11deg);
  background: linear-gradient(145deg, rgba(146, 181, 146, .2), rgba(146, 181, 146, .09));
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 22px 60px rgba(53, 94, 60, .08);
}
.hero-viz .phone-device {
  position: absolute;
  inset: -30px 0;
  transform: rotate(6deg);
}
.hero-viz .phone-device::before {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: 1;
  border: 2px solid #909790;
  border-radius: 51px;
  background: linear-gradient(90deg, #485049, #d8ddd6 15%, #737c74 48%, #e4e8e1 79%, #424a43);
  box-shadow: 0 34px 68px rgba(27, 52, 34, .24);
}
.hero-viz .phone-side {
  position: absolute;
  z-index: 1;
  left: -6px;
  width: 2px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, #737c74, #aab1a9);
  box-shadow: 0 1px 2px rgba(25, 37, 29, .12);
}
.hero-viz .phone-side-action { top: 96px; height: 22px; }
.hero-viz .phone-side-volume-up { top: 140px; height: 38px; }
.hero-viz .phone-side-volume-down { top: 196px; height: 38px; }
.hero-viz .phone-side-power {
  left: auto;
  right: -6px;
  top: 153px;
  height: 58px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #aab1a9, #737c74);
}
.hero-viz .qr-card {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 8px;
  border-radius: 47px;
  background: linear-gradient(145deg, #f8faef, #e7eee1);
  border: 6px solid #171c19;
  box-shadow: 0 32px 68px rgba(36, 76, 45, .2), inset 0 0 0 1px rgba(255, 255, 255, .38), inset 0 0 38px rgba(255, 255, 255, .52);
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.hero-viz .phone-island {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 16px;
  width: 78px;
  height: 23px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: #101311;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 1px 2px rgba(0, 0, 0, .25);
}
.hero-viz .phone-island::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #334b41, #111714 68%);
}
.hero-viz .phone-home-indicator {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 12px;
  width: 78px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: rgba(23, 30, 25, .72);
}
.hero-viz .qr-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, .32) 45%, transparent 60%);
  transform: translateX(-120%);
  animation: hzvCardGlint 6s 1.5s ease-in-out infinite;
  pointer-events: none;
}
.hero-viz .qr-code {
  display: block;
  width: 240px;
  height: 240px;
  margin: 0;
  overflow: visible;
  color: var(--vz-green);
  filter: drop-shadow(0 3px 2px rgba(25, 68, 39, .08));
}
.hero-viz .qr-module { fill: #194c32; animation: hzvModuleIn .55s both; transform-box: fill-box; transform-origin: center; }
.hero-viz .qr-finder-outer { fill: #194c32; }
.hero-viz .qr-finder-mid { fill: #eef3e3; }
.hero-viz .qr-finder-inner { fill: #194c32; }
.hero-viz .qr-play-badge {
  position: absolute;
  z-index: 5;
  width: 47px;
  height: 47px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-6deg);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #f6f5e8;
  background: #3d7651;
  border: 5px solid rgba(239, 243, 226, .9);
  box-shadow: 0 8px 15px rgba(29, 69, 42, .18);
}
.hero-viz .qr-play-badge .play-triangle {
  border-top-width: 5px;
  border-bottom-width: 5px;
  border-left-width: 8px;
  margin-left: 2px;
}
.hero-viz .scan-line {
  position: absolute;
  z-index: 4;
  left: 20px;
  right: 20px;
  top: 155px;
  height: 2px;
  opacity: 0;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, rgba(157, 211, 135, .95), transparent);
  box-shadow: 0 0 11px 3px rgba(130, 190, 120, .35);
  animation: hzvScanning 4s 1.4s ease-in-out infinite;
}
.hero-viz .fragment-field { position: absolute; left: -25px; top: 57px; width: 330px; height: 375px; pointer-events: none; }
.hero-viz .qr-fragment {
  position: absolute;
  width: var(--size);
  height: var(--size);
  left: var(--left);
  top: var(--top);
  border-radius: var(--radius);
  opacity: 0;
  background: #3c7651;
  box-shadow: 0 3px 9px rgba(44, 85, 52, .12);
  animation: hzvParticleDrift var(--duration) var(--delay) ease-out infinite;
  will-change: transform, opacity;
}
.hero-viz .glass-tile {
  position: absolute;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  transform: rotate(15deg);
  background: linear-gradient(135deg, rgba(255, 255, 255, .62), rgba(96, 143, 103, .35));
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow: 0 12px 24px rgba(41, 82, 47, .1), inset 0 0 12px rgba(255, 255, 255, .35);
  backdrop-filter: blur(4px);
  animation: hzvTileFloat 5s ease-in-out infinite alternate;
}
.hero-viz .tile-one { left: 44px; top: 118px; width: 27px; height: 27px; animation-delay: -1.5s; }
.hero-viz .tile-two { right: 25px; top: 50px; width: 23px; height: 23px; animation-delay: -3s; }
.hero-viz .tile-three { left: 109px; bottom: 65px; width: 39px; height: 39px; animation-delay: -2s; }
.hero-viz .tile-four { right: -5px; bottom: 112px; width: 33px; height: 33px; animation-delay: -.6s; }

@keyframes hzvOrbitTrace { to { stroke-dashoffset: -1090; } }
@keyframes hzvModuleIn { from { opacity: 0; transform: scale(.3); } to { transform: scale(1); } }
@keyframes hzvScanning {
  0%, 12% { opacity: 0; transform: translateY(0); }
  18% { opacity: 1; }
  68% { opacity: 1; }
  78%, 100% { opacity: 0; transform: translateY(245px); }
}
@keyframes hzvCardGlint {
  0%, 55% { transform: translateX(-120%); }
  80%, 100% { transform: translateX(120%); }
}
@keyframes hzvParticleDrift {
  0% { opacity: 0; transform: translate(-16px, 8px) rotate(-12deg) scale(.5); filter: blur(0); }
  16% { opacity: var(--opacity); }
  70% { opacity: var(--opacity); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--rotate)) scale(.95); filter: blur(var(--blur)); }
}
@keyframes hzvTileFloat {
  from { translate: 0 -5px; rotate: -4deg; }
  to { translate: 4px 8px; rotate: 5deg; }
}
@keyframes hzvPlayPulse {
  0% { transform: scale(.9); opacity: .7; }
  75%, 100% { transform: scale(1.35); opacity: 0; }
}

@media (max-width: 900px) {
  .hero-viz { height: 430px; }
}
@media (max-width: 600px) {
  .hero-viz { height: 330px; }
}

/* Thin guide lines that run beneath the hero copy and return to the visual. */
.hero-loop-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.hero-loop-lines .loop-line {
  fill: none;
  stroke: rgba(36, 91, 62, .16);
  stroke-width: 1.4;
  stroke-linecap: round;
}
.hero-loop-lines .loop-line-two {
  stroke: rgba(110, 157, 118, .22);
  stroke-dasharray: 2 10;
  animation: hzvLoopFlow 16s linear infinite;
}
.hero-loop-lines .loop-line-three {
  stroke: rgba(230, 183, 95, .24);
  stroke-dasharray: 90 220;
  animation: hzvLoopFlow 20s linear infinite reverse;
}
.hero-loop-lines .loop-line-four {
  stroke: rgba(36, 91, 62, .12);
}

/* Original demo overlay: “三步，让视频被看见”. */
.demo-dialog {
  width: min(560px, calc(100% - 32px));
  padding: 35px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 27px;
  background: #f8f5e9;
  color: var(--ink, #183e2c);
  box-shadow: 0 40px 120px rgba(14, 42, 25, .3);
  overflow: visible;
}
.demo-dialog::backdrop {
  background: rgba(14, 37, 24, .55);
  backdrop-filter: blur(8px);
}
.demo-dialog[open] { animation: hzvDialogIn .3s ease-out; }
.dialog-close {
  position: absolute;
  right: 15px;
  top: 13px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #e6eadc;
  color: var(--ink, #183e2c);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}
.dialog-kicker {
  margin: 0 0 7px;
  font-size: 9px;
  letter-spacing: 2px;
  color: #788772;
}
.demo-dialog h2 { margin: 0 0 22px; font-size: 26px; letter-spacing: -1px; }
.demo-preview { height: 245px; position: relative; border-radius: 18px; overflow: hidden; }
.demo-preview img { width: 100%; height: 100%; object-fit: cover; }
.demo-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(17, 52, 31, .18));
}
.demo-play {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 57px;
  height: 57px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .9);
  color: #245b3e;
}
.demo-play .play-triangle {
  display: block;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
  margin-left: 3px;
}
.demo-scan {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  height: 2px;
  background: #d6e6a8;
  box-shadow: 0 0 15px 4px rgba(214, 230, 168, .55);
  animation: hzvDemoScan 3s ease-in-out infinite;
}
.demo-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.demo-steps div { padding: 15px 12px; background: #ebeee1; border-radius: 12px; }
.demo-steps span { color: #8a9a7e; font-size: 10px; }
.demo-steps p { margin: 5px 0 0; font-size: 12px; font-weight: 600; }

@keyframes hzvLoopFlow { to { stroke-dashoffset: -420; } }
@keyframes hzvDemoScan { 0%, 100% { top: 4%; opacity: 0; } 15%, 85% { opacity: 1; } 50% { top: 95%; } }
@keyframes hzvDialogIn { from { opacity: 0; transform: translateY(15px) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .demo-dialog { padding: 28px 20px 22px; }
  .demo-preview { height: 200px; }
  .demo-steps { gap: 6px; }
  .demo-steps div { padding: 12px 8px; }
  .demo-steps p { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-viz *,
  .hero-viz *::before,
  .hero-viz *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
