/* css/home-style.css - 首页专用样式 */

/* 修复滚动条问题的全局样式 */
* {
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden; /* 隐藏HTML元素的滚动条 */
}

body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto; /* 只在body上显示垂直滚动条 */
    display: flex;
    flex-direction: column;
    background-color: var(--body-bg, #f8f9fa);
}

.container {
    width: 100%;
    max-width: 1800px; /* 从1600px增加到1800px，最大限度增加宽度 */
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    padding: 1.5rem 0;
    width: 100%;
    overflow: visible;
}

/* 搜索框区域 - 优化版 */
.search-section {
    max-width: 1200px; /* 从1000px增加到1200px */
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
}

.search-box-wrapper {
    background: white;
    border-radius: var(--radius);
    padding: 0.8rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--light-gray);
}

.search-form {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    z-index: 1;
    font-size: 0.95rem;
}

.search-input {
    width: 100%;
    padding: 0.7rem 0.9rem 0.7rem 2.5rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
    color: var(--dark);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-search-btn {
    padding: 0.7rem 1.2rem;
    background: var(--light-gray);
    color: var(--dark);
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: #e5e7eb;
}

/* 分类筛选 */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.category-filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 20px;
    background: white;
    color: var(--dark);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.category-filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.category-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* 数据统计区域 */
.stats-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 2rem auto;
    max-width: 100%; /* 从1400px改为100%充分利用空间 */
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--light-gray);
    min-width: 180px;
    flex: 1;
    max-width: 280px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-lighter);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.6rem;
    color: var(--primary);
    font-size: 1.1rem;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 500;
}

.stat-subinfo {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.3rem;
}

/* 当前筛选状态 */
.filter-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem auto;
    padding: 0.8rem;
    background: var(--primary-lighter);
    border-radius: var(--radius);
    font-size: 0.85rem;
    max-width: 1200px; /* 从1000px增加到1200px */
}

.filter-label {
    font-weight: 600;
    color: var(--dark);
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    background: white;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--dark);
}

.filter-remove {
    color: var(--gray);
    text-decoration: none;
    font-size: 0.75rem;
    margin-left: 0.2rem;
}

.filter-remove:hover {
    color: var(--dark);
}

.filter-clear {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
}

/* VIP提示 */
.vip-alert {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fbbf24;
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem auto;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    max-width: 1200px; /* 从1000px增加到1200px */
}

.vip-alert-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #f97316);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.vip-alert-content {
    flex: 1;
}

.vip-alert-title {
    font-weight: 600;
    color: #7c2d12;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.vip-alert-desc {
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 0.3rem;
}

/* 文章列表 - 最大限度增加宽度 */
.articles-list {
    max-width: 100% !important; /* 改为100%充分利用可用空间 */
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
}

/* 修改：为不可访问的文章添加特殊样式 */
.article-list-item {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    align-items: stretch;
    margin-bottom: 1.5rem;
    border: 1px solid var(--light-gray);
    text-decoration: none;
    color: inherit;
    width: 100%;
    min-height: 180px;
    height: auto;
    position: relative;
}

/* 修改：为不可访问的文章添加半透明覆盖层 */
.article-list-item.article-locked {
    opacity: 0.85;
    position: relative;
}

.article-list-item.article-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 1;
    pointer-events: none;
}

.article-list-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

/* 修改：锁定文章悬停效果减弱 */
.article-list-item.article-locked:hover {
    transform: translateY(0);
    box-shadow: var(--shadow);
    cursor: not-allowed;
}

.article-list-thumbnail {
    width: 260px; /* 从220px增加到260px */
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.list-thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-list-item:hover .list-thumbnail-image {
    transform: scale(1.05);
}

.list-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-lighter), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 2.2rem;
}

