/* 基础样式 */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --success: #22c55e;
  --code-bg: #f1f5f9;
  --nav-bg: #1e293b;
}

/* ===== 顶部导航栏 ===== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: white !important;
  text-decoration: none !important;
}

.nav-brand:hover {
  opacity: 0.9;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 0.85rem;
  color: rgba(255,255,255,0.85) !important;
  text-decoration: none !important;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover {
  background: rgba(255,255,255,0.15);
  color: white !important;
}

/* 导航栏下拉菜单 */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 280px;
  z-index: 200;
  overflow: hidden;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text) !important;
  text-decoration: none !important;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.dropdown-item:last-child {
  border-bottom: none;
}

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

.dropdown-item-name {
  display: block;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.dropdown-item-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  font: 16px/1.7 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
}

h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem; line-height: 1.3; }
h2 { font-size: 1.25rem; font-weight: 600; margin: 1.5rem 0 0.75rem; color: var(--text); border-bottom: 2px solid var(--primary); padding-bottom: 0.5rem; }
h3 { font-size: 1.1rem; font-weight: 600; margin: 1rem 0 0.5rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 表格样式 */
table { border-collapse: collapse; width: 100%; margin: 1.5rem 0; font-size: 0.9rem; }
th, td { border: 1px solid var(--border); padding: 0.75rem; vertical-align: top; text-align: left; }
th { background: var(--bg-secondary); font-weight: 600; }
tr:hover { background: var(--bg-secondary); }
td:first-child { text-align: center; font-weight: 600; color: var(--text-secondary); width: 40px; }
td:last-child { text-align: center; width: 40px; }

/* 代码样式 */
code, pre { background: var(--code-bg); padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.85em; }
pre { padding: 1rem; overflow-x: auto; }

/* 引用块 - 用于原文摘要 */
blockquote {
  margin: 1rem 0;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* 页脚 */
.footer { margin: 3rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 0.85rem; text-align: center; }

/* 日期选择器 */
.date-switcher {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
}
.date-switcher select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  background: white;
}
.date-switcher .btn {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  font-weight: 500;
}
.date-switcher .btn:hover { background: var(--primary-dark); text-decoration: none; }

/* 分类卡片网格 */
.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.tag-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  background: var(--bg);
  transition: box-shadow 0.2s, transform 0.2s;
}
.tag-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-2px); }
.tag-card h3 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.tag-card h3 a { color: var(--text); }
.tag-card p { margin: 0.5rem 0; color: var(--text-secondary); font-size: 0.9rem; }
.tag-card .btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  font-weight: 500;
}
.tag-card .btn:hover { background: var(--primary-dark); text-decoration: none; }

/* 论文详情页样式 */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 论文关键图片展示 */
.paper-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1rem 0;
}

.paper-figure {
  margin: 0;
  padding: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.paper-figure:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.paper-figure img {
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: zoom-in;
  transition: opacity 0.2s;
}

.paper-figure img:hover {
  opacity: 0.9;
}

/* ===== 图片放大 Lightbox ===== */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  cursor: zoom-out;
}

.lightbox-overlay.show {
  display: flex;
}

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

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox-caption {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 8px;
  font-size: 0.9rem;
  max-width: 800px;
  text-align: center;
  line-height: 1.6;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-counter {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.paper-figure figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

/* 论文工具栏 */
.paper-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin: 1rem 0;
  border: 1px solid var(--border);
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.85rem;
  background: var(--bg);
  color: var(--text) !important;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.2s;
}

.toolbar-btn:hover {
  background: var(--primary);
  color: white !important;
  border-color: var(--primary);
  text-decoration: none !important;
}

.toolbar-btn.favorite-btn.favorited {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309 !important;
}

.toolbar-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: white !important;
}

/* 关键词标签 */
code {
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-right: 0.25rem;
}

/* 信息块 */
.info-block {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

/* 兴趣领域导航 */
.interest-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.interest-badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: transform 0.2s, box-shadow 0.2s;
}
.interest-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  text-decoration: none !important;
}

/* ===== 新版首页样式 ===== */

/* 分类区块 - 折叠式 */
.tag-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 1rem;
  background: var(--bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
}

.tag-section .tag-content {
  padding: 0 1.5rem 1.5rem;
  max-height: 2000px;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.tag-section.collapsed .tag-content {
  max-height: 0;
  padding: 0 1.5rem;
  opacity: 0;
  overflow: hidden;
}

.tag-section .tag-expand-icon {
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.tag-section:not(.collapsed) .tag-expand-icon {
  transform: rotate(90deg);
}

.tag-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-title-wrap h2 {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1.3rem;
}

.tag-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: normal;
}

.tag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--primary);
  cursor: pointer;
  transition: background 0.15s;
}

.tag-header:hover {
  background: var(--bg-secondary);
}

