/* ============================================
   Splatoon 3 Hub - Glitch Framework
   斯普拉遁赛博朋克风格组件库
   ============================================ */

/* ============================================
   第一部分：变量扩展
   ============================================ */
:root {
  /* Glitch专用颜色 - 使用sg-前缀避免冲突 */
  --sg-ink-pink: #ff4d8d;
  --sg-ink-pink-glow: #ff0066;
  --sg-ink-pink-dark: #c41e3a;
  --sg-ink-cyan: #00e5ff;
  --sg-ink-cyan-glow: #00b8d4;
  --sg-ink-cyan-dark: #0097a7;
  --sg-ink-yellow: #ffeb3b;
  --sg-ink-yellow-glow: #ffd700;
  --sg-ink-purple: #9c27b0;
  --sg-ink-purple-glow: #7b1fa2;
  --sg-ink-orange: #ff9800;
  --sg-ink-orange-glow: #f57c00;
  --sg-ink-lime: #76ff03;
  --sg-ink-lime-glow: #64dd17;
  --sg-ink-green: #00e676;
  --sg-ink-blue: #2979ff;

  /* 故障效果颜色 */
  --sg-glitch-red: #ff0000;
  --sg-glitch-cyan: #00ffff;
  --sg-glitch-green: #00ff00;

  /* 动画配置 */
  --sg-glitch-offset: 3px;
}

/* 性能优化：低动画模式自动禁用 */
@media (prefers-reduced-motion: reduce) {
  :root {
    --sg-animation-duration: 0.01ms;
  }
}

/* ============================================
   第二部分：故障文字效果
   使用: <h1 class="sg-glitch-text" data-text="标题">标题</h1>
   ============================================ */

.sg-glitch-text {
  position: relative;
  font-weight: 900;
  text-transform: uppercase;
  display: inline-block;
}

.sg-glitch-text::before,
.sg-glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.sg-glitch-text::before {
  color: var(--sg-glitch-cyan);
  animation: sg-glitch-anim-1 2s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.sg-glitch-text::after {
  color: var(--sg-glitch-red);
  animation: sg-glitch-anim-2 3s infinite linear alternate-reverse;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

/* 重度故障文字效果 - 用于Hero区域 */
.sg-glitch-text--heavy {
  font-size: 4rem;
  color: #fff;
  text-shadow:
    0 0 10px var(--sg-ink-pink),
    0 0 20px var(--sg-ink-pink),
    0 0 40px var(--sg-ink-pink);
  animation: sg-glitch-skew 4s infinite;
}

.sg-glitch-text--heavy::before {
  animation: sg-glitch-heavy-1 2s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  transform: translate(-2px, -2px);
}

.sg-glitch-text--heavy::after {
  animation: sg-glitch-heavy-2 3s infinite linear alternate-reverse;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  transform: translate(2px, 2px);
}

/* 故障动画关键帧 */
@keyframes sg-glitch-anim-1 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-3px, 3px); }
  40% { transform: translate(-3px, -3px); }
  60% { transform: translate(3px, 3px); }
  80% { transform: translate(3px, -3px); }
}

@keyframes sg-glitch-anim-2 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(3px, -3px); }
  40% { transform: translate(3px, 3px); }
  60% { transform: translate(-3px, -3px); }
  80% { transform: translate(-3px, 3px); }
}

@keyframes sg-glitch-skew {
  0%, 100% { transform: skew(0deg); }
  20% { transform: skew(-2deg); }
  40% { transform: skew(2deg); }
  60% { transform: skew(-1deg); }
  80% { transform: skew(1deg); }
}

@keyframes sg-glitch-heavy-1 {
  0%, 100% {
    transform: translate(0);
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  }
  10% {
    transform: translate(-5px, 3px);
    clip-path: polygon(0 10%, 100% 0, 100% 35%, 0 45%);
  }
  20% {
    transform: translate(5px, -3px);
    clip-path: polygon(0 0, 100% 20%, 100% 45%, 0 25%);
  }
  30% {
    transform: translate(-3px, 5px);
    clip-path: polygon(0 15%, 100% 0, 100% 40%, 0 50%);
  }
  40% {
    transform: translate(3px, -5px);
    clip-path: polygon(0 0, 100% 15%, 100% 35%, 0 45%);
  }
  50% {
    transform: translate(-5px, 2px);
    clip-path: polygon(0 5%, 100% 0, 100% 45%, 0 40%);
  }
  60% {
    transform: translate(5px, -2px);
    clip-path: polygon(0 0, 100% 5%, 100% 40%, 0 45%);
  }
  70% {
    transform: translate(-2px, 4px);
    clip-path: polygon(0 20%, 100% 0, 100% 45%, 0 30%);
  }
  80% {
    transform: translate(2px, -4px);
    clip-path: polygon(0 0, 100% 25%, 100% 35%, 0 45%);
  }
  90% {
    transform: translate(-4px, 1px);
    clip-path: polygon(0 10%, 100% 0, 100% 45%, 0 35%);
  }
}

