/* ===== 设计系统 - 变量与基础 ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* 颜色体系 */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a1f35;
  --bg-card-hover: #222845;
  --bg-glass: rgba(26, 31, 53, 0.7);
  --bg-glass-hover: rgba(34, 40, 69, 0.85);

  --text-primary: #f0f2f8;
  --text-secondary: #a0a8c4;
  --text-muted: #6b7394;

  --accent-orange: #ff6b35;
  --accent-orange-glow: rgba(255, 107, 53, 0.25);
  --accent-blue: #4e8cff;
  --accent-blue-glow: rgba(78, 140, 255, 0.2);
  --accent-purple: #a855f7;
  --accent-teal: #2dd4bf;
  --accent-pink: #ec4899;

  --gradient-primary: linear-gradient(135deg, #ff6b35, #ff8f5e);
  --gradient-hero: linear-gradient(160deg, #0a0e1a 0%, #151b30 40%, #1a1040 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,107,53,0.08), rgba(78,140,255,0.05));

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(255, 107, 53, 0.3);

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(255, 107, 53, 0.15);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== 重置与基础样式 ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== 背景装饰 ===== */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}

.bg-orb--orange {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.15), transparent 70%);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}

.bg-orb--blue {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(78, 140, 255, 0.12), transparent 70%);
  bottom: 10%;
  left: -5%;
  animation-delay: -7s;
}

.bg-orb--purple {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.1), transparent 70%);
  top: 40%;
  right: 20%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 30px) scale(1.02); }
}

/* ===== 网格背景 ===== */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 2rem;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-smooth);
}

.navbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.navbar__logo-icon {
  width: 38px;
  height: 38px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-orange-glow);
}

.navbar__links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.navbar__link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.navbar__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-orange);
  border-radius: 1px;
  transition: width var(--transition-smooth);
}

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

.navbar__link:hover::after {
  width: 100%;
}

/* ===== 主内容容器 ===== */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== Hero 区域 ===== */
.hero {
  padding: 140px 0 60px;
  text-align: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.2);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-orange);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out;
}

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

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

.hero__title {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero__title-accent {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  font-weight: 400;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

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

/* ===== 技术分类标签 ===== */
.category-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 48px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.category-tab {
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.category-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.category-tab--active {
  color: #fff;
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  box-shadow: 0 2px 16px var(--accent-orange-glow);
}

.category-tab--active:hover {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
}

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

/* ===== 文章卡片 ===== */
.article-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-smooth);
  animation: fadeInUp 0.5s ease-out both;
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.15s; }
.article-card:nth-child(3) { animation-delay: 0.2s; }
.article-card:nth-child(4) { animation-delay: 0.25s; }
.article-card:nth-child(5) { animation-delay: 0.3s; }
.article-card:nth-child(6) { animation-delay: 0.35s; }

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

.article-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card-hover), var(--shadow-glow);
  background: var(--bg-card-hover);
}

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

.article-card__cover {
  width: 100%;
  height: 180px;
  background: var(--gradient-card);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.article-card__cover-icon {
  font-size: 3.5rem;
  z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  transition: transform var(--transition-spring);
}

.article-card:hover .article-card__cover-icon {
  transform: scale(1.12) rotate(-3deg);
}

.article-card__cover-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.06;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 20px,
    rgba(255,255,255,1) 20px,
    rgba(255,255,255,1) 21px
  );
}

.article-card__body {
  padding: 24px;
}

.article-card__tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.tag--core { background: rgba(78, 140, 255, 0.15); color: var(--accent-blue); }
.tag--framework { background: rgba(45, 212, 191, 0.15); color: var(--accent-teal); }
.tag--advanced { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }
.tag--pattern { background: rgba(236, 72, 153, 0.15); color: var(--accent-pink); }
.tag--ecosystem { background: rgba(255, 107, 53, 0.15); color: var(--accent-orange); }

.article-card__title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  line-height: 1.35;
  transition: color var(--transition-fast);
}

.article-card:hover .article-card__title {
  color: var(--accent-orange);
}

.article-card__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.article-card__meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-card__arrow {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 107, 53, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-orange);
  font-size: 1rem;
  transition: all var(--transition-smooth);
  opacity: 0;
  transform: translateX(-8px);
}

.article-card:hover .article-card__arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ===== 详情页 ===== */
.detail-page {
  padding: 100px 0 80px;
}

.detail-page__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 32px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.detail-page__back:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  transform: translateX(-4px);
}

.detail-page__header {
  margin-bottom: 48px;
  animation: fadeInUp 0.5s ease-out;
}

.detail-page__tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.detail-page__title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.detail-page__meta {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--text-muted);
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.detail-page__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-page__divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
  margin: 32px 0;
}

/* ===== 文章内容 ===== */
.detail-content {
  animation: fadeInUp 0.5s ease-out 0.15s both;
}

.detail-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 40px 0 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  position: relative;
  padding-left: 18px;
}

.detail-content h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 2px;
  background: var(--gradient-primary);
}

.detail-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--text-primary);
}

.detail-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.detail-content ul, .detail-content ol {
  color: var(--text-secondary);
  margin: 12px 0 20px 20px;
  line-height: 1.8;
}

.detail-content li {
  margin-bottom: 6px;
}

.detail-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* 代码块 */
.code-block {
  background: #0d1117;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  margin: 20px 0 24px;
  overflow: hidden;
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border-subtle);
}

.code-block__dots {
  display: flex;
  gap: 6px;
}

.code-block__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-block__dot--red { background: #ff5f57; }
.code-block__dot--yellow { background: #ffbd2e; }
.code-block__dot--green { background: #28c840; }

.code-block__lang {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.code-block__body {
  padding: 18px;
  overflow-x: auto;
}

.code-block__body pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  color: #c9d1d9;
}

.code-block__body .keyword { color: #ff7b72; }
.code-block__body .string { color: #a5d6ff; }
.code-block__body .comment { color: #6e7681; font-style: italic; }
.code-block__body .type { color: #79c0ff; }
.code-block__body .annotation { color: #d2a8ff; }
.code-block__body .number { color: #ffa657; }

/* 要点提示框 */
.tip-box {
  background: rgba(78, 140, 255, 0.08);
  border: 1px solid rgba(78, 140, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 24px 0;
}

.tip-box--warning {
  background: rgba(255, 189, 46, 0.08);
  border-color: rgba(255, 189, 46, 0.2);
}

.tip-box__title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tip-box__content {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ===== 页脚 ===== */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 2rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer p + p {
  margin-top: 8px;
}

.footer a {
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: var(--text-primary);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .main-container { padding: 0 1rem; }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero { padding: 120px 0 40px; }

  .navbar__links { display: none; }

  .category-tabs { gap: 6px; }
  .category-tab { padding: 6px 14px; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .article-card__cover { height: 140px; }
  .article-card__body { padding: 18px; }
}

/* ===== 页面过渡动画 ===== */
.page-transition-enter {
  opacity: 0;
  transform: translateY(16px);
}

.page-transition-active {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}