.tag-section.collapsed .tag-header {
  border-bottom-color: transparent;
}

.tag-header h2 {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
}

.tag-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.tag-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* 支柱统计 */
.pillar-stats {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.pillar-stats h4 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pillar-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pillar-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  color: #0369a1;
  border-radius: 20px;
  font-size: 0.8rem;
  border: 1px solid #bae6fd;
}

.pillar-badge strong {
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  background: #0369a1;
  color: white;
  border-radius: 10px;
  font-size: 0.75rem;
}

/* 最近日期按钮 */
.recent-dates {
  margin: 1rem 0;
}

.recent-dates h4 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.date-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.date-btn {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  color: var(--text) !important;
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  transition: all 0.2s;
  text-decoration: none !important;
}

.date-btn:hover {
  background: var(--primary);
  color: white !important;
  border-color: var(--primary);
}

.date-btn small {
  color: var(--text-secondary);
  margin-left: 0.25rem;
}

.date-btn:hover small {
  color: rgba(255,255,255,0.8);
}

.date-btn-more {
  border-style: dashed;
  color: var(--primary) !important;
}

.date-btn-more:hover {
  border-style: solid;
}

/* 最近论文列表 */
.recent-papers {
  margin: 1rem 0;
}

.recent-papers h4 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.paper-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.paper-list li {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.paper-list li:last-child {
  border-bottom: none;
}

.paper-list li:hover {
  background: var(--bg-secondary);
}

.paper-list a {
  font-weight: 500;
  color: var(--text);
}

.paper-list small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* 操作按钮 */
.tag-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white !important;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text) !important;
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--text) !important;
}

