/* ══════════════════════════════════════
   关于 / 归档 / 留言 — 高级设计 (pg-*)
   ══════════════════════════════════════ */

/* ── 通用卡片 ── */
/* ══════════════════════════════════════
   关于页面
   ══════════════════════════════════════ */

.pg-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 12px;
  position: relative; overflow: hidden;
  animation: cardFadeIn 0.4s ease both;
}
.pg-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: var(--glass-highlight); z-index: 0;
}
.pg-card > * { position: relative; z-index: 1; }

.pg-card-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.pg-card-title i {
  color: var(--accent); font-size: 13px;
}

/* ── 个人资料卡片 ── */
.pg-profile-card {
  padding: 24px;
}
.pg-profile-top {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
}
.pg-profile-avatar {
  width: 60px; height: 60px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.pg-profile-avatar img {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover; display: block;
}
.pg-profile-avatar span {
  font-size: 26px; font-weight: 700; color: #fff;
}
.pg-profile-info { flex: 1; min-width: 0; }
.pg-profile-name {
  font-size: 20px; font-weight: 700; color: var(--text);
  margin-bottom: 4px;
}
.pg-profile-bio {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
}
.pg-profile-bottom {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.pg-profile-links {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.pg-profile-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px; color: var(--text-secondary);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all .2s;
}
.pg-profile-links a:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-soft);
}
.pg-profile-links a i { font-size: 11px; }

/* ── 数据统计 ── */
.pg-stats-card {
  display: flex; align-items: center;
  padding: 18px 22px;
  gap: 0;
}
.pg-stat {
  flex: 1; text-align: center;
  padding: 4px 0;
}
.pg-stat-divider {
  width: 1px; height: 28px;
  background: var(--border);
  flex-shrink: 0;
}
.pg-stat b {
  display: block;
  font-size: 24px; font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.pg-stat span {
  font-size: 12px; color: var(--text-light);
}

/* ── 站点信息 ── */
.pg-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pg-info-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.pg-info-item:hover {
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-md);
}
html.dark .pg-info-item:hover { box-shadow: var(--shadow-md); }
.pg-info-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.pg-info-text { display: flex; flex-direction: column; }
.pg-info-label { font-size: 11px; color: var(--text-light); margin-bottom: 2px; }
.pg-info-value { font-size: 13px; font-weight: 600; color: var(--text); }

@media (max-width: 600px) {
  .pg-info-grid { grid-template-columns: 1fr; }
}

/* ── 建站历程 ── */
.pg-tl {
  padding-left: 20px; position: relative;
}
.pg-tl::before {
  content: ''; position: absolute;
  left: 5px; top: 12px; bottom: 12px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
  border-radius: 2px;
}
.pg-tl-item {
  position: relative;
  padding: 0 0 24px 20px;
}
.pg-tl-item:last-child { padding-bottom: 0; }
.pg-tl-item::before {
  content: ''; position: absolute;
  left: -18px; top: 8px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent-soft), 0 0 8px var(--accent-glow);
}
.pg-tl-head {
  font-size: 15px; font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}