@keyframes sg-glitch-heavy-2 {
  0%, 100% {
    transform: translate(0);
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  }
  15% {
    transform: translate(4px, -4px);
    clip-path: polygon(0 65%, 100% 55%, 100% 90%, 0 100%);
  }
  30% {
    transform: translate(-4px, 4px);
    clip-path: polygon(0 55%, 100% 65%, 100% 100%, 0 90%);
  }
  45% {
    transform: translate(3px, -3px);
    clip-path: polygon(0 60%, 100% 55%, 100% 95%, 0 100%);
  }
  60% {
    transform: translate(-3px, 3px);
    clip-path: polygon(0 55%, 100% 60%, 100% 100%, 0 95%);
  }
  75% {
    transform: translate(2px, -2px);
    clip-path: polygon(0 70%, 100% 55%, 100% 85%, 0 100%);
  }
  90% {
    transform: translate(-2px, 2px);
    clip-path: polygon(0 55%, 100% 70%, 100% 100%, 0 85%);
  }
}

/* ============================================
   第三部分：3D倾斜卡片
   使用: <div class="sg-tilt-card">...</div>
   依赖JS: SGF.TiltEffect.init()
   ============================================ */

.sg-tilt-card {
  position: relative;
  background: rgba(22, 33, 62, 0.9);
  border-radius: 20px;
  padding: 30px;
  transform-style: preserve-3d;
  transition: transform 0.1s;
  border: 2px solid transparent;
  background-clip: padding-box;
  cursor: pointer;
}

.sg-tilt-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--sg-ink-pink), var(--sg-ink-cyan), var(--sg-ink-yellow), var(--sg-ink-pink));
  border-radius: 20px;
  z-index: -1;
  background-size: 400% 400%;
  animation: sg-gradient-shift 3s ease infinite;
}

@keyframes sg-gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.sg-tilt-card-content {
  transform: translateZ(30px);
}

.sg-tilt-card-shine {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.sg-tilt-card:hover .sg-tilt-card-shine {
  opacity: 1;
}

/* ============================================
   第四部分：全息卡片
   使用: <div class="sg-holographic-card">...</div>
   ============================================ */

.sg-holographic-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 77, 141, 0.1), rgba(0, 229, 255, 0.1));
  border-radius: 20px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.sg-holographic-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 77, 141, 0.3) 60deg,
    rgba(0, 229, 255, 0.3) 120deg,
    rgba(255, 235, 59, 0.3) 180deg,
    rgba(156, 39, 176, 0.3) 240deg,
    rgba(255, 152, 0, 0.3) 300deg,
    transparent 360deg
  );
  animation: sg-holographic-rotate 4s linear infinite;
  opacity: 0.6;
  pointer-events: none;
}

@keyframes sg-holographic-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.sg-holographic-content {
  position: relative;
  z-index: 1;
  background: rgba(22, 33, 62, 0.8);
  border-radius: 15px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

/* ============================================
   第五部分：液态按钮
   使用: <button class="sg-liquid-btn">按钮</button>
   依赖JS: SGF.LiquidButton.init()
   ============================================ */

.sg-liquid-btn {
  position: relative;
  padding: 20px 50px;
  font-size: 1.3rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border: none;
  cursor: pointer;
  background: transparent;
  color: #fff;
  overflow: hidden;
  z-index: 1;
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
  transition: all 0.3s;
}

.sg-liquid-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, var(--sg-ink-pink), var(--sg-ink-purple));
  z-index: -2;
  transition: all 0.5s;
}

