/* ========================================
   Index Page Styles - 首页
   ======================================== */

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #1a252f);
    color: white;
    padding: 4rem 5%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    text-align: center;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-top: 2rem;
    flex-wrap: nowrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.hero-stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Section */
.section {
    padding: 4rem 5%;
}

.topics {
    padding: 4rem 5%;
}

.articles {
    padding: 4rem 5%;
}

.articles-container {
    max-width: 1440px;
    margin: 0 auto;
}

.articles-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.section-subtitle {
    color: var(--text-light);
}

/* Topic Cards Grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.topic-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.topic-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.topic-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    position: relative;
}

.topic-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35px;
    background: linear-gradient(to top, white, transparent);
}

.topic-image.ai-tools { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.topic-image.ai-writing { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.topic-image.ai-workflow { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.topic-image.tutorials { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }

.topic-content {
    padding: 1.25rem;
}

.topic-content h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.topic-content p {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.5;
    height: 3em; /* 两行高度，line-height 1.5 * 0.85rem * 2 ≈ 2.55em，取整 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

.topic-meta {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
}

.topic-stats {
    font-size: 0.8rem;
    color: var(--text-light);
}

.topic-arrow {
    color: var(--secondary-color);
    font-size: 0.8rem;
    transition: transform 0.3s;
}

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

.topic-footer {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
}

.topic-stats {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Article Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.6rem 1.5rem;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-light);
    transition: all 0.3s;
}

.tab-btn:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.tab-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

/* Article Cards Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.article-header {
    padding: 1.25rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.article-topic-badge {
    background: var(--secondary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.7rem;
    text-decoration: none;
}

.article-title {
    font-size: 1.1rem;
    line-height: 1.4;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-excerpt {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-footer {
    padding: 0.75rem 1.25rem;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid var(--border-color);
}

.article-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.article-tag {
    background: var(--light-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-light);
}

.article-info-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* More Link */
.more-link {
    text-align: center;
    margin-top: 2.5rem;
}

.more-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: white;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.more-link a:hover {
    background: var(--secondary-color);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 2rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-stat-number {
        font-size: 2rem;
    }

    .hero-stat-label {
        font-size: 0.8rem;
    }
    
    .section {
        padding: 3rem 5%;
    }
    
    .tabs {
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
}
