/* ═══════════════════════════════════════════════════════════════
   星屑手帐 · 公开页面样式
   适用于：blog / post / about / auth / me
   ───────────────────────────────────────────────────────────────
   这是一套偏中性的「毛坯房」骨架，方便你自己改。
   改样式优先只看下面 ★ 个性化变量 这一段；
   改文案和开关看 public/js/*.js 顶部的 OPTIONS / COPY；
   页面里的静态文字看各 HTML 顶部标了「可改」的地方。
   颜色和字体来自 tokens.css，全站共用。
   ═══════════════════════════════════════════════════════════════ */

/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
   ★  个性化变量：只改这里，就能大改这五页的样子
   ★  每个变量都有默认值；不想要某一段就直接删掉对应 HTML
   ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */

:root {
  /* ── 整体骨架 ───────────────────────────────────────────── */
  --pg-max: 1120px;               /* 次级页面最大宽度（改小会更像窄栏博客） */
  --pg-gutter: var(--gutter);     /* 左右留白，沿用全站 gutter */
  --pg-radius: var(--radius-md);  /* 你这几页统一圆角 */
  --pg-line: var(--c-line);       /* 你这几页统一分隔线颜色 */
  --pg-accent: var(--c-accent);   /* 链接 / 分类 / 激活状态的强调色 */

  /* ── 页面头部 ───────────────────────────────────────────── */
  --pg-head-top: clamp(32px, 5vw, 64px);     /* 标题区上留白 */
  --pg-head-bottom: clamp(20px, 3vw, 36px);  /* 标题区下留白 */
  --pg-title-size: clamp(2rem, 4.4vw, 3.25rem);
  --pg-title-weight: 400;
  --pg-desc-width: 42em;
  --pg-desc-size: var(--text-sm);

  /* ── 归档页卡片列表 ─────────────────────────────────────── */
  --pg-columns: 2;                 /* 桌面几列，2 或 3；手机自动 1 列 */
  --pg-card-gap: clamp(24px, 3.6vw, 44px);
  --pg-cover-ratio: 16 / 10;       /* 封面比例：16 / 10、4 / 3、1 / 1 */
  --pg-card-title-size: clamp(1.15rem, 1.8vw, 1.45rem);
  --pg-excerpt-lines: 2;           /* 摘要最多几行 */

  /* ── 文章页 ─────────────────────────────────────────────── */
  --pg-article-width: 720px;       /* 正文一栏的宽度 */
  --pg-cover-width: 960px;         /* 大封面的最大宽度 */
  --pg-article-title-size: clamp(1.9rem, 4.2vw, 3rem);
  --pg-prose-size: var(--text-base);
  --pg-comments-width: 760px;      /* 评论区宽度 */

  /* ── 关于页 ─────────────────────────────────────────────── */
  --pg-about-width: 760px;         /* 关于正文一栏 */
  --pg-avatar-size: 112px;         /* 关于页 / 会员中心头像大小 */

  /* ── 会员中心 ───────────────────────────────────────────── */
  --pg-me-max: 1040px;
  --pg-side-width: 320px;          /* 右侧设置栏宽度 */

  /* ── 背景照片 ───────────────────────────────────────────── */
  /* 想换背景：替换 public/assets/background/page-bg.jpg，或改这里的路径 */
  /* ── 登录 / 注册 ────────────────────────────────────────── */
  --pg-auth-width: 420px;          /* 表单卡片宽度 */
  --pg-auth-card-bg: var(--c-surface);
}

/* 常用改法速查（照着改上面的变量即可）
   · 想更窄、更像随手写的手帐：  --pg-max: 960px; --pg-card-gap: 24px;
   · 归档页想排三列：             --pg-columns: 3;
   · 封面想方一点：               --pg-cover-ratio: 1 / 1;
   · 不想要圆角：                 --pg-radius: 0;
   · 强调色想低调一点：           --pg-accent: var(--c-sage);
   · 头像大一点：                 --pg-avatar-size: 140px;
   · 换背景照片：                 改 public/css/photo-theme.css 里的 --pg-photo，或同名覆盖图片
   · 想暂时隐藏某一块：           给对应 HTML 元素加 hidden 属性即可。
*/

