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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --transition: 0.2s ease;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

/* ===== Navigation ===== */
.site-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.nav-brand:hover { color: var(--primary-dark); text-decoration: none; }

.nav-brand .brand-icon {
  width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-toggle:hover { background: var(--border-light); }

.nav-list {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}

.nav-list a {
  display: block;
  padding: 0.5rem 0.875rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.nav-list a:hover {
  color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
}

/* ===== Main Container ===== */
main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
  color: #fff;
  text-align: center;
  padding: 3.5rem 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  position: relative;
}

.hero p {
  font-size: 1.125rem;
  opacity: 0.9;
  position: relative;
}

.hero .stat-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  padding: 0.3rem 0.875rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  margin-top: 1rem;
  font-weight: 500;
}

/* ===== Home Sections ===== */
.home-section {
  margin-bottom: 2.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-header h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.25rem;
  background: linear-gradient(180deg, var(--primary), #7c3aed);
  border-radius: 2px;
}

.section-header a {
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.section-header a:hover { text-decoration: none; }

/* ===== Article Cards ===== */
.article-list {
  list-style: none;
  display: grid;
  gap: 0;
}

.article-list li {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: background var(--transition);
}

.article-list li:first-child { border-top: 1px solid var(--border-light); }

.article-list li:hover { background: var(--border-light); }

.article-list .article-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  transition: color var(--transition);
  line-height: 1.5;
}

.article-list .article-title:hover { color: var(--primary); }

.article-list time {
  font-size: 0.8125rem;
  color: var(--text-light);
}

.article-list .summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card-style article list */
.article-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1rem;
  list-style: none;
}

.article-cards li {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.article-cards li:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.article-cards .article-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

.article-cards .article-title:hover { color: var(--primary); }

.article-cards time {
  font-size: 0.8125rem;
  color: var(--text-light);
}

.article-cards .summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== More Link ===== */
.more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  margin-top: 0.75rem;
  padding: 0.375rem 0;
}

.more-link:hover { text-decoration: none; gap: 0.5rem; }

/* ===== List Page ===== */
.list-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.list-page h1::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.5rem;
  background: linear-gradient(180deg, var(--primary), #7c3aed);
  border-radius: 2px;
}

.list-page .article-list {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.list-page .article-list li:first-child { border-top: none; }
.list-page .article-list li:last-child { border-bottom: none; }

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 0 1rem;
}

.pagination a {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-white);
  transition: all var(--transition);
}

.pagination a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

.page-info {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ===== Article Detail ===== */
.article {
  max-width: 48rem;
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-light); }

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1rem;
}

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

.category-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.625rem;
  border-radius: 2rem;
  font-weight: 500;
  font-size: 0.8125rem;
}

.category-badge a { color: inherit; font-weight: 500; }
.category-badge a:hover { text-decoration: none; color: var(--primary-dark); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tag {
  display: inline-block;
  background: var(--accent-light);
  color: #92400e;
  padding: 0.2rem 0.625rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ===== Article Body ===== */
.article-body {
  line-height: 1.85;
  font-size: 1.0625rem;
  color: var(--text);
}

.article-body h2 {
  margin: 2rem 0 1rem;
  font-size: 1.375rem;
  font-weight: 700;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.article-body h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.article-body p {
  margin: 1rem 0;
  color: #334155;
}

.article-body ul, .article-body ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.article-body li { margin: 0.375rem 0; color: #334155; }

.article-body blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
}

.article-body code {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.article-body pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.25rem 0;
}

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

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1rem 0;
}

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

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

.article-body th {
  background: var(--border-light);
  font-weight: 600;
  font-size: 0.875rem;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2rem 1.5rem;
  text-align: center;
}

.site-footer .footer-inner {
  max-width: 72rem;
  margin: 0 auto;
}

.site-footer p {
  color: var(--text-light);
  font-size: 0.8125rem;
}

.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.site-footer .footer-links a {
  color: var(--text-light);
  font-size: 0.8125rem;
  transition: color var(--transition);
}

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

/* ===== Scroll to top ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  opacity: 0;
  visibility: hidden;
}

.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-list {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav-list.open { display: flex; }
  .nav-list a { padding: 0.75rem 1rem; }

  .hero { padding: 2.5rem 1.5rem; }
  .hero h1 { font-size: 1.75rem; }

  .article-header h1 { font-size: 1.375rem; }
  .article-body { font-size: 1rem; }

  main { padding: 1.5rem 1rem; }
}

@media (max-width: 480px) {
  .article-cards { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 1rem; }
}