/* Copyright (C) 毛伊西格 (myxige). All Rights Reserved. 本主题专有闭源，禁止复制、分发、修改、反编译。 */
/* ============================================
   Aloha Theme - 核心样式
   受 Threads.com 启发 | 极简个人博客主题
   作者：毛伊西格
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-hover: #f5f5f5;
  --text-primary: #333;
  --text-secondary: #536471;
  --text-tertiary: #8b98a5;
  --border-color: #eff3f4;
  --border-strong: #cfd9de;
  --accent: #333;
  --accent-hover: #272727;
  --danger: #f4212e;
  --like-color: #f91880;
  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", monospace;
  --max-width: 640px;
  --header-height: 53px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: #eeeeee; /* 全局背景色 */
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img, video {
  max-width: 100%;
  display: block;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }

/* ============================================
   APP LAYOUT — sidebar + main feed
   ============================================ */
.app-layout {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  gap: 0;
  padding-top: 50px;
}

/* --- Left Sidebar — threads.com 风格 --- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  width: 260px;
  padding: 24px 20px 24px 24px;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 36px;
  padding: 5px 15px;
}

.sidebar-logo:hover { opacity: 0.75; }

.sidebar-logo svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-logo-img {
  height: 60px;
  object-fit: cover;
  flex-shrink: 0;
}

/* --- Nav Items --- */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg-hover);
}

.nav-item.active {
  font-weight: 700;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
}

/* --- Main Feed --- */
.main-container {
  flex: 1;
  max-width: 750px;
  min-width: 0;
  padding: 0 0 20px 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
}


.social-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.social-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}


.social-icon-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ============================================
   PROFILE HEADER — 封面 + 头像 + 简介 + 社交入口
   ============================================ */
.profile-header {
  background: var(--bg-primary);
}

.profile-cover {
  display: block;
  position: relative;
  width: 100%;
  height: 350px;
  object-fit: cover;
  object-position: center;
  background-color: var(--bg-secondary);
  z-index: 0;
}

.profile-header-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 30px 16px;
}

.profile-avatar-wrap {
  flex-shrink: 0;
  margin-top: -70px;
  position: relative;
  z-index: 2;
}