/* ═══════════════════════════════════════════════════════════════
   通用：只在这里收窄页面容器，不动公共 .container
   ═══════════════════════════════════════════════════════════════ */

html {
  scroll-padding-top: calc(var(--header-h) + 24px);
}

.page-main .container {
  width: min(calc(100% - var(--pg-gutter) * 2), var(--pg-max));
  max-width: var(--pg-max);
}

[data-page="me"] .page-main .container {
  width: min(calc(100% - var(--pg-gutter) * 2), var(--pg-me-max));
  max-width: var(--pg-me-max);
}

[data-page="about"] .page-main .container {
  width: min(calc(100% - var(--pg-gutter) * 2), var(--pg-about-width));
  max-width: var(--pg-about-width);
}

/* 页面头部：所有页共用，改标题/说明直接改 HTML */
.page-head {
  padding-top: var(--pg-head-top);
  padding-bottom: var(--pg-head-bottom);
}

.page-head__title {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: var(--pg-title-size);
  font-weight: var(--pg-title-weight);
  line-height: 1.25;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.page-head__desc {
  max-width: var(--pg-desc-width);
  margin-top: 12px;
  font-size: var(--pg-desc-size);
  line-height: 1.9;
  color: var(--c-muted);
}

.page-head__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.page-head__meta strong {
  font-weight: 600;
  color: var(--c-ink-soft);
}

/* 空态 / 错误态：几页共用，不需要可以删掉对应 HTML */
.page-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 240px;
  padding: 40px 24px;
  border: 1px dashed var(--pg-line);
  border-radius: var(--pg-radius);
  text-align: center;
  color: var(--c-muted);
}

.page-state--span {
  grid-column: 1 / -1;
}

.page-state__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.4;
  color: var(--c-ink);
}

.page-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  border: 1px solid var(--pg-line);
  border-radius: 50%;
  color: var(--c-muted);
}

.page-state__text {
  max-width: 36em;
  font-size: var(--text-sm);
  line-height: 1.8;
}

.page-state .btn {
  margin-top: 8px;
}

.page-state--error .page-state__title {
  color: var(--c-danger);
}

/* 通用的小标题（关于页 / 会员中心） */
.section-title {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--pg-line);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  font-weight: 400;
  line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════════
   一、归档 blog.html
   ═══════════════════════════════════════════════════════════════ */

.archive-tools {
  display: grid;
  gap: 14px;
  padding: 18px 0;
  border-block: 1px solid var(--pg-line);
}

.archive-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 460px;
}

.archive-search > .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--c-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.archive-search__input {
  min-height: 46px;
  padding-right: 96px;
  padding-left: 42px;
  background: var(--c-surface);
}

.archive-search__clear {
  position: absolute;
  top: 50%;
  right: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 4px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--c-paper-deep);
  color: var(--c-muted);
  font-size: var(--text-2xs);
  transform: translateY(-50%);
}

.archive-search__clear:hover {
  color: var(--c-ink);
}

.archive-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--c-paper-deep);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  color: var(--c-muted);
}

.chip.is-active .chip__count {
  background: color-mix(in srgb, var(--c-cream) 18%, transparent);
  color: var(--c-cream);
}

.archive-summary {
  font-size: var(--text-xs);
  line-height: 1.7;
  color: var(--c-muted);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(var(--pg-columns), minmax(0, 1fr));
  gap: var(--pg-card-gap);
  align-items: start;
  padding-top: clamp(28px, 4vw, 44px);
}

/* 复用共享的 .note-card，只覆盖这几处尺寸 */
.archive-grid .note-card__cover {
  aspect-ratio: var(--pg-cover-ratio);
  border-radius: var(--pg-radius);
}

.archive-grid .note-card__body {
  padding-top: 14px;
}

.archive-grid .note-card__title {
  font-family: var(--font-sans);
  font-size: var(--pg-card-title-size);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
}

.archive-grid .note-card__excerpt {
  -webkit-line-clamp: var(--pg-excerpt-lines);
  margin-top: 6px;
}

.archive-grid .note-card__foot {
  margin-top: 10px;
}

