/* 网络安全博客 - 样式表 */
:root {
  --primary-color: #ef4444;
  --primary-hover: #dc2626;
  --secondary-color: #f87171;
  --background: #0f0f0f;
  --surface: #1a1a1a;
  --surface-hover: #2a2a2a;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: #27272a;
  --gradient: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.7;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 导航栏 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(15, 15, 15, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  padding: 16px 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-icon { font-size: 1.5rem; }

.nav-toggle { display: none; cursor: pointer; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 24px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover { color: var(--primary-color); }

/* 英雄区域 */
.hero {
  padding: 120px 0 80px;
  text-align: center;
  background: linear-gradient(180deg, var(--background) 0%, var(--surface) 100%);
}

.hero-icon { font-size: 4rem; margin-bottom: 20px; }

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 40px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
}

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

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.hero-tags {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tag {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* 分类区域 */
.categories-section { padding: 60px 0; }

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.section-icon { font-size: 1.5rem; }

.section-title h2 {
  font-size: 1.75rem;
  font-weight: 700;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.1);
}

.category-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.category-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.category-count {
  font-size: 0.875rem;
  color: var(--primary-color);
}

/* 文章区域 */
.articles-section { padding: 60px 0; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
}

.article-image {
  padding: 40px;
  background: var(--gradient);
  text-align: center;
}

.article-image-icon { font-size: 3rem; }

.article-content { padding: 20px; }

.article-category {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--primary-color);
  border-radius: 4px;
  font-size: 0.75rem;
  margin-bottom: 8px;
}

.article-content h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.article-excerpt {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* 外链区域 */
.links-section {
  padding: 60px 0;
  background: var(--surface);
}

.links-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.link-item {
  display: block;
  padding: 12px 16px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.3s;
  text-align: center;
}

.link-item:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* 文章详情 */
.article-detail { padding: 100px 0 60px; }

.article-header {
  text-align: center;
  margin-bottom: 40px;
}

.article-header .category {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--primary-color);
  border-radius: 4px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.article-header .meta {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 32px 0 16px;
  color: var(--primary-color);
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 24px 0 12px;
}

.article-body p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

.article-body ul, .article-body ol {
  color: var(--text-secondary);
  margin: 16px 0;
  padding-left: 24px;
}

.article-body li { margin-bottom: 8px; }

.article-body blockquote {
  background: var(--surface);
  border-left: 4px solid var(--primary-color);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 4px;
}

.article-body code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.article-body pre {
  background: var(--surface);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}

/* 相关文章 */
.related-articles {
  max-width: 800px;
  margin: 40px auto 0;
  padding: 0 20px;
}

.related-articles h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.related-articles-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.related-article-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s;
}

.related-article-item:hover {
  border-color: var(--primary-color);
}

.related-article-item .icon { font-size: 1.5rem; }

/* Footer */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.footer-brand {
  margin-bottom: 12px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
}

.footer-logo-icon { font-size: 1.5rem; }

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

.footer-column h4 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* 响应式 */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); flex-direction: column; padding: 20px; }
  .nav-links.active { display: flex; }
  .hero h1 { font-size: 2rem; }
  .hero-stats { flex-direction: column; gap: 20px; }
  .categories-grid, .articles-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .related-articles-list { grid-template-columns: 1fr; }
}