.article-list-badges {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 2;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-premium {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.badge-vip {
    background: linear-gradient(135deg, var(--accent), #f97316);
}

.badge-locked {
    background: linear-gradient(135deg, var(--gray), #6b7280);
}

.badge-external {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
}

/* 新增：不可访问提示标签 */
.access-restricted-badge {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    padding: 0.3rem 0.8rem;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.9), rgba(200, 35, 51, 0.9));
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* 文章内容区域 - 增加内边距 */
.article-list-content {
    flex: 1;
    padding: 1.8rem; /* 从1.5rem增加到1.8rem */
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.list-title {
    font-size: 1.3rem; /* 从1.25rem增加到1.3rem */
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.6rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 修改：锁定文章标题颜色变浅 */
.article-list-item.article-locked .list-title {
    color: var(--gray);
}

.list-excerpt {
    font-size: 1rem; /* 从0.95rem增加到1rem */
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* 从3行增加到4行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* 修改：锁定文章摘要颜色更浅 */
.article-list-item.article-locked .list-excerpt {
    color: #a0a0a0;
}

.list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.list-tag {
    padding: 0.2rem 0.6rem;
    background: #f5f5f5;
    color: var(--dark);
    border-radius: 8px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.list-tag:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.list-meta-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--gray);
    border-top: 1px solid var(--light-gray);
    padding-top: 0.8rem;
    margin-top: auto;
}

.list-category {
    background: var(--primary-lighter);
    color: var(--primary);
    padding: 0.2rem 0.7rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.list-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.list-views {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    font-weight: 500;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 3rem auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-lighter);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
    font-size: 2rem;
}

.empty-state h3 {
    margin-bottom: 0.8rem;
    color: var(--dark);
    font-size: 1.3rem;
}

.empty-state p {
    color: var(--gray);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--light-gray);
    border-radius: 6px;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-info {
    font-size: 0.9rem;
    color: var(--gray);
    margin-left: 1rem;
}

/* 永久会员专属区域 */
.permanent-vip-thank-section {
    background: #FFFDF6 !important;
    border: 1.5px solid #FFD700 !important;
    border-radius: 12px !important;
    margin-top: 2.5rem !important;
    padding: 1.5rem !important;
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.permanent-vip-alert {
    background: linear-gradient(135deg, #FFFDF6, #FFF9E6);
    border: 1.5px solid #FFD700;
}

.permanent-vip-alert .vip-alert-icon {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.permanent-vip-alert .vip-alert-title {
    color: #D4A017;
}

.permanent-vip-alert .vip-alert-desc {
    color: #996515;
}

/* 确保所有容器都没有不必要的滚动条 */
.search-section,
.articles-list,
.filter-status,
.stats-grid,
.pagination,
.main-content {
    overflow: visible;
}

/* 外链文章相关样式 */
.article-external .list-title {
    color: var(--primary) !important;
}

.article-external:hover {
    border-color: var(--primary) !important;
}

/* 大屏幕专用优化 - 进一步增加宽度 */
@media (min-width: 1600px) {
    .container {
        max-width: 1920px; /* 从1800px增加到1920px */
        padding: 0 2.5rem;
    }
    
    .articles-list {
        max-width: 100% !important;
    }
    
    .article-list-thumbnail {
        width: 280px; /* 从260px增加到280px */
    }
    
    .list-title {
        font-size: 1.35rem; /* 从1.3rem增加到1.35rem */
    }
    
    .list-excerpt {
        font-size: 1.05rem; /* 从1rem增加到1.05rem */
        -webkit-line-clamp: 5; /* 从4行增加到5行 */
    }
    
    .stats-grid {
        max-width: 100%;
        gap: 2rem;
    }
    
    .stat-card {
        min-width: 220px; /* 从180px增加到220px */
        max-width: 350px; /* 从280px增加到350px */
        padding: 1.5rem;
    }
}

/* 中等屏幕优化 */
@media (min-width: 1201px) and (max-width: 1599px) {
    .container {
        max-width: 1600px;
    }
    
    .article-list-thumbnail {
        width: 240px; /* 适当增加 */
    }
    
    .list-title {
        font-size: 1.25rem;
    }
    
    .list-excerpt {
        font-size: 0.98rem;
        -webkit-line-clamp: 4;
    }
}

/* 平板优化 */
@media (min-width: 769px) and (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 1.2rem;
    }
    
    .articles-list {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .article-list-thumbnail {
        width: 200px;
    }
    
    .list-title {
        font-size: 1.2rem;
    }
    
    .list-excerpt {
        font-size: 0.95rem;
        -webkit-line-clamp: 3;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    html {
        overflow: auto;
    }
    
    body {
        overflow-x: hidden;
        overflow-y: auto;
        display: block;
    }
    
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 0.5rem 0 1rem 0;
    }
    
    /* 移动端搜索区域优化 */
    .search-section {
        margin: 0.5rem auto 1rem;
        padding: 0 0.8rem;
    }
    
    .search-box-wrapper {
        padding: 0.7rem;
    }
    
    .search-form {
        flex-direction: column;
        gap: 0.6rem;
    }
    
    .search-input-wrapper {
        width: 100%;
    }
    
    .search-input {
        padding: 0.8rem 0.9rem 0.8rem 2.5rem;
        font-size: 0.9rem;
    }
    
    .search-btn, .clear-search-btn {
        width: 100%;
        padding: 0.8rem;
        justify-content: center;
    }
    
    .category-filter {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        margin: 0.8rem 0;
        gap: 0.4rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-filter-btn {
        white-space: nowrap;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* 移动端隐藏VIP提示区域 */
    .vip-alert {
        display: none !important;
    }
    
    /* 移动端统计区域调整 */
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        margin: 1rem auto;
        padding: 0 0.8rem;
    }
    
    .stat-card {
        padding: 0.8rem;
        min-width: auto;
        max-width: none;
    }
    
    .stat-number {
        font-size: 1.1rem;
    }
    
    .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* 文章列表移动端优化 */
    .articles-list {
        padding: 0 0.8rem;
        margin: 1rem auto;
        max-width: 100%;
    }
    
    .article-list-item {
        flex-direction: column;
        min-height: auto;
        height: auto;
    }
    
    .article-list-thumbnail {
        width: 100%;
        height: 140px;
    }
    
    .list-title {
        font-size: 1rem;
        -webkit-line-clamp: 2;
    }
    
    .list-excerpt {
        -webkit-line-clamp: 2;
        font-size: 0.8rem;
    }
    
    .list-meta-info {
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 0.7rem;
    }
    
    .list-views {
        margin-left: 0;
    }
    
    /* 筛选状态移动端优化 */
    .filter-status {
        flex-direction: column;
        align-items: flex-start;
        margin: 0.8rem auto;
        padding: 0.8rem;
        max-width: 100%;
    }
    
    .filter-clear {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .search-section {
        padding: 0 0.6rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.6rem;
    }
    
    .stat-number {
        font-size: 1rem;
    }
    
    .article-list-content {
        padding: 0.8rem;
    }
    
    .list-title {
        font-size: 0.95rem;
    }
    
    .list-excerpt {
        font-size: 0.78rem;
    }
}

/* 自定义滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}