/* ============================== */
/* 博客前台样式表 —— 文艺暖色风格 */
/* 设计灵感：Typecho / Ghost 主题 */
/* 配色：温暖米色背景 + 深棕文字 + 珊瑚橘强调色 */
/* 字体：Noto Serif SC（标题衬线） + Noto Sans SC（正文无衬线） */
/* ============================== */


/* ============================== */
/* CSS 变量 —— 浅色主题（默认） */
/* 温暖的奶油色/米色背景，深棕/墨色文字，珊瑚橘强调色 */
/* ============================== */
:root {
    /* --- 背景色 --- */
    --bg-primary: #faf8f5;          /* 主背景：温暖米白色 */
    --bg-secondary: #f3efe9;       /* 次级背景：稍深的米色 */
    --bg-card: #fffcf8;            /* 卡片背景：近白偏暖 */
    --bg-code: #f5f0e8;            /* 代码背景：淡黄褐色 */

    /* --- 文字色 --- */
    --text-primary: #3d3229;       /* 主文字：深棕色（不用纯黑） */
    --text-secondary: #7a6e63;     /* 次级文字：中棕色 */
    --text-muted: #a8998c;         /* 弱化文字：浅棕色 */

    /* --- 边框与分割线 --- */
    --border-color: #e8e0d6;      /* 边框：暖灰色 */
    --divider-color: #ede6dc;      /* 分割线 */

    /* --- 强调色 --- */
    --accent-color: #c96b4f;       /* 主强调色：温暖的珊瑚橘红 */
    --accent-hover: #b55a3f;      /* 强调色悬停：深珊瑚 */
    --accent-light: rgba(201, 107, 79, 0.1);  /* 强调色淡底 */
    --accent-green: #5a7a5e;       /* 辅助强调色：墨绿色 */

    /* --- 功能色 --- */
    --success-color: #5a7a5e;      /* 成功：墨绿 */
    --warning-color: #c49a3c;      /* 警告：暖黄 */
    --error-color: #c44e4e;         /* 错误：暖红 */

    /* --- 阴影 --- */
    --shadow-sm: 0 1px 3px rgba(61, 50, 41, 0.06);
    --shadow: 0 2px 12px rgba(61, 50, 41, 0.08);
    --shadow-md: 0 4px 20px rgba(61, 50, 41, 0.10);
    --shadow-lg: 0 8px 40px rgba(61, 50, 41, 0.12);
    --shadow-hover: 0 8px 30px rgba(61, 50, 41, 0.15);

    /* --- 字体 --- */
    --font-serif: 'Noto Serif SC', 'Songti SC', 'SimSun', Georgia, serif;
    --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-mono: 'Fira Code', 'Source Code Pro', Consolas, 'Courier New', monospace;

    /* --- 布局 --- */
    --container-max: 1200px;        /* 最大宽度（侧边栏布局需要更宽） */
    --content-max: 820px;           /* 单栏内容最大宽度 */
    --radius: 12px;                 /* 主圆角 */
    --radius-sm: 8px;               /* 小圆角 */
    --radius-xs: 4px;               /* 极小圆角 */

    /* --- 导航栏高度 --- */
    --navbar-height: 64px;

    /* --- 过渡动画 --- */
    --transition-fast: 0.2s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
}


/* ============================== */
/* CSS 变量 —— 深色主题 */
/* 当 HTML 标签有 data-theme="dark" 属性时激活 */
/* ============================== */
[data-theme="dark"] {
    --bg-primary: #1e1c1a;          /* 主背景：深棕黑 */
    --bg-secondary: #262320;        /* 次级背景 */
    --bg-card: #2a2724;             /* 卡片背景 */
    --bg-code: #1a1816;             /* 代码背景 */

    --text-primary: #e8e0d6;        /* 主文字：暖白 */
    --text-secondary: #b0a498;      /* 次级文字 */
    --text-muted: #7a6e63;          /* 弱化文字 */

    --border-color: #3d362e;        /* 边框 */
    --divider-color: #3a332b;        /* 分割线 */

    --accent-color: #e08b6f;        /* 强调色：浅珊瑚 */
    --accent-hover: #ea9d84;        /* 强调色悬停 */
    --accent-light: rgba(224, 139, 111, 0.12);
    --accent-green: #7fa883;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
}


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

