/* ============================================
   小红书选材看板 — 完整样式表 (带详细注释)
   Theme: Editor's desk / warm paper + xiaohongshu red
   说明：本文件包含所有组件的样式定义，采用 BEM 命名规范思路，
   并使用 CSS 变量（Design Tokens）统一管理设计系统。
   ============================================ */

/* ---------- 1. 设计令牌 (Design Tokens) ---------- */
:root {
  /* 
   * 背景色板 (Surface) 
   * 采用暖色调纸张质感，模拟编辑桌的温馨氛围
   */
  --bg-page: #FAF7F2;       /* 页面整体背景：暖白纸色 */
  --bg-card: #FFFFFF;       /* 卡片背景：纯白，用于突出内容 */
  --bg-elevated: #FFFDF9;   /*  elevated 元素背景（如 Header）：略带暖色 */
  --bg-sidebar: #F3EEE5;    /* 侧边栏背景：稍深的暖灰，区分主内容区 */
  --bg-chip: #EFE8DC;       /* 标签/筛选器默认背景 */
  --bg-chip-active: #FF2442;/* 激活状态标签背景（品牌红） */
  --bg-input: #FFFFFF;      /* 输入框背景 */
  --bg-hover: #F5EFE3;      /* 通用悬浮状态背景 */

  /* 边框 (Border) */
  --border-subtle: #E8DFD0; /* 细微边框，用于分隔线、卡片边框 */
  --border-card: #EDE5D5;   /* 卡片专属边框，比细微边框稍明显 */
  --border-focus: #FF2442;  /* 聚焦状态边框色（品牌红） */

  /* 文本颜色 (Text) */
  --text-primary: #1F1D1A;  /* 主要文本：深灰近黑，保证可读性 */
  --text-secondary: #5E5A52;/* 次要文本：中灰，用于辅助信息 */
  --text-tertiary: #8A8478; /* 三级文本：浅灰，用于占位符、禁用状态 */
  --text-inverse: #FFFFFF;  /* 反色文本：用于深色背景上 */
  --text-accent: #FF2442;   /* 强调色文本：品牌红 */

  /* 强调色 — 小红书红 (Accent) */
  --accent: #FF2442;        /* 主品牌色：小红书红 */
  --accent-soft: #FFE4E8;   /* 浅红色背景，用于标签、高亮 */
  --accent-deep: #E01E39;   /* 深红色，用于悬浮交互 */

  /* 书籍标签颜色 */
  --book-tag-bg: #F3EEE5;
  --book-tag-text: #5E5A52;

  /* 阴影 (Shadow) */
  --shadow-card: 0 1px 2px rgba(31, 29, 26, 0.04), 0 4px 12px rgba(31, 29, 26, 0.04); /* 默认卡片阴影 */
  --shadow-card-hover: 0 2px 4px rgba(31, 29, 26, 0.06), 0 8px 24px rgba(31, 29, 26, 0.08); /* 卡片悬浮阴影 */
  --shadow-drawer: -4px 0 24px rgba(31, 29, 26, 0.1); /* 抽屉组件阴影 */
  --shadow-stamp: 0 2px 8px rgba(255, 36, 66, 0.3); /* 收藏印章阴影 */

  /* 圆角 (Radius) */
  --radius-sm: 6px;   /* 小组件圆角：标签、按钮 */
  --radius-md: 10px;  /* 中等圆角：输入框、弹窗 */
  --radius-lg: 14px;  /* 大圆角：卡片 */

  /* 字体排印 (Typography) */
  --font-serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif; /* 衬线体：用于标题、书名，体现文艺感 */
  --font-sans: 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif; /* 无衬线体：用于正文 */

  /* 间距系统 (Spacing scale) - 基于 4px 网格 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
}

/* ---------- 2. 全局重置与基础样式 ---------- */
* {
  box-sizing: border-box; /* 边框和内边距包含在元素宽高内 */
  margin: 0;
  padding: 0;
}

img {
  display: block; /* 去除图片底部默认空白 */
  max-width: 100%;
  /* 
   * 锁定图片方向，防止移动端或某些浏览器根据 EXIF 信息自动旋转图片 
   * 确保封面图始终按设计比例展示
   */
  transform: none;
  -webkit-transform: none;
  image-orientation: none;
  backface-visibility: hidden; /* 防止 Safari 缩放时闪烁 */
}

html, body {
  height: 100%; /* 确保页面占满视口 */
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased; /* 字体抗锯齿，使文字更清晰 */
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- 3. 整体布局 (Layout) ---------- */
.app {
  display: grid;
  /* 左侧边栏 280px，右侧主内容区自适应 */
  grid-template-columns: 280px 1fr;
  /* 顶部 Header 64px，下方内容区占满剩余高度 */
  grid-template-rows: 64px 1fr;
  height: 100vh; /* 视口高度 */
  min-height: 0; /* 防止内容溢出 */
}

.app-header {
  grid-column: 1 / -1; /* 横跨所有列 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10; /* 确保在内容之上 */
}

.app-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto; /* 内容过多时内部滚动 */
  padding: var(--space-5) var(--space-4);
}

.app-main {
  overflow-y: auto; /* 主内容区独立滚动 */
  padding: var(--space-6);
  position: relative;
}

/* ---------- 4. 顶部导航栏 (Header) ---------- */
.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent); /* 品牌红色背景 */
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
  font-family: var(--font-serif); /* 衬线体 Logo */
}

