/* ============================================================
   博客前台门户样式（独立于管理端；仅依赖 layui 按钮/表单基础样式）

   设计口径（60-30-10）：
   - 60% 主色：页面背景（亮 #fafafa / 暗 #16181d）
   - 30% 辅助色：卡片/头部表面色（surface）
   - 10% 点缀色：accent（按钮/链接/高亮，亮 #16b777 / 暗 #3ecf9a）
   - 主题：html[data-theme=dark] 切换，变量集中在 :root 与 [data-theme=dark]
   - 排版：系统字体栈（sans + 等宽两种），正文 15px / 1.75，标题层级显著
   - 动效：悬停轻浮 + 阴影、卡片入场淡入，克制不抢戏
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f6f5;
    --header-bg: rgba(255, 255, 255, .86);
    --text: #333;
    --text-2: #666;
    --text-3: #999;
    --accent: #16b777;
    --accent-hover: #12a067;
    --accent-soft: #eaf7f0;
    --border: #eceef0;
    --shadow-1: 0 1px 3px rgba(0, 0, 0, .04);
    --shadow-hover: 0 10px 28px rgba(0, 0, 0, .10);
    --code-bg: #282c34;
    --code-fg: #abb2bf;
    --code-inline-bg: #f0f2f4;
}

html[data-theme="dark"] {
    --bg: #16181d;
    --surface: #1f2329;
    --surface-2: #262b32;
    --header-bg: rgba(22, 24, 29, .86);
    --text: #cfd3d8;
    --text-2: #9aa1ab;
    --text-3: #6f7680;
    --accent: #3ecf9a;
    --accent-hover: #57d9a9;
    --accent-soft: #1d2b26;
    --border: #31363e;
    --shadow-1: 0 1px 3px rgba(0, 0, 0, .3);
    --shadow-hover: 0 10px 28px rgba(0, 0, 0, .45);
    --code-bg: #111318;
    --code-fg: #abb2bf;
    --code-inline-bg: #2b3038;
}

/* ---------- 基础 ---------- */
.blog-body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 15px;
    line-height: 1.75;
    transition: background-color .3s, color .3s;
}

::selection { background: var(--accent-soft); color: var(--accent); }

/* ---------- 布局宽度：桌面 80%（超宽屏封顶 1600px），窄屏逐级回退 ---------- */
.blog-header-inner,
.blog-hero,
.blog-main {
    width: 80%;
    max-width: 1600px;
    margin: 0 auto;
    box-sizing: border-box;
}
@media (max-width: 1400px) {
    .blog-header-inner, .blog-hero, .blog-main { width: 86%; }
}
@media (max-width: 1100px) {
    .blog-header-inner, .blog-hero, .blog-main { width: 92%; }
}