html {
    scroll-behavior: smooth;  /* 平滑滚动 */
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 16px;
    transition: background-color var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

::selection {
    background: var(--accent-light);
    color: var(--text-primary);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}


/* ============================== */
/* 容器 —— 限制页面最大宽度 */
/* ============================== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* 双栏布局容器（内容 + 侧边栏） */
.layout-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.layout-main {
    flex: 1;
    min-width: 0;  /* 防止 flex 子元素溢出 */
}

.layout-sidebar {
    width: 300px;
    flex-shrink: 0;
}


/* ============================== */
/* 导航栏（毛玻璃效果） */
/* ============================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    /* 毛玻璃效果 */
    background: rgba(250, 248, 245, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition), border-color var(--transition);
}

[data-theme="dark"] .navbar {
    background: rgba(30, 28, 26, 0.85);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* 博客品牌名/Logo */
.navbar-brand {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
    transition: color var(--transition-fast);
    flex-shrink: 0;
}

.navbar-brand:hover {
    color: var(--accent-color);
}

/* 搜索框 */
.navbar-search {
    display: flex;
    gap: 0;
    margin: 0 20px;
    flex: 1;
    max-width: 320px;
}

.navbar-search input {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    width: 100%;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.navbar-search input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.navbar-search input::placeholder {
    color: var(--text-muted);
}

.navbar-search button {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
}

.navbar-search button:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* 导航链接 */
.navbar-links {
    display: flex;
    list-style: none;
    gap: 6px;
    align-items: center;
}

.navbar-links a {
    color: var(--text-secondary);
    font-size: 15px;
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar-links a:hover {
    color: var(--accent-color);
    background: var(--accent-light);
}

.navbar-links a i {
    font-size: 14px;
}

/* 主题切换按钮 */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 16px;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
}

.theme-toggle:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: var(--accent-light);
}

/* 深色主题下隐藏月亮图标，显示太阳图标 */
[data-theme="dark"] .theme-icon-light { display: none; }
/* 浅色主题下隐藏太阳图标，显示月亮图标 */
:not([data-theme="dark"]) .theme-icon-dark { display: none; }

/* 移动端菜单按钮 */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 4px;
}


/* ============================== */
/* 主内容区域 */
/* ============================== */
.main-content {
    padding: 0;
    min-height: 60vh;
}


/* ============================== */
/* 首页 Hero 区域（更有设计感） */
/* ============================== */
.hero {
    text-align: center;
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}

/* Hero 背景装饰（渐变色块 + 圆形光斑） */
.hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -80px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(90, 122, 94, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Hero 装饰分割线 */
.hero-divider {
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    margin: 20px auto 0;
    border-radius: 2px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: 2px;
    position: relative;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 1px;
}

/* Hero 下方的公告栏 */
.hero-notice {
    margin-top: 32px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-color);
    border-radius: var(--radius-sm);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    animation: fadeInUp 0.6s ease;
}

.hero-notice-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-notice-title i {
    color: var(--accent-color);
}


/* ============================== */
/* 文章卡片列表 */
/* ============================== */
.post-list {
    display: flex;
    flex-direction: column;
}

/* 文章之间的分割线 */
.post-card + .post-card {
    margin-top: 0;
}

.post-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--divider-color), transparent);
    margin: 8px 0;
}

/* 文章卡片 */
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
    border: 1px solid transparent;
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
    border-color: var(--border-color);
}

