/* ============================================
   HEYDAY VIDEO — 科技风视频画廊
   深色霓虹 | 移动端优先 | 响应式
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-deep: #060912;
  --bg-primary: #0a0e1a;
  --bg-card: rgba(255, 255, 255, 0.025);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --bg-elevated: rgba(20, 28, 48, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(0, 212, 255, 0.25);
  --text-primary: #e8edf5;
  --text-secondary: #8892a8;
  --text-muted: #4a5468;
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.4);
  --accent-dim: rgba(0, 212, 255, 0.08);
  --accent-2: #6c5ce7;
  --gradient-accent: linear-gradient(135deg, #00d4ff 0%, #6c5ce7 100%);
  --gradient-glow: radial-gradient(circle, rgba(0, 212, 255, 0.15) 0%, transparent 70%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* --- 科技网格背景 --- */
.grid-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* 扫描线 */
.scan-line {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  z-index: 0;
  pointer-events: none;
  opacity: 0.15;
  animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
  0% { transform: translateY(0); }
  100% { transform: translateY(100vh); }
}

/* --- 顶部导航 --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-smooth);
}

.topbar.scrolled {
  background: rgba(10, 14, 26, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.brand-text {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.brand-sub {
  font-weight: 300;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 1px;
}

/* 搜索框 */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  padding: 0 14px;
  height: 38px;
  transition: all var(--transition-fast);
  flex: 1;
  max-width: 320px;
}

.topbar-search:focus-within {
  border-color: var(--border-glow);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: rgba(0, 212, 255, 0.03);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

#searchInput {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  width: 100%;
  font-family: inherit;
}

#searchInput::placeholder { color: var(--text-muted); }

/* --- Hero 区域 --- */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 20px 32px;
  overflow: hidden;
}

.hero-bg-glow {
  position: absolute;
  top: -50%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  border: 1px solid var(--border-glow);
  border-radius: 100px;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 2px;
  margin-bottom: 20px;
  background: var(--accent-dim);
  font-family: var(--font-mono);
}

.pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.5s ease-in-out infinite;
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.title-line-1 {
  font-size: clamp(28px, 8vw, 52px);
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #e8edf5 0%, #00d4ff 50%, #6c5ce7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-line-2 {
  font-size: clamp(12px, 3vw, 18px);
  font-weight: 400;
  letter-spacing: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hero-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.stat { text-align: center; }

.stat-num {
  font-size: clamp(24px, 6vw, 36px);
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 1px;
}

/* --- 分类筛选 --- */
.filter-bar {
  position: sticky;
  top: 56px;
  z-index: 90;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 0;
}

.filter-chips {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 6px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
}

.chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-dim);
}

.chip .chip-count {
  font-size: 11px;
  opacity: 0.6;
  margin-left: 4px;
  font-family: var(--font-mono);
}

/* --- 视频网格 --- */
.video-grid {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* --- 视频卡片 --- */
.video-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-smooth);
  opacity: 0;
  transform: translateY(20px);
  animation: cardIn 0.5s ease forwards;
}

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

.video-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-dim);
}

.card-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-deep);
  overflow: hidden;
}

.card-thumbnail video,
.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(6, 9, 18, 0.7) 100%);
  pointer-events: none;
}

/* 播放按钮 */
.play-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.15);
  border: 2px solid var(--accent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-bounce);
  z-index: 2;
  box-shadow: 0 0 20px var(--accent-dim);
}

.video-card:hover .play-btn {
  transform: translate(-50%, -50%) scale(1.15);
  background: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.play-btn svg {
  width: 22px; height: 22px;
  fill: var(--accent);
  margin-left: 2px;
  transition: fill var(--transition-fast);
}

.video-card:hover .play-btn svg { fill: var(--bg-deep); }

/* 分类标签 */
.card-tag {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-glow);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 1px;
  font-weight: 600;
  z-index: 2;
  font-family: var(--font-mono);
}

/* 加载指示器 */
.card-loader {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 1;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 卡片信息 */
.card-info {
  padding: 12px 14px 14px;
}

.card-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 卡片转发按钮 */
.share-mini {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  opacity: 0.7;
}

.share-mini:hover {
  color: var(--accent);
  border-color: var(--border-glow);
  background: var(--accent-dim);
  opacity: 1;
}

/* 缩略图防长按保存 */
.card-thumbnail {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* --- 空状态 --- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-icon {
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 15px;
}

/* --- 视频播放弹窗 --- */
.player-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.player-overlay.open {
  display: flex;
}

.player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.player-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.4s var(--transition-bounce);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.player-close {
  position: absolute;
  top: -48px; right: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 10;
}

.player-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-deep);
  transform: rotate(90deg);
}