.sg-liquid-btn::after {
  content: '';
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle at var(--sg-x, 50%) var(--sg-y, 50%),
    rgba(255, 255, 255, 0.4) 0%,
    transparent 50%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.sg-liquid-btn:hover::after {
  opacity: 1;
}

.sg-liquid-btn:hover {
  transform: translateY(-5px) scale(1.05);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
  box-shadow:
    0 20px 40px rgba(255, 77, 141, 0.4),
    0 0 60px rgba(255, 77, 141, 0.2);
}

/* 液态按钮波纹效果 */
.sg-liquid-btn.sg-ripple {
  overflow: visible;
}

.sg-liquid-btn.sg-ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: 10;
  pointer-events: none;
}

.sg-liquid-btn.sg-ripple:active::before {
  width: 300px;
  height: 300px;
}

/* ============================================
   第六部分：霓虹按钮（简化版）
   使用: <button class="sg-neon-btn">按钮</button>
   ============================================ */

.sg-neon-btn {
  position: relative;
  padding: 16px 40px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s;
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
  color: #fff;
  z-index: 1;
}

.sg-neon-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, var(--sg-ink-pink), var(--sg-ink-purple));
  z-index: -2;
}

.sg-neon-btn--primary {
  box-shadow:
    0 0 20px rgba(255, 77, 141, 0.5),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.sg-neon-btn--primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 10px 30px rgba(255, 77, 141, 0.6),
    0 0 40px rgba(255, 77, 141, 0.4);
}

.sg-neon-btn--secondary {
  background: transparent;
  border: 2px solid var(--sg-ink-cyan);
  color: var(--sg-ink-cyan);
}

.sg-neon-btn--secondary::before {
  background: transparent;
}

.sg-neon-btn--secondary:hover {
  background: var(--sg-ink-cyan);
  color: #1a1a2e;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.5);
}

/* 扫光效果 */
.sg-neon-btn__shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  transform: rotate(45deg) translateY(-100%);
  transition: transform 0.6s;
  pointer-events: none;
}

.sg-neon-btn:hover .sg-neon-btn__shine {
  transform: rotate(45deg) translateY(100%);
}

/* ============================================
   第七部分：霓虹网格背景
   使用: <div class="sg-neon-grid">...</div>
   ============================================ */

.sg-neon-grid {
  position: relative;
  background: var(--bg-darker, #0f0f1a);
  overflow: hidden;
  min-height: 400px;
}

.sg-neon-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 77, 141, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.2) 1px, transparent 1px);
  background-size: 50px 50px;
  transform: perspective(600px) rotateX(60deg);
  transform-origin: center top;
  animation: sg-grid-move 15s linear infinite;
}

.sg-neon-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg-darker, #0f0f1a) 70%);
  pointer-events: none;
}

@keyframes sg-grid-move {
  0% {
    background-position: 0 0;
    filter: hue-rotate(0deg);
  }
  50% {
    filter: hue-rotate(30deg);
  }
  100% {
    background-position: 0 50px;
    filter: hue-rotate(0deg);
  }
}

/* 地平线网格 */
.sg-horizon-grid {
  position: relative;
  height: 400px;
  background: linear-gradient(to bottom, var(--bg-darker, #0f0f1a) 0%, var(--bg-dark, #1a1a2e) 100%);
  overflow: hidden;
}

.sg-horizon-grid::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background-image:
    linear-gradient(rgba(255, 77, 141, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.3) 1px, transparent 1px);
  background-size: 100px 100px;
  transform: perspective(500px) rotateX(70deg);
  transform-origin: center bottom;
  animation: sg-horizon-move 20s linear infinite;
}

@keyframes sg-horizon-move {
  0% { background-position: 0 0; }
  100% { background-position: 0 100px; }
}

/* ============================================
   第八部分：旋转边框卡片
   使用: <div class="sg-border-card">...</div>
   ============================================ */

.sg-border-card {
  position: relative;
  background: rgba(22, 33, 62, 0.8);
  border-radius: 20px;
  padding: 30px;
  border: 2px solid transparent;
  background-clip: padding-box;
  overflow: hidden;
}

.sg-border-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--sg-ink-pink), var(--sg-ink-cyan), var(--sg-ink-yellow));
  border-radius: 20px;
  z-index: -1;
  animation: sg-border-rotate 3s linear infinite;
}

@keyframes sg-border-rotate {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.sg-border-card__content {
  position: relative;
  z-index: 1;
}

/* ============================================
   第九部分：侧边栏导航
   使用: <nav class="sg-sidebar">...</nav>
   依赖JS: SGF.Sidebar.init()
   ============================================ */

.sg-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: rgba(15, 15, 26, 0.98);
  border-right: 2px solid var(--sg-ink-pink);
  padding: 100px 0 30px;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  overflow-y: auto;
}

