/* 磨砂玻璃风格横幅样式 */
.glass-banner {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 100px auto 10px; /* 调整margin以适应顶部固定的导航栏 */
    padding: 40px 20px; /* 减少padding */
    text-align: center;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-banner::before,
.glass-banner::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 6s infinite;
}

.glass-banner::before {
    top: -50%;
    left: -150%;
    animation-delay: 0s;
}

.glass-banner::after {
    top: -50%;
    left: 50%;
    animation-delay: -3s;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.glass-banner h1 {
    font-size: 2rem; /* 减小标题字体 */
    color: #444;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.glass-banner p {
    font-size: 1.1rem; /* 减小描述字体 */
    color: #666;
    margin-bottom: 5px;
}

.container {
    max-width: 1200px; /* 减小最大宽度 */
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.main-content {
    width: 100%;
}

.post-list {
    list-style: none;
    padding: 0;
}

.post-item {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    height: 180px; /* 固定高度确保统一 */
    box-sizing: border-box; /* 确保padding不增加元素总高度 */
    width: 100%; /* 确保不超出容器 */
    overflow: hidden; /* 防止内容溢出 */
    max-width: 100%; /* 额外保障 */
}

.post-with-cover {
    display: flex;
    gap: 20px;
    width: 100%;
    height: 100%;
    box-sizing: border-box; /* 确保padding不增加元素尺寸 */
    overflow: visible; /* 允许图片悬停时放大效果可见 */
}

.post-cover-img {
    width: 150px;
    min-width: 150px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    align-self: flex-end; /* 修改为flex-end，使图片底部与内容对齐 */
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

@media screen and (max-width: 768px) {
    .post-cover-img {
        width: 100px !important; /* 移动端减小图片宽度 */
        min-width: 100px !important;
        height: 90px !important;
    }
}

.post-cover-img.loaded {
    opacity: 1;
}

.post-cover-img:hover {
    transform: scale(1.05);
    transform-origin: center;
    z-index: 10;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.post-content {
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    max-width: 100%; /* 确保不超出容器 */
    overflow-x: hidden; /* 防止水平溢出 */
    min-width: 0; /* 允许flex项目收缩 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* 修改为flex-start，使内容从顶部开始排列 */
    height: 100%; /* 确保内容区域高度与容器一致 */
}

.post-title {
    font-size: 0.8em; /* 相应调整标题字体大小 */
    word-break: break-word;
    overflow-wrap: break-word; /* 确保标题不溢出 */
    overflow-x: hidden;
    margin-bottom: 10px; /* 添加一些底部边距 */
    flex-shrink: 0; /* 防止标题区域被压缩 */
}

.post-excerpt {
    font-size: 0.8em; /* 缩小简介字体大小 */
    line-height: 1.4;
    overflow-wrap: break-word;
    overflow-x: hidden;
    flex-shrink: 0; /* 防止摘要区域被压缩 */
    margin-bottom: 10px; /* 添加一些底部边距 */
}

.post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.post-title a {
    color: #444;
    text-decoration: none;
    font-weight: 600;
}

.post-title a:hover {
    color: #666;
}

.post-meta {
    display: flex;
    justify-content: space-between; /* 分类信息移到右边 */
    align-items: flex-end; /* 修改为flex-end，使元数据对齐到底部 */
    margin-top: auto; /* 使用margin-top: auto将元数据推到底部 */
    flex-shrink: 0; /* 防止元数据区域被压缩 */
}

.post-date {
    color: #888;
    font-size: 0.9rem;
    flex-shrink: 0; /* 时间不收缩 */
}

.post-category {
    background: rgba(163, 201, 178, 0.3);
    color: #444;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    text-decoration: none;
    flex-shrink: 0; /* 分类不收缩 */
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tag {
    background: rgba(163, 201, 178, 0.2);
    color: #555;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    text-decoration: none;
}

.post-tag:hover {
    background: rgba(163, 201, 178, 0.5);
}

.author-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.author-name {
    font-size: 1.3rem;
    color: #444;
    margin-bottom: 10px;
}

.author-bio {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.author-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.author-link {
    color: #666;
    font-size: 1.2rem;
    text-decoration: none;
    transition: color 0.3s;
}

.author-link:hover {
    color: #444;
}

.filters {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-title {
    font-weight: 600;
    color: #444;
    font-size: 1.1rem;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    background: rgba(163, 201, 178, 0.3);
    color: #444;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tag:hover,
.filter-tag.active {
    background: rgba(163, 201, 178, 0.7);
    color: white;
}

.clear-filters {
    background: #a3c9b2;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.clear-filters:hover {
    background: #8bad97;
}

.hidden {
    display: none;
}

.loading, .error {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.2rem;
    color: #666;
}

.error {
    color: #e74c3c;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 16px;
    background: #ffffff; /* 默认白色 */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #444;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.page-btn:hover:not(:disabled) {
    background: #FFA07A; /* 橙色背景 */
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(163, 201, 178, 0.2);
}

.page-btn.active {
    background: #FFA07A; /* 橙色背景 */
    color: white;
    border-color: #FFA07A;
    box-shadow: 0 2px 6px rgba(163, 201, 178, 0.4);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(200, 200, 200, 0.3);
}

/* 上一页和下一页按钮 */
.page-btn.prev,
.page-btn.next {
    padding: 10px 12px;
}

.page-btn.prev::before {
    content: '<';
    font-family: "Arial", sans-serif;
}

.page-btn.next::after {
    content: '>';
    font-family: "Arial", sans-serif;
}

.pagination-info {
    padding: 10px 16px;
    color: #666;
    font-size: 0.95rem;
    margin: 0 10px;
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 140px;
    justify-content: center;
    height: 40px;
}

/* 移动端响应式设计 */
@media screen and (max-width: 768px) {
    .glass-banner {
        padding: 40px 10px;
        margin: 80px auto 20px;
        border-radius: 15px;
    }
    
    .glass-banner h1 {
        font-size: 1.8rem;
    }
    
    .glass-banner p {
        font-size: 1rem;
    }
    
    .container {
        padding: 5px;
        gap: 10px;
        grid-template-columns: 1fr; /* 移动端单列布局 */
        max-width: 100vw;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden; /* 防止水平溢出 */
    }
    
    .main-content, .sidebar {
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .post-item {
        height: auto; /* 移动端取消固定高度，允许自适应 */
        padding: 15px;
        flex-direction: column; /* 改为垂直布局 */
        box-sizing: border-box;
        width: 100%;
        min-height: auto;
        max-width: 100%; /* 确保不超出父容器 */
        overflow-x: hidden; /* 防止水平溢出 */
    }
    
    .post-with-cover {
        flex-direction: row; /* 图片和内容水平排列 */
        align-items: center; /* 垂直居中对齐 */
        width: 100%;
        box-sizing: border-box;
        max-width: 100%; /* 确保不超出容器 */
        overflow-x: hidden; /* 防止水平溢出 */
    }
    
    .post-cover-img {
        width: 100px !important; /* 设置图片宽度 */
        min-width: 100px !important;
        height: 80px !important;
        margin-bottom: 0 !important; /* 移除底部边距 */
        object-fit: cover;
        object-position: center;
    }
    
    .post-content {
        width: calc(100% - 120px); /* 剩余宽度给内容区域 */
        padding-left: 15px; /* 与图片留出间距 */
        box-sizing: border-box;
        overflow-wrap: break-word;
        max-width: 100%; /* 确保不超出容器 */
        overflow-x: hidden; /* 防止水平溢出 */
        font-size: 0.667em; /* 缩小字体为原来的2/3 */
    }
    
    .post-title {
        font-size: 1.2em; /* 恢复标题字体大小为相对于post-content的大小 */
        word-break: break-word;
        overflow-wrap: break-word; /* 确保标题不溢出 */
        overflow-x: hidden;
        margin-bottom: 5px; /* 减少标题底部间距 */
    }
    
    .post-excerpt {
        display: none; /* 隐藏文章简介 */
    }
    
    .post-meta {
        font-size: 1em; /* 恢复元数据字体大小为相对于post-content的大小 */
        flex-wrap: wrap; /* 允许元数据换行 */
        overflow-x: hidden;
    }
    
    .post-date {
        font-size: 0.6em; /* 缩小日期字体大小 */
    }
    
    .filter-tag {
        padding: 5px 10px;
        font-size: 0.85em;
    }
    
    /* 移动端分页优化 */
    .pagination {
        gap: 6px;
        margin-top: 20px;
        flex-wrap: wrap; /* 允许分页控件换行 */
    }
    
    .page-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-width: 36px;
        height: 36px;
    }
    
    .pagination-info {
        font-size: 0.85rem;
        padding: 8px 12px;
        min-width: 120px;
        height: 36px;
    }
    
    /* 额外的移动端内容保护 */
    .post-item {
        min-width: 0; /* 确保flex项目可以收缩 */
    }
    
    .post-content {
        min-width: 0; /* 确保flex项目可以收缩 */
    }
    
    .post-title a {
        word-break: break-word; /* 确保长标题能换行 */
        overflow-wrap: break-word;
    }
}

/* 闪烁光标样式 */
.blinking-cursor {
    animation: blink 1s infinite;
    margin-left: 4px;
    color: #444;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}