/* === 科技化风格 - Cyberpunk Tech Theme === */
@import url('https://fonts.googleapis.cn/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* 暗色科技配色 */
  --color-bg: #0a0a0f;
  --color-bg-secondary: #12121a;
  --color-bg-card: #1a1a25;
  --color-bg-hover: #22222f;
  --color-text: #e4e4e7;
  --color-text-secondary: #a1a1aa;
  --color-text-muted: #71717a;
  --color-border: rgba(139, 92, 246, 0.2);
  --color-border-glow: rgba(139, 92, 246, 0.5);
  --color-primary: #8b5cf6;
  --color-primary-hover: #a78bfa;
  --color-primary-glow: rgba(139, 92, 246, 0.3);
  --color-accent: #06b6d4;
  --color-accent-glow: rgba(6, 182, 212, 0.3);
  --color-success: #10b981;
  --color-error: #ef4444;
  --font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 1200px;
  --header-height: 72px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 粒子背景 */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* 渐变叠加层 */
#app::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--color-primary-glow), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, var(--color-accent-glow), transparent);
  z-index: 0;
  pointer-events: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* === 头部导航 === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-accent), transparent);
  opacity: 0.5;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
  transition: var(--transition);
}

.logo:hover {
  color: var(--color-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 18px;
  color: white;
  box-shadow: 0 0 20px var(--color-primary-glow);
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-icon {
  width: 18px;
  height: 18px;
}

.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary-glow), var(--color-accent-glow));
  opacity: 0;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--color-text);
  background: var(--color-bg-hover);
}

.nav-link:hover::before {
  opacity: 0.1;
}

.nav-link.active {
  color: var(--color-primary);
  background: rgba(139, 92, 246, 0.1);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  box-shadow: 0 0 10px var(--color-primary);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-btn span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: var(--transition);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 24px;
  z-index: 99;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu.active {
  display: flex;
}

/* === 主内容区 === */
.main {
  min-height: calc(100vh - var(--header-height) - 100px);
  padding-top: calc(var(--header-height) + 60px);
  padding-bottom: 60px;
  position: relative;
  z-index: 1;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

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

/* Hero 区域 */
.hero-section {
  text-align: center;
  margin-bottom: 60px;
  padding: 40px 0;
}

.hero-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--color-text), var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  display: block;
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 8px;
  background: none;
  -webkit-text-fill-color: var(--color-primary);
}

.hero-desc {
  font-size: 18px;
  color: var(--color-text-secondary);
  font-weight: 300;
}

/* === 文章卡片网格 === */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0;
  transition: var(--transition);
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-glow);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 30px var(--color-primary-glow);
}

.article-card:hover::before {
  opacity: 1;
}

.article-card h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
  line-height: 1.3;
}

.article-card .excerpt {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.article-card .meta::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 50%;
}

/* === 视频网格 === */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.video-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

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

.thumbnail-wrapper {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.video-card:hover .thumbnail {
  transform: scale(1.05);
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(139, 92, 246, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.play-icon::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 18px solid white;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  margin-left: 4px;
}

.video-card:hover .play-icon {
  opacity: 1;
}

.duration {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.8);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: white;
}

.video-card h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  padding: 16px 16px 8px;
  line-height: 1.4;
}

.video-card .video-meta {
  font-size: 13px;
  color: var(--color-text-muted);
  padding: 0 16px 16px;
  font-family: var(--font-mono);
}

/* === 加载状态 === */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--color-text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* 加载更多按钮 */
.load-more-btn {
  display: block;
  margin: 40px auto 0;
  padding: 14px 32px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.load-more-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 20px var(--color-primary-glow);
}

/* === 文章详情页 === */
.article-detail {
  max-width: 720px;
  margin: 0 auto;
}

.article-detail h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 16px;
}

.article-detail .article-meta {
  font-size: 14px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.article-detail .article-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--color-text);
}

.article-detail .article-content h2 {
  font-size: 26px;
  font-weight: 600;
  color: var(--color-text);
  margin: 40px 0 20px;
  padding-top: 20px;
}

.article-detail .article-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin: 30px 0 16px;
}

.article-detail .article-content p {
  margin-bottom: 20px;
}

.article-detail .article-content blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--color-primary-hover);
  gap: 12px;
}

/* === 视频详情页 === */
.video-detail {
  max-width: 960px;
  margin: 0 auto;
}

.video-detail .video-player {
  aspect-ratio: 16/9;
  background: var(--color-bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.video-detail .video-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 嵌入视频播放器样式 */
.video-detail .video-player iframe {
  width: 100%;
  height: 100%;
  border: none;
  min-height: 400px;
}

/* 抖音嵌入（竖屏适配） */
.video-detail .video-player.douyin-embed {
  aspect-ratio: 9/16;
  max-width: 420px;
  margin: 0 auto 24px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.video-detail .video-player.douyin-embed iframe {
  min-height: 100%;
  border-radius: 12px;
}

/* 哔哩哔哩嵌入 */
.video-detail .video-player.bilibili-embed iframe {
  min-height: 450px;
}

/* YouTube嵌入 */
.video-detail .video-player.youtube-embed iframe {
  min-height: 400px;
}

.video-detail h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
}

.video-detail .description {
  color: var(--color-text-secondary);
  font-size: 15px;
}

/* === 页脚 === */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 40px 0;
  position: relative;
  z-index: 1;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--color-text);
}

.footer-logo {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.footer-copy {
  font-size: 13px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

/* === 响应式 === */
@media (max-width: 768px) {
  .nav {
    display: none;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .articles-grid,
  .videos-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-section {
    margin-bottom: 40px;
  }
  
  .hero-desc {
    font-size: 15px;
  }
  
  .main {
    padding-top: calc(var(--header-height) + 40px);
  }
}

/* === 滚动条样式 === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* === 选中文字样式 === */
::selection {
  background: var(--color-primary);
  color: white;
}
