﻿/* ============================================================
   Hero v2 · 同一布局，两套皮肤
   Day   = 浅色 + 二次元人物
   Night = REALITY.EXE（终端 / glitch，无人物）
   右栏、左栏、统计、信任条 —— 位置完全一致，只换视觉语言
   ============================================================ */

.hero2 {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  gap: 40px;
  align-items: center;
  padding-top: 8px;
}

.hero-copy { position: relative; z-index: 3; }

.hero2 .kicker {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 12.5px; color: var(--muted);
  margin-bottom: 22px;
}
.hero2 .kicker i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok, #67e8a0);
  box-shadow: 0 0 0 3px rgba(103,232,160,.16);
}

.hero2 h1 {
  font-size: clamp(38px, 5.2vw, 66px);
  line-height: 1.02;
  letter-spacing: -.05em;
  font-weight: 700;
  margin-bottom: 18px;
}
.hero2 h1 .l2 { display: block; }
.hero2 h1 .accent { color: var(--sakura); }

.hero2 .lead {
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}
.hero2 .hero-actions { margin-top: 26px; }

/* ---------- 统计（两套共用结构） ---------- */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.hero-stats .st {
  padding: 20px 20px 18px;
  border-right: 1px solid var(--line);
}
.hero-stats .st:last-child { border-right: 0; }
.hero-stats b { display: block; font-size: 27px; font-weight: 700; letter-spacing: -.03em; }
.hero-stats span { font-size: 12.5px; color: var(--muted-2); }

/* ---------- 信任条 ---------- */
.hero-trust { margin-top: 34px; }
.hero-trust .lbl {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 12px;
}
.hero-trust .rows { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-trust .rows span {
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 12.5px;
}

/* ============================================================
   右栏视觉：Day / Night 二选一显示
   ============================================================ */
.hero-art { position: relative; min-height: 520px; }

.hero-art.day { display: block; }
.hero-art.night { display: none; }

[data-theme="dark"] .hero-art.day { display: none; }
[data-theme="dark"] .hero-art.night { display: block; }

/* ---------- Day：人物 + 樱枝 ---------- */
.hero-art.day img.char {
  position: absolute;
  right: -6%;
  bottom: -8%;
  height: 118%;
  width: auto;
  opacity: .9;
  mix-blend-mode: multiply;
  filter: saturate(1.05) contrast(1.02);
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 98%);
  mask-image: linear-gradient(180deg, #000 62%, transparent 98%);
  pointer-events: none;
}
.hero-art.day img.branch {
  position: absolute;
  right: 2%;
  top: 2%;
  width: 300px;
  opacity: .45;
  pointer-events: none;
}

/* ---------- Night：终端 + glitch ---------- */
.hero-art.night {
  align-items: center;
  justify-items: center;
}
[data-theme="dark"] .hero-art.night { display: grid; }

.hero-art.night .glitch-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .5;
  pointer-events: none;
}

