/* blog.css - 博客列表和管理页面样式 */

/* 基础样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: "Custom-CN-Bold", "Arial", sans-serif;
    min-height: 100vh;
    background: url('../../images/background5.jpg') no-repeat center center fixed;
    background-size: cover;
    color: white;
    overflow-x: hidden;
}

.CenterContainer {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 40px;
    min-height: 100vh;
}

/* 毛玻璃效果 */
.glassmorphism {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

#title {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    font-size: 3em;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    animation: fadeIn 1.2s ease-in-out;
}

/* 头部区域 */
.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.2);
}

.blog-count {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.back-home-btn,
.back-btn,
.new-blog-btn,
.action-button {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: inline-block;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.back-home-btn:hover,
.back-btn:hover,
.new-blog-btn:hover,
.action-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 博客卡片列表 */
.blog-list-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    position: relative;
}

/* 时间轴布局容器 */
.blog-item-wrapper {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 40px;
    align-items: center;
    position: relative;
}

/* 让整个卡片可点击 */
.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.blog-card {
    padding: 25px;
    border-radius: 20px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out;
    cursor: pointer;
    width: 95%;
    height: 280px;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateX(-10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.2);
}

.blog-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.blog-title {
    margin: 0;
    font-size: 1.6em;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

/* 移除原来的单独链接样式，因为整个卡片都可点击 */
.blog-card:hover .blog-title {
    color: #3498db;
}

/* 时间轴区域 */
.timeline-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    position: relative;
    padding: 20px 0;
}

/* 时间轴线条 - 连接相邻的dot */
.blog-item-wrapper:not(:last-child) .timeline-section::after {
    content: '';
    position: absolute;
    top: -120%;
    left: -7px;
    transform: translateY(50%);
    width: 3px;
    height: calc(100% + 240px);
    background: linear-gradient(180deg,
            rgba(52, 152, 219, 0.8) 0%,
            rgba(52, 152, 219, 0.4) 100%);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
    z-index: 1;
}

/* 时间轴圆点 */
.timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.8),
        0 0 40px rgba(52, 152, 219, 0.4);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.blog-item-wrapper:hover .timeline-dot {
    transform: scale(1.3);
    box-shadow: 0 0 30px rgba(52, 152, 219, 1),
        0 0 60px rgba(52, 152, 219, 0.6);
}

/* 时间轴日期 */
.timeline-date {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(52, 152, 219, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(52, 152, 219, 0.3);
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-weight: bold;
}

.blog-item-wrapper:hover .timeline-date {
    background: rgba(52, 152, 219, 0.35);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* 脉冲动画 */
@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(52, 152, 219, 0.8),
            0 0 40px rgba(52, 152, 219, 0.4);
    }

    50% {
        box-shadow: 0 0 30px rgba(52, 152, 219, 1),
            0 0 60px rgba(52, 152, 219, 0.6);
    }
}

.blog-summary {
    margin: 15px 0;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    min-height: 0;
}

.blog-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    flex-wrap: wrap;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    margin-top: auto;
}

/* 标签样式 */
.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.blog-tag {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    font-size: 0.85em;
    color: white;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.blog-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.blog-views,
.blog-updated {
    display: inline-block;
}

/* 博客操作按钮 */
.blog-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    display: inline-block;
    font-size: 0.9em;
    backdrop-filter: blur(5px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.edit-btn {
    border-color: #3498db;
    color: #3498db;
}

.edit-btn:hover {
    background: rgba(52, 152, 219, 0.2);
}

.publish-btn {
    border-color: #2ecc71;
    color: #2ecc71;
}

.publish-btn:hover {
    background: rgba(46, 204, 113, 0.2);
}

.delete-btn {
    border-color: #e74c3c;
    color: #e74c3c;
}

.delete-btn:hover {
    background: rgba(231, 76, 60, 0.2);
}

.draft-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(241, 196, 15, 0.9);
    color: white;
    border-radius: 15px;
    font-size: 0.75em;
    margin-left: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 无博客提示 */
.no-blogs {
    padding: 60px 20px;
    text-align: center;
    border-radius: 20px;
}

.no-blogs p {
    font-size: 1.3em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.new-blog-link {
    color: #3498db;
    text-decoration: none;
    font-size: 1.1em;
    padding: 10px 20px;
    background: rgba(52, 152, 219, 0.2);
    border-radius: 25px;
    display: inline-block;
    transition: all 0.3s;
    border: 1px solid #3498db;
}

.new-blog-link:hover {
    background: rgba(52, 152, 219, 0.3);
    transform: scale(1.05);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 20px;
}

.page-btn {
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.page-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.page-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .CenterContainer {
        padding: 60px 15px 30px;
    }

    #title {
        font-size: 2em;
        margin-bottom: 25px;
    }

    .blog-header {
        max-width: 80%;
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }

    /* 移动端时间轴布局调整：隐藏时间轴节点，改为纵向右对齐 */
    .blog-item-wrapper {
        max-width: 80%;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 12px;
    }

    .blog-card {
        width: 100%;
    }

    .timeline-section {
        width: 100%;
        justify-content: flex-end;
        padding: 0;
        margin: 0;
        gap: 8px;
    }

    .timeline-section::after {
        display: none;
    }

    .timeline-dot {
        display: none;
    }

    .timeline-date {
        font-size: 0.8em;
        padding: 6px 10px;
        text-align: right;
    }

    .blog-title {
        font-size: 1.3em;
    }

    .blog-card {
        padding: 20px;
        height: 260px;
    }

    .blog-card:hover {
        transform: translateX(-5px);
    }

    .header-actions {
        width: 100%;
    }

    .back-home-btn,
    .back-btn,
    .new-blog-btn {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    #title {
        font-size: 1.8em;
    }

    /* 超小屏幕时间轴布局 */
    .blog-item-wrapper {
        grid-template-columns: 1fr 100px;
        gap: 15px;
    }

    .timeline-section {
        gap: 8px;
    }

    .timeline-date {
        font-size: 0.75em;
        padding: 5px 8px;
    }

    .timeline-dot {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }

    /* 调整线条位置 */
    .blog-item-wrapper:not(:last-child) .timeline-section::after {
        right: 7px;
    }

    .blog-card {
        padding: 15px;
        height: 240px;
    }

    .blog-title {
        font-size: 1.2em;
    }

    .blog-meta {
        flex-direction: column;
        gap: 8px;
    }
}