/*
 * Blog 全局样式与核心布局
 * 依赖: loading.css, magnetic-pointer.css
 * ===========================================
 * @font-face: 字体声明
 * .blog-header: 顶部导航弹性盒
 * .blog-container: 主体网格(三栏配置)
 * .article-card / aside 组件
 */

*, *::before, *::after {
  box-sizing: border-box;
}

@font-face {
  font-family: 'HarmonyOS Sans';
  src: url('../font/HarmonyOS Sans/HarmonyOS_Sans/HarmonyOS_Sans_Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-color: #121212;
  --text-main: #f1f1f1;
  --text-muted: #888;
  --accent: #2c93fd;
  --card-bg: rgba(255, 255, 255, 0.05);
  --border-light: rgba(255, 255, 255, 0.1);
}

body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'HarmonyOS Sans', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  /* 隐藏滚轮，直到加载完毕 (可选：这部分可在加载动画完成后移出) */
  overflow-x: hidden;
}

/* ================= 导航栏 ================= */
.blog-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(13, 13, 13, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  border-bottom: 1px solid var(--border-light);
}

.blog-header nav {
  display: flex;
  align-items: center;
}

.nav-left a,
.nav-right a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.3s, text-shadow 0.3s;
  padding: 8px 12px;
}

.nav-left a:hover,
.nav-right a:hover {
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.nav-divider {
  width: 1px;
  height: 14px;
  background-color: rgba(255, 255, 255, 0.15);
  margin: 0 15px;
}

/* 独立按钮样式 */
.btn-login {
  background: transparent;
  border: 1px solid var(--border-light);
  color: #fff;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 20px;
  margin-right: -20px;
}
.btn-login:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 12px rgba(44, 147, 253, 0.15);
}

/* ================= 主体三栏容器 ================= */
/* 
 * 布局：左栏 (搜索/分类), 中栏 (文章列表), 右侧栏 (公告/日志),
 * 默认使用 CSS Grid。响应式下可塌陷为 1 列。
 */
.blog-container {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 40px;
  max-width: 1400px;
  margin: 100px auto 60px;
  padding: 0 40px;
}

/* 入场前隐藏，由 animatePageEntry() 统一控制显现 */
.sidebar-left,
.sidebar-right {
  opacity: 0;
}

.blog-header {
  opacity: 0;
}

/* --------- 左侧 / 右侧组件 --------- */
aside > div {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 30px;
}

aside h3 {
  font-size: 1.1rem;
  margin-top: 0;
  font-weight: 600;
  margin-bottom: 16px;
  color: #e0e0e0;
}

.search-box input {
  width: 100%;
  padding: 10px 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s;
}
.search-box input:focus {
  border-color: var(--accent);
}

.category-box ul,
.changelog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-box li {
  margin-bottom: 10px;
}

.category-box a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.3s, padding-left 0.3s;
  display: inline-block;
}
.category-box a:hover {
  color: #fff;
  padding-left: 4px;
}

.notice-box p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.changelog-list li {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
  line-height: 1.4;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  padding-left: 12px;
}
.changelog-list strong {
  color: #e0e0e0;
}

.more-link {
  display: inline-block;
  margin-top: 5px;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--accent);
  transition: color 0.3s, text-shadow 0.3s;
}
.more-link:hover {
  color: #5db0ff;
  text-shadow: 0 0 8px rgba(44, 147, 253, 0.3);
}

/* --------- 中间区域 --------- */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* 结合逐片加载逻辑，初始设为透明并稍微下移 */
.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 30px;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s, transform 0.25s;
  opacity: 0;
  transform: translateY(20px);
}
.article-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.article-title {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.4rem;
  font-weight: 600;
}
.article-title a {
  text-decoration: none;
  color: #f1f1f1;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.article-excerpt {
  color: #b0b0b0;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

/* ================= 移动端适配 ================= */
@media (max-width: 1000px) {
  .blog-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .blog-header {
    flex-wrap: wrap;
    padding: 0 20px;
  }
}
/*
 * �������鵯�����¼�����������ʽ��չ (׷��)
 */

/* ================= �����Ķ���� ================= */
.article-detail-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 500;
  background-color: var(--bg-color);
  padding: 80px 20px;
  overflow-x: hidden;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-close-article {
  position: fixed;
  top: 20px;
  left: 40px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  font-size: 1rem;
  cursor: pointer;
  z-index: 510;
  padding: 10px 16px;
  border-radius: 4px;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.btn-close-article:hover {
  color: #fff;
  border-color: var(--border-light);
  background: var(--card-bg);
}

.detail-header {
  width: 100%;
  max-width: 800px;
  margin-top: 60px;
  position: relative;
  text-align: left;
}

.detail-title {
  position: absolute; /* �� GSAP �ӹܼ���õ�����λ�ú����� */
  left: 0;
  top: 0;
  margin: 0;
  font-size: 2.2rem;
  color: #fff;
  font-weight: 600;
}

.detail-meta {
  margin-top: 70px; /* ���������� title �ó��ռ� */
  color: var(--text-muted);
  font-size: 0.9rem;
}

.detail-body {
  width: 100%;
  max-width: 800px;
  margin-top: 40px;
  color: #e0e0e0;
  line-height: 1.8;
  font-size: 1.05rem;
  padding-bottom: 100px;
}

/* ================= Markdown �Ű����� ================= */
.markdown-body h1, 
.markdown-body h2, 
.markdown-body h3 {
  color: #fff;
  margin-top: 2em;
  margin-bottom: 1em;
}
.markdown-body p {
  margin-bottom: 1.5em;
}
.markdown-body pre {
  background: #1e1e1e;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 20px 0;
}
.markdown-body code {
  font-family: Consolas, 'Courier New', monospace;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}
.markdown-body pre code {
  background: transparent;
  padding: 0;
}
.markdown-body blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 15px;
  color: var(--text-muted);
  margin-left: 0;
  font-style: italic;
}

/* ================= ��¼���� (���װ�) ================= */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000; /* ���� Header */
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-box {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  width: 90%;
  max-width: 360px;
  padding: 40px;
  position: relative;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.auth-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
}
.auth-close:hover {
  color: #fff;
}

.auth-box h2 {
  margin-top: 0;
  margin-bottom: 30px;
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-form input {
  background: #2a2a2a;
  border: 1px solid #333;
  padding: 14px 16px;
  border-radius: 6px;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}
.auth-form input:focus {
  border-color: var(--accent);
}

.auth-form .btn-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-size: 1.05rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
}
.auth-form .btn-submit:hover {
  background: #1b7ceb;
}

.anim-title {
  display: inline-block;
  pointer-events: none; 
}
