/* =========================================
   1. 全局基础样式
   ========================================= */
body {
    margin: 0;
    display: flex;
    flex-direction: column; 
    align-items: center;
    min-height: 100vh;
    padding: 0; 
    background-color: #f5f7fa;
    font-family: 'Open Sans', sans-serif;
    color: #333;
}

/* 通用卡片样式 */
.card-style {
    background: #fff;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
    border-radius: 8px;
    box-sizing: border-box;
}

/* =========================================
   2. 布局容器 (Flexbox)
   ========================================= */
.main-container {
    display: flex;
    gap: 30px;
    max-width: 1300px;
    width: 100%;
    align-items: flex-start;
    padding: 40px 20px; 
    box-sizing: border-box;
}

/* 左侧栏 (个人+状态) */
.profile-sidebar {
    flex: 0 0 260px;
    text-align: center; 
}

/* 中间栏 (首页文章列表) */
.center-column {
    flex: 1;
    min-width: 0;
}

/* 右侧栏 (照片墙) */
.right-sidebar {
    flex: 0 0 280px;
    position: sticky;
    top: 100px; 
}

/* --- 文章详情页专用布局 --- */
.content-area, .content-list {
    flex: 1;
    min-height: 800px; 
}

/* =========================================
   3. 组件样式
   ========================================= */

/* 头像与个人信息 */
.profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); 
    margin-bottom: 25px;
    transition: transform 0.3s;
}
.profile-image:hover { transform: scale(1.05); }

.profile-title, .profile-title a {
    font-family: 'Open Sans', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #2c3e50;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.red-line {
    width: 60px;
    height: 4px;
    background-color: #c00;
    margin: 0 auto 30px auto;
}

.profile-text {
    font-family: 'Noto Serif SC', serif;
    font-size: 16px;
    line-height: 1.8;
    text-align: left;
    margin-bottom: 20px;
    color: #555;
}

.back-link {
    display: inline-block;
    margin-top: 15px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 2px;
    transition: color 0.3s;
}
.back-link:hover { color: #c00; border-color: #c00; }

/* =========================================
   4. 文章列表与详情
   ========================================= */
.post-item {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}
.post-item:last-child { border-bottom: none; }

.post-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #222;
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: color 0.2s;
}
.post-title a { text-decoration: none; color: inherit; }
.post-title:hover, .post-title a:hover { color: #c00; }

.post-content, .article-body {
    font-family: 'Noto Serif SC', serif;
    font-size: 18px; /* 正文统一字号 */
    color: #333;
    line-height: 1.9;
    text-align: justify;
}
.post-content p, .article-body p { margin-bottom: 25px; }

.post-date, .article-meta {
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    color: #999;
    display: block;
    letter-spacing: 1px;
    margin-top: 10px;
}

/* 文章详情页头部 */
.article-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}
.article-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 10px;
}

/* 详情页返回按钮 */
.back-btn {
    display: inline-block;
    margin-top: 40px;
    color: #e74c3c;
    text-decoration: none;
    font-weight: bold;
    border: 1px solid #e74c3c;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s;
}
.back-btn:hover { background: #e74c3c; color: white; }

/* =========================================
   5. 图片与相册系统
   ========================================= */

/* 文章插图 (万能样式) */
.post-img {
    display: block;
    margin: 20px auto 8px;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 图片说明 */
.img-caption {
    display: block;
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-bottom: 30px;
    font-style: italic;
}

/* 照片墙网格 (Gallery) */
.photo-section { margin-bottom: 20px; }
.section-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 默认两列 */
    gap: 10px;
}
.photo-grid img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.3s ease;

}
.photo-grid img:hover { transform: translateY(-3px); }

/* =========================================
   6. 标签云 (Tags)
   ========================================= */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag {
    font-size: 12px;
    color: #555;
    background-color: #f2f2f2;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: default;
    transition: all 0.2s;
}
.tag:hover { background-color: #e0e0e0; color: #000; }

/* --- Bio List --- */
.bio-list {
    list-style: none;
    padding: 0;
    margin: 10px auto 30px;
    text-align: left;
    display: inline-block;
    max-width: 100%;
}

.bio-list li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
    line-height: 1.4;
    font-family: 'Open Sans', sans-serif;
}