.profile-avatar {
  width: 150px;
  height: 150px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 4px solid var(--bg-primary);
  background: var(--bg-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.profile-info {
  flex: 1;
  min-width: 0;
  padding-bottom: 10px;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin: 0 0 2px;
}

.profile-bio {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.profile-social .social-links {
  gap: 15px;
}

.profile-social .social-link {
  width: 60px;
  height: 60px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.profile-social .social-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}


.profile-social .social-icon-svg {
  width: 26px;
  height: 26px;
  color: #434343;
}

/* --- Profile Stats（点赞/评论/访问 三列） --- */
.profile-stats {
  display: flex;
  gap: 20px;
  padding: 0 35px 18px;
  border-bottom: 1px solid var(--border-color);
}
.profile-stats .stat-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  cursor: default;
}
.profile-stats .stat-count {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.1;
  color: #454545;
}
.profile-stats .stat-label {
  font-size: 0.9375rem;
  color: var(--text-tertiary);
}

/* --- Profile Nav（主页导航 tabs，配置驱动） --- */
.profile-nav {
  display: flex;
  gap: 4px;
  padding: 30px 50px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-bottom: 1px solid var(--border-color);
}
.profile-nav::-webkit-scrollbar { display: none; }

.profile-nav-item {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 8px 18px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.profile-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.profile-nav-item.active {
  color: var(--text-primary);
  font-weight: 700;
  background: var(--bg-hover);
}

@media (max-width: 640px) {
  .profile-cover {
    height: 150px;
  }

  .profile-avatar-wrap {
    margin-top: -36px;
  }

  .profile-avatar {
    width: 80px;
    height: 80px;
  }

  .profile-header-body {
    gap: 12px;
    padding: 0 12px 12px;
  }

  .profile-name {
    font-size: 1.125rem;
  }

  .profile-bio {
    font-size: 0.8125rem;
  }

  .profile-social .social-link {
    width: 40px;
    height: 40px;
  }

  .profile-stats {
    padding: 0 12px 14px;
  }
  .profile-stats .stat-count {
    font-size: 0.875rem;
  }
  .profile-stats .stat-label {
    font-size: 0.875rem;
  }
  .profile-nav {
    padding: 8px 12px;
  }
  .profile-nav-item {
    padding: 6px 14px;
    font-size: 0.875rem;
  }

  .feed-container {
    padding: 0 10px;
  }
}

/* --- Post Card --- */
.feed-container {
  padding: 0 60px;
}

.post-card {
  padding: 30px 0px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
  cursor: default;
}
.post-article-wrap {
  padding: 0 50px;
}

.post-item-wrap {
  padding: 0 50px;
}
.post-card.post-detail.post-moment {
  padding: 30px 60px;
}
.post-card:hover {
  background: var(--bg-secondary);
}

.post-card-inner {
  display: flex;
  gap: 10px;
}

.post-avatar-col {
  flex-shrink: 0;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--border-color);
}

.post-body-col {
  flex: 1;
  min-width: 0;
}

/* --- Post Header --- */
.post-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

/* post-header 内的作者名复用 .profile-name 类（与资料页同款类名），
   但资料页 .profile-name 是 1.5rem/800 的大标题，此处作用域收窄保持紧凑，避免撑破头部行。 */
.post-header .profile-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  text-decoration: none;
}
.post-header .profile-name:hover { opacity: 0.7; }

/* post-username 现在位于 profile-name 链接内部，保持灰色用户名样式 */
.post-header .profile-name .post-username {
  font-weight: 400;
  color: var(--text-tertiary);
}
.post-username {
  font-size: 0.9375rem;
  color: var(--text-tertiary);
}

.post-time {
  font-size: 0.9375rem;
  color: var(--text-tertiary);
}

/* 文章模板：标题（位于卡片顶部，左对齐） */
.entity-field-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: left;
  color: var(--text-primary);
  margin: 6px 0 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

/* 文章模板：时间移到「作者名」下方，作为独立块 */
.post-article .post-header {
  margin-bottom: 0;
}
.post-article .post-time {
  display: block;
  margin: 2px 0 10px;
}
/* 文章模板：正文作为 post-card-inner 的同级块，左边缘与头像对齐，与上方头像行间隔开 */
.post-article .post-content {
  margin-top: 14px;
}

/* --- Post Content / Markdown --- */
.post-content {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--text-primary);
  word-break: break-word;
  white-space: pre-wrap;
  margin-bottom: 8px;
}

/* 首页摘要文字容器：统一间距、黑色文字 */
.post-content-summary {
  margin-bottom: 0;
  white-space: normal;
}

/* 纯文字截断：~4.5 行 × 1.45 = ~6.5em ≈ 150 中文字 */
.post-content--truncated {
  max-height: 6.5em;
  overflow: hidden;
  position: relative;
  margin-bottom: 2px !important;
}

.post-content--truncated::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2em;
  background: linear-gradient(transparent, var(--bg-primary));
}

/* 首页摘要文字：可点击跳转到文章页，纯黑色 */
.post-content .post-text-link,
.post-content-summary .post-text-link {
  display: block;
  color: #333;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.post-content .post-text-link:hover,
.post-content-summary .post-text-link:hover {
  opacity: 0.7;
}

/* 首页文章标题（含 # 包裹符）统一为深蓝 #000066 */
.post-content-summary .post-title-link {
  color: #000066;
  font-weight: 500;
}

/* 展开/收起按钮 */
.text-expand-btn {
  display: inline-block;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 6px;
  transition: color 0.15s;
}

.text-expand-btn:hover {
  color: var(--text-secondary);
}

.post-content h1 { font-size: 1.25rem; font-weight: 700; margin: 12px 0 4px; }
.post-content h2 { font-size: 1.15rem; font-weight: 700; margin: 10px 0 4px; }
.post-content h3 { font-size: 1.05rem; font-weight: 600; margin: 8px 0 4px; }
.post-content p { margin-bottom: 6px; min-height: 1.45em; }
.post-content ul, .post-content ol { padding-left: 20px; margin-bottom: 6px; }
.post-content li { margin-bottom: 2px; }
.post-content blockquote {
  border-left: 3px solid var(--border-strong);
  padding-left: 12px;
  color: var(--text-secondary);
  margin: 8px 0;
}
.post-content code {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
}
.post-content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 8px 0;
  font-size: 0.8125rem;
  line-height: 1.6;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.post-content a {
  color: #1d9bf0;
  text-decoration: none;
}
.post-content a:hover { opacity: 0.7; }
.post-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
}
.post-content th, .post-content td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
  font-size: 0.875rem;
}
.post-content th { background: var(--bg-secondary); }
.post-content img { border-radius: var(--radius-md); margin: 6px 0; max-width: 100%; height: auto; }

