/**
 * Shiguang 拾光集 - 首页专用样式
 * 毛玻璃 · 简约白 · 插画风
 */

/* ========== Hero 区域 ========== */
.hero {
  position: relative;
  padding: 140px 0 80px;
  overflow: hidden;
  background: linear-gradient(165deg, #F5F7FB 0%, #EEF2FF 30%, #FFF9F3 60%, #F5F7FB 100%);
}

.hero-blobs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; animation: heroBlobFloat 8s ease-in-out infinite; transition: transform 0.1s ease-out; }
.hero-blob-1 { width: 420px; height: 420px; background: radial-gradient(circle, rgba(108,159,255,0.25), transparent 70%); top: -120px; right: -80px; }
.hero-blob-2 { width: 320px; height: 320px; background: radial-gradient(circle, rgba(255,184,122,0.2), transparent 70%); bottom: -80px; left: -60px; animation-delay: -3s; }
.hero-blob-3 { width: 240px; height: 240px; background: radial-gradient(circle, rgba(168,200,255,0.18), transparent 70%); top: 40%; left: 50%; animation-delay: -5s; }

/* 粒子画布 */
.hero-particles {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
}

@keyframes heroBlobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -15px) scale(1.05); }
  66% { transform: translate(-10px, 10px) scale(0.95); }
}

.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; position: relative; z-index: 1; }
.hero-text { max-width: 520px; }
.hero-title { margin-bottom: 16px; }
.hero-title-main {
  font-size: 3.2rem; font-weight: 900; letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 40%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.2;
}
.hero-subtitle { font-size: 1.2rem; font-weight: 500; color: var(--text); margin-bottom: 12px; opacity: 0.85; min-height: 1.8em; }
.hero-desc { font-size: 15px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.8; }

/* 打字机光标 */
.typing-cursor { display: inline-block; width: 2px; height: 1em; background: var(--primary); margin-left: 2px; animation: blink 1s infinite; }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* 统计条 */
.hero-stats {
  display: flex; align-items: center; gap: 20px;
  padding: 16px 24px; margin-bottom: 28px;
  background: rgba(255,255,255,0.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.8); border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.stat-item { display: flex; align-items: baseline; gap: 4px; }
.stat-num { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-light); }
.stat-divider { width: 1px; height: 24px; background: var(--border); }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Hero 插画区 */
.hero-visual { display: flex; align-items: center; justify-content: center; }
.hero-illustration { position: relative; width: 340px; height: 340px; }
.hero-circle { position: absolute; border-radius: 50%; border: 2px solid; animation: heroOrbit 12s linear infinite; }
.hero-circle-1 { width: 300px; height: 300px; top: 20px; left: 20px; border-color: rgba(108,159,255,0.15); animation-duration: 20s; }
.hero-circle-2 { width: 220px; height: 220px; top: 60px; left: 60px; border-color: rgba(255,184,122,0.15); animation-duration: 15s; animation-direction: reverse; }
.hero-circle-3 { width: 140px; height: 140px; top: 100px; left: 100px; border-color: rgba(108,159,255,0.1); animation-duration: 10s; }
@keyframes heroOrbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.hero-icon { position: absolute; font-size: 36px; animation: heroFloat 4s ease-in-out infinite; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.08)); }
.hero-icon-1 { top: 10px; left: 50%; transform: translateX(-50%); }
.hero-icon-2 { bottom: 30px; left: 20px; animation-delay: -1.5s; }
.hero-icon-3 { bottom: 60px; right: 20px; animation-delay: -3s; }
@keyframes heroFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ========== 轮播区域 ========== */
.swipe-section { padding: 0; margin-top: -40px; position: relative; z-index: 2; }
.swipe-carousel { position: relative; width: 100%; overflow: hidden; }
.swipe-track { position: relative; width: 100%; padding-top: 48%; overflow: hidden; }
.swipe-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1s ease; cursor: pointer; }
.swipe-slide.active { opacity: 1; }
.swipe-slide img { width: 100%; height: 100%; object-fit: cover; }

