/* ============== 全局样式优化 ============= */
:root {
    --main-color: #4a5568;    /* 中性主色 */
    --second-color: #2d3748;  /* 深灰色 */
    --text-color: #718096;    /* 中性文本色 */
    --white-color: #ffffff;
    --bg-light: #f7fafc;
    --border-color: #e2e8f0;
    --success-color: #38a169; /* 成功色 */
    --warning-color: #d69e2e;  /* 警告色 */
}

/* ============ 响应式基础设置 ============ */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--second-color);
    background-color: var(--white-color);
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 0 15px;
    margin: 0 auto;
}

/* ============ 通用卡片样式优化 ============ */
.top-post-card,
.feature-card,
.news-card,
.instagram-card {
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.top-post-card:hover,
.feature-card:hover,
.news-card:hover,
.instagram-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--main-color);
}

/* ============ 顶部文章卡片优化 ============ */
.top-post-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.post-img {
    flex: 0 0 80px;
    border-radius: 8px;
    overflow: hidden;
}

.post-img img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.top-post-card:hover .post-img img {
    transform: scale(1.05);
}

.top-post-details {
    flex: 1;
    min-width: 0;
}

.top-post-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--second-color);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.top-post-title:hover {
    color: var(--main-color);
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-color);
    margin: 0;
}

/* ============ 新闻卡片优化 ============ */
.news-card {
    position: relative;
    overflow: hidden;
}

.news-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-details {
    padding: 1.5rem;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--second-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-title:hover {
    color: var(--main-color);
}

/* ============ 特色区域优化 ============ */
.feature-news-img {
    position: relative;
    overflow: hidden;
}

.feature-news-img img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-news-img img {
    transform: scale(1.05);
}

.feature-card-inner {
    padding: 1.5rem;
}

.feature-post-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--second-color);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 0.5rem;
}

.feature-post-title:hover {
    color: var(--main-color);
}

.cat-date {
    font-size: 0.85rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

/* ============ 社交价值区域优化 ============ */
.social-value-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--second-color);
    transition: all 0.3s ease;
}

.social-value-name:hover {
    background-color: var(--bg-light);
    color: var(--main-color);
}

.parent-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-color);
    font-size: 1.2rem;
}

/* ============ Instagram 卡片优化 ============ */
.instagram-card {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.instagram-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.insta-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-color);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.instagram-card:hover .insta-info {
    opacity: 1;
}

.instagram-card:hover img {
    transform: scale(1.1);
}

/* ============ 网格布局优化 ============ */
.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

/* ============ 页面标题区域优化 ============ */
.page-banner {
    background: linear-gradient(135deg, var(--bg-light) 0%, #edf2f7 100%);
    padding: 3rem 0;
}

.page-title {
    text-align: center;
}

.page-ban-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--second-color);
    margin-bottom: 1rem;
}

.page-url {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.old-page {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.old-page:hover {
    color: var(--main-color);
}

/* ============ 分类列表优化 ============ */
.inner-category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--second-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.inner-category-link:hover {
    background-color: var(--bg-light);
    color: var(--main-color);
}

/* ============ 分页优化 ============ */
.pagination-ul {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    padding: 2rem 0;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.pagination-link:hover {
    background-color: var(--main-color);
    color: var(--white-color);
    border-color: var(--main-color);
}

/* ============ 移动端优化 ============ */
@media (max-width: 768px) {
    /* 基础布局调整 */
    .container {
        padding: 0 1rem;
    }
    
    /* 卡片布局调整 */
    .top-post-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .post-img {
        flex: none;
        width: 100%;
        max-width: 200px;
    }
    
    .post-img img {
        height: 120px;
    }
    
    /* 网格布局调整 */
    .grid-5 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* 页面标题调整 */
    .page-banner {
        padding: 2rem 0;
    }
    
    .page-ban-content h2 {
        font-size: 2rem;
    }
    
    /* 新闻卡片调整 */
    .news-img img {
        height: 150px;
    }
    
    .news-details {
        padding: 1rem;
    }
    
    /* 特色卡片调整 */
    .feature-news-img img {
        height: 180px;
    }
    
    .feature-card-inner {
        padding: 1rem;
    }
    
    /* 社交价值区域调整 */
    .social-value-name {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .parent-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    /* 分页调整 */
    .pagination-ul {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination-link {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    /* 小屏幕进一步优化 */
    .grid-5 {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .page-ban-content h2 {
        font-size: 1.75rem;
    }
    
    .top-post-title {
        font-size: 0.9rem;
    }
    
    .feature-post-title {
        font-size: 1.1rem;
    }
    
    .news-title {
        font-size: 1rem;
    }
    
    /* 触摸友好的点击区域 */
    .top-post-card,
    .news-card,
    .feature-card {
        margin-bottom: 0.75rem;
    }
    
    a, button, .pagination-link {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============ 深色模式支持 ============ */
@media (prefers-color-scheme: dark) {
    :root {
        --main-color: #a0aec0;
        --second-color: #e2e8f0;
        --text-color: #cbd5e0;
        --white-color: #2d3748;
        --bg-light: #1a202c;
        --border-color: #4a5568;
    }
    
    body {
        background-color: #1a202c;
        color: #e2e8f0;
    }
}

/* ============ 性能优化 ============ */
img {
    max-width: 100%;
    height: auto;
}

/* 减少重排 */
.top-post-card,
.news-card,
.feature-card {
    will-change: transform;
}

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

/* ============ 无障碍访问优化 ============ */
/* 焦点状态 */
a:focus,
button:focus,
.pagination-link:focus {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

/* 跳过链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--main-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
    :root {
        --main-color: #000000;
        --second-color: #000000;
        --border-color: #000000;
    }
    
    .top-post-card,
    .news-card,
    .feature-card {
        border-width: 2px;
    }
}

/* ============ 打印样式优化 ============ */
@media print {
    .top-post-card,
    .news-card,
    .feature-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .insta-info {
        position: relative;
        opacity: 1;
        background: none;
        color: #000;
    }
}

/* ============ 加载状态优化 ============ */
/* 图片懒加载占位符 */
.post-img,
.news-img,
.feature-news-img {
    background: var(--bg-light);
    position: relative;
    overflow: hidden;
}

.post-img::before,
.news-img::before,
.feature-news-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150px;
    height: 100%;
    width: 150px;
    /*background: linear-gradient(*/
    /*    to right,*/
    /*    transparent 0%,*/
    /*    rgba(255,255,255,0.6) 50%,*/
    /*    transparent 100%*/
    /*);*/
    animation: load 1.5s infinite;
}

@keyframes load {
    from {
        left: -150px;
    }
    to {
        left: 100%;
    }
}