/* 详情页正文内媒体：来自文章真实内容（figure 由 Halo 渲染包裹） */
.post-content figure { margin: 8px 0; }
.post-content figure img,
.post-content figure video { max-width: 100%; width: auto; height: auto; margin: 0; }
.post-content video { border-radius: var(--radius-md); margin: 6px 0; max-width: 100%; }

/* 瞬间模板（post_moment.html）标识徽章 */
.moment-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 12px;
}

/* ============================================
   瞬间详情页（post_moment.html）— 朋友圈式布局
   - 文字：仅第一张图 / 视频之前
   - 图片：1张80% / 2张90%并排 / 3张三并排 / 4张两并排 / 5+三并排
           2张及以上为正方形「豆腐块」缩略图，点击放大可左右切换
   - 视频：保持原生渲染（不二次加工）
   ============================================ */

.moment-text {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-primary);
  word-break: break-word;
  white-space: pre-wrap;
  margin-bottom: 10px;
}
.moment-text:empty { display: none; }

.moment-image-grid {
  display: grid;
  gap: 4px;
  margin: 4px 0 8px;
}
.moment-image-grid.cols-1 { width: 80%; grid-template-columns: 1fr; }
.moment-image-grid.cols-2 { width: 90%; grid-template-columns: repeat(2, 1fr); }
.moment-image-grid.cols-3 { width: 90%; grid-template-columns: repeat(3, 1fr); }
.moment-image-grid.cols-4 { width: 90%; grid-template-columns: repeat(2, 1fr); }
.moment-image-grid.cols-many { width: 90%; grid-template-columns: repeat(3, 1fr); }

.moment-image-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--bg-secondary);
}
.moment-image-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}
.moment-image-cell:hover img { transform: scale(1.03); }

/* 单图：保持原图比例，不裁切为正方形 */
.moment-image-grid.cols-1 .moment-image-cell {
  aspect-ratio: auto;
  background: transparent;
}
.moment-image-grid.cols-1 .moment-image-cell img {
  height: auto;
  max-height: 600px;
  object-fit: cover;
}

.moment-video { margin-top: 6px; }
.moment-video:empty { display: none; }
.moment-video video,
.moment-video iframe {
  max-width: 100%;
  border-radius: var(--radius-md);
}


/* ============================================
   MEDIA GALLERY — threads.com 深度复刻
   
   规则：
   - 1 张图 → 单图全宽
   - 2+ 张图 → 水平一行自由滑动，每张占 ~40% 宽度
   - 一屏可见约 2.5 张，右侧自然露出下一张
   - 无 snap、无圆点、无箭头 — 纯原生滚动
   ============================================ */

.media-wrapper {
  margin-top: 8px;
}

.media-wrapper:empty {
  display: none;
}

/* --- 单图：全宽 + 圆角 --- */
.media-single {
  position: relative;
  width: fit-content;
  max-width: 80%;
  margin: 0;
}

.media-single img {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  display: block;
  cursor: pointer;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease;
}

.media-single:hover img {
  transform: scale(1.02);
}

.media-single video,
.media-single .video-wrapper {
  width: 100%;
  display: block;
}

/* ============================================
   MEDIA GALLERY — threads.com justified 画廊

   - 外层 overflow-x: auto 原生横向滚动（超宽时）
   - 内层 flex track，每张图保留自身宽高比
   - 整行高度 = 画廊中最小图片的自然高度（JS 设宽高，不裁切）
   ============================================ */