/* 毛玻璃文字条 */
.swipe-glass-bar { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); width: calc(100% - 80px); max-width: 800px; z-index: 5; pointer-events: none; }
.swipe-glass-content { background: rgba(255,255,255,0.15); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border: 1px solid rgba(255,255,255,0.25); border-radius: 16px; padding: 24px 32px; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.swipe-glass-title { font-size: 1.4rem; font-weight: 700; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.3); margin: 0 0 8px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.swipe-glass-desc { font-size: 14px; color: rgba(255,255,255,0.85); text-shadow: 0 1px 4px rgba(0,0,0,0.2); margin: 0; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.swipe-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 6; }
.swipe-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: all 0.3s ease; border: none; padding: 0; }
.swipe-dot.active { width: 24px; border-radius: 4px; background: rgba(255,255,255,0.9); }

/* ========== 每日一句 ========== */
.daily-quote-section { padding: 40px 0 20px; }
.daily-quote-card {
  position: relative; max-width: 700px; margin: 0 auto;
  padding: 36px 40px; text-align: center;
  background: linear-gradient(135deg, rgba(108,159,255,0.04), rgba(255,184,122,0.04));
  border: 1px solid rgba(108,159,255,0.1); border-radius: 20px;
  overflow: hidden;
}
.daily-quote-card::before {
  content: '\201C'; position: absolute; top: -10px; left: 20px;
  font-size: 120px; color: rgba(108,159,255,0.06); font-family: Georgia, serif;
  line-height: 1; pointer-events: none;
}
.daily-quote-badge {
  display: inline-block; padding: 4px 14px; margin-bottom: 16px;
  font-size: 12px; font-weight: 500; color: var(--primary);
  background: rgba(108,159,255,0.08); border-radius: 20px;
}
.daily-quote-text {
  font-size: 1.2rem; font-style: italic; color: var(--text);
  line-height: 1.8; margin: 0 0 12px; position: relative;
}
.daily-quote-source {
  font-size: 14px; color: var(--text-light); margin-bottom: 16px;
}
.daily-quote-article {
  display: inline-block; padding: 6px 16px;
  font-size: 13px; color: var(--primary);
  background: rgba(108,159,255,0.06); border-radius: 20px;
  cursor: pointer; transition: all 0.3s ease;
}
.daily-quote-article:hover { background: rgba(108,159,255,0.12); }

/* ========== 作者 Spotlight ========== */
.author-spotlight-section { padding: 40px 0 20px; }
.author-spotlight-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.author-spotlight-card {
  position: relative; padding: 24px 20px; text-align: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  transition: all 0.4s ease; cursor: pointer;
  transform-style: preserve-3d; perspective: 800px;
}
.author-spotlight-card:hover {
  transform: translateY(-6px); box-shadow: 0 16px 40px rgba(108,159,255,0.12);
  border-color: rgba(108,159,255,0.2);
}
.author-spotlight-avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px;
  object-fit: cover; border: 3px solid rgba(108,159,255,0.15);
  box-shadow: 0 4px 16px rgba(108,159,255,0.1);
}
.author-spotlight-name {
  font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px;
}
.author-spotlight-bio {
  font-size: 12px; color: var(--text-light); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 12px;
}
.author-spotlight-stats {
  display: flex; justify-content: center; gap: 16px;
  font-size: 12px; color: var(--text-light);
}
.author-spotlight-stats span { display: flex; align-items: center; gap: 4px; }
.author-spotlight-stats strong { color: var(--primary); font-weight: 600; }

/* ========== 分类横向滚动 ========== */
.cat-scroll-section { padding-top: 40px; }
.cat-scroll {
  display: flex; gap: 16px; overflow-x: auto; padding: 8px 0 16px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-scroll-item {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px 20px; min-width: 110px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  text-decoration: none; color: inherit; transition: all 0.3s ease; cursor: pointer;
}
.cat-scroll-item:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(108,159,255,0.12); border-color: var(--primary-light); }
.cat-scroll-icon { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, rgba(108,159,255,0.08), rgba(255,184,122,0.08)); display: flex; align-items: center; justify-content: center; }
.cat-scroll-icon img { width: 100%; height: 100%; object-fit: cover; }
.cat-scroll-name { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; }
.cat-scroll-count { font-size: 12px; color: var(--text-light); }