.header-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.header-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-stat {
  display: flex;
  align-items: baseline; /* 基线对齐，让数字和文字底部对齐 */
  gap: var(--space-1);
}

.header-stat-value {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent); /* 强调数字 */
}

.header-stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
}

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

/* 收藏计数胶囊 */
.fav-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px; /* 完全圆角，形成胶囊状 */
  font-size: 13px;
  font-weight: 600;
}

/* ---------- 5. 侧边栏筛选器 (Sidebar filters) ---------- */
.sidebar-section {
  margin-bottom: var(--space-6);
}

.sidebar-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-3);
  padding-left: var(--space-1);
}

/* 搜索框 */
.search-box {
  position: relative; /* 为内部绝对定位的图标提供参照 */
  margin-bottom: var(--space-4);
}

.search-box input {
  width: 100%;
  padding: 9px 12px 9px 36px; /* 左侧留出图标空间 */
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--accent); /* 聚焦时显示品牌色边框 */
}

.search-box input::placeholder {
  color: var(--text-tertiary);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%); /* 垂直居中 */
  color: var(--text-tertiary);
  pointer-events: none; /* 让鼠标事件穿透，不影响输入框操作 */
}

/* 标签列表 (Chip List) */
.chip-list {
  display: flex;
  flex-wrap: wrap; /* 允许换行 */
  gap: 6px;
}

.chip {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--bg-chip);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap; /* 防止文字换行 */
}

.chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chip.active {
  background: var(--accent); /* 激活状态使用品牌红 */
  color: white;
}

.chip.book-chip {
  font-family: var(--font-serif); /* 书籍标签使用衬线体 */
}

.chip.source-chip {
  font-weight: 600;
  letter-spacing: 0.3px;
}

.chip.angle-chip {
  font-size: 11px;
  padding: 4px 9px;
}

/* 日期筛选项 */
.date-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.date-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.date-item.active {
  background: var(--accent);
  color: white;
}

.date-item-count {
  font-size: 11px;
  opacity: 0.7;
}

/* 清除筛选按钮 */
.clear-filters {
  width: 100%;
  padding: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.clear-filters:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- 6. 主内容网格 (Content grid) ---------- */
.date-group {
  margin-bottom: var(--space-8);
}

.date-group-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* 日期书签样式 */
.date-bookmark {
  position: relative; /* 为伪元素定位 */
  padding: 6px 14px 6px 12px;
  background: var(--text-primary);
  color: white;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-sm) 0; /* 左下角直角，模拟书签 */
}

.date-bookmark::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -7px;
  width: 0;
  height: 0;
  /* 利用边框绘制一个向下的三角形，与背景色一致，形成书签尾巴 */
  border-top: 7px solid var(--text-primary);
  border-right: 7px solid transparent;
}

.date-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 13px;
  color: var(--text-tertiary);
}