.sg-sidebar.sg-is-open {
  transform: translateX(0);
}

.sg-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 998;
}

.sg-sidebar-overlay.sg-is-open {
  opacity: 1;
  visibility: visible;
}

.sg-sidebar-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 30px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.sg-sidebar-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--sg-ink-pink);
  transform: scaleY(0);
  transition: transform 0.3s;
  box-shadow: 0 0 20px var(--sg-ink-pink);
}

.sg-sidebar-item:hover {
  background: rgba(255, 77, 141, 0.1);
  color: var(--sg-ink-pink);
  padding-left: 40px;
}

.sg-sidebar-item:hover::before {
  transform: scaleY(1);
}

/* ============================================
   第十一部分：底部导航
   使用: <nav class="sg-bottom-nav">...</nav>
   ============================================ */

.sg-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: rgba(15, 15, 26, 0.95);
  backdrop-filter: blur(20px);
  border-top: 2px solid var(--sg-ink-pink);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
}

.sg-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #888;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.3s;
  position: relative;
}

.sg-bottom-nav-item::before {
  content: '';
  position: absolute;
  top: -10px;
  width: 40px;
  height: 3px;
  background: var(--sg-ink-cyan);
  border-radius: 2px;
  opacity: 0;
  transform: scaleX(0);
  transition: all 0.3s;
  box-shadow: 0 0 10px var(--sg-ink-cyan);
}

.sg-bottom-nav-item:hover,
.sg-bottom-nav-item.sg-is-active {
  color: var(--sg-ink-cyan);
  transform: translateY(-5px);
}

.sg-bottom-nav-item:hover::before,
.sg-bottom-nav-item.sg-is-active::before {
  opacity: 1;
  transform: scaleX(1);
}

.sg-bottom-nav-icon {
  font-size: 1.5rem;
  transition: transform 0.3s;
}

.sg-bottom-nav-item:hover .sg-bottom-nav-icon {
  transform: scale(1.2);
  filter: drop-shadow(0 0 10px var(--sg-ink-cyan));
}

/* ============================================
   第十二部分：霓虹表单组件
   ============================================ */

/* 霓虹输入框 */
.sg-neon-input-group {
  position: relative;
  margin-bottom: 30px;
}

.sg-neon-input {
  width: 100%;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s;
  outline: none;
}

.sg-neon-input:focus {
  border-color: var(--sg-ink-cyan);
  box-shadow:
    0 0 20px rgba(0, 229, 255, 0.3),
    inset 0 0 20px rgba(0, 229, 255, 0.1);
}

.sg-neon-label {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-weight: 700;
  transition: all 0.3s;
  pointer-events: none;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.sg-neon-input:focus + .sg-neon-label,
.sg-neon-input:not(:placeholder-shown) + .sg-neon-label {
  top: -10px;
  left: 15px;
  font-size: 0.75rem;
  color: var(--sg-ink-cyan);
  background: var(--bg-darker, #0f0f1a);
  padding: 0 10px;
  text-shadow: 0 0 10px var(--sg-ink-cyan);
}

/* 霓虹开关 */
.sg-neon-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.sg-neon-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sg-neon-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  transition: 0.4s;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.sg-neon-slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.4s;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.sg-neon-switch input:checked + .sg-neon-slider {
  background: rgba(255, 77, 141, 0.3);
  border-color: var(--sg-ink-pink);
  box-shadow: 0 0 20px rgba(255, 77, 141, 0.5);
}

.sg-neon-switch input:checked + .sg-neon-slider::before {
  transform: translateX(30px);
  background: var(--sg-ink-pink);
  box-shadow: 0 0 20px var(--sg-ink-pink);
}

/* 进度条 */
.sg-progress-bar {
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.sg-progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sg-ink-pink), var(--sg-ink-yellow));
  border-radius: 10px;
  animation: sg-progress-pulse 2s ease-in-out infinite;
}

@keyframes sg-progress-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

/* ============================================
   第十三部分：数据可视化组件
   ============================================ */

/* 霓虹图表 */
.sg-chart-bar {
  height: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 15px;
  position: relative;
}

.sg-chart-bar__fill {
  height: 100%;
  border-radius: 15px;
  position: relative;
  overflow: hidden;
  animation: sg-chart-glow 2s ease-in-out infinite;
}

.sg-chart-bar__fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%);
  animation: sg-chart-shine 2s infinite;
}