/* 文章封面图片 */
.post-card-image {
    display: block;
    height: 220px;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-card-image img {
    transform: scale(1.06);
}

/* 文章卡片内容区 */
.post-card-body {
    padding: 24px 28px 20px;
}

/* 文章元信息（分类、日期） */
.post-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.post-meta i {
    margin-right: 3px;
    font-size: 12px;
}

/* 分类标签样式 */
.post-category {
    color: var(--accent-color);
    font-weight: 500;
    padding: 2px 10px;
    background: var(--accent-light);
    border-radius: 12px;
    font-size: 12px;
    transition: all var(--transition-fast);
}

.post-category:hover {
    background: var(--accent-color);
    color: #fff;
}

/* 文章标题 */
.post-card-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    letter-spacing: 0.5px;
}

.post-card-title a {
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.post-card-title a:hover {
    color: var(--accent-color);
}

/* 文章摘要 */
.post-card-summary {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 16px;
    /* 限制显示3行 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 文章底部信息 */
.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--divider-color);
}

.post-card-footer i {
    margin-right: 4px;
}

.read-more {
    color: var(--accent-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.read-more:hover {
    gap: 8px;  /* 悬停时箭头右移动画 */
}


/* ============================== */
/* 归档页头部 */
/* ============================== */
.archive-header {
    text-align: center;
    padding: 50px 0 30px;
    position: relative;
}

.archive-header h1 {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.archive-header h1 i {
    color: var(--accent-color);
    font-size: 28px;
}

.archive-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.archive-count {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 10px;
}


/* ============================== */
/* 标签云 */
/* ============================== */
.tags-cloud {
    text-align: center;
    padding: 30px 0;
}

/* 标签网格卡片（分类页也复用） */
.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.tag-card {
    display: block;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
    text-align: center;
}

.tag-card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tag-card h3 {
    font-family: var(--font-serif);
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tag-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.tag-count {
    font-size: 13px;
    color: var(--text-muted);
}

/* 标签云胶囊样式 */
.tag-cloud-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 18px;
    margin: 5px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.tag-cloud-item:hover {
    background: var(--accent-light);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-1px);
}

/* 标签大小变化（根据文章数量） */
.tag-cloud-item.tag-sm { font-size: 12px; padding: 5px 12px; }
.tag-cloud-item.tag-md { font-size: 14px; padding: 7px 16px; }
.tag-cloud-item.tag-lg { font-size: 16px; padding: 9px 20px; font-weight: 500; }


/* ============================== */
/* 文章详情页 */
/* ============================== */
.post-detail {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 48px 52px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.post-header {
    margin-bottom: 36px;
    text-align: center;
}

.post-title {
    font-family: var(--font-serif);
    font-size: 34px;
    font-weight: 900;
    line-height: 1.35;
    margin-bottom: 18px;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* 文章详情页元信息 */
.post-detail .post-meta {
    justify-content: center;
    gap: 18px;
}

.post-tags {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 文章标签胶囊 */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px;
    background: var(--accent-light);
    color: var(--accent-color);
    border-radius: 14px;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--accent-color);
    color: #fff;
}


/* ============================== */
/* Markdown 正文排版（优化阅读体验） */
/* ============================== */
.markdown-body {
    font-size: 16.5px;
    line-height: 1.9;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
    font-family: var(--font-serif);
    margin-top: 36px;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.markdown-body h1 { font-size: 28px; margin-top: 40px; }
.markdown-body h2 {
    font-size: 24px;
    border-bottom: 2px solid var(--divider-color);
    padding-bottom: 10px;
}
.markdown-body h3 { font-size: 20px; }
.markdown-body h4 { font-size: 18px; }

.markdown-body p {
    margin-bottom: 18px;
}

.markdown-body a {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-color: var(--accent-light);
    text-underline-offset: 3px;
    transition: all var(--transition-fast);
}

.markdown-body a:hover {
    text-decoration-color: var(--accent-color);
}

/* 引用块样式（左侧彩色边框 + 淡色背景） */
.markdown-body blockquote {
    margin: 20px 0;
    padding: 16px 24px;
    border-left: 4px solid var(--accent-color);
    background: var(--accent-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.markdown-body blockquote p:last-child {
    margin-bottom: 0;
}

/* 行内代码 */
.markdown-body code {
    font-family: var(--font-mono);
    padding: 2px 8px;
    background: var(--bg-code);
    border-radius: var(--radius-xs);
    font-size: 0.88em;
    color: var(--accent-color);
    border: 1px solid var(--border-color);
}

/* 代码块 */
.markdown-body pre {
    margin: 20px 0;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    position: relative;
}

.markdown-body pre code {
    display: block;
    padding: 20px 24px;
    overflow-x: auto;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

/* 代码块顶部标签栏 */
.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--border-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
    border-radius: var(--radius) var(--radius) 0 0;
}

.code-block-lang {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.code-copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.code-copy-btn:hover {
    color: var(--accent-color);
    background: var(--accent-light);
}

/* 列表 */
.markdown-body ul, .markdown-body ol {
    margin: 14px 0;
    padding-left: 30px;
}

.markdown-body li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.markdown-body li::marker {
    color: var(--accent-color);
}

/* 图片 */
.markdown-body img {
    border-radius: var(--radius);
    margin: 24px auto;
    box-shadow: var(--shadow);
}

/* 表格 */
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.markdown-body th, .markdown-body td {
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    text-align: left;
}

.markdown-body th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-family: var(--font-serif);
}

.markdown-body tr:hover td {
    background: var(--accent-light);
}

/* 分割线 */
.markdown-body hr {
    border: none;
    border-top: 1px solid var(--divider-color);
    margin: 32px 0;
}

/* 文章底部信息 */
.post-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--divider-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}


/* ============================== */
/* 上下篇导航 */
/* ============================== */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--divider-color);
}

.post-nav-item {
    flex: 1;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all var(--transition);
    text-decoration: none;
}

.post-nav-item:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.post-nav-item.post-nav-next {
    text-align: right;
}

.post-nav-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.post-nav-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    /* 限制一行 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ============================== */
/* 相关文章推荐 */
/* ============================== */
.related-posts {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--divider-color);
}

.related-posts-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-posts-title i {
    color: var(--accent-color);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.related-post-item {
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.related-post-item:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.related-post-item h4 {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
}

.related-post-item h4 a {
    color: var(--text-primary);
}

.related-post-item h4 a:hover {
    color: var(--accent-color);
}

.related-post-item .related-post-date {
    font-size: 12px;
    color: var(--text-muted);
}


/* ============================== */
/* 评论区 */
/* ============================== */
.comments-section {
    margin-top: 48px;
}

.comments-title {
    font-family: var(--font-serif);
    font-size: 24px;
    margin-bottom: 28px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-title i {
    color: var(--accent-color);
}

.comments-list {
    margin-bottom: 32px;
}

/* 单条评论（气泡样式） */
.comment-item {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--divider-color);
}

/* 圆角头像 */
.comment-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-green));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.comment-avatar.small {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.comment-name {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-date {
    color: var(--text-muted);
    font-size: 13px;
}

.comment-text {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 10px;
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--divider-color);
}

.comment-reply-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    font-family: var(--font-sans);
    transition: color var(--transition-fast);
}

.comment-reply-btn:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.comment-reply {
    margin-left: 16px;
    padding-top: 12px;
}

.no-comments {
    color: var(--text-muted);
    text-align: center;
    padding: 32px 20px;
    font-size: 15px;
}

/* 评论表单 */
.comment-form-section {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.comment-form-section h3 {
    font-family: var(--font-serif);
    margin-bottom: 18px;
    font-size: 18px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-form-section h3 i {
    color: var(--accent-color);
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    line-height: 1.6;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
    color: var(--text-muted);
}

.comment-form textarea {
    resize: vertical;
    min-height: 120px;
}


/* ============================== */
/* 通用按钮 */
/* ============================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: 0 4px 12px rgba(201, 107, 79, 0.3);
    transform: translateY(-1px);
}


/* ============================== */
/* 分页组件 */
/* ============================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 40px 0;
}

.pagination-btn {
    padding: 10px 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--accent-color);
    font-weight: 500;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(201, 107, 79, 0.2);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 14px;
    padding: 0 12px;
}


/* ============================== */
/* 空状态 */
/* ============================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    color: var(--border-color);
}

.empty-state p {
    font-size: 15px;
    line-height: 1.8;
}


/* ============================== */
/* 侧边栏组件 */
/* ============================== */

/* 侧边栏通用卡片 */
.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow var(--transition);
}

.sidebar-card:hover {
    box-shadow: var(--shadow);
}

.sidebar-card-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--divider-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-card-title i {
    color: var(--accent-color);
    font-size: 15px;
}

/* 关于博主 */
.about-author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-green));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    font-family: var(--font-serif);
    margin: 0 auto 16px;
    box-shadow: var(--shadow);
}

.about-author-name {
    text-align: center;
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.about-author-bio {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    text-align: center;
}

/* 热门文章列表 */
.hot-post-list {
    list-style: none;
}

.hot-post-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider-color);
    transition: all var(--transition-fast);
}

