/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

/* Header */
.header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.logo h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav a:hover, .nav a.active {
  color: white;
  border-bottom-color: white;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2.5rem;
}

.hero-stat {
  text-align: center;
}

.hero-stat .num {
  font-size: 2rem;
  font-weight: 700;
  display: block;
}

.hero-stat .label {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Main */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
  width: 100%;
}

/* Category tabs */
.categories {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.cat-tag {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  background: white;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.cat-tag:hover, .cat-tag.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Article grid */
.articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  border: 1px solid var(--border);
}

.article-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.article-card .meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-light);
}

.article-card .meta .tag {
  background: #eff6ff;
  color: var(--primary);
  padding: 0.15rem 0.6rem;
  border-radius: 10px;
  font-weight: 500;
}

.article-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.article-card h3 a {
  color: var(--text);
}

.article-card h3 a:hover {
  color: var(--primary);
}

.article-card .desc {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.article-card .footer-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Article detail page */
.article-detail {
  max-width: 800px;
  margin: 0 auto;
}

.article-detail .back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.article-detail .back:hover {
  color: var(--primary);
}

.article-detail h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.article-detail .article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.9rem;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-content h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.article-content h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content ul, .article-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content code {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: #dc2626;
  font-family: 'Fira Code', 'Consolas', monospace;
}

.article-content pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.article-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: #f8fafc;
  color: var(--text-light);
  border-radius: 0 8px 8px 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.article-content th, .article-content td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}

.article-content th {
  background: #f8fafc;
  font-weight: 600;
}

/* About page */
.about-page {
  max-width: 800px;
  margin: 0 auto;
}

.about-page h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.about-page .intro {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.about-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.about-card h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.about-card ul {
  list-style: none;
  padding: 0;
}

.about-card li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.about-card li:last-child {
  border-bottom: none;
}

.about-card li::before {
  content: "✓";
  color: var(--primary);
  font-weight: bold;
}

/* Footer */
.footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 1.5rem 2rem;
  text-align: center;
  margin-top: auto;
}

.footer p {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

.footer a {
  color: #93c5fd;
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: #e2e8f0;
}

.footer .beian-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.footer .beian-sep {
  color: #475569;
  font-size: 0.75rem;
  user-select: none;
}

.footer .beian-info .beian-icon {
  height: 10.5px;
  width: auto;
  vertical-align: middle;
  margin-right: 3px;
  opacity: 0.85;
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav {
    gap: 1rem;
  }
  
  .hero h2 {
    font-size: 1.75rem;
  }
  
  .hero-stats {
    gap: 1.5rem;
  }
  
  .articles {
    grid-template-columns: 1fr;
  }
  
  .article-detail h1 {
    font-size: 1.5rem;
  }
}