/* ========== 文章瀑布流 ========== */
.posts-masonry {
  columns: 2; column-gap: 24px;
}
.post-masonry-item {
  break-inside: avoid; margin-bottom: 24px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; cursor: pointer;
  opacity: 0; transform: translateY(20px);
  transform-style: preserve-3d; perspective: 1000px;
}
.post-masonry-item.visible { opacity: 1; transform: translateY(0); }
.post-masonry-item:hover { box-shadow: 0 12px 32px rgba(0,0,0,0.08); }
.post-masonry-item.tilt-active { transition: transform 0.1s ease-out; }
.post-masonry-cover { position: relative; overflow: hidden; }
.post-masonry-cover img { width: 100%; display: block; transition: transform 0.5s ease; }
.post-masonry-item:hover .post-masonry-cover img { transform: scale(1.05); }
.post-masonry-read { position: absolute; top: 12px; right: 12px; padding: 4px 10px; font-size: 11px; background: rgba(0,0,0,0.5); color: #fff; border-radius: 20px; }
.post-masonry-body { padding: 18px 20px; }
.post-masonry-cat { display: inline-block; font-size: 12px; color: var(--primary); font-weight: 500; margin-bottom: 8px; }
.post-masonry-title { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--text); margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-masonry-excerpt { font-size: 13px; color: var(--text-light); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 12px; }
.post-masonry-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-light); }

/* 列表分页 */
#postsPagination { margin-top: 24px; }
#postsPagination .pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 20px 0; }
#postsPagination .pagination button { min-width: 34px; height: 34px; border-radius: var(--radius-full); font-size: 13px; color: var(--text-secondary); background: var(--card-solid); border: 1px solid var(--border); transition: all var(--transition); display: flex; align-items: center; justify-content: center; cursor: pointer; }
#postsPagination .pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: rgba(108,159,255,0.06); }
#postsPagination .pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 500; }
#postsPagination .pagination button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ========== 热门推荐排行榜 ========== */
.hot-section { background: linear-gradient(180deg, transparent 0%, rgba(255,120,80,0.02) 30%, rgba(255,184,122,0.03) 70%, transparent 100%); }
.hot-list { padding: 8px 0; }
.hot-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 16px; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--border); transition: background var(--transition); cursor: pointer; }
.hot-item:last-child { border-bottom: none; }
.hot-item:hover { background: rgba(108,159,255,0.03); }
.hot-rank { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: var(--text-light); background: rgba(0,0,0,0.03); flex-shrink: 0; }
.hot-item:nth-child(1) .hot-rank { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; box-shadow: 0 2px 8px rgba(255,215,0,0.4); }
.hot-item:nth-child(2) .hot-rank { background: linear-gradient(135deg, #C0C0C0, #A8A8A8); color: #fff; box-shadow: 0 2px 8px rgba(192,192,192,0.4); }
.hot-item:nth-child(3) .hot-rank { background: linear-gradient(135deg, #CD7F32, #B87333); color: #fff; box-shadow: 0 2px 8px rgba(205,127,50,0.4); }
.hot-title { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.hot-item:hover .hot-title { color: var(--primary); }
.hot-views { font-size: 12px; color: var(--text-light); white-space: nowrap; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.hot-views::before { content: ''; display: inline-block; width: 14px; height: 14px; background: currentColor; opacity: 0.4; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); -webkit-mask-size: contain; mask-size: contain; }

/* ========== 精选合集横向滑动 ========== */
.collections-slider {
  display: flex; gap: 24px; overflow-x: auto; padding: 8px 0 16px;
  scrollbar-width: none; -ms-overflow-style: none; scroll-snap-type: x mandatory;
}
.collections-slider::-webkit-scrollbar { display: none; }
.collection-slide {
  flex: 0 0 320px; scroll-snap-align: start;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; transition: all 0.3s ease; cursor: pointer;
}
.collection-slide:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.08); }
.collection-slide-cover { position: relative; padding-top: 56%; overflow: hidden; }
.collection-slide-cover img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.collection-slide:hover .collection-slide-cover img { transform: scale(1.05); }
.collection-slide-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.5), transparent 60%); display: flex; align-items: flex-end; padding: 16px 20px; }
.collection-slide-count { padding: 4px 10px; font-size: 12px; background: rgba(255,255,255,0.2); backdrop-filter: blur(8px); color: #fff; border-radius: 20px; }
.collection-slide-body { padding: 18px 20px; }
.collection-slide-title { font-size: 16px; font-weight: 600; color: var(--text); margin: 0 0 8px; }
.collection-slide-desc { font-size: 13px; color: var(--text-light); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }

/* ========== 导航搜索栏 ========== */
.nav-search { display: flex; align-items: center; background: rgba(0,0,0,0.04); border-radius: 20px; padding: 6px 12px; margin-right: 12px; }
.nav-search input { border: none; background: transparent; font-size: 13px; width: 140px; outline: none; color: var(--text); }
.nav-search-btn { border: none; background: transparent; cursor: pointer; font-size: 14px; padding: 0; opacity: 0.6; }
.nav-search-btn:hover { opacity: 1; }

/* 暗色模式按钮 */
.theme-toggle { border: none; background: rgba(0,0,0,0.04); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; margin-right: 8px; font-size: 16px; transition: all 0.3s ease; }
.theme-toggle:hover { background: rgba(108,159,255,0.1); }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }

/* 回到顶部 */
.back-to-top { position: fixed; bottom: 32px; right: 32px; width: 44px; height: 44px; border-radius: 50%; background: var(--card-solid); border: 1px solid var(--border); box-shadow: 0 4px 16px rgba(0,0,0,0.08); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 100; }
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108,159,255,0.15); border-color: var(--primary); }

/* 页脚更新时间和二维码 */
.footer-update { font-size: 12px; color: var(--text-light); margin-top: 12px; }
.footer-qr { display: flex; align-items: center; justify-content: center; }
.qr-placeholder { width: 100px; height: 100px; background: rgba(0,0,0,0.03); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.qr-placeholder span { font-size: 32px; }
.qr-placeholder small { font-size: 10px; color: var(--text-light); }

/* ========== 暗色模式 ========== */
[data-theme="dark"] {
  --bg: #1a1a2e;
  --card: rgba(255,255,255,0.05);
  --card-solid: #252540;
  --border: rgba(255,255,255,0.1);
  --text: #e8e8f0;
  --text-secondary: #a0a0b0;
  --text-light: #707080;
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] .hero { background: linear-gradient(165deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%); }
[data-theme="dark"] .hero-stats { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .nav-search { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .theme-toggle { background: rgba(255,255,255,0.08); }

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .hero-inner { gap: 40px; }
  .hero-illustration { width: 280px; height: 280px; }
  .hero-circle-1 { width: 240px; height: 240px; }
  .hero-circle-2 { width: 180px; height: 180px; }
  .hero-circle-3 { width: 110px; height: 110px; }
  .posts-masonry { columns: 2; }
  .collection-slide { flex: 0 0 280px; }
  .author-spotlight-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero { padding: 100px 0 60px; }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .hero-text { max-width: 100%; }
  .hero-title-main { font-size: 2.4rem; }
  .hero-subtitle { font-size: 1.05rem; }
  .hero-stats { justify-content: center; }
  .hero-actions { justify-content: center; }
  .hero-visual { display: none; }
  .swipe-section { margin-top: -20px; }
  .swipe-track { padding-top: 56%; }
  .swipe-glass-bar { bottom: 24px; width: calc(100% - 32px); }
  .swipe-glass-content { padding: 16px 20px; border-radius: 12px; }
  .swipe-glass-title { font-size: 1.1rem; }
  .swipe-glass-desc { font-size: 13px; }
  .daily-quote-card { padding: 24px 20px; }
  .daily-quote-text { font-size: 1rem; }
  .author-spotlight-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .author-spotlight-card { padding: 16px 12px; }
  .author-spotlight-avatar { width: 48px; height: 48px; }
  .posts-masonry { columns: 1; }
  .nav-search { display: none; }
  .collection-slide { flex: 0 0 260px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-qr { display: none; }
}

@media (max-width: 480px) {
  .hero { padding: 80px 0 50px; }
  .hero-title-main { font-size: 2rem; }
  .hero-stats { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .stat-divider { display: none; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; max-width: 260px; }
  .swipe-track { padding-top: 65%; }
  .swipe-glass-bar { bottom: 16px; width: calc(100% - 24px); }
  .swipe-glass-content { padding: 12px 16px; }
  .swipe-glass-title { font-size: 1rem; }
  .swipe-glass-desc { display: none; }
  .cat-scroll-item { min-width: 90px; padding: 12px 14px; }
  .hot-item { grid-template-columns: 32px 1fr; padding: 12px 16px; gap: 12px; }
  .hot-views { display: none; }
  .hot-rank { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
  .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
}