.hot-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hot-post-item:first-child {
    padding-top: 0;
}

.hot-post-rank {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

/* 前三名高亮 */
.hot-post-item:nth-child(1) .hot-post-rank {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}
.hot-post-item:nth-child(2) .hot-post-rank {
    background: var(--accent-green);
    color: #fff;
    border-color: var(--accent-green);
}
.hot-post-item:nth-child(3) .hot-post-rank {
    background: var(--warning-color);
    color: #fff;
    border-color: var(--warning-color);
}

.hot-post-info {
    flex: 1;
    min-width: 0;
}

.hot-post-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    /* 限制两行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hot-post-title a {
    color: var(--text-primary);
}

.hot-post-title a:hover {
    color: var(--accent-color);
}

.hot-post-views {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 侧边栏标签云 */
.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sidebar-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all var(--transition-fast);
}

.sidebar-tag-item:hover {
    background: var(--accent-light);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* 友情链接 */
.friend-links-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friend-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.friend-link-item:hover {
    background: var(--accent-light);
}

.friend-link-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-color);
    flex-shrink: 0;
}

.friend-link-info {
    flex: 1;
    min-width: 0;
}

.friend-link-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.friend-link-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 公告栏（侧边栏和首页共用） */
.sidebar-notice {
    padding: 16px;
    background: var(--accent-light);
    border-left: 3px solid var(--accent-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}


/* ============================== */
/* 页脚 */
/* ============================== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 24px;
    margin-top: 60px;
}

.footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* 页脚友情链接区域 */
.footer-links-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--divider-color);
}