.date-meta .dot {
  width: 3px;
  height: 3px;
  background: var(--text-tertiary);
  border-radius: 50%;
}

.post-grid {
  display: grid;
  /* 响应式网格：每列最小 230px，最大 1fr 自动填充（适配 3:4 竖版封面） */
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--space-5);
}

.post-grid.list-mode {
  grid-template-columns: 1fr;
  max-width: 600px;
  margin: 0 auto;
}

.post-grid.list-mode .post-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 0;
}

.post-grid.list-mode .post-card-cover {
  aspect-ratio: 3 / 4;
}

.post-grid.list-mode .post-card-body {
  padding: var(--space-4);
}

/* ---------- 7. 文章卡片 (Post Card) ---------- */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden; /* 隐藏溢出内容，配合圆角 */
  display: flex;
  flex-direction: column; /* 纵向排列封面和内容 */
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-2px); /* 悬浮微微上浮 */
  box-shadow: var(--shadow-card-hover);
  border-color: #E0D7C4;
}

/* 卡片封面区 */
.post-card-cover {
  position: relative;
  /*
   * 封面比例 3:4 竖版（生成 2:3 纵向图后中心裁剪为 3:4）
   * 适合小红书风格的竖版图片展示
   */
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-chip);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 填满卡片，保持比例裁剪 */
  transition: transform 0.3s ease, opacity 0.2s ease;
  display: block;
  animation: coverFadeIn 0.25s ease; /* A/B/C 切换封面时淡入 */
}

@keyframes coverFadeIn {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.post-card:hover .post-card-cover img {
  transform: scale(1.04); /* 悬浮时图片微微放大，增加交互感 */
}

/* 封面占位符（无图片时显示） */
.post-card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #EFE8DC 0%, #E5DDCE 100%);
  color: var(--text-tertiary);
  font-family: var(--font-serif);
  font-size: 16px;
  padding: var(--space-5);
  text-align: center;
  line-height: 1.5;
  flex-direction: column;
  gap: 12px;
}

.post-card-cover-placeholder::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--text-tertiary);
  opacity: 0.3;
}

/* 收藏按钮（心形） */
.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px); /* 毛玻璃效果 */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 2;
  opacity: 0; /* 默认隐藏，悬浮或已收藏时显示 */
}

.post-card:hover .fav-btn,
.post-card.favorited .fav-btn {
  opacity: 1;
}

.fav-btn:hover {
  background: white;
  transform: scale(1.1); /* 点击前微微放大 */
}

.fav-btn svg {
  width: 18px;
  height: 18px;
  transition: all 0.15s;
}

.fav-btn.favorited svg {
  fill: var(--accent); /* 已收藏：填充红色 */
  stroke: var(--accent);
}

.fav-btn:not(.favorited) svg {
  fill: none; /* 未收藏：只有描边 */
  stroke: var(--text-secondary);
}

/* 收藏印章（左上角红色标签） */
.fav-stamp {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 4px;
  transform: rotate(-4deg); /* 倾斜，模拟真实印章效果 */
  box-shadow: var(--shadow-stamp);
  z-index: 2;
  display: none; /* 默认隐藏 */
}

.post-card.favorited .fav-stamp {
  display: block; /* 收藏后显示 */
}

/* 版本徽章（如 TXT, MD 来源标识） */
.version-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  background: rgba(31, 29, 26, 0.75); /* 半透明黑底 */
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 3;
  line-height: 1.4;
  pointer-events: none; /* 不阻挡鼠标事件 */
}

.version-badge.source-txt {
  background: rgba(255, 36, 66, 0.88); /* TXT 来源用品牌红色 */
}

.version-badge.source-md {
  background: rgba(94, 90, 82, 0.88); /* MD 来源用灰色 */
}

/* 卡片内容区 */
.post-card-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1; /* 撑满剩余高度 */
}

.post-card-book {
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.post-card-book > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0; /* 配合 ellipsis 实现单行截断 */
}

/* 标题字数统计徽章 */
.title-count-badge {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255, 36, 66, 0.1);
  color: var(--accent);
  letter-spacing: 0;
  line-height: 1.4;
}