@keyframes sg-chart-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

@keyframes sg-chart-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.sg-chart-bar__fill--pink { background: linear-gradient(90deg, var(--sg-ink-pink), var(--sg-ink-pink-glow)); }
.sg-chart-bar__fill--cyan { background: linear-gradient(90deg, var(--sg-ink-cyan), var(--sg-ink-cyan-glow)); }
.sg-chart-bar__fill--yellow { background: linear-gradient(90deg, var(--sg-ink-yellow), var(--sg-ink-orange)); }

/* 圆形进度 */
.sg-circular-progress {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(
    var(--sg-ink-pink) 0deg,
    var(--sg-ink-pink) var(--sg-progress, 0deg),
    rgba(255, 255, 255, 0.1) var(--sg-progress, 0deg),
    rgba(255, 255, 255, 0.1) 360deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sg-pulse-glow 2s ease-in-out infinite;
}

.sg-circular-progress::before {
  content: '';
  position: absolute;
  inset: 10px;
  background: var(--bg-card, #16213e);
  border-radius: 50%;
}

.sg-circular-progress__value {
  position: relative;
  font-size: 2rem;
  font-weight: 900;
  color: var(--sg-ink-pink);
  text-shadow: 0 0 10px var(--sg-ink-pink-glow);
}

@keyframes sg-pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 77, 141, 0.5); }
  50% { box-shadow: 0 0 40px rgba(255, 77, 141, 0.8); }
}

/* ============================================
   第十四部分：模态框
   使用: <div class="sg-modal">...</div>
   依赖JS: SGF.Modal.init()
   ============================================ */

.sg-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.sg-modal.sg-is-open {
  opacity: 1;
  visibility: visible;
}

.sg-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.sg-modal-content {
  position: relative;
  background: var(--bg-card, #16213e);
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  border: 2px solid var(--sg-ink-pink);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(255, 77, 141, 0.3);
  transform: scale(0.8) translateY(50px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sg-modal.sg-is-open .sg-modal-content {
  transform: scale(1) translateY(0);
}

.sg-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-modal-close:hover {
  border-color: var(--sg-glitch-red);
  color: var(--sg-glitch-red);
  transform: rotate(90deg);
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

/* ============================================
   第十五部分：Toast通知
   使用: <div class="sg-toast">...</div>
   ============================================ */

.sg-toast {
  position: fixed;
  top: 100px;
  right: -400px;
  background: rgba(22, 33, 62, 0.95);
  border-left: 4px solid var(--sg-ink-pink);
  padding: 20px 30px;
  border-radius: 0 10px 10px 0;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(255, 77, 141, 0.3);
  backdrop-filter: blur(10px);
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 2000;
  max-width: 350px;
}

.sg-toast.sg-is-show {
  transform: translateX(-420px);
}

.sg-toast--success { border-left-color: var(--sg-ink-lime); }
.sg-toast--error { border-left-color: var(--sg-glitch-red); }
.sg-toast--info { border-left-color: var(--sg-ink-cyan); }

/* ============================================
   第十六部分：工具提示
   使用: <div class="sg-tooltip"><span class="sg-tooltip__text">...</span></div>
   ============================================ */

.sg-tooltip {
  position: relative;
  display: inline-block;
}

.sg-tooltip__text {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  border: 1px solid var(--sg-ink-cyan);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
  z-index: 100;
}

.sg-tooltip__text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--sg-ink-cyan);
}

.sg-tooltip:hover .sg-tooltip__text {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-15px);
}

/* ============================================
   第十七部分：列表组件
   ============================================ */

.sg-list {
  list-style: none;
  padding: 0;
}

.sg-list-item {
  position: relative;
  padding: 20px 25px;
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
  border-radius: 10px;
  border-left: 3px solid transparent;
  transition: all 0.3s;
  cursor: pointer;
  overflow: hidden;
}

.sg-list-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--sg-ink-pink), transparent);
  transition: width 0.3s;
  opacity: 0.3;
}

.sg-list-item:hover {
  background: rgba(255, 77, 141, 0.1);
  border-left-color: var(--sg-ink-pink);
  transform: translateX(10px);
  padding-left: 35px;
}

.sg-list-item:hover::before {
  width: 100%;
}

/* ============================================
   第十八部分：标签页
   ============================================ */