.footer-links-title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.footer-links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    list-style: none;
}

.footer-links-list a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color var(--transition-fast);
}

.footer-links-list a:hover {
    color: var(--accent-color);
}

.footer-links-list a::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-color);
    margin-right: 6px;
    vertical-align: middle;
    opacity: 0.6;
}

/* 页脚底部信息 */
.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.8;
}

.footer-bottom a {
    color: var(--text-muted);
}

.footer-bottom a:hover {
    color: var(--accent-color);
}


/* ============================== */
/* 提示消息 */
/* ============================== */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash-message {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.4s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flash-success {
    background: var(--success-color);
    color: #fff;
}

.flash-error {
    background: var(--error-color);
    color: #fff;
}


/* ============================== */
/* 动画效果 */
/* ============================== */

/* 淡入上移 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 右侧滑入 */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 淡入 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 文章卡片和侧边栏卡片的淡入动画 */
.post-card {
    animation: fadeInUp 0.5s ease both;
}

.sidebar-card {
    animation: fadeInUp 0.5s ease both;
}

/* 卡片逐个延迟出现 */
.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.2s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }
.post-card:nth-child(6) { animation-delay: 0.3s; }

.sidebar-card:nth-child(1) { animation-delay: 0.1s; }
.sidebar-card:nth-child(2) { animation-delay: 0.15s; }
.sidebar-card:nth-child(3) { animation-delay: 0.2s; }
.sidebar-card:nth-child(4) { animation-delay: 0.25s; }

/* 页面加载淡入 */
.main-content {
    animation: fadeIn 0.4s ease;
}


/* ============================== */
/* 响应式设计 */
/* ============================== */

