/* index_page.css - 从 index.blade.php 提取的样式 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  background: #f8fafc;
  color: #0f172a;
  line-height: 1.5;
}

/* ---------- 左侧导航栏 (紧贴左侧边框) ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  backdrop-filter: blur(0px);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  overflow-y: auto;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  text-align: center;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  line-height: 1.2;
}
.logo span {
  font-size: 0.75rem;
  display: block;
  color: #94a3b8;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  letter-spacing: 1px;
  margin-top: 6px;
  font-weight: 400;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  align-items: center;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 28px;
  border-radius: 16px;
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  font-weight: 500;
  width: 100%;
  max-width: 220px;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: white;
  transform: translateX(5px);
}

.nav-item.active {
  background: linear-gradient(95deg, #f97316, #ef4444);
  color: white;
  box-shadow: 0 6px 14px rgba(249, 115, 22, 0.25);
}

.nav-icon {
  font-size: 1.35rem;
  width: 28px;
  text-align: center;
}

.nav-text {
  font-size: 1rem;
}

.sidebar-qrcode {
  text-align: center;
  padding: 1.5rem 0 0.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 0.5rem;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.7rem;
  text-align: center;
  padding-top: 2rem;
  color: #64748b;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ===== 移动端顶部导航栏（类似 /new_index 的 nav-container 风格） ===== */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 0;
  left: 1.2rem;
  right: 1.2rem;
  width: auto;
  height: 56px;
  z-index: 1100;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  transition: 0.2s;
  border-radius: 0 0 22px 22px;
  text-decoration: none;
}
.mobile-menu-toggle:hover {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* 左侧 logo 文字 */
.mobile-menu-toggle .mobile-logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

/* 右侧汉堡图标 */
.mobile-menu-toggle .mobile-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s;
}
.mobile-menu-toggle .mobile-hamburger:hover {
  background: rgba(255, 255, 255, 0.25);
}
.mobile-menu-toggle .mobile-hamburger svg {
  width: 22px;
  height: 22px;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
}

/* 右侧主内容区 */
.main-content {
  margin-left: 280px;
  padding: 2rem 2rem 3rem 2rem;
  transition: margin 0.3s ease;
  min-height: 100vh;
}

/* 内容区域切换 */
.content-section {
  display: none;
  animation: fadeIn 0.25s ease;
}
.content-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px);}
  to { opacity: 1; transform: translateY(0);}
}

/* 瀑布流容器 - 通用样式 */
.masonry-container {
  margin-bottom: 2rem;
  width: 100%; /* 确保容器宽度正常 */
}

/* 顶部瀑布流 - 使用Masonry.js插件，需要明确的卡片宽度 */
#top-masonry .quote-card {
  width: 23.5%; /* 4列布局，预留一点间隙 (100%/4 - 间距) */
  margin-right: 1.5%; /* 配合Masonry的百分比布局 */
  float: left; /* Masonry需要这个来正确计算布局 */
}

/* 底部瀑布流 - 使用Masonry.js插件，需要明确的卡片宽度 */
#bottom-masonry .quote-card {
  width: 23.5%; /* 4列布局，预留一点间隙 (100%/4 - 间距) */
  margin-right: 1.5%; /* 配合Masonry的百分比布局 */
  float: left; /* Masonry需要这个来正确计算布局 */
}

/* 名言卡片 - 通用样式 */
.quote-card {
  break-inside: avoid;
  page-break-inside: avoid;
  background: #ffffff;
  border-radius: 28px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
  border: 1px solid rgba(203, 213, 225, 0.3);
  backdrop-filter: blur(2px);
  display: block; /* 改为block，Masonry需要 */
}

.quote-card:hover {
  transform: none;
  box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.15);
  border-color: #fed7aa;
}

.quote-card::before {
  content: "“";
  font-size: 3.5rem;
  line-height: 1;
  font-family: serif;
  color: #f97316;
  opacity: 0.25;
  display: block;
  margin-bottom: -1rem;
}