.title-count-badge.over {
  background: var(--accent);
  color: white; /* 超出字数限制时反白显示 */
}

.post-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
  /* 多行文本截断（WebKit 私有属性） */
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 最多显示 2 行 */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-summary {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 热点话题条 */
.post-card-hot-topic {
  font-size: 11px;
  color: var(--accent);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 8px;
  background: var(--accent-soft);
  border-radius: 4px;
  font-weight: 500;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto; /* 推到底部 */
  padding-top: var(--space-2);
}

.post-card-tag {
  font-size: 11px;
  padding: 2px 7px;
  background: var(--bg-chip);
  color: var(--text-tertiary);
  border-radius: 4px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle); /* 顶部细线分隔 */
}

.post-card-meta-angle {
  color: var(--text-secondary);
}

.post-card-meta-batch {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 16px;
  color: var(--accent, #c2571b);
  background: color-mix(in srgb, var(--accent, #c2571b) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #c2571b) 28%, transparent);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- 8. 详情抽屉 (Post Detail Drawer) ---------- */
/* 遮罩层 */
.drawer-overlay {
  position: fixed;
  inset: 0; /* 等同于 top:0; right:0; bottom:0; left:0 */
  background: rgba(31, 29, 26, 0.3); /* 半透明黑色 */
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* 抽屉主体 */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 90vw); /* 响应式宽度：最大 560px，最小为视口宽度的 90% */
  background: var(--bg-card);
  box-shadow: var(--shadow-drawer);
  z-index: 101;
  transform: translateX(100%); /* 默认在视口右侧隐藏 */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* 使用贝塞尔曲线实现丝滑动画 */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer.open {
  transform: translateX(0); /* 展开时滑入 */
}

.drawer-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0; /* 防止头部被压缩 */
}

.drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: all 0.15s;
}

.drawer-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* 按钮样式 */
.btn-outline {
  padding: 7px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  padding: 7px 16px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}

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

/* 抽屉内容区 */
.drawer-body {
  flex: 1; /* 占据剩余所有高度 */
  overflow-y: auto; /* 内容超出时滚动 */
  padding: var(--space-6);
}

/* 详情页封面大图 */
.detail-cover {
  width: 60%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto; /* 水平居中 */
  /* 
   * 详情页封面使用 3:4 纵向比例（与卡片封面一致）
   */
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  background: var(--bg-chip);
  display: block;
  box-shadow: 0 8px 32px rgba(31, 29, 26, 0.15); /* 大图增加阴影凸显层次 */
}

/* 封面下载：A/B/C 版本独立下载按钮行（移动端友好，触摸目标≥40px） */
.detail-cover-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.detail-cover-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.detail-cover-dl-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-cover-dl-btn.current {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.detail-cover-dl-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* 封面图允许长按保存（微信/飞书 webview 的关键兑底） */
.post-card-cover img,
.detail-cover,
.download-sheet-img {
  -webkit-touch-callout: default;
  user-select: auto;
}

/* 下载结果轻提示 */
.download-toast {
  position: fixed;
  left: 50%;
  bottom: 96px; /* 避开移动端底部导航栏 */
  transform: translateX(-50%);
  z-index: 3200;
  background: rgba(31, 29, 26, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 86vw;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* 长按保存兑底页（webview 内直接下载被拦截时） */
.download-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 29, 26, 0.55);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.download-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 380px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

.download-sheet-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-align: center;
}

.download-sheet-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--bg-chip);
  margin-bottom: 12px;
}

.download-sheet-hint {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: center;
}

.download-sheet-hint b {
  color: var(--accent);
}

.download-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.download-sheet-btn {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

/* 面板内的链接型按钮（浏览器打开原图）与普通按钮视觉一致 */
a.download-sheet-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.download-sheet-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.download-sheet-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.download-sheet-btn.primary:hover {
  color: #fff;
}

/* 详情页书籍标签 */
.detail-book-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  margin-bottom: var(--space-3);
}

.detail-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

/* 标题字数统计 */
.detail-title-count {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-title-count strong {
  font-size: 14px;
  font-weight: 700;
  color: #2E9E64; /* 正常字数显示绿色 */
  font-family: var(--font-serif);
}

.detail-title-count strong.over {
  color: var(--accent); /* 超出显示红色 */
}

/* 状态提示标签 */
.detail-title-warn {
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.detail-title-ok {
  padding: 2px 8px;
  background: rgba(46, 158, 100, 0.1);
  color: #2E9E64;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* 元数据行（日期、角度等） */
.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  font-size: 12px;
  color: var(--text-tertiary);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-meta-item strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* 热点话题高亮块 */
.detail-hot-topic {
  background: #FFF8E1; /* 浅黄色背景 */
  color: #8B6914;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: var(--space-5);
  line-height: 1.5;
  border-left: 3px solid #F5C518; /* 左侧金色边框 */
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-hot-topic strong {
  color: #B8860B;
}

.detail-hot-topic-name {
  font-weight: 600;
  font-size: 14px;
  color: #7A5C00;
}

.detail-hot-topic-detail {
  font-size: 12px;
  color: #A07C20;
  opacity: 0.85;
}

/* 正文内容 */
.detail-body {
  font-size: 14px;
  line-height: 1.85; /* 较大的行高，提升长文阅读体验 */
  color: var(--text-primary);
  white-space: pre-wrap; /* 保留换行符和空格 */
  margin-bottom: var(--space-6);
}

.detail-body .detail-body-tags {
  color: var(--text-secondary);
  font-size: 13px;
}

.detail-tags-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

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

.detail-tag {
  padding: 4px 10px;
  background: var(--bg-chip);
  color: var(--text-secondary);
  font-size: 12px;
  border-radius: 4px;
}

/* ---------- 9. A/B 版本切换 (Version Toggle) ---------- */

/* 卡片内版本切换控件 */
.version-toggle {
  display: flex;
  background: var(--bg-chip);
  border-radius: 8px;
  padding: 3px;
  margin: var(--space-1) 0;
  gap: 2px;
}

.version-toggle-btn {
  flex: 1;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1.3;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* 窄卡不下溢出 */
}

.version-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.5);
}

.version-toggle-btn.active {
  background: white;
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(31, 29, 26, 0.08);
}

.version-toggle-label {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  overflow: hidden;
}

/* 平板/手机窄卡：只显示字母，完整标签见封面上的版本徽章 */
@media (max-width: 1024px) {
  .version-toggle-label .vt-text {
    display: none;
  }
}

/* 版本徽章（A/B 标识） */
.version-badge.source-ab {
  background: rgba(31, 29, 26, 0.72);
  backdrop-filter: blur(4px);
  font-size: 10px;
  padding: 3px 7px;
  letter-spacing: 0.3px;
}

/* 详情页版本切换区 */
.detail-version-section {
  margin-bottom: var(--space-5);
}

.detail-version-toggle {
  display: flex;
  background: var(--bg-chip);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: var(--space-2);
}

.detail-version-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.detail-version-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.4);
}

.detail-version-btn.active {
  background: white;
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(31, 29, 26, 0.08);
}

.detail-version-letter {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-serif);
  line-height: 1;
}