.pg-tl-item p, .pg-tl-item ul, .pg-tl-item ol {
  font-size: 13px; line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.pg-tl-item p:last-child { margin-bottom: 0; }
.pg-tl-item a { color: var(--accent); text-decoration: none; }
.pg-tl-item a:hover { text-decoration: underline; }
.pg-tl-item img {
  max-width: 100%; border-radius: var(--radius-xs);
  margin: 8px 0; cursor: pointer;
}
.pg-tl-item blockquote {
  margin: 8px 0; padding: 8px 14px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  color: var(--text-secondary); font-size: 13px;
}
.pg-tl-item pre {
  background: rgba(0,0,0,0.04);
  border-radius: var(--radius-xs); padding: 12px;
  overflow-x: auto; font-size: 13px;
}
html.dark .pg-tl-item pre { background: rgba(255,255,255,0.06); }

@media (max-width: 480px) {
  .pg-profile-avatar { width: 48px; height: 48px; }
  .pg-profile-avatar img { width: 48px; height: 48px; }
  .pg-profile-avatar span { font-size: 22px; }
  .pg-profile-name { font-size: 18px; }
  .pg-stat b { font-size: 20px; }
}

/* ══════════════════════════════════════
   归档页面
   ══════════════════════════════════════ */

.pg-arch-list {
  padding-top: 8px;
}

.pg-arch-panel {
  animation: archFadeIn .3s ease;
  position: relative; z-index: 2;
}
@keyframes archFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pg-arch-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  text-decoration: none; color: inherit;
  transition: background .2s, box-shadow .2s;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  position: relative; z-index: 2;
  opacity: 0; transform: translateY(16px);
}
.pg-arch-row.card-visible {
  animation: cardFadeIn 0.4s ease both;
}
.pg-arch-row:hover {
  background: var(--glass-bg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
html.dark .pg-arch-row:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.15); }

.pg-arch-row-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: all .2s;
}
.pg-arch-row:hover .pg-arch-row-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.pg-arch-row-date {
  font-size: 13px; color: var(--text-light);
  flex-shrink: 0; min-width: 60px;
  font-weight: 500;
}
.pg-arch-row-title {
  font-size: 14px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex: 1;
  transition: color .15s;
  font-weight: 500;
}
.pg-arch-row:hover .pg-arch-row-title { color: var(--accent); }

.pg-arch-row-meta {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  font-size: 12px; color: var(--text-light);
}
.pg-arch-row-meta i { font-size: 11px; margin-right: 3px; }
.pg-arch-row-meta span {
  display: inline-flex; align-items: center; gap: 2px;
}


/* ── 留言排行榜 ── */
.pg-leaderboard {
  margin-bottom: 16px;
}
.pg-lb-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.pg-lb-title i { color: #D4A84B; font-size: 13px; }

.pg-lb-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.pg-lb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  transition: all .2s;
  opacity: 0; transform: translateY(16px);
}
.pg-lb-item.card-visible {
  animation: cardFadeIn 0.3s ease both;
}
.pg-lb-item:hover {
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.7);
}
html.dark .pg-lb-item { box-shadow: var(--shadow-sm); }
html.dark .pg-lb-item:hover { box-shadow: var(--shadow-md); border-color: rgba(255,255,255,0.1); }
.pg-lb-rank {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  flex-shrink: 0;
  background: var(--glass-bg);
  color: var(--text-light);
}
.pg-lb-rank-1 { background: rgba(234,179,8,0.15); color: #ca8a04; }
.pg-lb-rank-2 { background: rgba(156,163,175,0.15); color: #6b7280; }
.pg-lb-rank-3 { background: rgba(180,83,9,0.15); color: #b45309; }
.pg-lb-avatar {
  width: 28px; height: 28px;
  border-radius: 50%; object-fit: cover;
  flex-shrink: 0;
}
.pg-lb-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  max-width: 100px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.pg-lb-count {
  font-size: 11px; color: var(--text-light);
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .pg-lb-list { flex-direction: column; }
  .pg-lb-item { border-radius: var(--radius-sm); }
  .pg-stats-card { flex-wrap: wrap; }
  .pg-stat { min-width: 45%; }
  .pg-stat-divider { display: none; }
}

/* ══════════════════════════════════════
   更新时间标记
   ══════════════════════════════════════ */
.article-meta-updated {
  color: var(--accent);
}
.article-meta-updated i {
  color: var(--accent);
}

/* ══════════════════════════════════════
   上一篇 / 下一篇
   ══════════════════════════════════════ */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border, rgba(0,0,0,.06));
}
.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  text-decoration: none;
  border: 1px solid var(--glass-border);
  min-width: 0;
  transition: background .25s, box-shadow .25s, border-color .25s;
}
.post-nav-item:not(.post-nav-empty):hover {
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.7);
}
html.dark .post-nav-item:not(.post-nav-empty):hover {
  border-color: rgba(255,255,255,0.1);
}
.post-nav-empty {
  opacity: .5;
  cursor: default;
}
.post-nav-label {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}
.post-nav-next .post-nav-label {
  justify-content: flex-end;
}
.post-nav-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s;
}
.post-nav-item:not(.post-nav-empty):hover .post-nav-title {
  color: var(--accent);
}
.post-nav-next {
  text-align: right;
}