.quote-text {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0.5rem 0 1rem 0;
  line-height: 1.55;
}
.quote-text a {
  color: inherit;
  text-decoration: none;
}
.quote-text a:hover {
  color: #f97316;
}

.quote-author {
  font-size: 0.8rem;
  color: #f97316;
  font-weight: 600;
  text-align: right;
  border-top: 1px dashed #e2e8f0;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.quote-author img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.quote-author a {
  color: inherit;
  text-decoration: none;
}
.quote-author a:hover {
  color: #f97316;
}
.quote-author-word {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 400;
  text-align: right;
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 分页组件 */
.pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2rem 0 3rem;
}

.pagination-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 40px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: #334155;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}
.page-btn:hover {
  background: #fff7ed;
  border-color: #f97316;
  color: #f97316;
  text-decoration: none;
}
.page-btn.active {
  background: #f97316;
  border-color: #f97316;
  color: white;
  box-shadow: 0 2px 8px rgba(249,115,22,0.3);
  cursor: default;
}
.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f1f5f9;
}

/* 针对多位数页码的适配 */
.page-btn[class*="page-btn"] {
  /* 确保按钮宽度能容纳内容 */
  box-sizing: border-box;
}
.page-dots {
  padding: 0 6px;
  color: #94a3b8;
}

/* 区域标题 */
.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.6rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: #0f172a;
  letter-spacing: -0.3px;
}
.section-title .badge {
  font-size: 0.85rem;
  background: #f1f5f9;
  padding: 4px 12px;
  border-radius: 40px;
  font-weight: normal;
  color: #f97316;
  display: inline-flex;
  align-items: center;
  align-self: center;
  line-height: 1.4;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, #f97316, #facc15, transparent);
  border-radius: 2px;
  align-self: center;
}

/* 占位卡片风格 */
.placeholder-card {
  background: #fef9f1;
  border-radius: 28px;
  padding: 2rem;
  text-align: center;
  color: #475569;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  #top-masonry .quote-card,
  #bottom-masonry .quote-card {
    width: 31%; /* 3列布局 */
  }
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-menu-toggle {
    display: flex;
  }
  .main-content {
    margin-left: 0;
    padding: 1.2rem;
    padding-top: 72px; /* 为顶部导航栏留出空间 */
  }
  #top-masonry .quote-card,
  #bottom-masonry .quote-card {
    width: 48%; /* 2列布局 */
  }
  .quote-card {
    padding: 1.2rem;
    margin-bottom: 1rem;
  }
  .section-title {
    font-size: 1.5rem;
  }
}
@media (max-width: 480px) {
  #top-masonry .quote-card,
  #bottom-masonry .quote-card {
    width: 100%; /* 1列布局 */
    margin-right: 0;
  }
}

/* 加载动画占位 */
.loading-shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 28px;
  height: 180px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== 标签详情卡片 - 浅色渐变背景 ===== */
.tag-detail-card {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe, #dbeafe);
  border-radius: 28px;
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(96, 165, 250, 0.2);
}

.tag-detail-avatar {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tag-detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tag-detail-info {
  flex: 1;
}

.tag-detail-name {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.3rem;
}

.tag-detail-word {
  font-size: 1rem;
  color: #2563eb;
  font-weight: 500;
}

.tag-detail-brief {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .tag-detail-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
  }
  .tag-detail-avatar {
    width: 80px;
    height: 80px;
  }
  .tag-detail-name {
    font-size: 1.4rem;
  }
}