/* ---------- 移动端响应式（≤800px 平板/手机） ---------- */
@media (max-width: 800px) {
    .blog-header-inner, .blog-hero, .blog-main { width: 100%; }
    .blog-hero { padding: 40px 18px 32px; }
    .blog-hero h1 { font-size: 24px; }
    .blog-hero p { font-size: 14.5px; }
    .blog-hero .blog-hero-cta { height: 40px; line-height: 40px; padding: 0 26px; font-size: 14px; }
    .blog-body { font-size: 14.5px; }

    /* 头部：导航保持可见（去掉冗余的「文章」锚点后 4 项可容纳），间距收紧 */
    .blog-nav-toggle {
        display: inline-flex;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        border-radius: 6px;
        color: var(--text-2);
        font-size: 16px;
        cursor: pointer;
    }
    .blog-nav a { margin-left: 0; padding: 6px 8px; font-size: 14px; }
    .blog-nav { gap: 2px; }
    .blog-nav a.blog-nav-anchor { display: none; }
    .blog-theme-toggle { margin-left: 6px; flex: none; }

    /* 侧栏 → 底部抽屉（热门/标签云/博主移动端仍可达） */
    .blog-side {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 200;
        display: block;
        max-height: 68vh;
        overflow-y: auto;
        background: var(--surface);
        border-top: 1px solid var(--border);
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
        padding: 6px 16px 20px;
        transform: translateY(105%);
        transition: transform .28s ease;
    }
    .blog-side.qa-open { transform: translateY(0); }
    .blog-side-mask {
        position: fixed;
        inset: 0;
        z-index: 190;
        background: rgba(0, 0, 0, .4);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s;
    }
    .blog-side-mask.qa-open { opacity: 1; pointer-events: auto; }
    .blog-side-card { border: none; box-shadow: none; border-bottom: 1px dashed var(--border); border-radius: 0; margin-bottom: 0; padding: 14px 4px; }
    .blog-side-profile { text-align: left; padding-top: 10px; }
    .blog-side-profile .blog-side-avatar { width: 44px; height: 44px; font-size: 18px; margin: 0 0 4px; }
    .blog-side-profile .blog-side-name { font-size: 15px; }
    .blog-side-profile p { font-size: 13px; }

    /* 卡片/间距/字号整体收紧 */
    .blog-main { margin-top: 14px; padding: 0 14px; gap: 0; }
    .blog-card { padding: 14px; }
    .blog-card-title { font-size: 16.5px; }
    .blog-card-summary { font-size: 13.5px; }
    .blog-card-meta { gap: 10px; font-size: 12.5px; }
    .blog-section-title { font-size: 16px; margin: 2px 0 12px; }
    .blog-search input { height: 42px; }        /* 触控友好高度 */
    .blog-search .layui-btn { height: 42px !important; }
    .blog-featured { gap: 12px; margin-bottom: 18px; }
    .blog-pager { padding: 10px 0 28px; gap: 4px; }
    .blog-pager a, .blog-pager span { min-width: 38px; height: 38px; line-height: 38px; }
    .blog-empty { padding: 44px 0; }
    .blog-footer { padding: 20px 0 90px; }      /* 底部留出抽屉安全区 */
}

/* 汉堡按钮：桌面隐藏（配合上方移动端规则） */
.blog-nav-toggle { display: none; }

/* 抽屉把手：仅移动端抽屉态显示 */
.blog-side-grip { display: none; }
@media (max-width: 800px) {
    .blog-side-grip {
        display: flex;
        justify-content: center;
        padding: 8px 0 2px;
        color: var(--text-3);
        font-size: 18px;
    }
}

/* 平板（801-1100px）：侧栏保留但收窄 */
@media (min-width: 801px) and (max-width: 1100px) {
    .blog-side { flex: 0 0 220px; }
}
/* 宽屏下侧栏与内容同比加宽，避免主列过空 */
@media (min-width: 1400px) {
    .blog-side { flex: 0 0 300px; }
}

/* ---------- 背景粒子画布（首页；pointer-events 穿透，内容浮于其上） ---------- */
#blogBgCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.blog-header, .blog-hero, .blog-main, .blog-footer { position: relative; z-index: 1; }

/* ---------- 粘性头部（Sticky Header + 毛玻璃） ---------- */
.blog-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.blog-header-inner {
    margin: 0 auto;
    padding: 0 16px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.blog-logo {
    font-size: 19px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: .5px;
}
.blog-logo .fa { margin-right: 6px; }
.blog-nav { display: flex; align-items: center; gap: 4px; }
.blog-nav a {
    color: var(--text-2);
    text-decoration: none;
    margin-left: 18px;
    font-size: 14px;
    padding: 4px 2px;
    transition: color .2s;
}
.blog-nav a:hover { color: var(--accent); }
.blog-nav a.active {
    color: var(--accent);
    font-weight: 600;
    border-bottom: 2px solid var(--accent);
}
.blog-theme-toggle {
    margin-left: 20px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-2);
    cursor: pointer;
    font-size: 15px;
    transition: color .2s, border-color .2s, transform .2s;
}
.blog-theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: rotate(15deg);
}