.sg-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.sg-tab {
  padding: 12px 25px;
  background: transparent;
  border: none;
  color: #888;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sg-tab::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--sg-ink-pink);
  transform: scaleX(0);
  transition: transform 0.3s;
  box-shadow: 0 0 15px var(--sg-ink-pink);
}

.sg-tab:hover {
  color: #fff;
}

.sg-tab.sg-is-active {
  color: var(--sg-ink-pink);
  text-shadow: 0 0 20px var(--sg-ink-pink);
}

.sg-tab.sg-is-active::after {
  transform: scaleX(1);
}

.sg-tab-content {
  display: none;
  animation: sg-fade-in 0.5s;
}

.sg-tab-content.sg-is-active {
  display: block;
}

@keyframes sg-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   第十九部分：加载动画
   ============================================ */

/* 墨水加载器 */
.sg-ink-loader {
  position: relative;
  width: 80px;
  height: 80px;
}

.sg-ink-loader-ring {
  position: absolute;
  inset: 0;
  border: 4px solid transparent;
  border-top-color: var(--sg-ink-pink);
  border-radius: 50%;
  animation: sg-spin 1s linear infinite;
}

.sg-ink-loader-ring:nth-child(2) {
  inset: 10px;
  border-top-color: var(--sg-ink-cyan);
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.sg-ink-loader-ring:nth-child(3) {
  inset: 20px;
  border-top-color: var(--sg-ink-yellow);
  animation-duration: 2s;
}

@keyframes sg-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 脉冲点加载 */
.sg-pulse-loader {
  display: flex;
  gap: 10px;
}

.sg-pulse-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--sg-ink-pink);
  animation: sg-pulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 20px var(--sg-ink-pink);
}

.sg-pulse-dot:nth-child(2) {
  background: var(--sg-ink-cyan);
  animation-delay: 0.2s;
  box-shadow: 0 0 20px var(--sg-ink-cyan);
}

.sg-pulse-dot:nth-child(3) {
  background: var(--sg-ink-yellow);
  animation-delay: 0.4s;
  box-shadow: 0 0 20px var(--sg-ink-yellow);
}

@keyframes sg-pulse {
  0%, 100% {
    transform: scale(0.5);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* ============================================
   第二十部分：徽章通知
   ============================================ */

.sg-badge-notification {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sg-badge-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--sg-ink-pink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--sg-ink-pink);
  animation: sg-badge-pulse 2s infinite;
}

@keyframes sg-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ============================================
   第二十一部分：图片效果
   ============================================ */

/* 故障图片 */
.sg-glitch-image {
  position: relative;
  overflow: hidden;
}

.sg-glitch-image img {
  width: 100%;
  display: block;
  transition: all 0.3s;
}

.sg-glitch-image:hover img {
  animation: sg-img-glitch 0.5s;
}

@keyframes sg-img-glitch {
  0%, 100% { transform: translate(0); filter: none; }
  20% { transform: translate(-5px, 2px); filter: hue-rotate(90deg); }
  40% { transform: translate(5px, -2px); filter: hue-rotate(180deg); }
  60% { transform: translate(-3px, 5px); filter: hue-rotate(270deg); }
  80% { transform: translate(3px, -5px); filter: hue-rotate(360deg); }
}

/* 霓虹边框图片 */
.sg-neon-frame-image {
  position: relative;
  padding: 10px;
  background: linear-gradient(45deg, var(--sg-ink-pink), var(--sg-ink-cyan), var(--sg-ink-yellow));
  border-radius: 15px;
  animation: sg-frame-glow 3s linear infinite;
  background-size: 400% 400%;
}

@keyframes sg-frame-glow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.sg-neon-frame-image img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

/* ============================================
   第二十二部分：响应式设计
   ============================================ */

@media (max-width: 768px) {
  .sg-glitch-text--heavy {
    font-size: 2.5rem;
  }

  .sg-bottom-nav {
    height: 70px;
  }

  .sg-sidebar {
    width: 100%;
  }

  .sg-modal-content {
    padding: 30px 20px;
  }

  .sg-toast {
    right: -350px;
    max-width: calc(100vw - 40px);
  }

  .sg-toast.sg-is-show {
    transform: translateX(calc(-100vw + 40px));
  }
}

/* ============================================
   第二十三部分：自定义滚动条
   ============================================ */

.sg-custom-scrollbar::-webkit-scrollbar {
  width: 10px;
}

.sg-custom-scrollbar::-webkit-scrollbar-track {
  background: var(--bg-darker, #0f0f1a);
}

.sg-custom-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--sg-ink-pink), var(--sg-ink-cyan));
  border-radius: 5px;
}

