/* ==========================================================================
   layout.css — 站点骨架：导航 / Hero / 分区网格 / 页脚 / 响应式
   ========================================================================== */

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: var(--fs-lg);
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .brand-mark {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-500), var(--cat-yuanzi));
  color: #fff;
  font-size: var(--fs-md);
}

.main-nav {
  display: flex;
  gap: 0.25rem;
  margin-left: 0.5rem;
}
.nav-link {
  padding: 0.42rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-weight: 600;
  border-bottom: 2px solid transparent;
}
.nav-link:hover {
  color: var(--text);
  text-decoration: none;
  background: var(--surface-3);
}
.nav-link.active {
  color: var(--brand-300);
  border-bottom-color: var(--brand-300);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-search {
  position: relative;
}
.header-search input {
  width: 210px;
  height: 36px;
  padding: 0 0.75rem 0 2.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-sm);
}
.header-search input:focus {
  border-color: var(--brand-300);
  outline: none;
  box-shadow: 0 0 0 3px var(--glow);
}
.header-search .search-ico {
  position: absolute;
  left: 0.7rem; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-3);
  pointer-events: none;
}

/* 移动端导航抽屉 */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  color: var(--text);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 3.25rem;
  text-align: center;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(720px 300px at 50% -20%, var(--glow), transparent 65%),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(139, 176, 227, 0.07) 46px 47px);
  pointer-events: none;
}
.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  color: var(--brand-300);
  background: var(--surface);
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(var(--fs-3xl), 5vw, var(--fs-4xl));
  margin: 0.9rem auto 0.6rem;
  max-width: 860px;
}
.hero .lead {
  max-width: 640px;
  margin-inline: auto;
  color: var(--text-2);
  font-size: var(--fs-lg);
}
.hero .stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2.2rem;
  margin-top: 1.6rem;
}
.stat-item { text-align: center; }
.stat-item b {
  display: block;
  font-size: var(--fs-2xl);
  font-variant-numeric: tabular-nums;
  color: var(--brand-300);
}
.stat-item span {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

/* ---------- 分区标题 ---------- */
.section { padding: 2.6rem 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: var(--fs-2xl);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-head .hint {
  font-size: var(--fs-sm);
  color: var(--text-3);
  font-weight: 400;
}

/* ---------- 网格 ---------- */
.grid-modules {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
.grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
@media (max-width: 1080px) {
  .grid-modules { grid-template-columns: repeat(3, 1fr); }
  .grid-cards  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .grid-modules { grid-template-columns: repeat(2, 1fr); }
  .grid-cards  { grid-template-columns: 1fr; }
}
/* 模块卡片 5 列在窄屏不出现“最后一行只剩 1 个” */
@media (max-width: 1080px) and (min-width: 761px) {
  .grid-modules { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 归档月份分组 ---------- */
.month-block { margin-bottom: 2.2rem; }
.month-block > h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-xl);
  margin-bottom: 0.9rem;
}
.month-block > h3::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand-300);
  box-shadow: 0 0 0 4px var(--glow);
}
.month-block .month-count {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-weight: 400;
}
.month-empty {
  padding: 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: var(--fs-sm);
  text-align: center;
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2.2rem 0 2.6rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.footer-grid h4 {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.footer-grid p, .footer-grid li {
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.footer-grid ul { list-style: none; padding: 0; }
.footer-grid li { margin-bottom: 0.4rem; }
.footer-bottom {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.2rem; }
}

/* ---------- 工具条（模块页 / 管理页） ---------- */
.toolbar {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.toolbar .spacer { flex: 1; }

/* ---------- 筛选胶囊 ---------- */
.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pill {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all var(--speed-fast) var(--ease);
}
.pill:hover { border-color: var(--brand-300); color: var(--brand-300); }
.pill.active {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}

/* ---------- 详情页头部信息区 ---------- */
.article-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1.6rem;
  margin-top: 1rem;
  max-width: 760px;
}
.article-meta .meta-item {
  display: flex;
  gap: 0.5rem;
  font-size: var(--fs-sm);
}
.article-meta .meta-item dt {
  color: var(--text-3);
  min-width: 5.2em;
  font-weight: 600;
}
.article-meta .meta-item dd { margin: 0; color: var(--text-2); }
@media (max-width: 640px) {
  .article-meta { grid-template-columns: 1fr; }
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.6rem;
}
.pagination button {
  min-width: 38px; height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-2);
}
.pagination button.active {
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-500);
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- 懒加载占位 ---------- */
.load-more-wrap { text-align: center; margin-top: 1.4rem; }