.detail-version-name {
  font-size: 12px;
  font-weight: 500;
}

.detail-version-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: var(--space-1);
}

/* ---------- 10. 手机端优化 (Mobile Optimization) ---------- */

/* 平板及以下：侧边栏收起，内容区全屏 */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr; /* 单栏布局 */
    grid-template-rows: 56px auto 1fr; /* header + sidebar + main */
  }

  .app-header {
    padding: 0 var(--space-4);
  }

  .header-title {
    font-size: 16px;
  }

  .header-subtitle {
    display: none; /* 手机端隐藏副标题 */
  }

  .header-right {
    gap: var(--space-2);
  }

  .header-stat {
    display: none; /* 手机端隐藏部分统计，只留收藏 */
  }

  .header-stat:last-of-type {
    display: flex; /* 保留最后一个统计 */
  }

  .header-divider {
    display: none;
  }

  .app-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-3) var(--space-4);
    max-height: 200px;
    overflow-y: auto;
  }

  .sidebar-section {
    margin-bottom: var(--space-4);
  }

  .sidebar-section-title {
    margin-bottom: var(--space-2);
  }

  .app-main {
    padding: var(--space-4);
    padding-bottom: calc(72px + env(safe-area-inset-bottom)); /* 避开固定底部导航栏 */
  }

  .post-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-3);
  }

  .date-group {
    margin-bottom: var(--space-6);
  }

  .date-group-header {
    margin-bottom: var(--space-3);
  }

  .drawer {
    width: 100vw; /* 手机端抽屉全屏 */
  }

  .drawer-header {
    padding: var(--space-3) var(--space-4);
  }

  .drawer-body {
    padding: var(--space-4);
  }

  .detail-cover {
    width: 50%;
    max-width: 200px;
    margin-bottom: var(--space-4);
  }

  .detail-title {
    font-size: 20px;
  }

  /* 手机端版本切换：加大点击区域 */
  .version-toggle-btn {
    min-height: 36px;
    font-size: 12px;
  }

  .detail-version-btn {
    padding: 12px 8px;
  }
}