.media-gallery {
  margin-top: 8px;
  border-radius: var(--radius-md);  /* 与媒体图一致的 12px 外圆角 */
  overflow-x: auto;            /* 画廊宽于卡片时原生横向滚动 */
  overflow-y: hidden;
  touch-action: pan-x;          /* 水平滑动交给画廊，垂直放行给页面 */
  -webkit-overflow-scrolling: touch;
  cursor: grab;                /* 可拖拽左右滑动的视觉提示 */
  user-select: none;
  -webkit-user-select: none;
  scrollbar-width: none;        /* Firefox 隐藏滚动条 */
}
.media-gallery::-webkit-scrollbar { display: none; }   /* Chrome / Safari / Edge 隐藏滚动条 */
.media-gallery.dragging { cursor: grabbing; }

.gallery-track {
  display: flex;
  align-items: flex-start;     /* 统一高度后自然顶对齐 */
  gap: 2px;
  padding: 2px 0;
}

/* justified 画廊：每张图保留自身宽高比（竖图竖、横图横），
   整行高度 = 画廊中最小图片的自然高度（JS 按宽高比设宽高，不裁切） */
.gallery-slide {
  flex: 0 0 auto;
  position: relative;
  cursor: pointer;
  border-radius: 2px;
  overflow: hidden;
}

.gallery-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;           /* slide 尺寸=图片宽高比，cover 即不裁切 */
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.gallery-slide:hover img {
  transform: scale(1.03);
  filter: brightness(1.05);
}

.gallery-slide:active img {
  transform: scale(0.97);
  filter: brightness(1);
}

/* ============================================
   LIGHTBOX
   ============================================ */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(4px);
}


.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1001;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1001;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-nav:disabled { opacity: 0.3; cursor: default; }
.lightbox-nav-prev { left: 16px; }
.lightbox-nav-next { right: 16px; }

.lightbox-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.8125rem;
  font-weight: 500;
}


@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   POST ACTIONS (Like / Comment / Views / Share)
   ============================================ */

.post-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
}

/* 首页信息流的操作栏恢复左对齐（覆盖上面的全局居中） */
body.home .post-actions {
  justify-content: flex-start;
}
body.category-moments .post-actions {
  justify-content: flex-start;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #666666;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-full);
  transition: color 0.15s, background 0.15s;
}

.action-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.action-btn:hover {
  color: var(--text-primary);
}

.action-btn.like:hover {
  color: var(--like-color);
  background: rgba(249, 24, 128, 0.08);
}

.action-btn.like.liked {
  color: #ff3333;
}
.action-btn.like.liked svg {
  fill: #ff3333;
  stroke: #ff3333;
}

.action-btn.comment:hover {
  color: #1d9bf0;
  background: rgba(29, 155, 240, 0.08);
}

.action-btn.views {
  color: #666666;
  cursor: default;
}

.action-btn.views:hover {
  color: var(--text-tertiary);
  background: none;
}

/* 轻量 toast 提示（分享复制链接等场景） */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 0.875rem;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.2s, transform 0.2s;
  max-width: 80vw;
  text-align: center;
}
.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   VIDEO PLAYER
   ============================================ */

.video-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  aspect-ratio: 16/9;
  background: #333;
  cursor: pointer;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.15);
  transition: background 0.2s;
}

.video-play-btn:hover {
  background: rgba(0,0,0,0.25);
}

.video-play-btn-circle {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.video-play-btn:hover .video-play-btn-circle {
  transform: scale(1.08);
}

.video-play-btn-circle svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  margin-left: 3px;
}

/* ============================================
   EMPTY / LOADING STATES
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
  text-align: center;
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.9375rem;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}

.site-footer a {
  color: var(--text-secondary);
}
.site-footer a:hover { text-decoration: underline; }

/* 克隆进 .feed-container 底部的版权行，保持页脚观感（.site-footer 本体不动） */
.feed-copyright {
  border-top: 1px solid var(--border-color);
  padding: 40px 20px 30px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}
.feed-copyright p { margin: 0; }
.feed-copyright a { color: var(--text-secondary); }
.feed-copyright a:hover { text-decoration: underline; }

