:root {
  --primary: #fa436a;
  --primary-light: #fd758e;
  --primary-dark: #e52d56;
  --secondary: #4a4a4a;
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --background: #f8f8f8;
  --card-bg: #ffffff;
  --border-color: #eeeeee;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden; /* 将 overflow-x 移到这里 */
}

body {

  font-family: -apple-system, BlinkMacSystemFont, 'Noto Sans SC', sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  padding-bottom: 70px;

}

/* 头部导航 */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background-color: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.header-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.logo {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.logo-sub {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.search-icon {
  color: var(--secondary);
  width: 24px;
  height: 24px;
  cursor: pointer;
}

/* 分类选项卡 */
.tabs {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  height: 40px;
  background-color: var(--card-bg);
  display: flex;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  z-index: 99;
  border-bottom: 1px solid var(--border-color);
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  margin: 0 3px;
  padding: 5px 14px;
  font-size: 13.5px;
  border-radius: 100px;
  color: var(--text-secondary);
  position: relative;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.tab:first-child { margin-left: 12px; }
.tab:last-child { margin-right: 12px; }

.tab.active {
  color: #fff;
  font-weight: 500;
  background-color: var(--primary);
}

/* 瀑布流布局 */
.content {
  margin-top: 102px;
  padding: 4px;
  /*display: grid;*/
  /*grid-template-columns: repeat(2, 1fr);*/
  /*grid-gap: 2px;*/
}

/* --- Masonry 瀑布流核心样式 --- */

.card {
  margin-bottom: 8px;
  /* 宽度将在下面的媒体查询中定义 */
}

.card-inner {
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative; /* 定位参考点现在在这里，非常安全 */
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:active .card-inner {
  transform: scale(0.98);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

/* --- Masonry 响应式布局 --- */

/* Sizer 元素，只负责宽度测量，不需要其他样式 */
.grid-sizer {
  /* 这个元素本身是空的，宽度将在下面的媒体查询中定义 */
}

/* Sizer 元素，只负责宽度测量，不需要其他样式 */
.grid-sizer {
  /* 这个元素本身是空的，宽度将在下面的媒体查询中定义 */
}

/* 1. 默认 (移动端): 2列 */
.grid-sizer,
.card {
  width: calc(50% - 4px); /* (100% / 2列) - (8px间距 / 2) */
}

/* 2. 平板及以上设备 (宽度 >= 768px): 3列 */
@media (min-width: 768px) {
  .grid-sizer,
  .card {
    width: calc(33.333% - 5.33px); /* (100% / 3列) - (8px间距 * 2/3) */
  }
}

/* --- 其他与卡片相关的样式（确保它们在上面代码块的后面） --- */

.card-cover {
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px 13px 15px;
}

/* 标题压在生成式封面上 */
.card-cover-title {
  position: relative;
  z-index: 2;
  font-weight: 600;
  line-height: 1.4;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.22);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.journal-tag {
  position: absolute;
  top: 9px;
  left: 11px;
  background-color: transparent;
  font-size: 10px;
  padding: 0;
  max-width: 88%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  letter-spacing: 0.02em;
  z-index: 3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.tier-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 100px;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.03em;
  z-index: 3;
  background-color: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: block;
}

.card-content {
  padding: 8px;
  padding-top: 10px; /* 适当增加上边距，弥补标题被移除的空间 */
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light);
}

.author {
  display: flex;
  align-items: center;
  max-width: calc(100% - 32px);
  min-width: 0;
  overflow: hidden;
}

.author-avatar {
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 4px;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 500;
  font-size: 10px;
  flex-shrink: 0;
}

.author-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.save-icon {
  width: 24px;
  height: 24px;
  color: #ccc;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 4px;
}

.save-icon.saved {
  color: var(--primary);
}

/* 底部导航 */
.nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0; /* 使用 left 和 right 来确保它横向撑满 */
  width: 100%; /* 再次强调宽度 */
  
  height: 50px;
  padding-bottom: env(safe-area-inset-bottom); /* 为 iPhone 等设备留出底部安全区域 */
  
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  
  display: flex;
  justify-content: space-around;
  align-items: center;
  
  z-index: 100; /* 确保它在内容之上 */
  
  /* 关键：防止任何意外的形变 */
  box-sizing: border-box; 
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  color: var(--text-secondary);
}

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

.nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
}

/* 加载更多 */
.loading {
  grid-column: span 2;
  text-align: center;
  padding: 20px 0;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary-light);
  border-top-color: transparent;
  border-radius: 50%;
  margin-right: 8px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 论文详情页面 */
.paper-detail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--card-bg);
  z-index: 200;
  transform: translateY(100%);
  overflow-y: auto;
  visibility: hidden; /* <-- 添加 */
  transition: transform 0.3s ease, visibility 0s 0.3s; /* <-- 修改 */
}

