/* =========================================================
   多肽博客主题 - 主样式
   颜色、间距等通过 :root CSS 变量控制，变量由后台 Customizer
   实时输出（见 functions.php -> pb_output_customizer_css）。
   ========================================================= */

:root {
  --pb-primary: #15806a;
  --pb-primary-dark: #0f6b58;
  --pb-secondary: #e8f5f0;
  --pb-bg: #ffffff;
  --pb-bg-soft: #f6f9f8;
  --pb-text: #1f2d2b;
  --pb-text-soft: #5b6b68;
  --pb-border: #e4ecea;
  --pb-link: #15806a;
  --pb-radius: 12px;
  --pb-shadow: 0 6px 24px rgba(15, 107, 88, 0.08);
  --pb-max-width: 1200px;
  --pb-hero-overlay: rgba(8, 46, 38, 0.55);
}

/* ---------- 基础排版 ---------- */
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--pb-text);
  background: var(--pb-bg-soft);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--pb-link); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--pb-primary-dark); }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--pb-max-width); margin: 0 auto; padding: 0 20px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- 页眉 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--pb-bg);
  border-bottom: 1px solid var(--pb-border);
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 20px; max-width: var(--pb-max-width); margin: 0 auto;
}
.site-brand { display: flex; align-items: center; gap: 12px; }
.site-brand__link { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-brand__logo { height: 44px; width: auto; }
.site-brand__logo-text {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 24px; font-weight: 800; letter-spacing: .3px; line-height: 1.1;
  color: var(--pb-primary);
  background-image: linear-gradient(135deg, var(--pb-primary), var(--pb-primary-dark));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.site-brand__name { font-size: 20px; font-weight: 700; color: var(--pb-text); line-height: 1.1; }
.site-brand__domain { font-size: 12px; color: var(--pb-text-soft); }

/* 模块名称（分类）导航 - 横向排列 */
.site-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-nav ul { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.site-nav li { display: inline-flex; }
.site-nav a {
  display: inline-block;
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--pb-text-soft); background: var(--pb-bg-soft);
  border: 1px solid transparent;
}
.site-nav a:hover, .site-nav a.is-active {
  color: #fff; background: var(--pb-primary); border-color: var(--pb-primary);
}
.site-nav__empty { font-size: 13px; color: var(--pb-text-soft); opacity: .7; }
.nav-toggle { display: none; }

/* ---------- 主题图片（Hero） ---------- */
.hero {
  position: relative; background-size: cover; background-position: center;
  color: #fff; min-height: 320px; display: flex; align-items: flex-end;
}
.hero::before {
  content: ""; position: absolute; inset: 0; background: var(--pb-hero-overlay);
}
.hero__inner { position: relative; padding: 56px 20px; max-width: var(--pb-max-width); margin: 0 auto; width: 100%; }
.hero__eyebrow { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; margin: 0 0 8px; }
.hero__title { font-size: clamp(26px, 4vw, 40px); font-weight: 800; margin: 0 0 10px; line-height: 1.2; }
.hero__subtitle { font-size: 16px; max-width: 720px; opacity: .92; margin: 0; }

/* ---------- 布局：主内容 + 悬浮卡片 ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px; align-items: start; padding: 40px 0 56px;
}
.main-col { min-width: 0; }
.sidebar-col { position: sticky; top: 92px; }

/* ---------- 文章卡片矩阵 ---------- */
.section-title { font-size: 22px; font-weight: 700; margin: 0 0 18px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 6px; height: 22px; background: var(--pb-primary); border-radius: 3px; }

.card-grid { display: grid; grid-template-columns: repeat(var(--pb-card-cols, 3), minmax(0, 1fr)); gap: 20px; }
.post-card {
  background: var(--pb-bg); border: 1px solid var(--pb-border); border-radius: var(--pb-radius);
  overflow: hidden; box-shadow: var(--pb-shadow); display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(15,107,88,.14); }
.post-card__thumb { aspect-ratio: 16/9; background: var(--pb-secondary); object-fit: cover; width: 100%; }
.post-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card__cat { font-size: 12px; color: var(--pb-primary); font-weight: 700; }
.post-card__title { font-size: 18px; font-weight: 700; margin: 0; line-height: 1.35; }
.post-card__title a { color: var(--pb-text); }
.post-card__title a:hover { color: var(--pb-primary); }
.post-card__excerpt { font-size: 14px; color: var(--pb-text-soft); margin: 0; flex: 1; }
.post-card__meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--pb-text-soft); border-top: 1px solid var(--pb-border); padding-top: 12px; }
.post-card__avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.post-card__author { font-weight: 600; color: var(--pb-text); }