/* 页脚备案信息：紧跟版权行下方， tertiary 小字 */
.footer-line .beian-info {
  margin: 6px 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.footer-line .beian-info:empty { display: none; }

/* ============================================
   RESPONSIVE
   ============================================ */


/* --- Sidebar responsive: collapse below 768px --- */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .app-layout {
    flex-direction: column;
    padding-top: 0;
  }

  .main-container {
    border: none;
    border-radius: 0; /* 最小尺寸移动端：banner(封面)去掉圆角 */
  }

  /* 平板尺寸：隐藏站点页脚 */
  .site-footer {
    display: none;
  }

  /* 平板尺寸：分类导航内边距 */
  .profile-nav {
    padding: 30px;
  }

  /* 平板尺寸：信息流左右留白 */
  .feed-container {
    padding: 0 30px;
  }
}

/* ============================================
   归档 / 分类 / 标签 / 单页面 — Threads 风格
   ============================================ */

/* 页面头部 */
.page-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border-color);
}
.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.page-title .hash {
  color: var(--text-tertiary);
  font-weight: 700;
  margin-right: 2px;
}
.page-meta {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* 单页面正文 */
.page-article {
  padding: 0 16px;
}
.page-content {
  padding-top: 16px;
  padding-bottom: 24px;
}
.page-content.post-content {
  font-size: 1rem;
  line-height: 1.7;
  white-space: normal;
}


/* 评论区（Halo 官方评论插件挂载点） */
.post-comments {
  padding: 20px 60px 28px;
}
.comments-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px;
}

/* 归档分组 */
.archive-group {
  padding: 8px 16px;
}
.archive-year {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
  margin: 16px 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}

/* 文章列表（归档/分类/标签通用） */
.post-list {
  padding: 0 16px;
}
.post-list-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
  margin: 0 -16px;
}
.post-list-item:hover {
  background: var(--bg-secondary);
}
.post-list-item:hover .post-list-title {
  color: var(--accent-hover);
}
.post-list-date {
  flex-shrink: 0;
  width: 48px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.post-list-title {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}
.post-list-excerpt {
  display: none;
}

/* --- 文章分类卡片：左图右文（仿 oneleaf 列表） --- */
.article-list {
  padding: 0 50px 20px;
}

@media (max-width: 500px) {
  .post-card { padding: 12px; }
  .post-avatar { width: 36px; height: 36px; }
  .post-header .profile-name, .post-username, .post-time, .post-content { font-size: 0.875rem; }

  /* 最小尺寸移动端：隐藏个人资料社交图标 */
  .profile-social { display: none; }

  /* 最小尺寸移动端：隐藏侧边栏 */
  .sidebar { display: none; }

  .media-single img {
    max-height: none;
    border-radius: 0;
    border: none;
  }

  .gallery-slide img {
    border-radius: 0;
    border: none;
  }

  .media-gallery,
  .media-single {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .feed-container {
    padding: 0 5px;
  }

  .article-list {
    padding: 0 10px 20px;
  }

  .post-item-wrap {
    padding: 0 10px;
  }

  /* 最小尺寸移动端：文章页内边距收窄 */
  .post-article-wrap {
    padding: 0 20px;
  }

  /* 最小尺寸移动端：瞬间详情页内边距收窄 */
  .post-card.post-detail.post-moment {
    padding: 20px 10px;
  }

  /* 最小尺寸移动端：评论区上下留白收窄 */
  .post-comments {
    padding: 20px 20px 28px;
  }

  /* 最小尺寸移动端：隐藏站点页脚 */
  .site-footer {
    display: none;
  }
}

.article-card {
  display: flex;
  gap: 14px;
  padding: 30px 16px;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.article-card:hover {
  background: var(--bg-secondary);
}
.article-card-cover {
  flex-shrink: 0;
  width: 132px;
  height: 132px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
}
.article-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-card-cover-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
}
.article-card-cover-ph svg {
  width: 36px;
  height: 36px;
  opacity: 0.5;
}
.article-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.article-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card:hover .article-card-title {
  color: var(--accent-hover);
}
.article-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.article-card-author {
  font-weight: 600;
  color: var(--text-secondary);
}
.article-card-excerpt {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}
.article-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.article-stat .stat-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 640px) {
  .article-card-cover {
    width: 96px;
    height: 96px;
  }
  .article-card-title {
    font-size: 1rem;
  }
  .article-card-excerpt {
    -webkit-line-clamp: 2;
  }
}

/* 分类卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}
.term-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, transform 0.15s;
}
.term-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.term-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.term-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.term-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 2px;
}

/* 标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.tag-chip:hover {
  border-color: var(--text-primary);
  transform: translateY(-1px);
}
.tag-chip-count {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px;
}
.page-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: border-color 0.15s, color 0.15s;
}
.page-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* 加载更多（不翻页）：threads 风格居中胶囊按钮 */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 35px;
}
.load-more-btn {
  padding: 10px 28px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.load-more-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.load-more-btn.loading,
.load-more-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* 小屏：分类网格单列 */
@media (max-width: 500px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .post-list-date {
    width: 40px;
  }
}

/* ============================================
   作者归档页 — Threads 风格
   ============================================ */

/* ============================================
   作者页面 — 无侧边栏、全屏英雄背景
   ============================================ */
.author-layout {
  display: block;        /* 覆盖 .app-layout 的 flex 居中，英雄区铺满宽度 */
  padding-top: 0;        /* 作者页无顶部固定栏，英雄区顶到视口顶部 */
}

.author-main {
  position: relative;   /* 作为 author-header-bg 的定位上下文，让背景可延伸到文章区 */
  width: 100%;
  max-width: 100%;
}

.author-header {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 58vh;      /* 背景图铺满英雄区（全屏宽度 + 大高度） */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 16px 40px;
  background: transparent;
  color: #fff;
}

/* 作者页背景图：铺满英雄区（全屏宽度） */
.author-header-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
}
.author-header-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  /* 英雄区显示背景图 → 向下渐隐，覆盖约半个文章区域后过渡为纯深色 */
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.30) 0,
    rgba(15, 23, 42, 0.48) 58vh,
    rgba(15, 23, 42, 0.78) calc(58vh + 80px),
    #0f0f0f calc(58vh + 150px)
  );
}

