/* ============================================
   DeepSleep Blog - 首页 3D 毛玻璃主题
   高级灰底 + 优雅金点缀（与 custom.css 一致）
   canvas 在 DOM 下层，卡片 backdrop-filter 模糊它
   ============================================ */

/* 该页面的 3D 背景画布：fixed 铺满视口，位于面板下方 */
#bg-scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
}

/* ---- 其它导航页面的毛玻璃面板（posts/resources/learn/me/profile/community/play） ---- */
body.ds3d-active #bg-scene { z-index: 0; }

.ds-glass-page {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 5vh auto 5rem;
  padding: 2.2rem clamp(1rem, 4vw, 2.8rem) 3rem;
  border-radius: 24px;
  min-height: 60vh;
  background: rgba(250, 250, 250, 0.55);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(212, 175, 55, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 20px 60px rgba(0, 0, 0, 0.10);
}
[data-theme="dark"] .ds-glass-page {
  background: rgba(24, 24, 27, 0.5);
  border-color: rgba(212, 175, 55, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 20px 60px rgba(0, 0, 0, 0.45);
}

/* 底部 footer 提升到画布之上，避免被 fixed 画布遮住 */
body.ds3d-active > footer,
body.ds3d-active footer { position: relative; z-index: 1; }

/* 面板出场动画 */
.ds-glass-page { animation: ds-rise 0.6s ease-out both; }

/* 内容层浮在画布上方 */
.ds-home {
  position: relative;
  z-index: 1;
  pointer-events: none; /* 让画布层交互由 JS 独立处理，卡片自身恢复事件 */
}

.ds-hero,
.ds-card {
  pointer-events: auto;
}

/* ---- 毛玻璃通用 ---- */
.glass {
  background: rgba(250, 250, 250, 0.55);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(212, 175, 55, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 20px 60px rgba(0, 0, 0, 0.10);
  border-radius: 24px;
  position: relative;
}

[data-theme="dark"] .glass {
  background: rgba(24, 24, 27, 0.5);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 20px 60px rgba(0, 0, 0, 0.45);
  border-color: rgba(212, 175, 55, 0.18);
}

/* ---- Hero ---- */
.ds-home {
  padding: 20vh 1.5rem 6rem;
  margin: 0 auto;
  max-width: 1120px;
}

.ds-hero {
  text-align: center;
  padding: 3.5rem 2.5rem;
  overflow: hidden;
}

/* 顶部金色微光条 */
.ds-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.8), transparent);
}

/* 柔和的金色光晕 orb（对应场景发光球，形成呼应） */
.ds-hero-orb {
  position: absolute;
  top: -90px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0) 68%);
  filter: blur(4px);
  pointer-events: none;
}

.ds-hero-title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  color: var(--color-text-primary, #2d2d2d);
  margin-bottom: 0.8rem;
  letter-spacing: 0.5px;
}

.ds-hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--color-text-secondary, #666);
  margin-bottom: 1.6rem;
}

.ds-hero-social {
  margin-bottom: 2rem;
}

.ds-hero-social .social-icons {
  justify-content: center;
}

.ds-hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}

/* 金色毛玻璃按钮 */
.ds-btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  color: var(--color-accent-dark, #B8960C);
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  background: rgba(212, 175, 55, 0.10);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: all 0.3s ease;
}
.ds-btn:hover {
  background: linear-gradient(135deg, var(--color-accent, #D4AF37), var(--color-accent-dark, #B8960C));
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(212, 175, 55, 0.35);
}

.ds-scroll-hint {
  margin-top: 2.6rem;
  font-size: 0.85rem;
  color: var(--color-text-muted, #999);
  letter-spacing: 2px;
  animation: ds-bob 2.2s ease-in-out infinite;
}
@keyframes ds-bob {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ---- 最近文章 ---- */
.ds-latest {
  margin-top: 5rem;
}

.ds-section-title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-text-primary, #2d2d2d);
  position: relative;
  display: inline-block;
  padding-left: 1rem;
  border-left: 4px solid var(--color-accent, #D4AF37);
  margin-bottom: 1.8rem;
}

.ds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
}

.ds-card {
  display: block;
  padding: 1.6rem 1.6rem 1.4rem;
  text-decoration: none;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.35s ease, border-color 0.35s ease;
}
.ds-card:hover {
  transform: translateY(-6px);
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 28px 60px rgba(0, 0, 0, 0.16);
}

.ds-card-title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary, #2d2d2d);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.ds-card-date {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--color-accent-dark, #B8960C);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.ds-card-summary {
  font-size: 0.95rem;
  color: var(--color-text-secondary, #666);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.ds-card-more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent-dark, #B8960C);
  opacity: 0.8;
  transition: opacity 0.3s ease, letter-spacing 0.3s ease;
}
.ds-card:hover .ds-card-more {
  opacity: 1;
  letter-spacing: 1px;
}

/* ---- 动画 ---- */
@keyframes ds-rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

.ds-hero { animation: ds-rise 0.8s ease-out both; }
.ds-latest .ds-card { animation: ds-rise 0.7s ease-out both; }
.ds-latest .ds-card:nth-child(1) { animation-delay: 0.05s; }
.ds-latest .ds-card:nth-child(2) { animation-delay: 0.12s; }
.ds-latest .ds-card:nth-child(3) { animation-delay: 0.19s; }
.ds-latest .ds-card:nth-child(4) { animation-delay: 0.26s; }
.ds-latest .ds-card:nth-child(5) { animation-delay: 0.33s; }
.ds-latest .ds-card:nth-child(6) { animation-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  .ds-hero, .ds-latest .ds-card, .ds-scroll-hint { animation: none; }
}

/* ---- 响应式 ---- */
@media (max-width: 720px) {
  .ds-home { padding: 14vh 1rem 5rem; }
  .ds-hero { padding: 3rem 1.4rem; }
  .ds-grid { grid-template-columns: 1fr; }
}