html.dark .post-nav-item {
  background: var(--glass-bg);
}

@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════
   404 页推荐文章
   ══════════════════════════════════════ */
.error-recommend {
  margin-top: 40px;
  width: 100%;
  max-width: 600px;
}
.error-recommend-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
}
.error-recommend-title i {
  color: var(--accent);
  font-size: 14px;
}
.error-recommend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.error-recommend-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--glass-bg, rgba(255,255,255,.45));
  backdrop-filter: blur(var(--glass-blur, 20px));
  -webkit-backdrop-filter: blur(var(--glass-blur, 20px));
  border: 1px solid rgba(255,255,255,.2);
  text-decoration: none;
  transition: all .2s;
}
.error-recommend-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border-color: var(--accent);
}
.error-recommend-cover {
  width: 100%;
  height: 100px;
  overflow: hidden;
}
.error-recommend-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.error-recommend-card:hover .error-recommend-cover img {
  transform: scale(1.05);
}
.error-recommend-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft, rgba(99,102,241,.1)), var(--accent-glow, rgba(99,102,241,.25)));
}
.error-recommend-fallback span {
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
}
.error-recommend-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.error-recommend-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #1f2937);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.error-recommend-date {
  font-size: 11px;
  color: var(--text-light, #9ca3af);
}

html.dark .error-recommend-card {
  background: rgba(26,29,39,.6);
  border-color: rgba(255,255,255,.06);
}
html.dark .error-recommend-card-title {
  color: #e5e7eb;
}
html.dark .error-recommend-title {
  color: #e5e7eb;
}

@media (max-width: 480px) {
  .error-recommend-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════
   代码高亮 (highlight.js)
   ══════════════════════════════════════ */
.article-content pre code.hljs {
  padding: 18px 22px;
  background: transparent;
}
html.dark .article-content pre code.hljs {
  background: transparent;
}

/* ══════════════════════════════════════
   打印样式
   ══════════════════════════════════════ */
@media print {
  .orb, .sidebar, .topbar, .bottom-bar, .sidebar-overlay,
  .like-wrap, .post-nav, .toc-wrap,
  .cmt-section, .topbar-actions,
  .hamburger, .mobile-search, .content-tabs, .hitokoto-banner,
  .code-copy-btn, .lightbox, .fade-top, .fade-bottom { display: none !important; }
  
  .page { box-shadow: none; border: none; max-width: 100%; margin: 0; }
  .shell { background: #fff !important; backdrop-filter: none !important; }
  .main-body { display: block; }
  .content-area { overflow: visible; }
  .content-inner { overflow: visible; }
  .content-scroll { overflow: visible; height: auto; }
  
  .article-title { font-size: 24px; margin-bottom: 12px; }
  .article-meta { font-size: 12px; color: #666; }
  .article-content { font-size: 14px; line-height: 1.8; }
  .article-content img { max-width: 100%; height: auto; page-break-inside: avoid; }
  .article-content pre { white-space: pre-wrap; word-break: break-all; border: 1px solid #ddd; }
  .article-content table { border-collapse: collapse; width: 100%; }
  .article-content th, .article-content td { border: 1px solid #ddd; padding: 6px 8px; }
  
  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 11px; color: #999; }
  a[href^="#"]::after, a[href^="javascript"]::after { content: ""; }
}