/* 有背景图时：文字转白保证对比度（无背景图时作者页也是深色主题，文字同样白色） */
.author-header .page-title,
.author-header .author-bio,
.author-header .page-meta {
  color: #fff;
}
.author-header .author-bio {
  color: rgba(255, 255, 255, 0.78);
}

.author-hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.author-avatar-figure {
  margin: 0 0 16px;
  line-height: 0;
}

.author-avatar {
  width: 104px;
  height: 104px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  background: var(--bg-secondary);
}

.author-hgroup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}


.author-header .page-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-top: 2px;
}

.author-bio {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 440px;
}
.author-bio.font-small {
  font-size: 0.9rem;
}

.author-header .page-meta {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  color: inherit;        /* 有背景图时跟随白色 */
}

/* 正文区：全屏宽度，位于英雄区下方（作者页整体深色主题） */
.author-content {
  position: relative;
  z-index: 1;
  max-width: 100%;
  margin: 0 auto;
  padding: 32px 4vw 80px;
}

/* 作者页整体深色主题（与卡片深色风格统一） */
body.author-page {
  background: #0f0f0f;
}

body.author-page .pagination .page-btn {
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.72);
}
body.author-page .pagination .page-btn:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

body.author-page .empty-state {
  color: rgba(255, 255, 255, 0.45);
}

/* ============================================
   错误页面 — 404/500
   ============================================ */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  min-height: 50vh;
}