/* 卡片依次出现，不需要可以直接删掉这段和 JS 里的 reveal */
.js .archive-grid > .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(10px);
}

.js .archive-grid > .reveal {
  transition:
    opacity 400ms var(--ease-out),
    transform 400ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.archive-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: clamp(32px, 5vw, 56px);
}

.archive-end {
  font-size: var(--text-xs);
  color: var(--c-muted);
}

/* 归档页的加载骨架也走同一套栅格 */
.archive-grid > .is-skeleton {
  pointer-events: none;
}

.archive-grid.is-single {
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   二、文章页 post.html
   ═══════════════════════════════════════════════════════════════ */

.reading-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 101;
  height: 2px;
  background: var(--pg-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.post-loading {
  display: grid;
  gap: 14px;
  max-width: var(--pg-article-width);
  margin-inline: auto;
  padding-top: var(--pg-head-top);
  padding-inline: var(--pg-gutter);
}

.post-loading__title {
  height: 40px;
}

.post-loading__cover {
  aspect-ratio: 16 / 9;
  margin-top: 8px;
  border-radius: var(--pg-radius);
}

.post-loading__lines {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.post-breadcrumb {
  max-width: var(--pg-article-width);
  margin-inline: auto;
  padding-top: clamp(20px, 3vw, 28px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.breadcrumb a:hover {
  color: var(--c-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.breadcrumb__sep {
  color: var(--c-line-strong);
}

.article-head {
  max-width: var(--pg-article-width);
  margin-inline: auto;
  padding-top: clamp(12px, 2vw, 20px);
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.article-date {
  white-space: nowrap;
}

.article-category {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding-block: 2px;
  color: var(--pg-accent);
  font-weight: 600;
}

.article-category:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.article-title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: var(--pg-article-title-size);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.005em;
  overflow-wrap: anywhere;
}

.article-excerpt {
  margin-top: 14px;
  font-size: var(--text-sm);
  line-height: 1.9;
  color: var(--c-muted);
}

.article-byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--pg-line);
}

.article-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
}

.article-author .avatar {
  width: 26px;
  height: 26px;
}

.article-author__name {
  color: var(--c-ink-soft);
}

.article-meta-line {
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.article-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 7px 14px;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: var(--text-sm);
  color: var(--c-ink);
}

.bookmark-btn:hover {
  border-color: var(--c-ink);
  background: var(--c-paper-soft);
}

.bookmark-btn[aria-pressed="true"] {
  border-color: var(--c-ink);
  background: var(--c-ink);
  color: var(--c-cream);
}

.bookmark-btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.bookmark-btn__icon {
  display: inline-flex;
}

.bookmark-btn .icon {
  width: 16px;
  height: 16px;
}

.article-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--c-muted);
}

.article-text-btn:hover {
  color: var(--c-ink);
}

.article-hint {
  flex-basis: 100%;
  font-size: var(--text-xs);
  line-height: 1.7;
  color: var(--c-muted);
}

.article-hint a {
  color: var(--pg-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.article-cover {
  max-width: var(--pg-cover-width);
  margin: clamp(24px, 4vw, 40px) auto 0;
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius);
  background: var(--c-paper-deep);
  object-fit: cover;
}

.article-body {
  max-width: var(--pg-article-width);
  margin-inline: auto;
  padding-top: clamp(28px, 4vw, 44px);
}

.article-body .prose {
  font-size: var(--pg-prose-size);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.article-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(28px, 4vw, 44px);
  padding-top: 16px;
  border-top: 1px solid var(--pg-line);
}

.article-back {
  font-size: var(--text-sm);
  color: var(--c-muted);
}

.article-back:hover {
  color: var(--c-ink);
}

/* ── 留言 ─────────────────────────────────────────────────── */

.post-comments {
  width: min(calc(100% - var(--pg-gutter) * 2), var(--pg-comments-width));
  margin: clamp(40px, 6vw, 72px) auto 0;
}

.comments-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--pg-line);
}

.comments-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 400;
  line-height: 1.3;
}

