/* ================= 全局与背景 ================= */
body {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%) !important;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

#home {
    max-width: 1200px;
    margin: 20px auto;
    background: transparent !important;
    box-shadow: none !important;
}

/* ================= 头部与导航 ================= */
#header {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#blogTitle h1 a {
    color: #ff79c1 !important;
    font-size: 28px !important;
    text-shadow: 2px 2px 4px rgba(255, 121, 193, 0.3);
}

#blogTitle h2 {
    color: #6272a4 !important;
}

#navList {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    padding: 10px;
    margin-top: 15px;
}

#navList li a {
    color: #bd93f9 !important;
    font-weight: bold;
    padding: 5px 15px !important;
    border-radius: 10px;
    transition: all 0.3s ease;
}

#navList li a:hover {
    background: rgba(255, 121, 193, 0.2);
    color: #ff79c1 !important;
    text-decoration: none;
}

/* ================= 主体内容区 (防溢出核心) ================= */
#main {
    display: flex;
    gap: 20px;
    background: transparent !important;
}

#mainContent {
    flex: 1;
    min-width: 0; /* 核心：防止Flex子元素内容溢出撑破容器 */
}

/* 文章卡片 */
.day, .post {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
    overflow: hidden; /* 防止内部元素撑破卡片 */
}

.postTitle a {
    color: #ff79c1 !important;
    font-size: 22px !important;
    font-weight: bold;
}

.postTitle a:hover {
    color: #bd93f9 !important;
    text-decoration: none;
}

.postBody {
    color: #44475a !important;
    line-height: 1.8;
    overflow-x: auto; /* 代码块横向滚动，防止纵向溢出 */
    word-wrap: break-word;
}

/* 图片防溢出与美化 */
.postBody img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 10px;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ================= 侧边栏 ================= */
.sidePanel {
    width: 280px;
    flex-shrink: 0; /* 防止侧边栏被压缩 */
}

#sidebar_news, sidebar_categories, #sidebar_recent_comments, #sidebar_recent_posts {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.catListTitle {
    color: #bd93f9 !important;
    font-size: 18px !important;
    border-bottom: 2px dashed #ff79c1 !important;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* ================= 滚动条美化 ================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(#ff79c1, #bd93f9);
    border-radius: 10px;
}

/* ================= 移动端适配 ================= */
@media (max-width: 768px) {
    #main {
        flex-direction: column;
    }
    .sidePanel {
        width: 100%;
    }
    #home {
        margin: 10px;
    }
}

/* ================= 博主信息模块 (author_profile) 终极修复版 ================= */

/* 1. 容器重置：优雅防溢出，保留阴影 */
#author_profile {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px !important;
    padding: 25px 20px !important;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.08); /* 阴影更柔和 */
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-sizing: border-box !important; /* 核心：padding 不增加总宽度 */
    text-align: center;
    /* 移除了 overflow: hidden，防止阴影和 hover 放大效果被裁剪 */
}

/* 兼容处理：防止外层容器背景干扰 */
#sidebar_recent_comments, #sidebar_shortcut, #sidebar_news {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

#author_profile img {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    object-fit: cover !important; /* 核心：无论原图比例，完美裁剪为圆形 */
    /*border: 3px solid rgba(255, 121, 193, 0.3) !important;*//*显示异常*/
    box-shadow: 0 4px 15px rgba(255, 121, 193, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 0 auto 15px auto !important;
    display: block !important; /* 确保居中 */
}

/* 头像悬停特效（现在不会被裁剪了） */
#author_profile img:hover {
    transform: scale(1.1) rotate(5deg);
    border-color: #ff79c1;
    box-shadow: 0 8px 25px rgba(255, 121, 193, 0.4);
}

/* 3. 昵称：防长文本撑破容器 */
#author_profile_nickname,
#author_profile a[href*="profile"] {
    font-size: 20px !important;
    font-weight: bold !important;
    color: #ff79c1 !important;
    text-decoration: none !important;
    margin-bottom: 10px;
    word-break: break-word; /* 允许长昵称自动换行 */
    display: block;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* 4. “+加关注”按钮：居中与美化 */
#author_profile_follow {
    margin: 15px 0 !important;
    text-align: center;
}

#author_profile_follow a,
#author_profile a[onclick*="follow"] {
    background: linear-gradient(135deg, #ff79c1, #bd93f9) !important;
    color: #fff !important;
    padding: 8px 24px !important;
    border-radius: 50px !important; /* 完美胶囊形状 */
    font-size: 14px !important;
    font-weight: bold;
    text-decoration: none !important;
    display: inline-block !important;
    box-shadow: 0 4px 15px rgba(255, 121, 193, 0.3);
    transition: all 0.3s ease;
    border: none !important;
}

#author_profile_follow a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 121, 193, 0.5);
}

/* 5. 统计数据（粉丝、关注等）：Flex 自适应防挤压 */
#author_profile_info {
    display: flex !important;
    justify-content: space-around;
    margin-top: 20px !important;
    padding-top: 15px;
    border-top: 1px dashed rgba(189, 147, 249, 0.4);
    flex-wrap: wrap; /* 核心：窄屏自动换行，绝不横向溢出 */
    gap: 10px;
}

#author_profile_info a,
#author_profile_info span {
    color: #6272a4 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    transition: color 0.3s;
}

#author_profile_info a:hover {
    color: #ff79c1 !important;
}

/* 6. 移动端适配 */
@media (max-width: 768px) {
    #author_profile {
        padding: 20px 15px !important;
    }
    #author_profile img {
        width: 75px !important;
        height: 75px !important;
    }
}