.error-code {
  font-size: 5rem;
  font-weight: 800;
  color: var(--text-tertiary);
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 8px;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.error-detail {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  max-width: 500px;
  word-break: break-all;
}

.error-hint {
  font-size: 0.9375rem;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

.error-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.error-btn-primary,
.error-btn-secondary {
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.error-btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
  border: 1px solid var(--text-primary);
}

.error-btn-primary:hover {
  background: var(--accent-hover);
}

.error-btn-secondary {
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.error-btn-secondary:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* ===== 相册页：微博风格「全部图片」网格 ===== */
.album-section {
  padding: 16px 35px 28px;
}
.album-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}
.album-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}
.album-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.album-loading {
  color: var(--text-secondary);
  padding: 24px 0;
  font-size: 0.9rem;
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-bottom: 50px;
  border-bottom: 1px solid var(--border-color);
}
.album-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg-secondary, #f2f2f2);
}
.album-cell img,
.album-cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.album-cell:hover img,
.album-cell:hover video {
  transform: scale(1.06);
}
.album-cell .cell-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.album-cell:hover .cell-overlay {
  opacity: 1;
}
.album-cell .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.album-cell .play-icon::after {
  content: "";
  display: block;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}

/* 灯箱 */
.album-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
}
.album-lightbox.open {
  display: flex;
}
.album-lightbox .lb-media {
  max-width: 92vw;
  max-height: 82vh;
  border-radius: 10px;
  object-fit: contain;
  background: #000;
}
.album-lightbox .lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.album-lightbox .lb-close:hover {
  background: rgba(255, 255, 255, 0.22);
}
.album-lightbox .lb-link {
  margin-top: 16px;
  color: #fff;
  text-decoration: underline;
  font-size: 0.9rem;
}
.album-lightbox.open .lb-link {
  text-decoration: none;
}
.album-lightbox .lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background 0.2s ease;
  z-index: 2;
}
.album-lightbox .lb-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.28);
}
.album-lightbox .lb-nav:disabled {
  opacity: 0.25;
  cursor: default;
}
.album-lightbox .lb-prev {
  left: 18px;
}
.album-lightbox .lb-next {
  right: 18px;
}

@media (max-width: 640px) {
  .album-section {
    padding: 14px 16px 24px;
  }
  .album-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  .album-cell {
    border-radius: 6px;
  }
}

/* ============================================
   物品模板（page_item.html）
   ============================================ */
.post-item .item-cover {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}
.post-item .entity-field-title {
  margin-bottom: 10px;
}
/* 物品操作按钮与文章/瞬间模板视觉一致 */
.post-item .post-actions .action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 999px;
  color: #666666;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}
.post-item .post-actions .action-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.post-item .post-actions .action-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* --- 瞬间分类：已改为首页同款 Threads 风格 post-card（见 .post-card） --- */

/* ============================================
   本地图标适配（Set A 精灵，替代 Iconify CDN）
   .svg-icon 默认 1em，这里按原 svg 尺寸显式约束
   ============================================ */
.svg-icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  width: 1em;
  height: 1em;
}
.sidebar-logo .svg-icon { width: 32px; height: 32px; }
.nav-item .svg-icon { width: 24px; height: 24px; }
.action-btn .svg-icon { display: block; width: 18px; height: 18px; }
.post-item .post-actions .action-btn .svg-icon { display: block; width: 20px; height: 20px; }
.action-count {
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .sidebar-logo .svg-icon { width: 26px; height: 26px; }
  .nav-item .svg-icon { width: 20px; height: 20px; }
}

/* ============================================
   作者页文章列表 — 深色横卡片，全屏一排三篇
   每篇卡片：左文右图
     顶部：左上角分类标签，右上角发布时间
     中部：标题（两行截断）
     底部：摘要（两行截断）
     右侧：正方形首图
   仅作用于作者页（.author-posts / .author-grid）
   ============================================ */
.author-posts {
  padding: 0 0 24px;
}

.author-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-grid-card {
  margin: 0;
}

.post-card-link {
  display: flex;
  align-items: stretch;
  gap: 16px;
  height: 100%;
  min-height: 148px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: #1a1a1a;
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.post-card-link:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.post-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.post-card-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
}

.post-card-category .svg-icon {
  width: 13px;
  height: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.post-card-date {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
}

.post-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.42;
  color: #fff;
}

.post-card-title.line-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.post-card-excerpt {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.55);
}

.post-card-excerpt.line-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.post-card-thumb {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #2a2a2a, #1f1f1f);
  align-self: center;
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}

.post-card-link:hover .post-card-thumb img {
  transform: scale(1.05);
}

