/* ===== 字体引入 ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

/* ===== 全局变量（浅色模式） ===== */
:root {
  --bg: #ffffff;
  --bg-soft: #f8f9fb;
  --text: #1f2a3a;
  --text-secondary: #5a6a7e;
  --primary: #0066cc;
  --primary-light: #e8f2ff;
  --border: #e2e8f0;
  --code-bg: #f5f7fa;
  --code-text: #24292f;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
  --header-bg: #ffffffcc;
  --link: #0066cc;
}

/* ===== 暗色模式变量 ===== */
body.dark {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --text: #c9d1d9;
  --text-secondary: #8b949e;
  --primary: #58a6ff;
  --primary-light: #1a2a3a;
  --border: #30363d;
  --code-bg: #1a1e26;
  --code-text: #c9d1d9;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --header-bg: #0d1117cc;
  --link: #58a6ff;
}

/* ===== 全局重置 ===== */
* { box-sizing: border-box; margin:0; padding:0; }

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: background 0.3s, color 0.3s;
}

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

/* 主容器 */
#home {
  max-width: 1000px;
  margin: 20px auto;
  background: transparent;
}

/* 头部与导航 */
#header { background: var(--header-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
#blogTitle h1 a { font-weight: 700; font-size: 1.8rem; color: var(--text); }
#blogTitle h2 { font-weight: 400; color: var(--text-secondary); font-size: 0.9rem; }
#navigator { font-size: 0.9rem; }
#navList li a { color: var(--text); padding: 8px 14px; border-radius: 6px; }
#navList li a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }

/* 文章卡片 */
.day, .entrylistItem, .post {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  transition: background 0.3s;
}
.postTitle a, .entrylistTitle a {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--text);
}
.postTitle a:hover, .entrylistTitle a:hover { color: var(--primary); text-decoration: none; }
.postCon, .entrylistSummary { color: var(--text-secondary); margin-top: 10px; }

/* 标题样式 */
h2, h3, h4 { margin: 1.5em 0 0.7em; color: var(--text); font-weight: 600; }
h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

/* 段落与列表 */
p { margin-bottom: 1.2em; }
ul, ol { padding-left: 2em; margin-bottom: 1.2em; }
li { margin-bottom: 0.3em; }

/* 代码块（同色系，融入页面） */
.cnblogs_code, .syntaxhighlighter, pre {
  background: var(--code-bg) !important;
  color: var(--code-text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 16px !important;
    overflow-x: auto;
}
code {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    border: 1px solid var(--border);
}

/* 侧边栏 */
#sideBar {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
    box-shadow: var(--shadow);
}
#sideBar h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 12px;
}
#sideBar li { list-style: none; margin: 8px 0; }
#sideBar a { color: var(--text-secondary); font-size: 0.9rem; }
#sideBar a:hover { color: var(--primary); }

/* 进度条 */
#reading-progress {
    position: fixed; top: 0; left: 0; height: 3px;
    background: var(--primary); width: 0%;
    z-index: 9999; transition: width 0.1s linear;
}

/* 主题切换按钮 */
#theme-toggle {
    position: fixed; bottom: 20px; right: 20px;
    width: 44px; height: 44px;
    border-radius: 50%; background: var(--bg-soft);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    z-index: 9998;
    transition: all 0.2s;
    color: var(--text);
}
#theme-toggle:hover { background: var(--primary-light); color: var(--primary); }

/* 目录容器 */
#toc-container {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 20px 0 10px;
    font-size: 0.9rem;
}
#toc-container .toc-title {
    font-weight: 600;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex; align-items: center; gap: 8px;
}
#toc-container ul { list-style: none; padding-left: 0; }
#toc-container li { margin: 4px 0; }
#toc-container a {
    color: var(--text-secondary); text-decoration: none;
    display: block; padding: 2px 6px; border-radius: 4px;
}
#toc-container a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }

/* 粒子画布 */
#particle-canvas {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* ===== 导航栏水平显示 ===== */
#navigator {
    display: flex;
    align-items: center;
    justify-content: center;   /* 居中对齐，若想靠左可改为 flex-start */
    gap: 12px;
    padding: 12px 0;
    background: transparent;   /* 可自行换成 var(--bg-soft) 加入背景 */
}

#navList {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}

#navList li {
    margin: 0;
}

#navList li a {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: none;       /* 去掉全局链接下划线 */
}

/* 当前激活页高亮（可选） */
#navList li a.current,
#navList li a:hover {
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}

