:root {
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  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;
}

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

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== 顶部导航 ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  letter-spacing: 0.5px;
}
.brand-text { font-size: 20px; }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: #eef2ff; color: var(--accent); }
.nav-link.active { background: #eef2ff; color: var(--accent); font-weight: 600; }

/* ===== 主视觉 ===== */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #7c3aed 100%);
  color: #fff;
  padding: 48px 0;
  text-align: center;
}
.hero h1 { margin: 0 0 10px; font-size: 30px; }
.hero p { margin: 0; opacity: .92; font-size: 16px; }

/* ===== 主体 ===== */
main.container { padding-top: 28px; padding-bottom: 40px; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.page-head h2 { margin: 0; font-size: 20px; }
.page-info { color: var(--muted); font-size: 14px; }

.article-list { display: flex; flex-direction: column; gap: 14px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 22px 24px;
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-title { margin: 0 0 8px; font-size: 18px; line-height: 1.4; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-excerpt { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.card-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.cat-python { background: #2563eb; }
.cat-frontend { background: #ea580c; }
.cat-java { background: #dc2626; }
.cat-cpp { background: #7c3aed; }
.cat-db { background: #0d9488; }
.cat-linux { background: #4b5563; }
.cat-algo { background: #db2777; }
.cat-default { background: #64748b; }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}
.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn.disabled { color: #c4c9d4; background: #f7f8fa; cursor: not-allowed; }
.page-ellipsis { color: var(--muted); padding: 0 4px; }

/* ===== 页脚 ===== */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
}
.site-footer p { margin: 4px 0; }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 560px) {
  .hero h1 { font-size: 24px; }
  .header-inner { height: auto; padding: 12px 0; }
}