/* 小屏手机：进一步优化 */
@media (max-width: 480px) {
  .app-header {
    padding: 0 var(--space-3);
  }

  .logo-mark {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .header-title {
    font-size: 15px;
  }

  .fav-count-pill {
    padding: 3px 10px;
    font-size: 12px;
  }

  .app-main {
    padding: var(--space-3);
  }

  .post-grid {
    grid-template-columns: repeat(2, 1fr); /* 强制两列 */
    gap: var(--space-2);
  }

  .post-card-body {
    padding: var(--space-2) var(--space-3) var(--space-3);
    gap: 6px;
  }

  .post-card-title {
    font-size: 14px;
    -webkit-line-clamp: 2;
  }

  .post-card-summary {
    display: none; /* 小屏隐藏摘要，节省空间 */
  }

  .post-card-book {
    font-size: 11px;
  }

  .post-card-tags {
    display: none; /* 小屏隐藏标签 */
  }

  .post-card-meta {
    font-size: 10px;
    padding-top: 6px;
  }

  /* 手机端版本切换更紧凑 */
  .version-toggle {
    padding: 2px;
    border-radius: 6px;
  }

  .version-toggle-btn {
    min-height: 30px;
    font-size: 10px;
    padding: 4px 2px;
  }

  .date-bookmark {
    font-size: 13px;
    padding: 5px 12px 5px 10px;
  }

  .date-meta {
    font-size: 12px;
    gap: var(--space-2);
  }

  /* 详情页手机端优化 */
  .drawer-body {
    padding: var(--space-3);
  }

  .detail-cover {
    width: 55%;
    max-width: 180px;
  }

  .detail-title {
    font-size: 18px;
  }

  .detail-meta-row {
    gap: var(--space-3);
    font-size: 11px;
  }

  .detail-body {
    font-size: 13px;
    line-height: 1.75;
  }

  .detail-version-btn {
    padding: 10px 6px;
  }

  .detail-version-letter {
    font-size: 14px;
  }

  .detail-version-name {
    font-size: 11px;
  }
}

/* 触摸设备优化：增大可点击区域 */
@media (hover: none) and (pointer: coarse) {
  .fav-btn {
    width: 40px;
    height: 40px;
    opacity: 1; /* 触摸设备始终显示收藏按钮 */
  }

  .fav-btn svg {
    width: 20px;
    height: 20px;
  }

  .chip {
    padding: 7px 12px;
    font-size: 13px;
  }

  .btn-outline,
  .btn-primary {
    padding: 10px 16px;
    font-size: 14px;
  }

  .drawer-close {
    width: 40px;
    height: 40px;
  }

  /* 触摸设备卡片不显示悬浮效果 */
  .post-card:hover {
    transform: none;
    box-shadow: var(--shadow-card);
    border-color: var(--border-card);
  }

  .post-card:hover .post-card-cover img {
    transform: none;
  }
}

/* ---------- 11. 底部收藏栏 (Favorite bar) ---------- */
.fav-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%); /* 水平居中 */
  background: var(--text-primary);
  color: white;
  padding: 10px 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 50;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden; /* 默认隐藏，有收藏时通过 JS 添加 visible 类展示 */
}