/* ===== 日历视图样式 ===== */
.calendar-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.calendar-month {
  flex: 1 1 280px;
  max-width: 320px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.month-title {
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.25rem;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: all 0.2s;
}

.cal-day.empty {
  visibility: hidden;
}

.cal-day.has-data {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white !important;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.cal-day.has-data:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* ===== 论文标签样式 ===== */
.paper-tag {
  display: inline-block;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4338ca;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  margin: 1px;
  white-space: nowrap;
  font-weight: 500;
}

.tags-cell {
  max-width: 180px;
  line-height: 1.6;
}

/* ===== 收藏功能样式 ===== */
.favorite-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.favorite-btn:hover {
  transform: scale(1.2);
  color: #f59e0b;
}

.favorite-btn.favorited {
  color: #f59e0b;
}

/* 导航栏收藏按钮 */
.nav-favorites {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.85rem;
  color: rgba(255,255,255,0.85) !important;
  text-decoration: none !important;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  background: none;
  border: none;
}

.nav-favorites:hover {
  background: rgba(255,255,255,0.15);
  color: white !important;
}

.favorites-badge {
  background: #f59e0b;
  color: white;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-weight: 600;
}

/* 弹窗样式 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-content {
  background: var(--bg);
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* 收藏项 */
.favorite-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.favorite-item:last-child {
  border-bottom: none;
}

.favorite-title {
  display: block;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.favorite-title:hover {
  color: var(--primary);
}

.favorite-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.remove-favorite {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

.remove-favorite:hover {
  text-decoration: underline;
}

/* 收藏夹选择菜单 */
.folder-menu {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 160px;
  z-index: 1001;
  overflow: hidden;
}

.folder-menu-title {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  font-weight: 600;
}

.folder-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.folder-menu-item:hover {
  background: var(--bg-secondary);
}

.folder-menu-item.active {
  background: #eff6ff;
}

.folder-menu-item.remove {
  color: #ef4444;
}

.folder-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
}

.folder-check {
  margin-left: auto;
  color: var(--primary);
  font-weight: bold;
}

.folder-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

/* 收藏夹标签页 */
.folder-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-wrap: nowrap;
}

.folder-tab {
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.2s;
}

.folder-tab:hover {
  color: var(--text);
}

.folder-tab.active {
  color: var(--folder-color, var(--primary));
  border-bottom-color: var(--folder-color, var(--primary));
  font-weight: 500;
}

.folder-tab .folder-count {
  font-size: 0.75rem;
  background: var(--bg-secondary);
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  margin-left: 0.25rem;
}

.folder-tab.add-tab {
  color: var(--primary);
}

.modal-large {
  max-width: 700px;
}

/* 新建收藏夹表单 */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.form-group input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.form-group input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.color-picker {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg);
}

/* 管理收藏夹 */
.manage-folders {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.manage-folder-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.manage-folder-item .folder-name {
  font-weight: 500;
}

.manage-folder-item .folder-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.manage-folder-item .remove-folder {
  margin-left: auto;
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.8rem;
}

/* ===== 搜索功能 ===== */
.nav-search {
  padding: 0.5rem 0.85rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-search:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem;
  margin-bottom: 1rem;
}

.search-input-wrap input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input-wrap input:focus {
  border-color: var(--primary);
}

.search-status {
  color: var(--text-secondary);
  font-size: 0.85rem;
  white-space: nowrap;
}

.search-hint {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
}

.search-result-count {
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.search-result-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-result-item {
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.search-result-item:hover {
  border-color: var(--primary);
}

.search-result-title {
  display: block;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.search-result-title:hover {
  color: var(--primary);
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.search-result-tag {
  padding: 0.15rem 0.5rem;
  background: var(--primary);
  color: white;
  border-radius: 4px;
}

.search-result-date {
  color: var(--text-secondary);
}

.search-result-id {
  color: var(--text-secondary);
  font-family: monospace;
}

.search-result-headline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.search-result-title mark,
.search-result-headline mark {
  background: #fef08a;
  color: inherit;
  padding: 0 0.1rem;
  border-radius: 2px;
}

/* ===== 访问控制 - 登录保护 ===== */
.auth-wall {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.auth-wall.hidden {
  display: none;
}

.auth-wall-content {
  background: var(--bg);
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.auth-wall-logo {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.auth-wall-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.auth-wall-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.auth-wall-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid #fecaca;
  display: none;
}

.auth-wall-error.show {
  display: block;
}

.auth-wall .form-group {
  text-align: left;
  margin-bottom: 1rem;
}

.auth-wall .form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.auth-wall .form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-wall .form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-wall-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 4px;
}

.auth-wall-tab {
  flex: 1;
  padding: 0.6rem;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s;
}

.auth-wall-tab.active {
  background: var(--bg);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.auth-wall-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-wall-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.auth-wall-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-wall-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.auth-wall-divider::before,
.auth-wall-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-wall-divider span {
  padding: 0 0.75rem;
}

.auth-wall-social {
  display: flex;
  gap: 0.75rem;
}

.auth-wall-social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-wall-social-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

.auth-wall-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.auth-wall-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 审核状态样式 */
.auth-wall-status-box {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  text-align: left;
  border: 1px solid var(--border);
}

.auth-wall-status-box p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.auth-wall-status-box p:first-child {
  margin-top: 0;
}

.auth-wall-status-box p:last-child {
  margin-bottom: 0;
}

.auth-wall-status-box.pending {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.auth-wall-status-box.pending p {
  color: #92400e;
}

.auth-wall-status-box.rejected {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.auth-wall-status-box.rejected p {
  color: #991b1b;
}

.auth-wall-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-wall-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.auth-wall-btn.secondary:hover {
  background: var(--border);
  box-shadow: none;
  transform: none;
}

.auth-wall-forgot {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.85rem;
}

.auth-wall-forgot a {
  color: var(--primary);
  text-decoration: none;
}

.auth-wall-forgot a:hover {
  text-decoration: underline;
}

.auth-wall-error.success {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}

/* 主内容隐藏 */
body.auth-required .top-nav,
body.auth-required .container,
body.auth-required .footer {
  display: none;
}

body.auth-ready .top-nav,
body.auth-ready .container,
body.auth-ready .footer {
  display: block;
}

/* ===== 用户登录相关样式 ===== */
.auth-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.login-btn {
  background: rgba(255,255,255,0.1) !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
}

.login-btn:hover {
  background: rgba(255,255,255,0.2) !important;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.user-name {
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-status {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  opacity: 0;
  transition: opacity 0.3s;
}

.sync-status.visible {
  opacity: 1;
}

/* 登录弹窗 */
.login-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.login-tab {
  flex: 1;
  padding: 0.75rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.login-tab:hover {
  color: var(--text);
}

.login-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

.login-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid #fecaca;
}

.btn-block {
  width: 100%;
  margin-top: 0.5rem;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-divider span {
  padding: 0 0.75rem;
}

.social-login {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-social:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

.btn-google:hover {
  border-color: #4285F4;
}

.btn-github:hover {
  border-color: #24292e;
}

.login-footer {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.login-footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

/* 响应式 */
@media (max-width: 768px) {
  /* 导航栏 */
  .nav-container { padding: 0.5rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .nav-brand { font-size: 1rem; }
  .nav-links { gap: 0.25rem; }
  .nav-link { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
  /* 日历 */
  .calendar-container { gap: 1rem; }
  .calendar-month { flex: 1 1 100%; max-width: 100%; }
  .cal-day { font-size: 0.8rem; }
  /* 其他 */
  .container { padding: 0 1rem; }
  h1 { font-size: 1.4rem; }
  table { font-size: 0.8rem; }
  th, td { padding: 0.5rem; }
  .tag-grid { grid-template-columns: 1fr; }
  .tag-header { flex-direction: column; align-items: flex-start; }
  .tag-meta { flex-direction: column; gap: 0.5rem; }
  .date-buttons { gap: 0.35rem; }
  .date-btn { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
  .tag-actions { flex-direction: column; }
  .btn { text-align: center; }
}
