/* ===== 博客通用组件：头像光晕、目录、代码块、表格、特性卡片 ===== */
/* ===== 博客通用排版样式（blog1~5 共用） ===== */

/* 左右侧栏背景图 — 遮罩跟随主题 */
.box.left {
    background-image: url('../images/bg_leftbox.jpg');
    background-size: cover;
    background-position: center;
    background-color: transparent;
    border: 1px solid rgba(255, 33, 192, 0.15);
}
.box.right {
    background-image: url('../images/bg_rightbox.jpg');
    background-size: cover;
    background-position: center;
    background-color: transparent;
    border: 1px solid rgba(33, 235, 255, 0.15);
}
/* 暗色 → 深色遮罩 */
body.dark-mode .box.left {
    background-image: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)), url('../images/bg_leftbox.jpg');
}
body.dark-mode .box.right {
    background-image: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)), url('../images/bg_rightbox.jpg');
}
/* 亮色 → 原色（无遮罩） */
body.light-mode .box.left {
    background-image: url('../images/bg_leftbox.jpg');
}
body.light-mode .box.right {
    background-image: url('../images/bg_rightbox.jpg');
}
.box.left img,
.box.right img {
    opacity: 0.9;
}
/* left 图片透明度降低 */
.box.left img:first-of-type {
    opacity: 0.7;
}

/* 侧栏分割线 */
.box .divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,33,192,0.4), transparent);
    margin: 0.4rem 0;
    border: none;
    padding: 0;
}

/* 左右侧栏统一字体样式 */
.box.left .text1,
.box.right .text1 {
    text-shadow: 0 0 10px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,0.6);
    color: #ff21c0;
}
.box.left .text2,
.box.right .text2 {
    text-shadow: 0 0 10px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,0.6);
    color: #21ebff;
    font-size: 1vw;
}
.box.left .text1,
.box.right .text1 {
    font-size: 1.125vw;
}

/* 博客文章容器 */
.blog-article {
    padding: 0.5rem 1.2rem 2rem;
    line-height: 1.9;
    font-size: 0.95vw;
    color: inherit;
}

/* 文章头部 */
.blog-header {
    text-align: center;
    padding: 2rem 0 1.5rem;
    border-bottom: 2px solid rgba(255, 33, 192, 0.25);
    margin-bottom: 2rem;
}