.comments-count {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.comments-note {
  font-size: var(--text-xs);
  line-height: 1.7;
  color: var(--c-muted);
}

.comment-guest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
  padding: 20px;
  border: 1px dashed var(--pg-line);
  border-radius: var(--pg-radius);
  background: var(--c-paper-soft);
}

.comment-guest__title {
  font-size: var(--text-sm);
  color: var(--c-ink-soft);
}

.comment-guest__text {
  margin-top: 4px;
  font-size: var(--text-xs);
  line-height: 1.7;
  color: var(--c-muted);
}

.comment-guest__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius);
  background: var(--c-surface);
}

.comment-form__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.comment-form__count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.comment-form__reply {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--pg-line);
  border-left: 3px solid var(--pg-accent);
  border-radius: var(--radius-sm);
  background: var(--c-paper-soft);
  color: var(--c-muted);
  font-size: var(--text-xs);
  line-height: 1.6;
}

.comment-form__reply strong {
  color: var(--c-ink);
  font-weight: 600;
}

.comment-form__reply-cancel {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 2px 6px;
  border: 0;
  background: transparent;
  color: var(--c-muted);
  font-size: var(--text-xs);
  cursor: pointer;
}

.comment-form__reply-cancel:hover {
  color: var(--c-danger);
}

.comment-form__input {
  min-height: 104px;
}

.comment-form__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.comment-form__as {
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.comment-form .form-error {
  margin: 0;
}

.comment-list {
  margin-top: 8px;
}

.comment {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--pg-line);
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

.comment .avatar {
  width: 36px;
  height: 36px;
}

.comment__avatar-link {
  display: block;
  align-self: start;
  border-radius: 50%;
  transition: box-shadow var(--dur-fast) var(--ease-out);
}

.comment__avatar-link:hover {
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}

.comment__avatar-link:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}

.comment__main {
  min-width: 0;
}

.comment__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.comment__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-ink);
}

.comment__time {
  font-size: var(--text-2xs);
  color: var(--c-muted);
}

.comment__body {
  max-width: 42em;
  margin-top: 4px;
  font-size: var(--text-sm);
  line-height: 1.9;
  color: var(--c-ink-soft);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.comment__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 3px;
}

.comment__reply,
.comment__delete {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 2px 6px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  font-size: var(--text-2xs);
  color: var(--c-muted);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}

.comment__reply {
  color: var(--c-accent-deep);
}

.comment__reply:hover {
  color: var(--c-ink);
}

.comment__delete {
  margin-left: auto;
}

.comment__delete:hover {
  color: var(--c-danger);
}

.comment__delete .icon,
.comment__reply .icon {
  width: 14px;
  height: 14px;
}

.comment__replies {
  display: grid;
  margin-top: 6px;
  padding-left: 14px;
  border-left: 1px solid var(--pg-line);
}

.comment--nested {
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0 2px;
  border-bottom: 0;
}

.comment--nested .avatar {
  width: 28px;
  height: 28px;
  font-size: var(--text-xs);
}

.comment--nested .comment__body {
  font-size: var(--text-xs);
}

.comment.is-removing {
  opacity: 0;
  transform: translateY(-4px);
}

.comment--skeleton {
  align-items: start;
}

.comment-skeleton__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.comments-empty {
  margin-top: 20px;
}

.comments-error {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--c-danger) 24%, transparent);
  border-radius: var(--pg-radius);
  background: var(--c-danger-soft);
}

.comments-error__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-danger);
}

.comments-error__text {
  font-size: var(--text-xs);
  line-height: 1.7;
  color: var(--c-danger);
}

.comments-error .btn {
  justify-self: start;
  margin-top: 4px;
}

.comments-more {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   三、关于 about.html
   ═══════════════════════════════════════════════════════════════ */

.about-loading {
  display: grid;
  gap: 24px;
  max-width: var(--pg-max);
  padding-top: var(--pg-head-top);
}

.about-loading__profile {
  display: flex;
  align-items: center;
  gap: 20px;
}

.about-loading__avatar {
  flex: 0 0 auto;
  width: var(--pg-avatar-size);
  height: var(--pg-avatar-size);
  border-radius: 50%;
}

.about-loading__lines {
  flex: 1;
  max-width: 420px;
}

.about-profile {
  display: flex;
  align-items: flex-start;
  gap: clamp(18px, 3vw, 32px);
  padding: clamp(20px, 3vw, 28px) 0;
  border-block: 1px solid var(--pg-line);
}

.about-avatar {
  flex: 0 0 auto;
  width: var(--pg-avatar-size);
  height: var(--pg-avatar-size);
  overflow: hidden;
  border: 1px solid var(--pg-line);
  border-radius: 50%;
  background: var(--c-paper-deep);
}

.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
}