.term {
  position: relative;
  width: 100%;
  max-width: 430px;
  border: 1px solid rgba(255, 59, 92, .28);
  border-radius: 10px;
  background: rgba(6, 6, 9, .86);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 59, 92, .08);
  overflow: hidden;
  font-family: var(--mono);
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-size: 10.5px; color: #6f6a78;
}
.term-bar i { width: 7px; height: 7px; border-radius: 50%; background: #2a2a33; }
.term-bar i:nth-child(1) { background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term pre {
  margin: 0;
  padding: 16px 16px 18px;
  font-size: 11.8px;
  line-height: 1.95;
  color: #b8b2c2;
  white-space: pre-wrap;
  min-height: 250px;
}
.term .ok { color: #67e8a0; }
.term .bad { color: #ff3b5c; }
.term .mut { color: #5b5564; }
.term .cur {
  display: inline-block; width: 6px; height: 13px;
  background: #ff3b5c; vertical-align: -2px;
  animation: curBlink 1s steps(1) infinite;
}
@keyframes curBlink { 50% { opacity: 0 } }

/* 浮动状态卡：两套都在同一位置 */
.hero-art .float {
  position: absolute;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  z-index: 4;
}
.hero-art .float.a { top: 12%; left: -2%; }
.hero-art .float.b { bottom: 16%; right: -2%; }
.hero-art .float i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok, #67e8a0);
}

/* ============================================================
   Night 皮肤：改写整页观感（同一结构）
   ============================================================ */
[data-theme="dark"] .hero2 h1 {
  font-family: var(--mono);
  letter-spacing: -.03em;
  text-shadow: 1px 0 rgba(53, 230, 255, .18), -1px 0 rgba(255, 59, 92, .22);
}
[data-theme="dark"] .hero2 h1 .accent {
  color: #ff3b5c;
  text-shadow: 2px 0 rgba(53, 230, 255, .25);
}
[data-theme="dark"] .hero2 .kicker {
  border-color: rgba(255, 59, 92, .3);
  color: #ff8fa3;
  background: rgba(255, 59, 92, .06);
  font-family: var(--mono);
  letter-spacing: .02em;
}
[data-theme="dark"] .hero2 .kicker i { background: #ff3b5c; box-shadow: 0 0 8px #ff3b5c; }
[data-theme="dark"] .hero-stats .st b { font-family: var(--mono); color: #d8f7ff; }
[data-theme="dark"] .hero-stats .st b::first-letter { color: inherit; }
[data-theme="dark"] .hero-trust .rows span {
  border-radius: 4px;
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .03);
  font-family: var(--mono);
  font-size: 11.5px;
  color: #9aa0ad;
}
[data-theme="dark"] .hero2 .btn-primary {
  background: #ff3b5c;
  color: #0a0508;
  border-radius: 4px;
  font-family: var(--mono);
  box-shadow: 0 0 0 1px rgba(255, 59, 92, .35), 0 10px 26px rgba(255, 59, 92, .18);
}
[data-theme="dark"] .hero2 .btn-primary:hover { background: #ff5773; }
[data-theme="dark"] .hero2 .btn-ghost {
  border-radius: 4px;
  font-family: var(--mono);
  border-color: rgba(255, 255, 255, .16);
}
[data-theme="dark"] .hero-art .float {
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  border-color: rgba(255, 59, 92, .25);
  background: rgba(8, 8, 12, .8);
}
[data-theme="dark"] .hero-art .float i { background: #ff3b5c; box-shadow: 0 0 8px #ff3b5c; }

/* Night 整页扫描线（很淡，只在大屏） */
[data-theme="dark"] body::before {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
  opacity: .5;
  mix-blend-mode: overlay;
}

/* 响应式 */
@media (max-width: 980px) {
  .hero2 { grid-template-columns: 1fr; gap: 24px; }
  /* 方案 v2 §6.1：手机先文案与主操作，动画放到其后 */
  .hero-copy { order: 1; }
  .hero-art { order: 2; min-height: 210px; max-height: 240px; overflow: hidden; }
  .hero-art.day img.char { height: 108%; right: 0; }
  .hero-art.night .term { font-size: 11px; }
  .hero-art .float.a { left: 0; }
  .hero-art .float.b { right: 0; }
  .hero-stats { margin-top: 34px; }
}
@media (max-width: 560px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats .st:nth-child(2) { border-right: 0; }
  .hero-stats .st:nth-child(1), .hero-stats .st:nth-child(2) { border-bottom: 1px solid var(--line); }
  .hero2 h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .term .cur { animation: none; }
}

/* ============================================================
   Day：人物半透明羽化 + 明神门（鸟居）半透明
   ============================================================ */
.hero-art.day img.char {
  opacity: .62;
  filter: blur(.5px) saturate(1.04) contrast(1.02);
  -webkit-mask-image:
    radial-gradient(120% 78% at 62% 42%, #000 52%, rgba(0,0,0,.55) 74%, transparent 92%),
    linear-gradient(180deg, #000 58%, transparent 98%);
  mask-image:
    radial-gradient(120% 78% at 62% 42%, #000 52%, rgba(0,0,0,.55) 74%, transparent 92%),
    linear-gradient(180deg, #000 58%, transparent 98%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.hero-art.day img.torii {
  position: absolute;
  left: 12%;
  top: 16%;
  width: 230px;
  opacity: .26;
  filter: blur(.6px) saturate(.9);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 50%, #000 45%, transparent 85%);
  mask-image: radial-gradient(80% 70% at 50% 50%, #000 45%, transparent 85%);
  pointer-events: none;
  z-index: 1;
}

/* ============================================================
   Night：加量微恐
   ============================================================ */

/* 1) 终端后面的一双眼睛（更淡，更靠后） */
[data-theme="dark"] .hero-art.night::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 34%;
  width: 240px;
  height: 90px;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 32% 50%, rgba(255, 59, 92, .55) 0 2.5px, transparent 4.5px),
    radial-gradient(circle at 68% 50%, rgba(255, 59, 92, .55) 0 2.5px, transparent 4.5px),
    radial-gradient(circle at 32% 50%, rgba(255, 59, 92, .14) 0 16px, transparent 26px),
    radial-gradient(circle at 68% 50%, rgba(255, 59, 92, .14) 0 16px, transparent 26px);
  filter: blur(.5px);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  animation: heroEyes 23s ease-in-out infinite;
}
@keyframes heroEyes {
  0%, 78%, 100% { opacity: 0; }
  79% { opacity: .85; }
  80.2% { opacity: .12; }
  81.4% { opacity: .9; }
  82.8% { opacity: 0; }
  92% { opacity: 0; }
  92.6% { opacity: .45; }
  93.4% { opacity: 0; }
}

/* 2) 终端整体偶发“信号丢失” */
[data-theme="dark"] .term {
  animation: termFlicker 19s steps(1) infinite;
}
@keyframes termFlicker {
  0%, 88.8%, 100% { filter: none; transform: none; }
  89% { filter: brightness(.55) contrast(1.25); transform: translateX(-2px); }
  89.6% { filter: brightness(.9); transform: translateX(1.5px); }
  90.2% { filter: none; transform: none; }
}

/* 3) 终端后面缓慢漂移的影子 */
[data-theme="dark"] .hero-art.night::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: 8%;
  width: 260px;
  height: 320px;
  background: radial-gradient(ellipse at 50% 60%, rgba(0,0,0,.85), transparent 70%);
  filter: blur(18px);
  opacity: .55;
  pointer-events: none;
  z-index: 0;
  animation: shadowDrift 21s ease-in-out infinite;
}
@keyframes shadowDrift {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: .45; }
  50% { transform: translate(-14px, -10px) scale(1.06); opacity: .62; }
}

/* 4) 浮动状态卡偶发变字（JS 切类） */
[data-theme="dark"] .hero-art.night .float.creepy {
  border-color: rgba(255, 59, 92, .6);
  color: #ff8fa3;
  box-shadow: 0 0 18px rgba(255, 59, 92, .25);
}
[data-theme="dark"] .hero-art.night .float.creepy i {
  background: #ff3b5c;
  animation: pulse 1.1s infinite;
}

/* 5) 标题偶尔整行偏色（配合 JS 字符错位） */
[data-theme="dark"] .hero2.creep .hero-copy h1 {
  text-shadow: 2px 0 rgba(255, 59, 92, .35), -2px 0 rgba(53, 230, 255, .3);
}

@media (prefers-reduced-motion: reduce) {
  [data-theme="dark"] .hero-art.night::before,
  [data-theme="dark"] .hero-art.night::after,
  [data-theme="dark"] .term { animation: none !important; }
  [data-theme="dark"] .hero-art.night::before { display: none; }
}
/* ============================================================
   Night：跟随鼠标的眼睛（替换原来的固定眼睛）
   ============================================================ */
[data-theme="dark"] .hero-art.night::before { display: none; }

.eyes3d {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
  width: 210px;
  height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  animation: eyesAppear 23s ease-in-out infinite;
}
[data-theme="dark"] .eyes3d { opacity: .9; animation: none; }
.eyes3d span {
  position: relative;
  width: 62px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 59, 92, .22), rgba(255, 59, 92, .05) 62%, transparent 74%);
  box-shadow: inset 0 0 18px rgba(255, 59, 92, .12);
  display: grid;
  place-items: center;
  animation: eyeBlink2 9s ease-in-out infinite;
}
.eyes3d span:nth-child(2) { animation-delay: .06s; }
.eyes3d span i {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #ff9fb1, #ff3b5c 55%, #6b0b1d 100%);
  box-shadow: 0 0 10px rgba(255, 59, 92, .75);
  transition: transform .1s linear;
}
.eyes3d span::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(6, 4, 8, .96);
  transform-origin: center;
  animation: lidClose 9s ease-in-out infinite;
  opacity: 0;
}
@keyframes eyeBlink2 {
  0%, 88%, 100% { transform: scaleY(1); }
  90% { transform: scaleY(.06); }
  92% { transform: scaleY(1); }
}
@keyframes lidClose { 0%, 100% { opacity: 0; } }

/* ============================================================
   主题切换：无缝擦除（白切黑 / 黑切白）
   ============================================================ */
#themeWipe {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
}
#themeWipe.on { opacity: 1; }
#themeWipe .layer {
  position: absolute;
  inset: 0;
  clip-path: circle(0% at var(--wx, 50%) var(--wy, 50%));
}
#themeWipe.run .layer { animation: wipeIn .42s cubic-bezier(.65, 0, .35, 1) forwards; }
#themeWipe.out .layer { animation: wipeOut .46s ease forwards; }
@keyframes wipeIn {
  to { clip-path: circle(155% at var(--wx, 50%) var(--wy, 50%)); }
}
@keyframes wipeOut {
  from { clip-path: circle(155% at var(--wx, 50%) var(--wy, 50%)); opacity: 1; }
  to { clip-path: circle(155% at var(--wx, 50%) var(--wy, 50%)); opacity: 0; }
}

/* 白切黑：暗色铺开 + 血色余晖 + 月亮 */
#themeWipe.to-dark .layer {
  background:
    radial-gradient(circle at var(--wx) var(--wy), rgba(255, 59, 92, .22), transparent 42%),
    radial-gradient(circle at var(--wx) var(--wy), #17101a, #07070b 62%);
}
/* 黑切白：暖白铺开 + 樱色晨光 */
#themeWipe.to-light .layer {
  background:
    radial-gradient(circle at var(--wx) var(--wy), rgba(255, 92, 147, .22), transparent 46%),
    radial-gradient(circle at var(--wx) var(--wy), #ffffff, #fdf3f7 64%);
}

#themeWipe .glyph {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.4);
  font-size: 120px;
  line-height: 1;
  opacity: 0;
  z-index: 2;
}
#themeWipe.run .glyph { animation: glyphIn .42s cubic-bezier(.65,0,.35,1) forwards; }
@keyframes glyphIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-20deg); }
  60% { opacity: .85; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5) rotate(8deg); }
}
#themeWipe.to-dark .glyph { color: #ff3b5c; text-shadow: 0 0 40px rgba(255, 59, 92, .5); }
#themeWipe.to-light .glyph { color: #ff5c93; text-shadow: 0 0 50px rgba(255, 92, 147, .35); }