.sg-custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--sg-ink-pink-glow), var(--sg-ink-cyan-glow));
}

/* ============================================
   第二十四部分：音频波形动画
   使用: <div class="sg-audio-visualizer">...</div>
   ============================================ */

.sg-audio-visualizer {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 40px;
}

.sg-audio-bar {
  width: 4px;
  background: linear-gradient(180deg, var(--sg-ink-pink), var(--sg-ink-cyan));
  border-radius: 2px;
  animation: sg-wave-form 1s ease-in-out infinite;
}

.sg-audio-bar:nth-child(1) { animation-delay: 0s; }
.sg-audio-bar:nth-child(2) { animation-delay: 0.05s; }
.sg-audio-bar:nth-child(3) { animation-delay: 0.1s; }
.sg-audio-bar:nth-child(4) { animation-delay: 0.15s; }
.sg-audio-bar:nth-child(5) { animation-delay: 0.2s; }
.sg-audio-bar:nth-child(6) { animation-delay: 0.25s; }
.sg-audio-bar:nth-child(7) { animation-delay: 0.3s; }
.sg-audio-bar:nth-child(8) { animation-delay: 0.35s; }
.sg-audio-bar:nth-child(9) { animation-delay: 0.4s; }
.sg-audio-bar:nth-child(10) { animation-delay: 0.45s; }
.sg-audio-bar:nth-child(11) { animation-delay: 0.5s; }
.sg-audio-bar:nth-child(12) { animation-delay: 0.55s; }
.sg-audio-bar:nth-child(13) { animation-delay: 0.6s; }
.sg-audio-bar:nth-child(14) { animation-delay: 0.65s; }
.sg-audio-bar:nth-child(15) { animation-delay: 0.7s; }
.sg-audio-bar:nth-child(16) { animation-delay: 0.75s; }
.sg-audio-bar:nth-child(17) { animation-delay: 0.8s; }
.sg-audio-bar:nth-child(18) { animation-delay: 0.85s; }
.sg-audio-bar:nth-child(19) { animation-delay: 0.9s; }
.sg-audio-bar:nth-child(20) { animation-delay: 0.95s; }

@keyframes sg-wave-form {
  0%, 100% { height: 20%; }
  50% { height: 100%; }
}

.sg-audio-visualizer.paused .sg-audio-bar {
  animation-play-state: paused;
  height: 20%;
}

/* ============================================
   第二十五部分：时间轴组件
   使用: <div class="sg-timeline">...</div>
   ============================================ */

.sg-timeline {
  position: relative;
  padding-left: 40px;
}

.sg-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg,
    var(--sg-ink-pink),
    var(--sg-ink-cyan),
    var(--sg-ink-yellow)
  );
  border-radius: 1px;
}

.sg-timeline-item {
  position: relative;
  margin-bottom: 30px;
  padding-left: 20px;
}

.sg-timeline-node {
  position: absolute;
  left: -39px;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--sg-ink-pink);
  border: 3px solid var(--bg-darker, #0f0f1a);
  box-shadow: 0 0 15px var(--sg-ink-pink);
  animation: sg-timeline-pulse 2s ease-in-out infinite;
}

.sg-timeline-node--cyan {
  background: var(--sg-ink-cyan);
  box-shadow: 0 0 15px var(--sg-ink-cyan);
}

.sg-timeline-node--yellow {
  background: var(--sg-ink-yellow);
  box-shadow: 0 0 15px var(--sg-ink-yellow);
}

@keyframes sg-timeline-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

.sg-timeline-date {
  font-size: 0.85rem;
  color: var(--sg-ink-cyan);
  font-weight: 700;
  margin-bottom: 5px;
  font-family: 'NinSplatoonSdodrNumber-Reg', monospace;
}

.sg-timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.sg-timeline-content {
  color: var(--text-secondary, rgba(255,255,255,0.7));
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============================================
   第二十六部分：涂鸦边框装饰
   使用: <div class="sg-graffiti-border">...</div>
   ============================================ */

.sg-graffiti-border {
  position: relative;
  border: 3px dashed var(--sg-ink-cyan);
  border-radius: 20px;
  padding: 20px;
  background: rgba(0, 229, 255, 0.02);
  overflow: hidden;
}

.sg-graffiti-border::before {
  content: 'INK!';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--sg-ink-pink), var(--sg-ink-purple));
  color: white;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 900;
  border-radius: 10px;
  box-shadow: 0 0 15px var(--sg-ink-pink);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sg-graffiti-border::after {
  content: '';
  position: absolute;
  inset: -10px;
  border: 2px dotted var(--sg-ink-pink);
  border-radius: 25px;
  opacity: 0.5;
  animation: sg-graffiti-dash 20s linear infinite;
  pointer-events: none;
}