/* ---------- 悬浮卡片（侧边栏） ---------- */
.widget {
  background: var(--pb-bg); border: 1px solid var(--pb-border); border-radius: var(--pb-radius);
  padding: 18px; box-shadow: var(--pb-shadow); margin-bottom: 20px;
}
.widget__title { font-size: 16px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.widget__title::before { content: ""; width: 5px; height: 16px; background: var(--pb-primary); border-radius: 3px; }
.widget-link { display: block; padding: 8px 0; border-bottom: 1px dashed var(--pb-border); font-size: 14px; }
.widget-link:last-child { border-bottom: 0; }
.widget-author { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.widget-author img { width: 36px; height: 36px; border-radius: 50%; }
.widget-author .author-initials { width: 36px; height: 36px; font-size: 14px; background: var(--pb-secondary); color: var(--pb-primary); }
.widget-comment__author { font-weight: 600; color: var(--pb-text); }
.widget-comment__excerpt { color: var(--pb-text-soft); }
.nav-empty { font-size: 13px; color: var(--pb-text-soft); opacity: .7; }

/* ---------- 文章正文 ---------- */
.article { background: var(--pb-bg); border: 1px solid var(--pb-border); border-radius: var(--pb-radius); padding: 28px 32px; box-shadow: var(--pb-shadow); }
.article__meta { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--pb-text-soft); margin-bottom: 18px; }
.article__content { font-size: 17px; line-height: 1.9; color: var(--pb-text); }
.article__content h2 { margin-top: 1.6em; }
.article__content img { border-radius: 8px; margin: 1em 0; }

/* ---------- 模块介绍 ---------- */
.module-intro {
  background: var(--pb-secondary); border-left: 4px solid var(--pb-primary);
  border-radius: 8px; padding: 16px 18px; margin-bottom: 26px; color: var(--pb-text);
}

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: 8px; background: var(--pb-bg);
  border: 1px solid var(--pb-border); font-size: 14px;
}
.pagination .current { background: var(--pb-primary); color: #fff; border-color: var(--pb-primary); }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--pb-primary-dark); color: #eafaf4; margin-top: 40px; }
.site-footer a { color: #b8e6d8; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px;
  padding: 48px 20px 30px; max-width: var(--pb-max-width); margin: 0 auto;
}
.footer-col h4 { font-size: 15px; margin: 0 0 14px; color: #fff; letter-spacing: .04em; }
.footer-col p, .footer-col li { font-size: 13.5px; line-height: 1.8; color: #d6f1e9; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 6px; }
.footer-authors { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.footer-author { display: flex; align-items: center; gap: 8px; font-size: 13px; width: calc(50% - 6px); }
.footer-author img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); flex: 0 0 auto; }
.footer-author__meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.footer-author__meta a { font-weight: 600; color: #fff; }
.footer-author__region { font-size: 11.5px; color: #bfe6da; }
.author-initials {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(255,255,255,.18); color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.footer-author-menu { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.footer-author-menu a { font-size: 13px; color: #b8e6d8; }
.footer-author-menu a:hover { color: #fff; }

.certs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cert { display: inline-flex; }
.cert img { height: 40px; width: auto; background: #fff; border-radius: 6px; padding: 4px; }
.cert--text {
  font-size: 12px; background: rgba(255,255,255,.12); padding: 6px 10px;
  border-radius: 6px; color: #eafaf4; white-space: nowrap;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.14);
  padding: 18px 20px; text-align: center; font-size: 13px; color: #bfe6da;
}
.footer-bottom .declaration { max-width: 880px; margin: 0 auto 10px; line-height: 1.7; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar-col { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .site-header__inner { flex-wrap: wrap; }
  .site-nav { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
}