.bio-icon {
    margin-right: 12px;
    font-size: 18px;
    min-width: 25px;
    text-align: center;
}

/* =========================================
   7. 响应式适配 (Media Queries)
   ========================================= */

@media (max-width: 1000px) {
    body {
        display: block !important; 
        padding: 0 !important;
        overflow-x: hidden; 
    }

    .main-container {
        display: block !important;
        width: 100% !important;
        padding: 20px !important;
    }

    .profile-sidebar, .center-column, .right-sidebar, .content-area, .content-list { 
        width: 100% !important; 
        flex: none !important; 
        margin-bottom: 30px;
    }
    
    .right-sidebar { position: static; }

    .card-style {
        padding: 20px !important;
    }

    img, .post-img {
        max-width: 100% !important; 
        height: auto !important;
    }

    /* 手机端导航适配 */
    .navbar {
        position: relative !important; 
    }
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    .nav-links {
        gap: 20px;
        font-size: 14px;
    }
    
    /* 手机端日历布局调整 */
    .calendar-page-layout {
        flex-direction: column !important;
    }
    .calendar-wrapper, .timeline-wrapper {
        width: 100% !important;
        border-right: none !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
    }
    .timeline-wrapper {
        margin-top: 30px;
        border-top: 1px solid #eee;
        padding-top: 30px;
    }
}

/* 相册页大屏适配 */
@media (min-width: 851px) {
    #fullPhotoAlbum {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    }
}

/* --- Twikoo 评论框精简 --- */
.tk-meta-input .el-input:nth-child(2),
.tk-meta-input .el-input:nth-child(3) {
    display: none !important;
}

.tk-meta-input .el-input:nth-child(1) {
    width: 100% !important; 
    border-radius: 4px !important; 
}

.tk-meta-input .el-input:nth-child(1) .el-input-group__append,
.tk-meta-input .el-input:nth-child(1) .el-input-group__prepend {
    border-radius: 4px !important;
}

/* --- 相册分类按钮样式 --- */
.filter-bar {
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #333;
    color: #333;
}

.filter-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* =========================================
   8. Lightbox (点击放大) 样式
   ========================================= */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    animation: zoomIn 0.3s;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    user-select: none;
}

.lightbox-close:hover {
    color: #e74c3c;
}

@keyframes zoomIn {
    from {transform: scale(0.8); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

/* =========================================
   9. 日历组件样式 (Calendar)
   ========================================= */
#calendar-container {
    font-family: 'Open Sans', sans-serif;
    user-select: none;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.calendar-title {
    font-weight: bold;
    color: #2c3e50;
    font-size: 20px;
}

.calendar-header button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    padding: 0 15px;
    transition: color 0.2s;
}
.calendar-header button:hover {
    color: #c00;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 13px; /* 字体改小 */
    font-weight: bold;
    color: #999;
    margin-bottom: 10px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px; /* [Fix] 间隙改小 (原8px) */
}

/* 日历格子 */
.calendar-days .day, .calendar-days .empty {
    min-height: 40px; /* [Fix] 高度改小 (原60px)，更紧凑 */
    aspect-ratio: 1/1; 
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px; /* [Fix] 字体改小 (原16px) */
    border-radius: 8px; /* 圆角改小 */
    color: #555;
    cursor: default;
    background-color: #fafafa;
    transition: 0.2s;
    position: relative; 
}

.calendar-days .day:hover {
    background-color: #eee;
}

/* "今天"的高亮 */
.calendar-days .day.today {
    background-color: #c00;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(204, 0, 0, 0.3);
}

/* 选中的日期 */
.calendar-days .day.selected {
    border: 2px solid #c00; 
    color: #c00;
    font-weight: bold;
}
.calendar-days .day.selected.today {
    background-color: #c00;
    color: #fff;
    border: 3px solid #800000;
}

/* 有事件的日期加红点 */
.calendar-days .day.has-event::after {
    content: '';
    position: absolute;
    bottom: 5px; /* 位置微调 */
    width: 4px; /* 点变小 */
    height: 4px;
    background-color: #e74c3c;
    border-radius: 50%;
}
.calendar-days .day.today.has-event::after {
    background-color: #fff;
}


/* =========================================
   10. 导航栏样式 (方案 A: 毛玻璃置顶)
   ========================================= */
.navbar {
    width: 100%;
    position: sticky; /* 吸附 */
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85); /* 半透明白 */
    backdrop-filter: blur(12px); /* 核心：毛玻璃 */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* 内容限制容器 */
.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
}