.fav-bar.visible {
  opacity: 1;
  visibility: visible;
}

.fav-bar-count {
  font-size: 13px;
  font-weight: 600;
}

.fav-bar-count span {
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 16px;
  margin: 0 4px;
}

.fav-bar-action {
  padding: 6px 14px;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
}

.fav-bar-action:hover {
  background: var(--accent-deep);
}

.fav-bar-clear {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.15s;
}

.fav-bar-clear:hover {
  color: white;
}

/* ---------- 10. 空状态 (Empty state) ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--text-tertiary);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: 13px;
  max-width: 360px;
  line-height: 1.6;
}

/* ---------- 11. 自定义滚动条 (Scrollbar) ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent; /* 轨道透明 */
}

::-webkit-scrollbar-thumb {
  background: #D5CCBB; /* 滑块颜色 */
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #BFB29B; /* 悬浮时加深 */
}

/* ---------- 12. 深色模式 (Dark Mode) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #141210;
    --bg-card: #1C1A17;
    --bg-elevated: #1C1A17;
    --bg-sidebar: #22201D;
    --bg-chip: #2A2724;
    --bg-chip-active: #FF2442;
    --bg-input: #22201D;
    --bg-hover: #2A2724;
    --border-subtle: #2A2724;
    --border-card: #2A2724;
    --border-focus: #FF2442;
    --text-primary: #F2EDE4;
    --text-secondary: #A9A398;
    --text-tertiary: #6B675F;
    --text-inverse: #141210;
    --text-accent: #FF4757;
    --accent: #FF2442;
    --accent-soft: rgba(255, 36, 66, 0.15);
    --accent-deep: #E01E39;
    --book-tag-bg: #2A2724;
    --book-tag-text: #A9A398;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-drawer: -4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .post-card-cover-placeholder {
    background: #2A2724;
    color: #6B675F;
  }

  .drawer-overlay {
    background: rgba(0, 0, 0, 0.6);
  }

  .detail-body {
    color: #C9C2B5;
  }

  .chip {
    color: var(--text-secondary);
  }

  .chip.active {
    color: white;
  }

  .date-item:hover {
    background: #2A2724;
  }

  .date-item.active {
    color: var(--accent);
    background: var(--accent-soft);
  }

  .clear-filters:hover {
    background: #2A2724;
  }

  .skeleton-card, .skeleton-line {
    background: #2A2724;
  }

  .skeleton-card::after, .skeleton-line::after {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  }
}

/* ---------- 13. 底部悬浮按钮 (FAB) ---------- */
.fab-container {
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.fab-btn {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255, 36, 66, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.fab-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.fab-btn:active {
  transform: scale(0.95);
}

.fab-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- 14. 骨架屏 (Skeleton Loading) ---------- */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}

.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-card);
  position: relative;
}

.skeleton-cover {
  aspect-ratio: 3 / 4;
  background: var(--bg-chip);
  position: relative;
  overflow: hidden;
}

.skeleton-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 12px;
  background: var(--bg-chip);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 90%; }

.skeleton-cover::after,
.skeleton-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ---------- 15. 移动端底部导航 (Mobile Bottom Nav) ---------- */
.mobile-bottom-nav {
  display: none;
}

.mobile-filter-overlay {
  display: none;
}

/* 桌面端隐藏移动端筛选抽屉，仅在移动端断点内显示 */
.mobile-filter-drawer {
  display: none;
}