@keyframes sg-graffiti-dash {
  0% { border-offset: 0; }
  100% { border-offset: 100; }
}

.sg-graffiti-splash {
  position: absolute;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle, var(--sg-ink-pink) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0.6;
  filter: blur(2px);
}

.sg-graffiti-splash:nth-child(1) {
  top: 10%;
  right: 5%;
  animation: sg-splash-bounce 3s ease-in-out infinite;
}

.sg-graffiti-splash:nth-child(2) {
  bottom: 15%;
  left: 8%;
  background: radial-gradient(circle, var(--sg-ink-cyan) 0%, transparent 70%);
  animation: sg-splash-bounce 4s ease-in-out infinite 1s;
}

@keyframes sg-splash-bounce {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* ============================================
   第二十七部分：装备图标展示
   使用: <div class="sg-gear-icon">...</div>
   ============================================ */

.sg-gear-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--sg-ink-pink), var(--sg-ink-cyan));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 0 20px rgba(255, 77, 141, 0.5);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.sg-gear-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.sg-gear-icon:hover {
  transform: rotate(15deg) scale(1.1);
  box-shadow: 0 0 30px rgba(255, 77, 141, 0.8);
}

.sg-gear-icon:hover::before {
  transform: translateX(100%);
}

.sg-gear-icon--small {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.sg-gear-icon--large {
  width: 80px;
  height: 80px;
  font-size: 40px;
}

.sg-gear-icon--yellow {
  background: linear-gradient(135deg, var(--sg-ink-yellow), var(--sg-ink-orange));
  box-shadow: 0 0 20px rgba(255, 235, 59, 0.5);
}

.sg-gear-icon--yellow:hover {
  box-shadow: 0 0 30px rgba(255, 235, 59, 0.8);
}

.sg-gear-icon--lime {
  background: linear-gradient(135deg, var(--sg-ink-lime), var(--sg-ink-green));
  box-shadow: 0 0 20px rgba(118, 255, 3, 0.5);
}

.sg-gear-icon--lime:hover {
  box-shadow: 0 0 30px rgba(118, 255, 3, 0.8);
}

/* ============================================
   第二十八部分：倒计时计时器
   使用: <div class="sg-countdown" id="countdown"></div>
   依赖JS: SGF.Countdown.init(targetDate, 'countdown')
   ============================================ */

.sg-countdown {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.sg-countdown-item {
  text-align: center;
  position: relative;
}

.sg-countdown-item:not(:last-child)::after {
  content: ':';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sg-ink-pink);
  font-size: 2.5rem;
  font-weight: 900;
  animation: sg-countdown-blink 1s ease-in-out infinite;
}

@keyframes sg-countdown-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.sg-countdown-value {
  font-size: 3rem;
  font-weight: 900;
  color: var(--sg-ink-pink);
  text-shadow: 0 0 20px var(--sg-ink-pink);
  font-family: 'NinSplatoonSdodrNumber-Reg', monospace;
  background: linear-gradient(180deg,
    var(--sg-ink-pink) 0%,
    var(--sg-ink-pink-glow) 50%,
    var(--sg-ink-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 80px;
}

.sg-countdown-label {
  font-size: 0.8rem;
  color: var(--text-muted, rgba(255,255,255,0.5));
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 5px;
}

.sg-countdown--compact {
  gap: 15px;
}

.sg-countdown--compact .sg-countdown-value {
  font-size: 2rem;
  min-width: 60px;
}

.sg-countdown--compact .sg-countdown-item:not(:last-child)::after {
  font-size: 1.5rem;
  right: -8px;
}

/* 紧急倒计时样式 */
.sg-countdown--urgent .sg-countdown-value {
  color: var(--sg-glitch-red);
  text-shadow: 0 0 20px var(--sg-glitch-red);
  background: linear-gradient(180deg,
    var(--sg-glitch-red) 0%,
    #ff3333 50%,
    var(--sg-glitch-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: sg-urgent-pulse 0.5s ease-in-out infinite;
}

@keyframes sg-urgent-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