.nav-logo {
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    font-size: 22px;
    color: #2c3e50;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 35px;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-size: 15px;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s;
}

/* 动态下划线动画 */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: #c00;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover {
    color: #c00;
}

.nav-links a:hover::after {
    width: 100%;
}
/* =========================================
   🆕 新版日历样式 (Diary Mode)
   ========================================= */

/* 1. 布局容器 */
.diary-layout {
    display: flex;
    gap: 30px;
    height: 500px; /* 固定高度，内部滚动 */
    align-items: stretch;
}

/* 2. 左侧：日历面板 */
.calendar-panel {
    flex: 0 0 320px; /* 固定宽度 */
    border-right: 1px solid #eee;
    padding-right: 30px;
    display: flex;
    flex-direction: column;
}

/* 日历头部 */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}
.month-btn {
    background: #f5f5f5;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    transition: 0.2s;
}
.month-btn:hover { background: #e0e0e0; color: #000; }

/* 日历网格 */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

/* 日子格子 */
.day-cell {
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    color: #555;
}
.day-cell:hover { background-color: #f0f0f0; }

/* 状态：今天 */
.day-cell.is-today {
    color: #c00;
    font-weight: bold;
}

/* 状态：选中 (实心红圆) */
.day-cell.is-selected {
    background-color: #c00 !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(204, 0, 0, 0.3);
}

/* 状态：有事件 (底部小红点) */
.day-cell.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background-color: #c00;
    border-radius: 50%;
}
.day-cell.is-selected::after { display: none; } /* 选中时不显示红点 */


/* 3. 右侧：事件列表面板 */
.event-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fafafa;
    border-radius: 12px;
    padding: 20px;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}
.selected-date-display {
    font-family: 'Noto Serif SC', serif;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}
.event-count-badge {
    font-size: 12px;
    background: #e0e0e0;
    color: #555;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 滚动区域 */
.event-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}
/* 滚动条美化 */
.event-list-scroll::-webkit-scrollbar { width: 6px; }
.event-list-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* 事件卡片项 */
.diary-item {
    background: #fff;
    border-left: 3px solid #c00;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    transition: transform 0.2s;
}
.diary-item:hover { transform: translateX(5px); }

.diary-time { font-size: 12px; color: #999; margin-bottom: 5px; display: block; }
.diary-title { font-size: 15px; font-weight: bold; color: #2c3e50; display: block; margin-bottom: 8px; text-decoration: none; }
.diary-excerpt { font-size: 13px; color: #666; line-height: 1.6; }
.diary-link { font-size: 12px; color: #c00; margin-top: 8px; display: inline-block; text-decoration: none; }

/* 响应式适配 */
@media (max-width: 800px) {
    .diary-layout { flex-direction: column; height: auto; }
    .calendar-panel { width: 100%; border-right: none; border-bottom: 1px solid #eee; padding-right: 0; padding-bottom: 20px; flex: none; }
    .event-panel { min-height: 300px; }
}
.event-link-btn:hover { background: #a00; }


/* =========================================
   📸 文章内多图并排 (优化版)
   ========================================= */
.image-row {
    display: flex;
    justify-content: center; /* 居中 */
    gap: 8px;                /* 间隙变小 */
    flex-wrap: wrap;
    margin: 20px 0 10px 0;
}

.image-row img {
    flex: 0 1 auto;          /* 不要强行撑满，按需分配 */
    width: auto;             /* 宽度自适应 */
    max-width: 30%;          /* 一行最多放3张 (即使屏幕很宽) */
    height: 200px;           /* 🟢 关键：强制高度变小 */
    object-fit: cover;       /* 裁剪画面，整齐划一 */
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.image-row img:hover {
    transform: scale(1.02);  /* 鼠标悬停轻微放大 */
    filter: brightness(0.95);
}

/* 手机端适配：一行放2张 */
@media (max-width: 600px) {
    .image-row img {
        max-width: 48%; 
        height: 100px;       /* 手机上更小一点 */
    }
}