.post-card-thumb .no-thumbnail {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2a2a2a, #1f1f1f);
}

@media (max-width: 1100px) {
  .author-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .author-grid {
    grid-template-columns: 1fr;
  }
  .post-card-thumb {
    width: 92px;
    height: 92px;
  }
  .post-card-title {
    font-size: 0.98rem;
  }
}

/* ============================================
   商品信息卡（post_item 数据源展示）
   左封面图 + 右型号/价格/购买渠道，类似电商产品
   ============================================ */
.item-product {
  display: flex;
  gap: 18px;
  padding: 16px;
  margin: 16px 0;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #eff3f4);
  border-radius: 16px;
}
.item-product-cover {
  flex: 0 0 180px;
  width: 180px;
}
.item-product-cover img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border-color, #eff3f4);
  background: var(--bg-secondary, #fafafa);
}
.item-product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}
.item-model {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary, #333);
  line-height: 1.35;
}
.item-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e63946;
}
.item-channel {
  font-size: 0.95rem;
  color: var(--text-secondary, #536471);
  word-break: break-word;
}
.item-channel-label {
  color: var(--text-tertiary, #8b98a5);
}
.item-channel a {
  color: var(--accent-color, #1d9bf0);
  text-decoration: none;
  word-break: break-all;
}
.item-channel a:hover {
  text-decoration: underline;
}

@media (max-width: 560px) {
  .item-product {
    flex-direction: column;
  }
  .item-product-cover {
    width: 100%;
    flex-basis: auto;
  }
}

/* ============================================
   分类物品网格（category_item）
   三列封面卡片：封面图 + 型号
   ============================================ */
.item-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 30px 35px;
}
.item-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #eff3f4);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  border-color: var(--border-strong, #cfd9de);
}
.item-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-secondary, #fafafa);
  overflow: hidden;
}
.item-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.item-card:hover .item-card-cover img {
  transform: scale(1.03);
}
.item-card-cover-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary, #8b98a5);
}
.item-card-cover-ph svg {
  width: 40%;
  height: 40%;
  opacity: 0.35;
}
.item-card-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.item-card-model {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-primary, #0f1419);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-card-title {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary, #536471);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* things 分类：物品卡片只显示图片 + 型号，型号两行居中 */
.category-things .item-card-title {
  display: none;
}
.category-things .item-card-cover {
  padding: 20px;
}
.category-things .item-card-cover img {
  object-fit: contain;
}
.category-things .item-card-model {
  text-align: center;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

@media (max-width: 768px) {
  .item-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}
@media (max-width: 500px) {
  .item-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px 25px 20px;
  }
  .item-card-info {
    padding: 10px;
  }
  .item-card-model {
    font-size: 0.9rem;
  }
  .item-card-title {
    font-size: 0.8rem;
  }
}

/* ============================================
   回到顶部按钮 (pixit 风格：默认隐藏，滚动后淡入 + 上滑)
   ============================================ */
.go-top {
  position: fixed;
  right: 20px; /* JS 会动态对齐到 main-container 右侧 20px，此为兜底值 */
  bottom: 22px;
  z-index: 999;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: var(--go-top-bg, var(--accent, #333));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  /* 默认隐藏：透明 + 下移 + 微缩 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease,
              background 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.go-top:hover {
  background: var(--go-top-hover, var(--accent-hover, #272727));
  transform: translateY(-2px) scale(1);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.go-top:active {
  transform: translateY(0) scale(0.94);
}

.go-top:focus-visible {
  outline: 2px solid var(--like-color, #f91880);
  outline-offset: 2px;
}

.go-top svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* 滚动后出现 */
.go-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  bottom: 100px;
  background: #313131;
}

/* 移动端：稍小、更贴边 */
@media (max-width: 680px) {
  .go-top {
    right: 20px;
    bottom: 22px;
    width: 25px;
    height: 25px;
  }
  .go-top svg {
    width: 14px;
    height: 14px;
  }
}

/* 尊重「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  .go-top {
    transition: opacity 0.2s ease;
    transform: none;
  }
  .go-top:hover,
  .go-top.show {
    transform: none;
  }
}