/* 平板端（768px - 1024px） */
@media (max-width: 1024px) {
    .layout-wrapper {
        flex-direction: column;
    }

    .layout-sidebar {
        width: 100%;
    }

    .layout-sidebar .sidebar-card {
        /* 侧边栏卡片横排排列 */
    }
}

/* 手机端（< 768px） */
@media (max-width: 768px) {
    :root {
        --navbar-height: 56px;
    }

    .container {
        padding: 0 16px;
    }

    /* 导航栏 */
    .navbar-toggle {
        display: block;
    }

    .navbar-search {
        display: none;
        width: 100%;
        max-width: none;
        margin: 0;
        order: 3;
        padding-top: 8px;
    }

    .navbar-search.show {
        display: flex;
    }

    .navbar-links {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 12px 0;
        order: 4;
        gap: 4px;
    }

    .navbar-links.show {
        display: flex;
    }

    .navbar-links a {
        padding: 10px 14px;
    }

    /* Hero */
    .hero {
        padding: 50px 0 40px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .hero::before,
    .hero::after {
        display: none;
    }

    /* 文章卡片 */
    .post-card-body {
        padding: 18px 20px 16px;
    }

    .post-card-title {
        font-size: 18px;
    }

    .post-card-summary {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    /* 文章详情 */
    .post-detail {
        padding: 24px 20px;
    }

    .post-title {
        font-size: 24px;
    }

    .markdown-body {
        font-size: 15px;
    }

    /* 上下篇导航 */
    .post-nav {
        flex-direction: column;
    }

    .post-nav-item.post-nav-next {
        text-align: left;
    }

    /* 评论 */
    .comment-item {
        gap: 12px;
    }

    .comment-avatar {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .comment-text {
        padding: 10px 12px;
    }

    .form-row {
        flex-direction: column;
    }

    /* 分页 */
    .pagination {
        gap: 6px;
    }

    .pagination-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* 标签网格 */
    .tags-grid {
        grid-template-columns: 1fr;
    }

    /* 相关文章 */
    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    /* 侧边栏 */
    .layout-sidebar {
        width: 100%;
    }

    /* 页脚友链 */
    .footer-links-list {
        flex-direction: column;
        gap: 6px;
    }

    /* 提示消息 */
    .flash-messages {
        right: 10px;
        left: 10px;
    }

    /* 归档页 */
    .archive-header h1 {
        font-size: 24px;
    }

    /* 前台相册 */
    .album-grid-frontend {
        grid-template-columns: repeat(2, 1fr);
    }

    .album-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 灯箱按钮 */
    .lightbox-prev, .lightbox-next {
        width: 40px;
        height: 40px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

    .lightbox-counter {
        bottom: 10px;
    }
}

/* ============================== */
/* 前台相册列表样式 */
/* ============================== */

/* 相册网格布局 */
.album-grid-frontend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 20px 0 40px;
}

/* 单个相册卡片（可点击跳转详情） */
.album-card-frontend {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
}

.album-card-frontend:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

/* 相册封面图区域 */
.album-card-cover {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.album-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.album-card-frontend:hover .album-card-cover img {
    transform: scale(1.06);
}

/* 无封面时的占位图 */
.album-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    color: var(--text-muted);
    font-size: 40px;
}

/* 图片数量角标（右上角） */
.album-card-count {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
}

/* 相册卡片内容区 */
.album-card-body {
    padding: 18px 20px;
}

.album-card-name {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    transition: color var(--transition-fast);
}

.album-card-frontend:hover .album-card-name {
    color: var(--accent-color);
}

.album-card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    /* 限制两行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================== */
/* 前台相册详情样式（图片网格） */
/* ============================== */

/* 图片网格布局 */
.album-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px 0 40px;
}

/* 单张图片项 */
.album-detail-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-secondary);
    /* 保持正方形/等高 */
    aspect-ratio: 1;
}

.album-detail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.album-detail-item:hover img {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ============================== */
/* 灯箱样式（图片放大查看） */
/* ============================== */

/* 灯箱容器 */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}

/* 灯箱遮罩层（半透明黑色背景） */
.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