.player-wrapper {
  width: 100%;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 40px var(--accent-dim);
}

#playerVideo {
  width: 100%;
  display: block;
  max-height: 72vh;
  object-fit: contain;
}

.player-info {
  padding: 16px 4px 0;
}

.player-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.player-tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 100px;
  background: var(--accent-dim);
  border: 1px solid var(--border-glow);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1px;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* 播放器转发按钮 */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 100px;
  border: 1px solid var(--border-glow);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.share-btn:hover {
  background: var(--accent);
  color: var(--bg-deep);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.share-btn svg { flex-shrink: 0; }

.player-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.player-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 播放器视频防长按保存 */
.player-wrapper {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* --- Toast 提示 --- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  z-index: 3000;
  background: rgba(10, 14, 26, 0.95);
  border: 1px solid var(--border-glow);
  border-radius: 100px;
  padding: 10px 22px;
  font-size: 13px;
  color: var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-smooth);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- 页脚 --- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  padding: 40px 20px 20px;
  overflow: hidden;
}

.footer-glow {
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 400px; height: 200px;
  background: radial-gradient(ellipse, rgba(0, 212, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.footer-brand p {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-bottom {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-bottom p {
  font-size: 11px;
  color: var(--text-muted);
}

/* --- 平板适配 --- */
@media (min-width: 640px) {
  .topbar-inner { padding: 0 24px; height: 60px; }
  .filter-bar { top: 60px; }
  .filter-chips { padding: 0 24px; }
  .hero { padding: 64px 24px 40px; }
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 24px 24px 80px;
  }
  .card-title { font-size: 16px; }
  .card-desc { font-size: 13px; }
  .player-close { top: -52px; right: 8px; }
}

/* --- 桌面适配 --- */
@media (min-width: 1024px) {
  .topbar-inner { padding: 0 32px; height: 64px; }
  .filter-bar { top: 64px; }
  .filter-chips { padding: 0 32px; }
  .hero { padding: 80px 32px 48px; }
  .hero-badge { font-size: 12px; }
  .hero-desc { font-size: 16px; }
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 28px 32px 100px;
  }
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
  .player-info { padding: 20px 8px 0; }
  .player-title { font-size: 22px; }
  .player-desc { font-size: 15px; }
}

/* --- 滚动条 --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.3); }

/* --- 减少动画偏好 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .scan-line { display: none; }
}

/* ============================================================
   悬浮语言切换胶囊（与 HEYDAY 官网同款）
   ============================================================ */
@keyframes lsFadeIn {
  from { opacity: 0; transform: translateY(24px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lang-switcher {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 100px;
  background: rgba(12, 12, 12, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(230, 0, 18, 0);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
  animation: lsFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 1.6s both;
}

.lang-switcher:hover {
  border-color: rgba(230, 0, 18, 0.45);
  box-shadow:
    0 14px 48px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(230, 0, 18, 0.22);
}

.ls-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: none;
  border-radius: 100px;
  background: transparent;
  color: #9a9a9a;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap;
}

.ls-btn .ls-globe {
  width: 0;
  height: 15px;
  opacity: 0;
  flex: none;
  transition: opacity 0.3s ease, width 0.3s ease;
}

.lang-switcher:hover .ls-btn .ls-globe { opacity: 0.8; width: 15px; }

.ls-btn.active {
  color: #fff;
  background: #e60012;
  box-shadow: 0 4px 18px rgba(230, 0, 18, 0.45);
}

.ls-btn.active .ls-globe { opacity: 1; width: 15px; }

.ls-btn:not(.active):hover { color: #fff; }

.ls-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 2px;
  flex: none;
}

@media (max-width: 768px) {
  .lang-switcher { right: 16px; bottom: 18px; }
  .ls-btn { padding: 8px 13px; font-size: 11px; letter-spacing: 1px; }
  .lang-switcher:hover .ls-btn .ls-globe,
  .ls-btn.active .ls-globe { opacity: 0; width: 0; }
}