/* ===== 头像 ===== */
.blog-avatar-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    cursor: pointer;
}
.blog-avatar {
    width: 6vw !important;
    height: 6vw !important;
    min-width: 70px;
    min-height: 70px;
    max-width: 110px;
    max-height: 110px;
    border-radius: 50% !important;
    object-fit: cover !important;
    aspect-ratio: 1 !important;
    align-self: center !important;
    margin-bottom: 0 !important;
    position: relative;
    z-index: 1;
    border: 3px solid rgba(255, 33, 192, 0.5);
    transition: border-color 0.4s, box-shadow 0.4s;
}
.blog-avatar-wrapper:hover .blog-avatar {
    border-color: #ff21c0;
}
/* 头像光晕 — 用伪元素居中，不会偏移 */
.blog-avatar-wrapper::before {
    content: '';
    position: absolute;
    width: calc(100% + 14px);
    height: calc(100% + 14px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: conic-gradient(#ff21c0, #21ebff, #ff21c0, #21ebff, #ff21c0);
    opacity: 0.40;
    z-index: 0;
    will-change: transform;
    animation: spin-glow 4s linear infinite;
}
.blog-avatar-wrapper:hover::before {
    opacity: 0.70;
}
@keyframes spin-glow {
    0%   { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.blog-brand {
    font-size: 1vw;
    font-weight: 600;
    letter-spacing: 3px;
    color: #21ebff;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.blog-header h1 {
    font-size: 1.8vw;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #ff21c0, #21ebff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    margin-bottom: 0.6rem;
}
.blog-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 0.85vw;
    color: inherit;
    opacity: 0.7;
}
.blog-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.blog-meta .tag {
    background: rgba(255, 33, 192, 0.2);
    color: #ff21c0;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.75vw;
    border: 1px solid rgba(255, 33, 192, 0.3);
}

/* 标签行 */
.blog-tags {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
    flex-wrap: nowrap;
}
.blog-tags .tag {
    background: rgba(255, 33, 192, 0.2);
    color: #ff21c0;
    padding: 2px 14px;
    border-radius: 12px;
    font-size: 0.75vw;
    border: 1px solid rgba(255, 33, 192, 0.3);
    white-space: nowrap;
}

/* 目录 */
.blog-toc {
    background: rgba(33, 235, 255, 0.06);
    border: 1px solid rgba(33, 235, 255, 0.15);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 2rem;
}
.blog-toc .toc-title {
    font-size: 1vw;
    font-weight: 600;
    color: #21ebff;
    margin-bottom: 0.6rem;
}
.blog-toc ol {
    padding-left: 1.5rem;
    margin: 0;
}
.blog-toc li {
    margin: 0.3rem 0;
    font-size: 0.85vw;
}
.blog-toc li a {
    all: unset;
    color: inherit;
    cursor: pointer;
    transition: color 0.3s;
}
.blog-toc li a:hover {
    color: #ff21c0;
}
.blog-toc li a::before,
.blog-toc li a::after {
    display: none;
}

/* 标题层级 */
.blog-article h2 {
    font-size: 1.3vw;
    font-weight: 700;
    margin: 2rem 0 1rem;
    padding-left: 0.8rem;
    border-left: 4px solid #ff21c0;
    color: inherit;
}
.blog-article h3 {
    font-size: 1.1vw;
    font-weight: 600;
    margin: 1.5rem 0 0.8rem;
    color: #21ebff;
}
.blog-article h4 {
    font-size: 0.95vw;
    font-weight: 600;
    margin: 1.2rem 0 0.5rem;
    color: inherit;
    opacity: 0.9;
}

/* 段落与文本 */
.blog-article p {
    margin: 0.8rem 0;
    text-align: justify;
}

/* 警告提示 */
.warning-note {
    margin: 1rem 0;
    padding: 0.8rem 1.2rem;
    border-left: 4px solid #ffd700;
    background: rgba(255, 215, 0, 0.08);
    border-radius: 0 8px 8px 0;
    color: inherit;
    opacity: 0.9;
}
.warning-note strong {
    color: #ffd700;
}

/* 引用块 */
.blog-article blockquote {
    margin: 1rem 0;
    padding: 0.8rem 1.2rem;
    border-left: 4px solid #ff21c0;
    background: rgba(255, 33, 192, 0.06);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: inherit;
    opacity: 0.88;
}
.blog-article blockquote strong {
    color: #ff21c0;
}

/* 高亮标注 */
.highlight {
    background: linear-gradient(120deg, rgba(255, 33, 192, 0.15) 0%, rgba(255, 33, 192, 0.15) 40%, transparent 80%);
    padding: 0 4px;
    font-weight: 500;
}
.highlight-cyan {
    background: linear-gradient(120deg, rgba(33, 235, 255, 0.15) 0%, rgba(33, 235, 255, 0.15) 40%, transparent 80%);
    padding: 0 4px;
    font-weight: 500;
}

/* 列表 */
.blog-article ul,
.blog-article ol {
    padding-left: 1.5rem;
    margin: 0.6rem 0;
}
.blog-article li {
    margin: 0.3rem 0;
}

/* 特性卡片网格 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14vw, 1fr));
    gap: 0.8rem;
    margin: 1rem 0;
}
.feature-card {
    background: rgba(33, 235, 255, 0.05);
    border: 1px solid rgba(33, 235, 255, 0.12);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    transition: transform 0.3s, border-color 0.3s;
}
.feature-card:hover {
    transform: translateY(-3px);
    border-color: #ff21c0;
}
.feature-card .card-num {
    font-size: 1.2vw;
    font-weight: 800;
    color: #ff21c0;
    display: block;
    margin-bottom: 0.3rem;
}
.feature-card .card-label {
    font-size: 0.85vw;
    opacity: 0.9;
}

/* 代码块 */
.blog-article pre {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(33, 235, 255, 0.12);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.82vw;
    line-height: 1.5;
    margin: 1rem 0;
    color: #e0e0e0;
    position: relative;
}
.blog-article pre .lang-tag {
    background: rgba(33, 235, 255, 0.15);
    color: #21ebff;
    font-size: 0.65vw;
    padding: 2px 10px;
    font-family: 'Poppins', sans-serif;
    display: inline-flex;
    align-items: center;
}

/* 代码块右上角操作栏（C 标签 + 复制按钮） */
.code-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: stretch;
    border-radius: 0 10px 0 8px;
    overflow: hidden;
    z-index: 1;
}

/* 复制按钮 — 与 C 标签同风格 */
.copy-btn {
    background: rgba(33, 235, 255, 0.15);
    color: #21ebff;
    font-size: 0.65vw;
    padding: 2px 10px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    border: none;
    display: inline-flex;
    align-items: center;
    line-height: 1.4;
    transition: background 0.25s, color 0.25s;
}
.copy-btn:hover {
    background: rgba(33, 235, 255, 0.3);
    color: #fff;
}
.copy-btn.copied {
    background: rgba(255, 33, 192, 0.2);
    color: #ff21c0;
}

/* Toast 提示 */
.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9vw;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.box_center.light-mode .copy-toast {
    background: rgba(255, 255, 255, 0.85);
    color: #333;
    border-color: rgba(0, 0, 0, 0.1);
}
.box_center.light-mode .copy-btn {
    background: rgba(33, 235, 255, 0.15);
    color: #0a8a9a;
}
.box_center.light-mode .copy-btn:hover {
    background: rgba(33, 235, 255, 0.3);
    color: #333;
}
.box_center.light-mode .copy-btn.copied {
    background: rgba(255, 33, 192, 0.15);
    color: #d01890;
}
.blog-article code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85em;
}
.blog-article p code {
    background: rgba(33, 235, 255, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
}

/* 表格 */
.blog-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85vw;
}
.blog-article table th {
    background: rgba(255, 33, 192, 0.12);
    border: 1px solid rgba(255, 33, 192, 0.2);
    padding: 0.5rem 0.8rem;
    text-align: left;
    font-weight: 600;
}
.blog-article table td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0.8rem;
}