/* ===== 书籍详情卡片 - 浅色渐变背景 ===== */
.book-detail-card {
  background: linear-gradient(135deg, #fce7f3, #fbcfe8, #fce7f3);
  border-radius: 28px;
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(244, 114, 182, 0.2);
}

.book-detail-cover {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.book-detail-icon {
  font-size: 3rem;
  line-height: 1;
}

.book-detail-info {
  flex: 1;
}

.book-detail-name {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.3rem;
}

.book-detail-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #475569;
}

.book-detail-author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.book-detail-author a {
  color: #db2777;
  text-decoration: none;
  font-weight: 600;
}

.book-detail-author a:hover {
  text-decoration: underline;
}

.book-detail-more {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.8;
}

.book-detail-more-label {
  font-weight: 500;
  color: #475569;
}

.book-detail-more-link {
  display: inline-block;
  color: #db2777;
  text-decoration: none;
  margin-right: 0.5rem;
  padding: 2px 10px;
  background: rgba(244, 114, 182, 0.1);
  border-radius: 20px;
  transition: all 0.2s;
}

.book-detail-more-link:hover {
  background: rgba(244, 114, 182, 0.2);
  text-decoration: none;
}

@media (max-width: 768px) {
  .book-detail-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
  }
  .book-detail-cover {
    width: 80px;
    height: 80px;
  }
  .book-detail-icon {
    font-size: 2.4rem;
  }
  .book-detail-name {
    font-size: 1.4rem;
  }
  .book-detail-author {
    justify-content: center;
  }
  .book-detail-more {
    text-align: center;
  }
}

/* ===== 作家详情卡片 - 浅色渐变背景 ===== */
.author-detail-card {
  background: linear-gradient(135deg, #fef3c7, #fde68a, #fef3c7);
  border-radius: 28px;
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.author-detail-avatar {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.author-detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-detail-info {
  flex: 1;
}

.author-detail-name {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.3rem;
}

.author-detail-word {
  font-size: 1rem;
  color: #f97316;
  font-weight: 500;
}

.author-detail-brief {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .author-detail-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
  }
  .author-detail-avatar {
    width: 80px;
    height: 80px;
  }
  .author-detail-name {
    font-size: 1.4rem;
  }
}

/* ===== 名言详情卡片 ===== */
.quote-detail-card {
  background: linear-gradient(135deg, #f0fdf4, #bbf7d0, #f0fdf4);
  border-radius: 28px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.quote-detail-content {
  position: relative;
}

.quote-detail-quote-mark {
  font-size: 4rem;
  line-height: 1;
  font-family: serif;
  color: #22c55e;
  opacity: 0.2;
  margin-bottom: -1.5rem;
}

.quote-detail-text {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.7;
  margin: 0.5rem 0 1.2rem 0;
}

.quote-detail-author-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #475569;
}

.quote-detail-author-line img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.quote-detail-author-line a {
  color: #16a34a;
  text-decoration: none;
  font-weight: 600;
}

.quote-detail-author-line a:hover {
  text-decoration: underline;
}

.quote-detail-explain {
  margin-top: 0.8rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.6;
}

.quote-detail-explain-label {
  font-weight: 600;
  color: #16a34a;
}

.quote-detail-tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.quote-detail-tags-label {
  font-size: 0.9rem;
  color: #64748b;
  margin-right: 4px;
}

.quote-detail-tag-link {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border-radius: 20px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s;
}

.quote-detail-tag-link:hover {
  background: rgba(34, 197, 94, 0.2);
  text-decoration: none;
}

@media (max-width: 768px) {
  .quote-detail-card {
    padding: 1.5rem;
  }
  .quote-detail-text {
    font-size: 1.2rem;
  }
  .quote-detail-quote-mark {
    font-size: 3rem;
  }
}

/* ===== 作家卡片微调 ===== */
.author-card {
  position: relative;
}
.author-card::before {
  content: "👤";
  font-size: 1.6rem;
  opacity: 0.15;
  position: absolute;
  top: 0.5rem;
  right: 0.8rem;
  margin-bottom: 0;
}
.author-card .quote-text {
  font-size: 1.1rem;
}
.author-card .quote-author {
  color: #6366f1;
}

/* ===== 书籍卡片微调 ===== */
.book-card {
  position: relative;
}
.book-card::before {
  content: "📖";
  font-size: 1.6rem;
  opacity: 0.15;
  position: absolute;
  top: 0.5rem;
  right: 0.8rem;
  margin-bottom: 0;
}
.book-card .quote-text {
  font-size: 1.05rem;
}
.book-card .quote-author {
  color: #0891b2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.book-card .quote-author img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.book-card .quote-author::before {
  content: "";
}