.about-avatar__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--c-muted);
}

.about-profile__main {
  min-width: 0;
}

.about-name {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 400;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.about-role {
  margin-top: 4px;
  font-size: var(--text-sm);
  color: var(--c-muted);
}

.about-bio {
  max-width: 40em;
  margin-top: 10px;
  font-size: var(--text-sm);
  line-height: 1.9;
  color: var(--c-ink-soft);
}

.about-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 14px;
}

.about-social {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  font-size: var(--text-sm);
  color: var(--pg-accent);
}

.about-social:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.about-social__arrow {
  display: inline-flex;
  opacity: 0.7;
}

.about-social__label {
  line-height: 1.4;
}

.about-socials__empty {
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.about-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--pg-line);
}

.about-figure {
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.about-figure strong {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
  color: var(--c-ink-soft);
}

.about-content {
  max-width: var(--pg-about-width);
  padding-top: clamp(28px, 4vw, 44px);
}

.about-intro {
  font-size: var(--text-lg);
  line-height: 1.9;
  color: var(--c-ink-soft);
}

.about-blocks {
  margin-top: 18px;
}

.about-prose {
  font-size: var(--text-base);
  line-height: 1.95;
}

.about-prose > * + * {
  margin-top: 1.2em;
}

.about-now {
  margin-top: clamp(32px, 5vw, 48px);
}

.now-list {
  display: grid;
}

.now-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--pg-line);
}

.now-item__label {
  padding-top: 3px;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.now-item__text {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--c-ink-soft);
}

.now-empty {
  padding: 18px 0;
  border-bottom: 1px solid var(--pg-line);
  font-size: var(--text-sm);
  color: var(--c-muted);
}

/* ═══════════════════════════════════════════════════════════════
   四、登录 / 注册 auth.html
   ═══════════════════════════════════════════════════════════════ */

.auth-body {
  background: var(--c-paper);
}

.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(24px, 5vw, 56px) var(--pg-gutter);
}

.auth-wrap {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(var(--pg-auth-width), 100%);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.1em;
}

.auth-brand img {
  width: 32px;
  height: 32px;
}

.auth-brand__name {
  line-height: 1.2;
}

.auth-brand__latin {
  display: block;
  margin-top: 3px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--c-muted);
}

.auth-card {
  width: 100%;
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius);
  background: var(--pg-auth-card-bg);
}

.auth-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--pg-line);
}

.auth-tab {
  position: relative;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: none;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--c-muted);
}

.auth-tab:hover {
  color: var(--c-ink);
}

.auth-tab[aria-selected="true"] {
  color: var(--c-ink);
}

.auth-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--pg-accent);
}

.auth-head {
  margin-top: 22px;
}

.auth-title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 400;
  line-height: 1.3;
}

.auth-sub {
  margin-top: 8px;
  font-size: var(--text-sm);
  line-height: 1.8;
  color: var(--c-muted);
}

.auth-alert {
  align-items: flex-start;
  margin-top: 16px;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.auth-form .field {
  gap: 6px;
}

.auth-submit {
  margin-top: 4px;
}

.auth-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--pg-line);
  font-size: var(--text-sm);
  color: var(--c-muted);
}

.auth-switch {
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--pg-accent);
}

.auth-switch:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.auth-back:hover {
  color: var(--c-ink);
}

