/* 流光星语 · 动画演示馆
   延续 AKI Portal 的设计语言：深色底、毛玻璃、内发光、低饱和与
   cubic-bezier(.16,1,.3,1) 缓动，并注入二次元霓虹、樱花与星空质感。 */

:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #090a0d;
  color: #f4f4ef;
  --line: rgba(255, 255, 255, 0.16);
  --muted: #b7b9c0;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* 主题色：由 data-theme 驱动，JS Canvas 也读取这两个变量 */
  --acc-1: #7aa2ff;
  --acc-2: #b39dff;
  --acc-3: #7de3ff;
  --glow: rgba(122, 162, 255, 0.55);

  --page-bg: #090a0d;
}

html[data-theme="sakura"] {
  --acc-1: #ff9ec7;
  --acc-2: #ffb3d9;
  --acc-3: #ffd1e8;
  --glow: rgba(255, 158, 199, 0.55);
}
html[data-theme="violet"] {
  --acc-1: #b08cff;
  --acc-2: #8f7bff;
  --acc-3: #d4b3ff;
  --glow: rgba(176, 140, 255, 0.55);
}
html[data-theme="mint"] {
  --acc-1: #6fe0c4;
  --acc-2: #7de3ff;
  --acc-3: #a5f3d0;
  --glow: rgba(111, 224, 196, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  min-height: 100svh;
  background:
    radial-gradient(1200px 700px at 78% -6%, color-mix(in srgb, var(--acc-1) 16%, transparent), transparent 60%),
    radial-gradient(900px 600px at 8% 30%, color-mix(in srgb, var(--acc-2) 11%, transparent), transparent 55%),
    var(--page-bg);
  color: #f4f4ef;
  overflow-x: hidden;
  transition: background 800ms var(--ease);
}
a { color: inherit; }
button { font: inherit; }

/* ---- 背景层 ---- */
#starfield, #sakura, #trail { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#starfield { z-index: 0; }
#sakura { z-index: 1; }
#trail { z-index: 3; }

.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- 导航（复刻门户浮动岛） ---- */
.nav {
  position: fixed; z-index: 40; top: 20px; left: clamp(16px, 4vw, 64px); right: clamp(16px, 4vw, 64px);
  display: flex; align-items: center; justify-content: space-between; pointer-events: none;
}
.nav-left, .nav-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.portal-header-island {
  width: fit-content; max-width: max-content; min-height: 46px; padding: 8px 12px; flex: none;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 16px;
  background: rgba(17, 19, 25, 0.52); box-shadow: 0 10px 32px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); pointer-events: auto;
}
.portal-header-divider { display: block; width: 1px; height: 16px; flex: none; background: rgba(255, 255, 255, 0.14); }
.brand {
  display: flex; align-items: center; min-height: 40px; color: #f5f7fb; text-decoration: none;
  font-size: 12px; font-weight: 750; letter-spacing: 0.15em;
}
.brand.sub { min-height: 0; font-weight: 600; letter-spacing: 0.22em; color: var(--acc-3); }
.pulse { display: inline-block; width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; background: var(--acc-1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc-1) 18%, transparent), 0 0 14px var(--glow); }
.ghost {
  display: inline-flex; min-height: 30px; align-items: center; justify-content: center; padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 11px; background: rgba(255, 255, 255, 0.06);
  color: #f4f4ef; text-decoration: none; white-space: nowrap; cursor: pointer; transition: border-color 0.25s, background 0.25s;
}
.ghost:hover { border-color: color-mix(in srgb, var(--acc-1) 60%, transparent); background: color-mix(in srgb, var(--acc-1) 14%, transparent); }