/* ---------- 顶部分类条（首页：header 第二行，粘性随头部固定） ---------- */
.blog-catbar {
    border-top: 1px solid var(--border);
    background: var(--header-bg);
}
.blog-catbar-inner {
    width: 80%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;           /* Firefox 隐藏滚动条 */
    -ms-overflow-style: none;        /* IE/旧 Edge */
}
.blog-catbar-inner::-webkit-scrollbar { display: none; }
.blog-catbar-inner a {
    display: inline-block;
    padding: 9px 14px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 13.5px;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
}
.blog-catbar-inner a:hover { color: var(--accent); }
.blog-catbar-inner a.active {
    color: var(--accent);
    font-weight: 600;
    border-bottom-color: var(--accent);
}
@media (max-width: 1400px) { .blog-catbar-inner { width: 86%; } }
@media (max-width: 1100px) { .blog-catbar-inner { width: 92%; } }
@media (max-width: 800px)  { .blog-catbar-inner { width: 100%; } }

/* ---------- 英雄区（Hero） ---------- */
.blog-hero {
    margin: 0 auto;
    padding: 72px 16px 56px;
    text-align: center;
    background:
        radial-gradient(circle at 18% 22%, var(--accent-soft) 0, transparent 42%),
        radial-gradient(circle at 82% 78%, var(--accent-soft) 0, transparent 42%);
}
.blog-hero h1 {
    margin: 0 0 14px;
    font-size: 34px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text);
}
.blog-hero h1 .blog-hero-dot { color: var(--accent); }
.blog-hero p {
    margin: 0 auto;
    max-width: 560px;
    color: var(--text-2);
    font-size: 16px;
}
.blog-hero .blog-hero-cta {
    margin-top: 26px;
    display: inline-block;
    padding: 0 30px;
    height: 42px;
    line-height: 42px;
    border-radius: 21px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    box-shadow: 0 6px 18px rgba(22, 183, 119, .35);
    transition: background .2s, transform .2s, box-shadow .2s;
}
.blog-hero .blog-hero-cta:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(22, 183, 119, .42);
}

/* ---------- 主体布局 ---------- */
.blog-main {
    margin: 24px auto 0;
    padding: 0 16px;
    display: flex;
    gap: 22px;
    align-items: flex-start;
}
.blog-content { flex: 1 1 auto; min-width: 0; }
.blog-side { flex: 0 0 260px; }

/* ---------- 区块标题 ---------- */
.blog-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}
.blog-section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--accent);
}
.blog-section-title small { font-weight: 400; color: var(--text-3); font-size: 12px; }
/* 区块标题右侧「查看更多」 */
.blog-section-title .blog-more-link {
    margin-left: auto;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: color .2s;
}
.blog-section-title .blog-more-link:hover { color: var(--accent); }

/* ---------- 文章来源徽章（1原创 2AI辅助 3转载） ---------- */
.blog-origin {
    display: inline-block;
    border-radius: 3px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 22px;
    border: 1px solid transparent;
}
.blog-origin-1 { color: var(--accent); background: var(--accent-soft); }
.blog-origin-2 { color: #7a5af8; background: rgba(122, 90, 248, .1); border-color: rgba(122, 90, 248, .25); }
.blog-origin-3 { color: var(--text-3); background: var(--surface-2); border-color: var(--border); }

/* ---------- 精选文章（Featured） ---------- */
.blog-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 26px;
}
@media (max-width: 680px) {
    .blog-featured { grid-template-columns: 1fr; }
}
.blog-feat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-1);
    transition: transform .25s, box-shadow .25s;
}
.blog-feat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.blog-feat-flag {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: var(--accent);
    color: #fff;
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 12px;
    line-height: 20px;
}
.blog-cover { position: relative; width: 100%; padding-top: 52%; overflow: hidden; background: var(--surface-2); }
.blog-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}
.blog-feat-card:hover .blog-cover img { transform: scale(1.04); }
/* 无封面回退：渐变占位 + 图标 */
.blog-cover-ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-soft), var(--surface-2));
    color: var(--accent);
    font-size: 34px;
}
.blog-feat-body { padding: 16px 20px 18px; }
.blog-feat-body h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.45;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-feat-body p {
    margin: 0 0 10px;
    color: var(--text-2);
    font-size: 13.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 文章卡片（横向：封面缩略图 + 内容） ---------- */
.blog-card {
    display: flex;
    gap: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-1);
    transition: transform .25s, box-shadow .25s;
    /* 入场动效：轻微上浮淡入，逐卡错峰（最多 6 档延迟） */
    animation: blogFadeUp .45s ease both;
}
.blog-card:nth-child(1) { animation-delay: .02s; }
.blog-card:nth-child(2) { animation-delay: .06s; }
.blog-card:nth-child(3) { animation-delay: .10s; }
.blog-card:nth-child(4) { animation-delay: .14s; }
.blog-card:nth-child(5) { animation-delay: .18s; }
.blog-card:nth-child(6) { animation-delay: .22s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
@keyframes blogFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.blog-card-cover {
    flex: 0 0 200px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-2);
}
.blog-card-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}
.blog-card:hover .blog-card-cover img { transform: scale(1.05); }
.blog-card-cover .blog-cover-ph { font-size: 26px; }
@media (max-width: 620px) {
    .blog-card { flex-direction: column; gap: 12px; }
    .blog-card-cover { flex: none; height: 150px; }
}