/* 切换瞬间压住页面动画，减少撕裂感 */
body.switching #petals { opacity: .15; transition: opacity .2s; }

/* 减少动效变体：不做圆形展开，改快速淡入（仍然可见） */
#themeWipe.fade .layer { clip-path: none !important; }
#themeWipe.run.fade .layer { animation: wipeFadeIn .3s cubic-bezier(.4,0,.2,1) forwards; }
#themeWipe.out.fade .layer { animation: wipeFadeOut .26s ease forwards; }
#themeWipe.fade .glyph { display: none; }
#themeWipe.fade .layer::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 92, 147, .25) 48%, rgba(53, 230, 255, .18) 52%, transparent 70%);
  animation: sweepAcross .3s ease forwards;
}
@keyframes sweepAcross {
  from { transform: translateX(-60%); opacity: 0; }
  40% { opacity: 1; }
  to { transform: translateX(60%); opacity: 0; }
}
@keyframes wipeFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes wipeFadeOut { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .eyes3d span { animation: none; }
}

/* 动效开关 */
.motion-toggle {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  margin-right: 6px;
  transition: color .15s, border-color .15s, background .15s;
}
.motion-toggle:hover { color: var(--text); border-color: var(--sakura); }
.motion-toggle.full { color: var(--sakura); border-color: rgba(255, 92, 147, .5); }
.motion-toggle.off { opacity: .55; }
@media (max-width: 560px) { .motion-toggle { display: none; } }