/* ---- Hero ---- */
.hero {
  position: relative; z-index: 5; min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 120px 24px 80px;
}
.hero-badge {
  padding: 7px 14px; border: 1px solid color-mix(in srgb, var(--acc-1) 35%, transparent); border-radius: 999px;
  color: var(--acc-3); background: color-mix(in srgb, var(--acc-1) 8%, transparent);
  font-size: 11px; letter-spacing: 0.28em; backdrop-filter: blur(8px);
}
.hero-title { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.18em; margin: 28px 0 22px; max-width: 100%; font-size: clamp(64px, 13vw, 168px); font-weight: 760; line-height: 0.95; letter-spacing: -0.06em; }
.title-line { display: inline-block; color: #fff; text-shadow: 0 0 14px rgba(255, 255, 255, 0.42), 0 0 46px color-mix(in srgb, var(--acc-1) 55%, transparent); animation: title-float 6s var(--ease) infinite; }
.title-line.accent { color: var(--acc-3); animation-delay: 1.6s; text-shadow: 0 0 16px var(--glow), 0 0 60px var(--glow); }
@keyframes title-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.hero-sub { max-width: min(640px, 100%); margin: 0; color: var(--muted); font-size: clamp(15px, 2vw, 18px); line-height: 1.9; }
.hero-cta { margin-top: 34px; max-width: 100%; }
.portal-action {
  display: inline-flex; align-items: center; gap: 14px; padding: 15px 22px; border: 1px solid rgba(255, 255, 255, 0.44);
  background: #f0f2f3; color: #101114; text-decoration: none; font-weight: 750; border-radius: 0;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.portal-action:hover { transform: translateY(-3px); box-shadow: 0 14px 40px color-mix(in srgb, var(--acc-1) 35%, transparent); }
.hero-credit { margin-top: 30px; max-width: 100%; color: #9298a5; font-size: 13px; letter-spacing: 0.06em; overflow-wrap: anywhere; }
.hero-credit strong { color: var(--acc-3); font-weight: 700; }
.credit-mark { color: var(--acc-1); }
.scroll-hint { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; color: #6d7280; font-size: 11px; letter-spacing: 0.24em; }
.scroll-hint i { display: block; width: 1px; height: 34px; background: linear-gradient(var(--acc-1), transparent); animation: scroll-line 1.8s var(--ease) infinite; }
@keyframes scroll-line { 0% { transform: scaleY(0); transform-origin: top; } 45% { transform: scaleY(1); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---- 主题 Dock ---- */
.theme-dock {
  position: relative; z-index: 5; display: flex; align-items: center; gap: 12px; justify-content: center;
  flex-wrap: wrap; margin: 0 auto 20px; padding: 12px 18px; width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px; background: rgba(17, 19, 25, 0.5);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.theme-label { color: #9298a5; font-size: 11px; letter-spacing: 0.22em; }
.theme-dot { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: #b7b9c0; cursor: pointer; transition: all 0.3s var(--ease); }
.theme-dot i { width: 9px; height: 9px; border-radius: 50%; }
.theme-dot b { font-size: 12px; font-weight: 600; }
.theme-dot[data-theme="star"] i { background: #7aa2ff; box-shadow: 0 0 10px #7aa2ff; }
.theme-dot[data-theme="sakura"] i { background: #ff9ec7; box-shadow: 0 0 10px #ff9ec7; }
.theme-dot[data-theme="violet"] i { background: #b08cff; box-shadow: 0 0 10px #b08cff; }
.theme-dot[data-theme="mint"] i { background: #6fe0c4; box-shadow: 0 0 10px #6fe0c4; }
.theme-dot.active { border-color: rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.07); color: #f4f4ef; }
.theme-dot:hover { color: #f4f4ef; }

/* ---- 画廊卡片 ---- */
.gallery {
  position: relative; z-index: 5; display: grid; gap: 24px; grid-template-columns: repeat(2, 1fr);
  width: min(1400px, calc(100vw - 48px)); margin: 40px auto 80px;
}
.card {
  position: relative; min-height: 460px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px; background: rgba(17, 19, 25, 0.62);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4), inset 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px) saturate(0.9); -webkit-backdrop-filter: blur(22px) saturate(0.9);
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--acc-1) 45%, transparent); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 50px color-mix(in srgb, var(--acc-1) 18%, transparent), inset 0 1px rgba(255, 255, 255, 0.08); }
.card canvas, .aurora-stage, .neon-stage { position: absolute; inset: 0; width: 100%; height: 100%; }
.card canvas { display: block; }
.card-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 28px 24px; z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(9, 10, 13, 0.88) 46%);
  pointer-events: none;
}
.card-kicker { display: block; color: var(--acc-3); font-size: 11px; letter-spacing: 0.24em; }
.card-info h2 { margin: 9px 0 8px; font-size: 26px; letter-spacing: -0.02em; }
.card-info p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; max-width: 46ch; }

/* 极光卡片 */
.aurora-stage { background: radial-gradient(120% 90% at 50% 100%, #0a0f1c, #05060a 70%); }
.aurora-band { position: absolute; left: -20%; right: -20%; top: 30%; height: 46%; border-radius: 50%; filter: blur(46px); opacity: 0.55; mix-blend-mode: screen; }
.aurora-band.a1 { background: linear-gradient(90deg, transparent, var(--acc-1), var(--acc-2), transparent); animation: aurora-shift 11s ease-in-out infinite; }
.aurora-band.a2 { background: linear-gradient(90deg, transparent, var(--acc-3), var(--acc-1), transparent); top: 46%; animation: aurora-shift 14s ease-in-out infinite reverse; opacity: 0.4; }
.aurora-band.a3 { background: linear-gradient(90deg, transparent, var(--acc-2), var(--acc-3), transparent); top: 22%; animation: aurora-shift 17s ease-in-out infinite; opacity: 0.34; }
@keyframes aurora-shift { 0%, 100% { transform: translateX(-6%) rotate(-2deg); } 50% { transform: translateX(6%) rotate(3deg); } }
.aurora-star { position: absolute; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; animation: star-twinkle 3.5s ease-in-out infinite; }
.aurora-star.s1 { width: 3px; height: 3px; top: 24%; left: 22%; }
.aurora-star.s2 { width: 2px; height: 2px; top: 14%; left: 64%; animation-delay: 1.2s; }
.aurora-star.s3 { width: 2px; height: 2px; top: 40%; left: 82%; animation-delay: 2.1s; }
@keyframes star-twinkle { 0%, 100% { opacity: 0.2; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.3); } }

/* 霓虹卡片 */
.neon-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(90% 80% at 50% 40%, #0c0a14, #05060a 75%); }
.neon-word { font-weight: 780; letter-spacing: 0.06em; line-height: 1; }
.neon-word.n1 { font-size: clamp(48px, 8vw, 96px); color: #fff; text-shadow: 0 0 6px #fff, 0 0 18px var(--acc-1), 0 0 42px var(--acc-1), 0 0 90px var(--glow); animation: neon-breathe 3.2s ease-in-out infinite; }
.neon-word.n2 { font-size: clamp(28px, 5vw, 56px); color: var(--acc-2); text-shadow: 0 0 8px var(--acc-2), 0 0 30px var(--acc-2); animation: neon-breathe 4s ease-in-out infinite 0.8s; }
.neon-word.n3 { font-size: clamp(14px, 2.4vw, 24px); letter-spacing: 0.5em; color: var(--acc-3); text-shadow: 0 0 10px var(--acc-3); animation: neon-breathe 4.6s ease-in-out infinite 1.6s; }
@keyframes neon-breathe { 0%, 100% { opacity: 0.72; } 50% { opacity: 1; } }

/* ---- Footer ---- */
.footer {
  position: relative; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 26px;
  flex-wrap: wrap; padding: 40px 24px 60px; border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-credit { color: #9298a5; font-size: 13px; }
.footer-credit strong { color: var(--acc-3); }
.footer-meta { color: #5b5f6a; font-size: 11px; letter-spacing: 0.24em; }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .gallery { grid-template-columns: 1fr; }
  .card { min-height: 400px; }
}
@media (max-width: 640px) {
  .nav { top: 10px; left: 10px; right: 10px; }
  .portal-header-island { min-height: 42px; padding: 6px 9px; border-radius: 14px; }
  .brand { font-size: 11px; letter-spacing: 0.12em; }
  .brand.sub, .portal-header-divider { display: none; }
  .hero-title { font-size: clamp(48px, 18vw, 96px); gap: 0.12em; }
  .hero-sub { padding: 0 4px; }
  .card { min-height: 360px; }
  .card-info { padding: 20px 20px 18px; }
}

/* ---- 无障碍：减少动效 ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .title-line, .aurora-band, .neon-word { animation: none !important; }
}