.auth-legal {
  margin-top: 14px;
  font-size: var(--text-2xs);
  line-height: 1.7;
  color: var(--c-muted);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   五、会员中心 me.html
   ═══════════════════════════════════════════════════════════════ */

.me-loading {
  display: grid;
  gap: 24px;
  padding-top: var(--pg-head-top);
}

.me-loading__profile {
  display: flex;
  align-items: center;
  gap: 20px;
}

.me-loading__avatar {
  flex: 0 0 auto;
  width: var(--pg-avatar-size);
  height: var(--pg-avatar-size);
  border-radius: 50%;
}

.me-loading__lines {
  flex: 1;
  max-width: 420px;
}

.me-loading__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.me-loading__card {
  height: 160px;
  border-radius: var(--pg-radius);
}

.me-profile {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 32px;
  padding: clamp(20px, 3vw, 28px) 0;
  border-block: 1px solid var(--pg-line);
}

.me-profile__identity {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.me-avatar-wrap {
  flex: 0 0 auto;
}

.me-avatar-wrap .avatar--xl {
  width: var(--pg-avatar-size);
  height: var(--pg-avatar-size);
  border: 1px solid var(--pg-line);
}

.me-identity {
  min-width: 0;
}

.me-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.me-name {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 400;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.me-handle {
  margin-top: 4px;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.me-bio {
  max-width: 34em;
  margin-top: 8px;
  font-size: var(--text-sm);
  line-height: 1.8;
  color: var(--c-ink-soft);
}

.me-bio.is-empty {
  color: var(--c-muted);
}

.me-joined {
  margin-top: 6px;
  font-size: var(--text-2xs);
  color: var(--c-muted);
}

.me-profile__aside {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 28px;
}

.me-stats {
  display: flex;
  gap: 24px;
}

.me-stat strong {
  display: block;
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
}

.me-stat span {
  font-size: var(--text-2xs);
  color: var(--c-muted);
}

.me-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.me-logout:hover {
  color: var(--c-danger);
}

.me-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, var(--pg-side-width));
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
  padding-top: clamp(24px, 4vw, 36px);
}

.me-content {
  min-width: 0;
}

.me-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--pg-line);
}

.me-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: -1px;
  padding: 4px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--c-muted);
}

.me-tab:first-child {
  padding-left: 0;
}

.me-tab:hover {
  color: var(--c-ink);
}

.me-tab[aria-selected="true"] {
  border-bottom-color: var(--pg-accent);
  color: var(--c-ink);
}

.me-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--c-paper-deep);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  color: var(--c-muted);
}

.me-tab[aria-selected="true"] .me-tab__count {
  background: var(--c-ink);
  color: var(--c-cream);
}

.me-panel {
  padding-top: 20px;
}

.me-panel__intro {
  margin-bottom: 14px;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.me-bookmarks {
  display: grid;
}

.me-bookmark {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--pg-line);
}

.me-bookmark:first-child {
  border-top: 1px solid var(--pg-line);
}

.me-bookmark__cover {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--pg-line);
  border-radius: var(--radius-sm);
  background: var(--c-paper-deep);
}

.me-bookmark__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.me-bookmark__cover.is-empty {
  background: var(--c-paper-deep);
}

.me-bookmark__body {
  min-width: 0;
}

.me-bookmark__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.me-bookmark__category {
  color: var(--pg-accent);
}

.me-bookmark__saved {
  font-size: var(--text-2xs);
}

.me-bookmark__title {
  margin-top: 4px;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.me-bookmark__title a:hover {
  color: var(--pg-accent);
}

.me-bookmark__foot {
  margin-top: 6px;
  font-size: var(--text-2xs);
  color: var(--c-muted);
}

.me-comments {
  display: grid;
}

.my-comment {
  padding: 16px 0;
  border-bottom: 1px solid var(--pg-line);
}

.my-comment:first-child {
  border-top: 1px solid var(--pg-line);
}

.my-comment__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.my-comment__post {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--c-ink);
}

a.my-comment__post:hover {
  color: var(--pg-accent);
}

.my-comment__time {
  font-size: var(--text-2xs);
  color: var(--c-muted);
}

