/* ==========================================================================
   public.css —— 公开页专用（首页）
   类名统一 p- 前缀，只影响公开页；后台样式改坏了也不会影响这里。
   约 4KB，gzip 后约 1KB。
   ========================================================================== */

/* ── 顶部导航 ─────────────────────────────────────────────────────────── */
.p-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.p-header__inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.p-header__brand {
  font-weight: 600;
  font-size: 16px;
  color: var(--c-text);
}

.p-header__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.p-header__link {
  font-size: 14px;
  color: var(--c-text-mute);
}

.p-header__link--login {
  padding: 5px 12px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  color: var(--c-text);
}

.p-header__link:hover {
  color: var(--c-primary);
  text-decoration: none;
}

/* ── 主体 ─────────────────────────────────────────────────────────────── */
.p-main {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 16px 8px;
  flex: 1 1 auto;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.p-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.p-hero__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  object-fit: cover;
}

.p-hero__name {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: 0.5px;
}

.p-hero__tagline {
  margin-top: 6px;
  font-size: 15px;
  color: var(--c-text-mute);
}

/* ── 联系方式 ─────────────────────────────────────────────────────────── */
.p-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 14px;
  color: var(--c-text-mute);
  margin-bottom: 28px;
}

.p-contact__item {
  color: var(--c-text-mute);
}

/* ── 区块标题 ─────────────────────────────────────────────────────────── */
.p-section-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 3px solid var(--c-primary);
  line-height: 1.2;
}

/* ── 作品网格：auto-fill + minmax 让手机自动变一列，不需要额外断点 ──── */
.p-works {
  margin-bottom: 32px;
}

.p-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.p-work-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

.p-work-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.p-work-card__thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex: 0 0 auto;
  object-fit: cover;
}

/* 没有缩略图时用纯色块 + 首字，不加载任何图片（省带宽） */
.p-work-card__thumb--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-info-bg);
  color: var(--c-primary);
  font-size: 18px;
  font-weight: 600;
}

.p-work-card__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.p-work-card__summary {
  font-size: 14px;
  color: var(--c-text-mute);
  line-height: 1.6;
}

.p-work-card__link {
  font-size: 13px;
  margin-top: auto;
}

/* ── 我在做的事 ───────────────────────────────────────────────────────── */
.p-about {
  margin-bottom: 32px;
}

.p-about__text {
  /* 纯文本简介：保留换行，不渲染 markdown、不加 |safe */
  white-space: pre-wrap;
  font-size: 15px;
  color: var(--c-text-mute);
  line-height: 1.9;
}

.p-empty {
  font-size: 14px;
  color: var(--c-text-mute);
}

/* 首页作品被 50 条上限截断时的一行说明（PRD 6.4）。
   只在真的截断时由模板渲染，正常情况下这段 CSS 是死代码，不产生任何请求。 */
.p-works__more {
  margin-top: 16px;
  font-size: 13px;
  color: var(--c-text-mute);
  text-align: center;
}

/* ── 页脚（备案号） ───────────────────────────────────────────────────── */
.p-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  padding: 18px 16px 26px;
  text-align: center;
}

.p-footer__copy {
  font-size: 13px;
  color: var(--c-text-mute);
}

.p-footer__icp {
  margin-top: 4px;
  font-size: 13px;
}

.p-footer__icp a {
  color: var(--c-text-mute);
}

/* ── 小屏（375px 起不出现横向滚动）───────────────────────────────────── */
@media (max-width: 640px) {
  .p-main {
    padding: 22px 12px 8px;
  }

  .p-header__inner {
    padding: 10px 12px;
    gap: 8px;
  }

  .p-hero {
    gap: 14px;
  }

  .p-hero__avatar {
    width: 56px;
    height: 56px;
  }

  .p-hero__name {
    font-size: 23px;
  }

  .p-grid {
    grid-template-columns: 1fr;
  }
}