/* ---------- 16. 移动端优化：单列瀑布流 ---------- */
@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "header"
      "sidebar"
      "main"
      "bottomnav";
  }

  .app-sidebar {
    display: none; /* 移动端侧边栏改为底部抽屉 */
  }

  .mobile-bottom-nav {
    display: flex;
    grid-area: bottomnav;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    z-index: 80;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    color: var(--text-secondary);
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px 0;
    height: 100%;
  }

  .mobile-nav-item.active {
    color: var(--accent);
  }

  .mobile-nav-item svg {
    width: 22px;
    height: 22px;
  }

  .mobile-filter-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .fab-container {
    bottom: 88px; /* 避开底部导航栏（56px 导航 + 24px 间距 + 安全区） */
  }

  .mobile-filter-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-filter-drawer {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    z-index: 100;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-filter-drawer.open {
    transform: translateY(0);
  }

  .mobile-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1;
  }

  .mobile-filter-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
  }

  .mobile-filter-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-chip);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .mobile-filter-body {
    padding: 16px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .mobile-filter-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
  }

  .mobile-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .mobile-filter-chip {
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--bg-chip);
    color: var(--text-secondary);
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-filter-chip.active {
    background: var(--accent);
    color: white;
  }

  .mobile-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 10px 16px;
    margin-bottom: 8px;
  }

  .mobile-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
  }

  .mobile-search-box input::placeholder {
    color: var(--text-tertiary);
  }

  /* 移动端单列瀑布流 */
  .post-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .post-card {
    max-width: 100%;
  }

  .post-card-body {
    padding: 14px 16px 16px;
    gap: 10px;
  }

  .post-card-title {
    font-size: 16px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
  }

  .post-card-summary {
    display: block;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
  }

  .post-card-book {
    font-size: 13px;
  }

  .post-card-hot-topic {
    font-size: 12px;
    padding: 4px 10px;
  }

  .post-card-tags {
    display: flex;
  }

  .post-card-meta {
    font-size: 12px;
    padding-top: 8px;
  }

  .fav-btn {
    width: 40px;
    height: 40px;
    top: 10px;
    right: 10px;
  }

  .app-main {
    padding: 14px 16px 80px;
  }

  .date-group {
    margin-bottom: 24px;
  }

  .date-group-header {
    margin-bottom: 12px;
  }

  .date-bookmark {
    font-size: 14px;
    padding: 6px 14px 6px 12px;
  }

  .date-meta {
    font-size: 12px;
  }

  /* FAB 移动端适配 */
  .fab-container {
    right: 14px;
    bottom: 84px; /* 避开底部导航栏（44px 按钮下沿距导航 20px+ 间距） */
  }

  .fab-btn {
    width: 44px;
    height: 44px;
  }

  .fab-btn svg {
    width: 18px;
    height: 18px;
  }

  /* 详情页移动端适配 */
  .drawer {
    width: 100vw !important;
    border-radius: 0;
  }

  .drawer-header {
    padding: 12px 16px;
  }

  .drawer-body {
    padding: 16px;
  }

  .detail-cover {
    width: 70% !important;
    max-width: 280px !important;
    margin-bottom: 20px;
  }

  .detail-title {
    font-size: 20px;
    line-height: 1.4;
  }

  .detail-meta-row {
    gap: 12px;
    font-size: 12px;
  }

  .detail-body {
    font-size: 15px;
    line-height: 1.8;
  }

  .version-toggle-btn {
    min-height: 38px;
    font-size: 12px;
  }

  .detail-version-btn {
    padding: 12px 8px;
  }

  .detail-version-letter {
    font-size: 16px;
  }

  .detail-version-name {
    font-size: 12px;
  }

  /* 头部移动端优化 */
  .app-header {
    padding: 0 16px;
    height: 52px;
  }

  .header-title {
    font-size: 16px;
  }

  .header-subtitle {
    display: none;
  }

  .header-stat {
    display: none;
  }

  .header-divider {
    display: none;
  }

  .fav-count-pill {
    padding: 4px 12px;
    font-size: 12px;
  }

  /* 触摸滑动卡片提示 */
  .swipe-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .swipe-hint.left { left: 12px; }
  .swipe-hint.right { right: 12px; }

  .post-card.dragging .swipe-hint {
    opacity: 1;
  }

  .post-card.dragging {
    transition: transform 0.1s ease;
    cursor: grabbing;
  }
}

/* 小屏手机进一步优化 */
@media (max-width: 375px) {
  .app-main {
    padding: 12px 14px 76px;
  }

  .post-card-body {
    padding: 12px 14px 14px;
    gap: 8px;
  }

  .post-card-title {
    font-size: 15px;
  }

  .detail-title {
    font-size: 18px;
  }

  .detail-body {
    font-size: 14px;
  }

  .mobile-nav-item {
    font-size: 9px;
  }
}