/* 灯箱内容区 */
.lightbox-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 40px;
}

/* 灯箱图片容器 */
.lightbox-image-wrap {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-wrap img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.4);
}

/* 关闭按钮（右上角） */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    backdrop-filter: blur(4px);
    z-index: 2;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 上一张/下一张按钮 */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    backdrop-filter: blur(4px);
    z-index: 2;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* 图片计数器（底部居中） */
.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    backdrop-filter: blur(4px);
    z-index: 2;
}


/* ============================== */
/* 动态交互效果升级 */
/* 以下为追加的动态交互样式，不修改现有样式 */
/* ============================== */


/* ---------- B1. 页面加载动画 ---------- */
/* 页面打开时，主内容区域从下方淡入 */
@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: pageLoad 0.6s ease-out;
}


/* ---------- B2. 导航栏滚动效果 ---------- */
/* 页面滚动超过一定距离后，导航栏增加阴影，增强层次感 */
.navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* 深色主题下，导航栏滚动阴影更明显 */
[data-theme="dark"] .navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}


/* ---------- B3. 文章卡片逐个淡入动画 ---------- */
/* 文章卡片初始不可见，通过动画逐个从下方淡入出现 */
.post-card {
    opacity: 0;
    transform: translateY(30px);
    animation: cardFadeInUp 0.5s ease forwards;
}

/* 逐个延迟出现（第1个到第10个） */
.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }
.post-card:nth-child(4) { animation-delay: 0.4s; }
.post-card:nth-child(5) { animation-delay: 0.5s; }
.post-card:nth-child(6) { animation-delay: 0.6s; }
.post-card:nth-child(7) { animation-delay: 0.7s; }
.post-card:nth-child(8) { animation-delay: 0.8s; }
.post-card:nth-child(9) { animation-delay: 0.9s; }
.post-card:nth-child(10) { animation-delay: 1.0s; }

/* 文章卡片淡入动画关键帧 */
@keyframes cardFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ---------- B4. 返回顶部按钮 ---------- */
/* 固定在右下角的圆形按钮，滚动后淡入显示 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    /* 初始不可见，通过 JS 添加 .visible 类来显示 */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 滚动后显示返回顶部按钮 */
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 返回顶部按钮悬停效果 */
.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background: var(--accent-hover);
}


/* ---------- B5. 搜索框展开动画 ---------- */
/* 搜索框默认宽度较窄，获得焦点时平滑展开 */
.navbar-search input {
    width: 180px;
    transition: width 0.3s ease, border-color 0.3s;
}

/* 搜索框获得焦点时展开到更宽 */
.navbar-search input:focus {
    width: 280px;
}

/* 手机端搜索框保持全宽（覆盖上面的展开动画） */
@media (max-width: 768px) {
    .navbar-search input {
        width: 100%;
    }
    .navbar-search input:focus {
        width: 100%;
    }
}


/* ---------- B6. 侧边栏组件动画 ---------- */
/* 侧边栏各组件依次从右侧滑入出现 */
.sidebar .widget {
    opacity: 0;
    transform: translateX(20px);
    animation: sidebarSlideIn 0.5s ease forwards;
}

/* 逐个延迟出现（第1个到第4个） */
.sidebar .widget:nth-child(1) { animation-delay: 0.2s; }
.sidebar .widget:nth-child(2) { animation-delay: 0.4s; }
.sidebar .widget:nth-child(3) { animation-delay: 0.6s; }
.sidebar .widget:nth-child(4) { animation-delay: 0.8s; }

/* 侧边栏组件滑入动画关键帧 */
@keyframes sidebarSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* ============================== */
/* 阅读进度条 —— 文章页顶部显示阅读进度 */
/* ============================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent-color, #c96b4f);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s linear;
    /* 默认隐藏，只在文章页显示 */
    opacity: 0;
}

/* 文章页激活后显示进度条 */
.reading-progress.active {
    opacity: 1;
}

/* 深色主题下进度条更亮，带发光效果 */
[data-theme="dark"] .reading-progress {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}