.paper-detail.show {
  transform: translateY(0);
  visibility: visible; /* <-- 添加 */
  transition: transform 0.3s ease; /* <-- 添加 */
}

.detail-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.back-button {
  width: 24px;
  height: 24px;
  margin-right: 16px;
  cursor: pointer;
}

.detail-title {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-content {
  padding: 16px;
  padding-bottom: 40px;
}

/* 详情页封面图 */
.detail-cover {
  width: 100%;
  min-height: 280px;
  overflow: hidden;
  border-radius: 14px;
  margin-bottom: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 50px 22px 26px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.detail-cover:active {
  opacity: 0.9;
}

.detail-title-overlay {
  position: relative;
  z-index: 2;
  font-weight: 600;
  line-height: 1.35;
  font-size: 23px;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.25);
}

.detail-journal-tag {
  position: absolute;
  top: 14px;
  left: 18px;
  background-color: transparent;
  font-size: 12px;
  padding: 0;
  font-weight: 600;
  letter-spacing: 0.03em;
  z-index: 3;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

/* 详情页元数据样式 */
.detail-meta {
  display: flex;
  align-items: center;
  margin-top: 16px;
  margin-bottom: 12px;
}

.detail-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.detail-author-info {
  display: flex;
  flex-direction: column;
  margin-left: 14px;
  font-weight: 500;
  flex: 1;
}

.detail-author-name {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.detail-date {
  font-size: 14px;
  color: var(--text-primary);
}

.detail-journal-name {
    display: inline-block;
    color: var(--text-primary);
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 24px;
}

.read-button {
  display: none; /* 隐藏旧的按钮，因为已经被新的操作按钮替代 */
}

/* 详情页操作按钮 */
.detail-actions {
  display: flex;
  justify-content: space-around;
  padding: 20px 0;
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
}

.detail-action {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.detail-action svg {
  margin-right: 8px;
  width: 22px;
  height: 22px;
}

.detail-action:active {
  background-color: rgba(0, 0, 0, 0.05);
}

/* 筛选页面 */
.filter-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--card-bg);
  z-index: 200;
  transform: translateX(100%);
  visibility: hidden; /* <-- 添加 */
  transition: transform 0.3s ease, visibility 0s 0.3s; /* <-- 修改 */
  overflow-y: auto;
}

.filter-page.show {
  transform: translateX(0);
  visibility: visible; /* <-- 添加 */
  transition: transform 0.3s ease; /* <-- 添加 */
}

.filter-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.filter-title {
  font-size: 16px;
  font-weight: 500;
  flex: 1;
  text-align: center;
}

.filter-content {
  padding: 16px;
}

.filter-section {
  margin-bottom: 20px;
}

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

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-option {
  padding: 6px 12px;
  border-radius: 16px;
  background-color: #f0f0f0;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.filter-option.selected {
  background-color: var(--primary);
  color: white;
}

.filter-button {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 500;
  display: block;
  width: 100%;
  margin: 20px 0;
  cursor: pointer;
}

.reset-button {
  background-color: #f0f0f0;
  color: var(--text-secondary);
  border: none;
  border-radius: 20px;
  padding: 10px 0;
  margin-bottom: 1rem;
  font-size: 14px;
  font-weight: 500;
  display: block;
  width: 100%;
  cursor: pointer;
}

.search-page {
    /* 保持原有的 fixed, top, left, right, height 等样式 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(100%); /* 保持占据屏幕高度减去主导航栏高度 */
    background-color: var(--card-bg);
    z-index: 200;
    transform: translateY(100%);
    transition: transform 0.3s ease, visibility 0s 0.3s;
    visibility: hidden;
    display: flex;
    flex-direction: column; /* 让其子元素垂直排列 */
}

.search-page.show {
  transform: translateY(0);
  visibility: visible; /* <-- 新增这行 */
  transition: transform 0.3s ease; 
}

.search-header {
    /* REMOVE: position: sticky; top: 0; */
    /* NEW: fixed position at the bottom of the search-page */
    position: absolute; /* 相对于父级 .search-page 定位 */
    bottom: 0; /* 贴紧底部 */
    left: 0;
    right: 0;
    padding: 10px 16px; /* 保持内边距 */
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color); /* 顶部边框 */
    /* REMOVE: border-bottom: 1px solid var(--border-color); */
    display: flex;
    align-items: center;
    z-index: 10; /* 确保在 search-results 内容之上 */
}

.search-input-container {
    /* 保持原有样式 */
    flex: 1;
    display: flex;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 20px;
    padding: 0 15px;
    height: 36px;
}

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

.search-button {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 0 10px;
  cursor: pointer;
}

.search-results {
    flex: 1; /* 让 search-results 占据所有可用空间并滚动 */
    overflow-y: auto; /* 允许内容垂直滚动 */
    padding: 10px; /* 保持原有的左右内边距 */
    /* NEW: 为底部 Search Header 留出空间 (search-header 高度约 50px + 额外间距) */
    padding-bottom: 70px; /* 根据 search-header 实际高度和需求调整此值 */
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

/* 收藏页面 */
.saved-page {
 position: fixed;
 top: 0;
 left: 0;
 right: 0;
 bottom: 0;
 background-color: var(--card-bg);
 z-index: 200;
 transform: translateX(100%);
 visibility: hidden;
 transition: transform 0.3s ease, visibility 0s 0.3s;
 display: flex;
 flex-direction: column;
}

.saved-page.show {
  transform: translateX(0);
  visibility: visible; /* <-- 添加 */
  transition: transform 0.3s ease; /* <-- 添加 */
}

.saved-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.saved-header .back-button {
  position: absolute; /* 将返回按钮绝对定位到左侧 */
  left: 16px;
}

/* ▼▼▼ 新增“导出”图标的样式 ▼▼▼ */
.export-icon {
  position: absolute; /* 将导出图标绝对定位到右侧 */
  right: 16px;
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.export-icon:active {
  color: var(--primary); /* 点击时变色 */
}

.saved-title {
  font-size: 16px;
  font-weight: 500;
  flex: 1;
  text-align: center;
}

.saved-content {

 padding: 10px;
 flex: 1; /* 占据剩余垂直空间 */
 overflow-y: auto; /* 允许内容滚动 */
 padding-bottom: 60px; 
}

.no-saved {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

/* 骨架屏 */
.skeleton-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}

.skeleton-cover {
  width: 100%;
  position: relative;
  background: linear-gradient(90deg, #f3e6ea 25%, #fbf2f5 50%, #f3e6ea 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.skeleton-content {
  padding: 10px;
}

.skeleton-title {
  height: 14px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 10px;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
  width: 95%;
}

.skeleton-text:last-child {
  width: 60%;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* 模态提示 */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 12px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 400;
  opacity: 0;
  transition: opacity 0.3s;
}

.toast.show {
  opacity: 1;
}

/* 错误状态 */
.error-state {
  grid-column: span 2;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.error-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  color: #ccc;
}

.retry-button {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 14px;
  margin-top: 16px;
  cursor: pointer;
}

/* 发现页面 */
.discover-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--background);
  z-index: 200;
  transform: translateX(100%);
   visibility: hidden; /* <-- 添加 */
  transition: transform 0.3s ease, visibility 0s 0.3s; /* <-- 修改 */
}

.discover-page.show {
  transform: translateX(0);
  visibility: visible; /* <-- 添加 */
  transition: transform 0.3s ease; /* <-- 添加 */
}

.discover-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.discover-title {
  font-size: 16px;
  font-weight: 500;
}

.discover-close {
  position: absolute;
  right: 16px;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.discover-container {
  height: calc(100% - 45px - 60px);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
}

/* Instagram风格的全屏卡片 */
.discover-card {
  height: 100%;
  width: 100%;
  padding: 16px;
  box-sizing: border-box;
  scroll-snap-align: start;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--card-bg);
  position: relative;
}

.discover-card-inner {
  background-color: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.no-more-papers {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-light);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

.discover-cover {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 46px 20px 22px;
}

.discover-title-overlay {
  position: relative;
  z-index: 2;
  font-weight: 600;
  line-height: 1.38;
  font-size: 21px;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 9px rgba(0, 0, 0, 0.24);
}

.discover-journal-tag {
  position: absolute;
  top: 14px;
  left: 16px;
  background-color: transparent;
  font-size: 12px;
  padding: 0;
  z-index: 3;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.24);
}

.discover-tier-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  color: white;
  font-weight: 500;
  z-index: 5;
  background-color: var(--primary);
}

.discover-content {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* 发现页元数据样式 */
.discover-meta {
  display: flex;
  align-items: center;
  margin-top: 16px;
  margin-bottom: 12px;
}

.discover-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.discover-author-info {
  display: flex;
  flex-direction: column;
  margin-left: 12px;
  flex: 1;
}

.discover-author-name {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.discover-date {
  font-size: 12px;
  color: var(--text-light);
}

.discover-journal-name {
 display: inline-block;
 background-color: var(--card-bg); 
 color: var(--text-primary); 
 padding: 4px 10px;
 border-radius: 4px;
 font-size: 14px;
 margin-bottom: 16px;
}

.discover-actions {
  display: flex;
  justify-content: space-around;
  padding: 16px 0;
  border-top: 1px solid var(--border-color);
  margin-top: auto; 
}

.discover-action {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.discover-action svg {
  margin-right: 8px;
  width: 20px;
  height: 20px;
}

.discover-action:active {
  background-color: rgba(0, 0, 0, 0.05);
}

/* 兼容性修复 */
.journal-tag, .tier-tag, .discover-journal-tag, .discover-tier-tag, .detail-journal-tag {
  z-index: 5;
}

.author-name, .detail-author-name, .discover-author-name {
  color: var(--text-primary); /* 从var(--text-light)改为var(--text-secondary) */
  font-weight: 500; /* 增加字重 */
}

/* 筛选页面按钮置顶 */
.filter-page {
  display: flex;
  flex-direction: column;
}

.filter-header {
  position: sticky;
  top: 0;
  z-index: 10;
}

.filter-actions {
  position: sticky;
  top: 45px; /* 标题栏高度 */
  background-color: var(--card-bg);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  z-index: 9;
  display: flex;
  gap: 10px;
}

.filter-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}



/* --- NEW/MODIFIED: 页面底部通用大按钮容器样式 --- */
/* 将 saved-page-bottom-button-area 和 paper-detail-bottom-button-area 合并 */
.saved-page-bottom-button-area,
.paper-detail-bottom-button-area,
.discover-page-bottom-button-area { 
    position: absolute; /* 相对于父级页面定位 */
    bottom: 0; /* 贴紧底部 */
    left: 0;
    right: 0;
    padding: 10px 16px; /* 按钮的内边距，提供一些空间 */
    background-color: var(--card-bg); /* 背景色和页面一致 */
    border-top: 1px solid var(--border-color); /* 顶部边框 */
    z-index: 10; /* 确保在内容之上 */
}

/* --- NEW/MODIFIED: 页面底部通用大按钮样式 --- */
/* 将 saved-page-back-button 和 paper-detail-back-button 合并 */
.saved-page-back-button,
.paper-detail-back-button,
.discover-page-back-button{ 
    width: 100%; /* 宽度占满父容器 */
    padding: 12px 0; /* 垂直内边距，让按钮更高 */
    background-color: var(--card-bg); /* 背景改为白色 */
    color: var(--primary);
    border: 1px solid var(--primary); /* NEW: 添加边框，让白色按钮有区分度 */
    border-radius: 8px; /* 圆角 */
    font-size: 16px; /* 文字大小 */
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow); /* 阴影效果 */
    transition: background-color 0.2s;
}

.saved-page-back-button:active,
.paper-detail-back-button:active {
    background-color: var(--primary-light); /* 点击时背景变为主题浅色 */
    color: white; /* 点击时文字变为白色 */
    border-color: var(--primary-light); /* 点击时边框颜色也变化 */
}

.content.single-column .card {
  width: 100%;       /* 强制卡片宽度为100% */
  margin-bottom: 12px; /* 可以适当增加单列时的垂直间距 */
}

/* 确保单列时 Sizer 不起作用 (虽然收藏页没有Sizer，但加上更保险) */
.content.single-column .grid-sizer {
  width: 0;
}