/* 手机（≤620px）：文章卡封面上置全宽、meta 精简换行 */
@media (max-width: 620px) {
    .blog-card { padding: 12px; }
    .blog-card-cover { height: 165px; border-radius: 6px; }
    .blog-card-meta span:not(.blog-origin):not(.blog-cate):not(.blog-tag) { font-size: 12px; }
    .blog-card-meta > span:has(.fa-eye), .blog-card-meta > span:has(.fa-heart) { display: none; } /* 浏览/点赞数让位 */
    .blog-featured { grid-template-columns: 1fr; }
    .blog-feat-body { padding: 13px 15px 15px; }
    .blog-feat-body h3 { font-size: 16px; }
}

.blog-card-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.blog-card-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.45;
}
.blog-card-title a { color: var(--text); text-decoration: none; transition: color .2s; }
.blog-card-title a:hover { color: var(--accent); }
/* 列表序号徽章（postSort > 0 时显示） */
.blog-card-seq {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-right: 8px;
    padding: 0 5px;
    border-radius: 11px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    vertical-align: 2px;
}
.blog-card-summary {
    color: var(--text-2);
    font-size: 14px;
    margin: 0 0 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-meta {
    color: var(--text-3);
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}
.blog-card-meta .fa { margin-right: 4px; }
.blog-tag {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 3px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 22px;
    transition: background .2s, color .2s;
}
a.blog-tag { text-decoration: none; }
a.blog-tag:hover { background: var(--accent); color: #fff; }
.blog-cate {
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 3px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 22px;
}

/* ---------- 侧栏 ---------- */
.blog-side-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-1);
}
.blog-side-card h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.blog-side-card h3::before {
    content: '';
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--accent);
}
/* 个人简介卡 */
.blog-side-profile { text-align: center; padding-top: 22px; }
.blog-side-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    font-size: 24px;
    overflow: hidden;
}
.blog-side-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-side-profile h3 { justify-content: center; }
.blog-side-profile h3::before { display: none; }
.blog-side-profile .blog-side-name { font-size: 16px; font-weight: 600; }
.blog-side-profile p {
    margin: 4px 0 0;
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.6;
    text-align: left;
}
.blog-side-cates a,
.blog-side-cates span {
    display: block;
    padding: 6px 6px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: background .2s, color .2s, padding-left .2s;
}
/* 侧栏精选文章（紧凑竖卡：封面 16:10 + 标题 + meta） */
.blog-side-feat {
    display: block;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    transition: transform .22s, box-shadow .22s;
}
.blog-side-feat:last-child { margin-bottom: 0; }
.blog-side-feat:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.blog-side-feat .blog-cover { padding-top: 62%; border-radius: 0; }
.blog-side-feat .blog-cover .blog-cover-ph { font-size: 24px; }
.blog-side-feat .blog-feat-flag {
    top: 8px;
    left: 8px;
    padding: 1px 8px;
    font-size: 11px;
    line-height: 18px;
}
.blog-side-feat-title {
    padding: 8px 10px 2px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-side-feat-meta {
    padding: 2px 10px 9px;
    color: var(--text-3);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.blog-side-feat-meta .fa { margin-right: 3px; }
.blog-side-cates a:hover { background: var(--accent-soft); color: var(--accent); padding-left: 10px; }
.blog-side-cates .active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.blog-side-cates small { float: right; color: var(--text-3); }
.blog-hot-item {
    display: flex;
    align-items: baseline;
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
    padding: 7px 4px;
    border-bottom: 1px dashed var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s;
}
.blog-hot-item:last-child { border-bottom: none; }
.blog-hot-item:hover { color: var(--accent); }
.blog-hot-item .blog-hot-rank {
    flex: none;
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: var(--surface-2);
    color: var(--text-3);
    border-radius: 4px;
    font-size: 12px;
    margin-right: 8px;
    transform: translateY(2px);
}
.blog-hot-item:first-child .blog-hot-rank { background: #ff7d32; color: #fff; }
.blog-hot-item:nth-child(2) .blog-hot-rank { background: #ffb13d; color: #fff; }
.blog-hot-item:nth-child(3) .blog-hot-rank { background: #f6c85f; color: #fff; }

/* 标签云 */
.blog-tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-tagcloud a {
    display: inline-block;
    background: var(--surface-2);
    color: var(--text-2);
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 12.5px;
    line-height: 22px;
    text-decoration: none;
    transition: background .2s, color .2s, transform .2s;
}
.blog-tagcloud a:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.blog-tagcloud a small { color: inherit; opacity: .65; margin-left: 3px; }
.blog-tagcloud a.cloud-hot { font-weight: 600; color: var(--accent); background: var(--accent-soft); }

/* ---------- 搜索/筛选 ---------- */
.blog-search {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.blog-search input {
    flex: 1;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.blog-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.blog-filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-size: 14px;
}
.blog-filter-bar .blog-clear {
    margin-left: auto;
    color: var(--text-3);
    font-size: 13px;
    text-decoration: none;
    transition: color .2s;
}
.blog-filter-bar .blog-clear:hover { color: var(--accent); }

/* ---------- 分页 ---------- */
.blog-pager {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 12px 0 34px;
}
.blog-pager a,
.blog-pager span {
    display: inline-block;
    min-width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    padding: 0 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color .2s, color .2s, transform .2s;
}
.blog-pager a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.blog-pager .active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    cursor: default;
}
.blog-pager .disabled { color: var(--text-3); background: var(--surface-2); cursor: not-allowed; }
.blog-empty {
    text-align: center;
    color: var(--text-3);
    padding: 64px 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* ---------- 详情页 ---------- */
.blog-article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 30px 36px;
    box-shadow: var(--shadow-1);
}
@media (max-width: 620px) {
    .blog-article { padding: 22px 18px; }
}
/* 详情页移动端：标题/meta/正文排版收紧 */
@media (max-width: 620px) {
    .blog-article h1 { font-size: 20px; }
    .blog-article-meta { gap: 10px; font-size: 12.5px; }
    .blog-md h1 { font-size: 19px; }
    .blog-md h2 { font-size: 17.5px; }
    .blog-md h3 { font-size: 16px; }
    .blog-md pre { padding: 12px; font-size: 12.5px; border-radius: 6px; }
    .blog-md table { display: block; overflow-x: auto; white-space: nowrap; }  /* 宽表横向滚动 */
    .blog-actions { gap: 10px; padding: 22px 0 4px; }
    .blog-act-btn { height: 38px; padding: 0 18px; font-size: 13.5px; }
    .blog-comments { padding: 18px 16px; }
    .blog-cmt-children { margin-left: 18px; }
    .blog-cmt-form .layui-input, .blog-cmt-form .layui-textarea { font-size: 16px !important; }  /* 防 iOS 聚焦缩放 */
    .blog-cmt-captcha input { height: 42px; }
    .blog-cmt-captcha img { height: 42px; }
    .blog-cmt-row2 { flex-direction: column; }   /* 昵称/邮箱窄屏堆叠 */
}
.blog-article h1 {
    font-size: 25px;
    margin: 0 0 10px;
    line-height: 1.4;
    font-weight: 700;
}
.blog-article-meta {
    color: var(--text-3);
    font-size: 13px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

/* 富文本正文排版（.blog-md 同时用于详情正文与预览弹层） */
.blog-md { word-break: break-word; }
.blog-md h1, .blog-md h2, .blog-md h3, .blog-md h4 { margin: 1.4em 0 .6em; line-height: 1.4; font-weight: 600; }
.blog-md h1 { font-size: 22px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.blog-md h2 { font-size: 20px; }
.blog-md h3 { font-size: 17px; }
.blog-md h4 { font-size: 15px; }
.blog-md p { margin: .8em 0; }
.blog-md pre {
    background: var(--code-bg);
    color: var(--code-fg);
    border-radius: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
}
.blog-md code {
    background: var(--code-inline-bg);
    color: var(--accent);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 13px;
    font-family: Consolas, Monaco, "Courier New", monospace;
}
.blog-md pre code { background: none; color: inherit; padding: 0; }
.blog-md blockquote {
    margin: 1em 0;
    padding: 8px 14px;
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    color: var(--text-2);
    border-radius: 0 6px 6px 0;
}
.blog-md blockquote p { margin: .2em 0; }
.blog-md ul, .blog-md ol { padding-left: 24px; margin: .8em 0; }
.blog-md img { max-width: 100%; border-radius: 6px; }
.blog-md video { max-width: 100%; border-radius: 6px; background: #000; }
.blog-md a { color: var(--accent); }
.blog-md hr { border: none; border-top: 1px solid var(--border); margin: 1.6em 0; }
.blog-md table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 14px; }
.blog-md th, .blog-md td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.blog-md th { background: var(--surface-2); font-weight: 600; }

/* ---------- 点赞 / 转发 ---------- */
.blog-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 28px 0 6px;
}
.blog-act-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 24px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
    cursor: pointer;
    transition: border-color .2s, color .2s, transform .2s;
}
.blog-act-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.blog-act-btn.liked {
    background: #fff1f0;
    border-color: #ff7d32;
    color: #ff7d32;
}
html[data-theme="dark"] .blog-act-btn.liked { background: #38271e; }
.blog-act-btn .fa { font-size: 16px; }

/* ---------- 评论区 ---------- */
.blog-comments {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px 28px;
    margin-top: 16px;
    box-shadow: var(--shadow-1);
}
.blog-comments h2 {
    font-size: 17px;
    margin: 0 0 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.blog-comments h2::before {
    content: '';
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--accent);
}
.blog-cmt { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.blog-cmt:last-of-type { border-bottom: none; }
.blog-cmt-head {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.blog-cmt-nick { color: var(--accent); font-weight: 600; margin-right: 8px; }
.blog-cmt-content { color: var(--text); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.blog-cmt-reply-btn {
    color: var(--text-3);
    cursor: pointer;
    font-size: 12px;
    background: none;
    border: none;
    padding: 0;
    transition: color .2s;
}
.blog-cmt-reply-btn:hover { color: var(--accent); }
.blog-cmt-children { margin-left: 40px; }
.blog-cmt-child { padding: 10px 0 0; border-top: 1px dashed var(--border); }
.blog-cmt-child .blog-cmt { border-bottom: none; padding: 0 0 6px; }
.blog-cmt-empty { color: var(--text-3); text-align: center; padding: 26px 0; }

.blog-cmt-form { margin-top: 18px; }
.blog-cmt-form .layui-input,
.blog-cmt-form .layui-textarea {
    border-radius: 6px;
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
}
.blog-cmt-form .layui-input:focus,
.blog-cmt-form .layui-textarea:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.blog-cmt-replying {
    display: none;
    margin-bottom: 10px;
    font-size: 13px;
    color: #ff7d32;
}
.blog-cmt-replying i { cursor: pointer; margin-left: 6px; color: var(--text-3); font-style: normal; }
.blog-cmt-captcha { display: flex; gap: 10px; }
.blog-cmt-captcha img { height: 38px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; }

/* ---------- 页脚 ---------- */
.blog-footer {
    margin-top: 30px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
    padding: 28px 0 44px;
    line-height: 1.9;
}
.blog-footer-links { margin-bottom: 6px; }
.blog-footer-links a {
    color: var(--text-2);
    text-decoration: none;
    margin: 0 10px;
    transition: color .2s;
}
.blog-footer-links a:hover { color: var(--accent); }
.blog-footer-dim a { color: var(--text-3); text-decoration: none; }
.blog-footer-dim a:hover { color: var(--accent); }

/* ---------- 关于页 ---------- */
.blog-about {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 36px 40px;
    box-shadow: var(--shadow-1);
}
.blog-about .blog-side-avatar { width: 72px; height: 72px; font-size: 28px; }
.blog-about h2 { font-size: 20px; font-weight: 700; margin: 14px 0 10px; }
.blog-about p { color: var(--text-2); font-size: 15px; }
.blog-about ul { color: var(--text-2); padding-left: 22px; }

/* ==================== 日常记录（时间线） ==================== */
.moment-timeline {
    position: relative;
    padding-left: 26px;             /* 给竖线与圆点让位 */
}
.moment-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
}
.moment-item { position: relative; margin-bottom: 18px; }
.moment-dot {
    position: absolute;
    left: -26px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.moment-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: var(--shadow-1);
    transition: box-shadow .25s;
}
.moment-card:hover { box-shadow: var(--shadow-hover); }
.moment-meta { color: var(--text-3); font-size: 13px; margin-bottom: 8px; }
.moment-meta .fa { margin-right: 4px; }
.moment-content {
    color: var(--text);
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}
/* 配图：1 张自适应大图（≤420px），多张网格（3 列 / 2 列） */
.moment-imgs { display: grid; gap: 6px; margin-top: 10px; }
.moment-imgs.n1 { grid-template-columns: minmax(0, 420px); }
.moment-imgs.n2, .moment-imgs.n4 { grid-template-columns: repeat(2, 1fr); max-width: 420px; }
.moment-imgs { grid-template-columns: repeat(3, 1fr); max-width: 440px; }
.moment-img-box {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface-2);
}
.moment-imgs.n1 .moment-img-box { aspect-ratio: auto; }
.moment-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.moment-img-box:hover img { transform: scale(1.04); }
@media (max-width: 620px) {
    .moment-timeline { padding-left: 20px; }
    .moment-dot { left: -20px; }
    .moment-card { padding: 13px 15px; }
    .moment-imgs.n2, .moment-imgs.n4 { grid-template-columns: repeat(2, 1fr); }
}

/* ==================== 照片墙（瀑布流 + 灯箱） ==================== */
.gallery-flow {
    column-count: 3;
    column-gap: 14px;
}
.gallery-item {
    display: block;
    position: relative;
    margin-bottom: 14px;
    border-radius: 10px;
    overflow: hidden;
    break-inside: avoid;            /* 瀑布流防断裂 */
    background: var(--surface-2);
    box-shadow: var(--shadow-1);
    text-decoration: none;
}
.gallery-item img {
    width: 100%;
    display: block;
    transition: transform .3s, opacity .3s;
}
.gallery-item:hover img { transform: scale(1.03); }
.gallery-item-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 12px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .55));
    color: #fff;
    font-size: 13px;
    opacity: 0;
    transition: opacity .25s;
}
.gallery-item:hover .gallery-item-title { opacity: 1; }
@media (max-width: 900px) { .gallery-flow { column-count: 2; } }
@media (max-width: 560px) { .gallery-flow { column-count: 2; column-gap: 8px; } .gallery-item { margin-bottom: 8px; border-radius: 6px; } }

/* 灯箱 */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
}
.gallery-lightbox.qa-open { display: flex; }
.gallery-lb-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .88); }
.gallery-lb-img {
    position: relative;
    z-index: 1;
    max-width: 92vw;
    max-height: 84vh;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
}
.gallery-lb-btn {
    position: absolute;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.gallery-lb-btn:hover { background: rgba(255, 255, 255, .28); }
.gallery-lb-close { top: 18px; right: 22px; }
.gallery-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.gallery-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.gallery-lb-caption {
    position: absolute;
    z-index: 2;
    bottom: 18px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, .85);
    font-size: 14px;
    display: flex;
    justify-content: center;
    gap: 14px;
}
@media (max-width: 620px) {
    .gallery-lb-prev { left: 8px; }
    .gallery-lb-next { right: 8px; }
    .gallery-lb-btn { width: 38px; height: 38px; }
}