/* 图片占位 - 文本描述 */
.fig-placeholder {
    background: rgba(33, 235, 255, 0.04);
    border: 1px dashed rgba(33, 235, 255, 0.2);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin: 0.8rem 0;
    text-align: center;
    font-size: 0.85vw;
    color: #21ebff;
    opacity: 0.7;
}
.fig-caption {
    text-align: center;
    font-size: 0.78vw;
    opacity: 0.6;
    margin-top: -0.4rem;
    margin-bottom: 1rem;
}

/* 分隔装饰 */
.section-divider {
    text-align: center;
    margin: 2.5rem 0 1.5rem;
    opacity: 0.3;
    font-size: 1.2vw;
    letter-spacing: 8px;
    color: #ff21c0;
}

/* 文章底部 */
.blog-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.8vw;
    opacity: 0.6;
}

/* ===== 暗色 / 亮色 双主题 ===== */
/* 默认（暗色） */
.box_center.dark-mode {
    background-color: #434343ba !important;
    color: #f0f0f0 !important;
}
.box_center.dark-mode .blog-toc {
    background: rgba(33, 235, 255, 0.08);
    border-color: rgba(33, 235, 255, 0.2);
}
.box_center.dark-mode .blog-toc li { color: #c0c0c0; }
.box_center.dark-mode .feature-card {
    background: rgba(33, 235, 255, 0.06);
    border-color: rgba(33, 235, 255, 0.15);
}
.box_center.dark-mode .feature-card .card-label { color: #d0d0d0; }
.box_center.dark-mode .blog-article blockquote {
    background: rgba(255, 33, 192, 0.08);
}
.box_center.dark-mode .blog-article blockquote { color: #ddd; }
.box_center.dark-mode .fig-placeholder {
    background: rgba(33, 235, 255, 0.06);
    border-color: rgba(33, 235, 255, 0.25);
    color: #21ebff;
}
.box_center.dark-mode .blog-article pre {
    background: rgba(0, 0, 0, 0.45);
}
.box_center.dark-mode .blog-footer {
    border-top-color: rgba(255, 255, 255, 0.12);
    color: #aaa;
}
.box_center.dark-mode .blog-article table td {
    border-color: rgba(255, 255, 255, 0.12);
}
.box_center.dark-mode .blog-article p code {
    background: rgba(33, 235, 255, 0.15);
}
.box_center.dark-mode .highlight-cyan.bordered {
    background: rgba(33, 235, 255, 0.12);
    border-color: rgba(33, 235, 255, 0.3);
}

/* 亮色 */
.box_center.light-mode {
    background-color: rgba(255, 255, 255, 0.92) !important;
    color: #222 !important;
}
.box_center.light-mode .blog-toc {
    background: rgba(33, 235, 255, 0.07);
    border-color: rgba(33, 235, 255, 0.25);
}
.box_center.light-mode .blog-toc li { color: #444; }
.box_center.light-mode .feature-card {
    background: rgba(33, 235, 255, 0.06);
    border-color: rgba(33, 235, 255, 0.2);
}
.box_center.light-mode .feature-card .card-label { color: #333; }
.box_center.light-mode .blog-article blockquote {
    background: rgba(255, 33, 192, 0.07);
}
.box_center.light-mode .blog-article blockquote { color: #444; }
.box_center.light-mode .fig-placeholder {
    background: rgba(33, 235, 255, 0.06);
    border-color: rgba(33, 235, 255, 0.3);
    color: #0a7a8a;
    opacity: 0.9;
}
.box_center.light-mode .blog-article pre {
    background: rgba(0, 0, 0, 0.07);
    border-color: rgba(33, 235, 255, 0.2);
    color: #222;
}
.box_center.light-mode .blog-article pre .lang-tag {
    background: rgba(33, 235, 255, 0.2);
    color: #0a7a8a;
}
.box_center.light-mode .blog-footer {
    border-top-color: rgba(0, 0, 0, 0.12);
    color: #888;
}
.box_center.light-mode .blog-article table td {
    border-color: rgba(0, 0, 0, 0.12);
}
.box_center.light-mode .blog-article p code {
    background: rgba(33, 235, 255, 0.18);
    color: #0a5a6a;
}
.box_center.light-mode .section-divider { opacity: 0.5; color: #ff21c0; }
.box_center.light-mode .blog-article h3 { color: #0a8a9a; }
.box_center.light-mode .blog-brand { color: #0a8a9a; }
.box_center.light-mode .blog-toc .toc-title { color: #0a8a9a; }
.box_center.light-mode .blog-article blockquote strong { color: #d01890; }
.box_center.light-mode .blog-article table th {
    background: rgba(255, 33, 192, 0.1);
    border-color: rgba(255, 33, 192, 0.25);
}
.box_center.light-mode .blog-meta .tag {
    background: rgba(255, 33, 192, 0.1);
    border-color: rgba(255, 33, 192, 0.25);
    color: #d01890;
}
.box_center.light-mode .blog-tags .tag {
    background: rgba(255, 33, 192, 0.1);
    border-color: rgba(255, 33, 192, 0.25);
    color: #d01890;
}
.box_center.light-mode .highlight-cyan.bordered {
    background: rgba(33, 235, 255, 0.12);
    border-color: rgba(33, 235, 255, 0.3);
}

/* 全文链接覆盖（继承父级主题） */
.blog-article a {
    position: static;
    padding: 0;
    color: #21ebff;
    text-decoration: none;
    font-size: inherit;
    letter-spacing: normal;
    -webkit-box-reflect: unset;
    background: none;
    border: none;
}
.blog-article a:hover {
    background: none;
    color: #ff21c0;
    box-shadow: none;
}
.blog-article a::before,
.blog-article a::after {
    display: none;
}
.box_center.light-mode .blog-article a { color: #0a8a9a; }
.box_center.light-mode .blog-article a:hover { color: #d01890; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .box_center {
        width: 70%;
    }
    .blog-article {
        font-size: 1.4vw;
    }
    .blog-header h1 { font-size: 2.2vw; }
    .blog-brand { font-size: 1.4vw; }
    .blog-article h2 { font-size: 1.8vw; }
    .blog-article h3 { font-size: 1.5vw; }
    .blog-article pre { font-size: 1.2vw; }
    .feature-grid { grid-template-columns: 1fr; }
    .feature-card .card-num { font-size: 1.8vw; }
    .feature-card .card-label { font-size: 1.2vw; }
}

@media (max-width: 768px) {
            .box.left, .box.right { display: none; }
            .box_center { width: 96% !important; }
            .blog-article {
                font-size: 2.2vw;
                padding: 0 0.5rem 1rem;
            }
            .blog-header { padding-top: 0.8rem; }
            .blog-header h1 { font-size: 3.5vw; }
            .blog-brand { font-size: 2.4vw; }
            .blog-meta { font-size: 2vw; gap: 1rem; }
            .blog-meta .tag { font-size: 1.8vw; }
            .blog-tags .tag { font-size: 1.8vw; }
            .download-link { font-size: 1.8vw; }
            .blog-toc { padding: 0.8rem 1rem; }
    .blog-toc .toc-title { font-size: 2.5vw; }
    .blog-toc li { font-size: 2vw; }
    .blog-article h2 { font-size: 3vw; }
    .blog-article h3 { font-size: 2.6vw; }
    .blog-article h4 { font-size: 2.4vw; }
    .blog-article pre { font-size: 2vw; }
    .blog-article table { font-size: 2vw; }
    .feature-card .card-num { font-size: 3vw; }
    .feature-card .card-label { font-size: 2.2vw; }
    .section-divider { font-size: 3vw; }
    .blog-footer { font-size: 2vw; }
    .fig-placeholder { font-size: 2vw; }
    .fig-caption { font-size: 1.8vw; }

    /* 底部留空，避免被固定按钮遮挡内容 */
    .blog-footer {
        padding-bottom: 10vw;
    }
}

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

/* 下载链接 — 紧凑版（用于 meta 区） */
.download-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.2rem 0.8rem;
    border-radius: 6px;
    background: rgba(33, 235, 255, 0.1);
    border: 1px solid rgba(33, 235, 255, 0.25);
    color: #21ebff !important;
    font-size: 0.75vw;
    transition: background 0.3s, border-color 0.3s !important;
    text-decoration: none;
    white-space: nowrap;
}
.download-link:hover {
    background: rgba(255, 33, 192, 0.12) !important;
    border-color: #ff21c0 !important;
    color: #ff21c0 !important;
}
.box_center.light-mode .download-link {
    background: rgba(33, 235, 255, 0.12);
    border-color: rgba(33, 235, 255, 0.3);
    color: #0a8a9a !important;
}
.box_center.light-mode .download-link:hover {
    background: rgba(255, 33, 192, 0.1) !important;
    border-color: #d01890 !important;
    color: #d01890 !important;
}

/* 超小屏幕适配 (max-width: 480px) */
@media (max-width: 480px) {
    .box_center {
        width: 96%;
        padding: 0.6rem;
        border-radius: 0;
    }
    .blog-article {
        font-size: 3.8vw;
        padding: 0 0.3rem 0.8rem;
    }
    .blog-article h2 { font-size: 5vw; border-left-width: 3px; }
    .blog-article h3 { font-size: 4.5vw; }
    .blog-article h4 { font-size: 4vw; }
    .blog-header { padding: 1rem 0; }
    .blog-header h1 { font-size: 5.5vw; }
    .blog-brand { font-size: 4vw; }
    .blog-meta { font-size: 3vw; gap: 1.5vw; }
    .blog-meta .tag { font-size: 2.8vw; padding: 1px 8px; }
    .blog-tags .tag { font-size: 2.8vw; padding: 1px 8px; }
    .download-link { font-size: 2.8vw; }
    .blog-toc .toc-title { font-size: 4vw; }
    .blog-toc li { font-size: 3.2vw; }
    .blog-article pre { font-size: 3vw; padding: 0.8rem; }
    .blog-article table { font-size: 3vw; }
    .blog-article blockquote { padding: 0.5rem 0.8rem; }
    .blog-article pre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .blog-footer { font-size: 3vw; }
    .section-divider { font-size: 4vw; margin: 1.5rem 0; }
    .feature-card .card-num { font-size: 5vw; }
    .feature-card .card-label { font-size: 3.5vw; }
    .fig-placeholder { font-size: 3vw; }
    .fig-caption { font-size: 2.8vw; }
    .box_center img { width: 100%; }
    .copy-btn { font-size: 2.5vw; padding: 1px 6px; }
    .blog-article pre .lang-tag { font-size: 2.5vw; }
    /* 头像：更大更清晰 */
    .blog-avatar {
        min-width: 70px !important;
        min-height: 70px !important;
        max-width: 100px;
        max-height: 100px;
    }
    .blog-avatar-wrapper {
        margin-bottom: 0.4rem;
    }
    .blog-header {
        padding-top: 0.5rem;
    }
    /* 底部留出更多空间给固定按钮 */
    .blog-footer {
        padding-bottom: 14vw;
    }
}

/* ===== 返回按钮主题风格 ===== */
body.light-mode .return-btn {
    color: #0a8a9a;
    background: rgba(33, 235, 255, 0.1);
    border-color: rgba(33, 235, 255, 0.3);
}
body.light-mode .return-btn:hover {
    background: #ff21c0 !important;
    color: #fff !important;
    border-color: #ff21c0 !important;
}
body.dark-mode .return-btn {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.08);
    border-color: rgba(192, 132, 252, 0.25);
}
body.dark-mode .return-btn:hover {
    background: #ff21c0 !important;
    color: #111 !important;
    border-color: #ff21c0 !important;
}

/* ================================================================
   主题切换过渡动画
   ================================================================ */
/* main_blog.css 中的 .box_center 定义了 position:absolute 等，
   这里只追加 transition 以实现黑白切换渐变 */
.box_center {
    transition: background-color 0.8s ease, color 0.8s ease !important;
}
.box_center .blog-toc,
.box_center .blog-toc li,
.box_center .feature-card,
.box_center .feature-card .card-label,
.box_center .blog-article blockquote,
.box_center .fig-placeholder,
.box_center .blog-article pre,
.box_center .blog-footer,
.box_center .blog-article table td,
.box_center .blog-article table th,
.box_center .blog-article p code,
.box_center .blog-article h3,
.box_center .blog-brand,
.box_center .blog-toc .toc-title,
.box_center .blog-article blockquote strong,
.box_center .section-divider,
.box_center .blog-meta .tag,
.box_center .blog-tags .tag,
.box_center .blog-article a,
.box_center .copy-btn,
.box_center pre .lang-tag,
.box_center .download-link,
.box_center .blog-header,
.box_center .blog-article h2,
.box_center .blog-article h4,
.box_center .blog-article li,
.box_center .blog-article p {
    transition: background-color 0.8s ease,
                color 0.8s ease,
                border-color 0.8s ease,
                border-top-color 0.8s ease,
                opacity 0.8s ease;
}

/* left/right 侧栏背景遮罩 */
.box.left,
.box.right {
    transition: background-image 0.8s ease;
}

/* sidebar 文本 */
.box.left .text1,
.box.right .text1,
.box.left .text2,
.box.right .text2 {
    transition: color 0.6s ease;
}

/* ================================================================
   背景主题切换 — 白天 / 黑夜（双层交叉淡入淡出）
   ================================================================ */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

/* 双层背景 — 交叉淡入淡出 */
.bg-day,
.bg-night {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transition: opacity 1.2s ease;
    z-index: 0;
}

.bg-day { opacity: 1; }
.bg-night { opacity: 0; }

body.dark-mode .bg-day { opacity: 0; }
body.dark-mode .bg-night { opacity: 1; }

/* ────────────── 白天 ────────────── */
.bg-day {
    background: linear-gradient(
        180deg,
        #4FC3F7 0%,
        #64B5F6 18%,
        #81D4FA 35%,
        #90CAF9 50%,
        #B3E5FC 68%,
        #E1F5FE 85%,
        #F3F9FF 100%
    );
}

/* 云朵 (多层径向渐变) */
.bg-day::after {
    content: '';
    position: absolute;
    bottom: 0;
    will-change: transform;
    left: 0;
    width: 300%;
    height: 100%;
    background-image:
        radial-gradient(ellipse 22vw 7vw at 15% 80%, rgba(255,255,255,0.70) 0%, transparent 65%),
        radial-gradient(ellipse 16vw 5vw at 22% 76%, rgba(255,255,255,0.55) 0%, transparent 65%),
        radial-gradient(ellipse 20vw 6vw at 50% 60%, rgba(255,255,255,0.60) 0%, transparent 65%),
        radial-gradient(ellipse 14vw 5vw at 58% 56%, rgba(255,255,255,0.45) 0%, transparent 65%),
        radial-gradient(ellipse 18vw 6vw at 78% 72%, rgba(255,255,255,0.55) 0%, transparent 65%),
        radial-gradient(ellipse 12vw 5vw at 84% 68%, rgba(255,255,255,0.40) 0%, transparent 65%),
        radial-gradient(ellipse 24vw 8vw at 5% 50%, rgba(255,255,255,0.50) 0%, transparent 65%),
        radial-gradient(ellipse 16vw 6vw at 12% 46%, rgba(255,255,255,0.35) 0%, transparent 65%),
        radial-gradient(ellipse 18vw 6vw at 35% 85%, rgba(255,255,255,0.45) 0%, transparent 65%),
        radial-gradient(ellipse 12vw 4vw at 42% 82%, rgba(255,255,255,0.30) 0%, transparent 65%),
        radial-gradient(ellipse 20vw 7vw at 70% 40%, rgba(255,255,255,0.40) 0%, transparent 65%),
        radial-gradient(ellipse 14vw 5vw at 76% 37%, rgba(255,255,255,0.25) 0%, transparent 65%),
        radial-gradient(ellipse 16vw 5vw at 60% 90%, rgba(255,255,255,0.35) 0%, transparent 65%),
        radial-gradient(ellipse 10vw 4vw at 66% 87%, rgba(255,255,255,0.20) 0%, transparent 65%);
    background-repeat: repeat-x;
    animation: cloudDrift 50s linear infinite;
}

/* ────────────── 夜晚 ────────────── */
.bg-night {
    background: linear-gradient(
        180deg,
        #07071e 0%,
        #0a0a2e 12%,
        #0f0f3a 25%,
        #121248 38%,
        #0e0e35 52%,
        #090928 65%,
        #05051a 78%,
        #020210 100%
    );
}

/* 星空 (大量星星点) */
.bg-night::after {
    content: '';
    position: absolute;
    top: 0;
    will-change: opacity;
    left: 0;
    width: 100%;
    height: 60%;
    background-image:
        /* 第一层 — 亮星 */
        radial-gradient(1.2px 1.2px at 8% 5%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 12%, #fff 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 22% 3%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 18%, #fff 0%, transparent 100%),
        radial-gradient(1.2px 1.2px at 38% 8%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 25%, #fff 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 52% 4%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 58% 15%, #fff 0%, transparent 100%),
        radial-gradient(1.2px 1.2px at 65% 10%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 72% 22%, #fff 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 78% 6%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 28%, #fff 0%, transparent 100%),
        radial-gradient(1.2px 1.2px at 92% 14%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 97% 8%, #fff 0%, transparent 100%),
        /* 第二层 — 微亮星 */
        radial-gradient(0.8px 0.8px at 5% 30%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 12% 42%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 20% 35%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 28% 48%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 35% 38%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 42% 45%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 50% 32%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 56% 50%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 62% 28%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 70% 44%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 76% 36%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 82% 48%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 90% 40%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(0.8px 0.8px at 95% 50%, rgba(255,255,255,0.5) 0%, transparent 100%),
        /* 第三层 — 微弱星 */
        radial-gradient(0.5px 0.5px at 3% 55%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 10% 60%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 18% 52%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 25% 58%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 33% 55%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 40% 62%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 48% 50%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 55% 58%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 60% 54%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 68% 60%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 75% 52%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 80% 58%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 88% 56%, rgba(200,200,255,0.3) 0%, transparent 100%),
        radial-gradient(0.5px 0.5px at 93% 62%, rgba(200,200,255,0.3) 0%, transparent 100%);
    animation: starTwinkle 6s ease-in-out infinite alternate;
}

@keyframes cloudDrift {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-66.66%); }
}

@keyframes starTwinkle {
    0%   { opacity: 0.55; }
    50%  { opacity: 0.85; }
    100% { opacity: 0.60; }
}