.my-comment__body {
  max-width: 42em;
  margin-top: 6px;
  font-size: var(--text-sm);
  line-height: 1.9;
  color: var(--c-ink-soft);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.my-comment__actions {
  margin-top: 2px;
}

.my-comment__delete {
  min-height: 40px;
  padding: 0;
  border-radius: 0;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.my-comment__delete::after {
  display: none;
}

.my-comment__delete:hover {
  color: var(--c-danger);
}

.me-side {
  display: grid;
  gap: 16px;
}

.me-card {
  padding: 18px;
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius);
  background: var(--c-surface);
}

.me-card__title {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.4;
}

.me-card__desc {
  margin-top: 4px;
  font-size: var(--text-xs);
  line-height: 1.7;
  color: var(--c-muted);
}

.me-card form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.me-card .btn[type="submit"] {
  justify-self: start;
}

.me-avatar-editor {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--pg-line);
}

.me-avatar-editor__preview {
  flex: 0 0 auto;
}

.me-avatar-editor__preview .avatar {
  width: 72px;
  height: 72px;
  border: 1px solid var(--pg-line);
}

.me-avatar-editor__body {
  flex: 1;
  min-width: 0;
}

.me-avatar-editor__body .field__hint {
  margin-top: 4px;
}

.me-avatar-editor__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.me-avatar-editor__actions .btn {
  min-height: 38px;
  padding-block: 8px;
}

.me-avatar-editor .field__error {
  margin-top: 6px;
}

.me-account {
  margin-top: 8px;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.me-empty {
  min-height: 220px;
}

/* ═══════════════════════════════════════════════════════════════
   响应式：默认 390 / 768 / 1280 都好用
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .me-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .me-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .archive-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-head__title {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
  }

  .article-cover {
    margin-top: 20px;
  }

  .article-cover img {
    aspect-ratio: 4 / 3;
  }

  .me-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .me-profile__aside {
    width: 100%;
    justify-content: space-between;
  }

  .comments-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .comment-guest {
    align-items: flex-start;
    flex-direction: column;
  }

  .comment-guest__actions .btn {
    flex: 1;
  }

  .comment-form__foot {
    align-items: stretch;
    flex-direction: column;
  }

  .comment__replies {
    padding-left: 9px;
  }

  .comment--nested {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
  }

  .comment--nested .avatar {
    width: 24px;
    height: 24px;
  }

  .comment-form__foot .btn {
    width: 100%;
  }

  .about-loading__profile,
  .me-loading__profile {
    align-items: flex-start;
  }

  .me-loading__cards {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 手机输入框 16px，避免 iOS 聚焦时缩放 */
  .archive-search__input,
  .auth-form .input,
  .auth-form .textarea,
  .comment-form__input,
  .me-card .input,
  .me-card .textarea {
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  :root {
    --pg-avatar-size: 88px;
  }

  .page-head {
    padding-top: 28px;
    padding-bottom: 20px;
  }

  .archive-search {
    max-width: none;
  }

  .archive-search__input {
    padding-right: 52px;
  }

  .archive-search__clear {
    width: 34px;
    justify-content: center;
    padding: 0;
  }

  .archive-search__clear span {
    display: none;
  }

  .archive-filters {
    align-items: flex-start;
    flex-direction: column;
  }

  .article-title {
    font-size: clamp(1.7rem, 7.4vw, 2.4rem);
  }

  .article-byline {
    gap: 8px 12px;
  }

  .me-bookmark {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
  }

  .me-profile__identity {
    gap: 12px;
  }

  .me-stats {
    gap: 18px;
  }

  .now-item {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
  }

  .about-profile {
    flex-direction: column;
  }

  .about-avatar {
    width: 88px;
    height: 88px;
  }

  .auth-card {
    padding: 20px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .archive-grid > .reveal,
  .js .archive-grid > .reveal:not(.is-visible) {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* 登录页不注入公共页头，单独放一个主题切换按钮 */
.auth-theme-toggle {
  position: fixed;
  top: clamp(16px, 3vw, 28px);
  right: clamp(16px, 3vw, 28px);
  z-index: 30;
  border-color: var(--c-line);
  background: var(--c-surface);
  color: var(--c-ink-soft);
  box-shadow: 0 8px 28px rgba(5, 9, 15, 0.16);
  backdrop-filter: blur(10px);
}

.auth-theme-toggle:hover {
  border-color: var(--c-line-strong);
}

/* 照片背景与深色主题已抽到 /css/photo-theme.css，所有公开页面共用。 */
