/* MEGAFAN Theme Styles */

:root {
    --primary-color: #0066cc;
    --secondary-color: #004d99;
    --accent-color: #ff6600;
    --text-color: #333;
    --light-text: #666;
    --dark-text: #1a1a1a;
    --border-color: #e0e0e0;
    --bg-color: #f9f9f9;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    padding-top: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 50px 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
    z-index: 10;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

header h1 a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
    display: inline-block;
}

header h1 a:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

nav {
    margin-top: 20px;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-block;
}

nav a:hover,
nav a[aria-current=page] {
    background-color: rgba(255,255,255,0.25);
}

/* Main Content */
main {
    max-width: 900px;
    margin: 50px auto;
    padding: 0 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding-bottom: 40px;
    position: relative;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 50px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
    background: #f8fbff;
    border-radius: 8px;
}

.hero h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.hero p {
    color: var(--light-text);
    font-size: 1.1rem;
}

/* Article Preview */
.articles h3 {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-left: 20px;
}

.article-preview {
    padding: 25px 20px 25px 30px;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s;
    position: relative;
}

.article-preview:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.article-preview h2 {
    margin-bottom: 15px;
    padding-right: 20px;
}

.article-preview h2 a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.6rem;
    transition: color 0.3s;
    display: inline-block;
}

.article-preview h2 a:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.article-meta {
    color: var(--light-text);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.article-meta span {
    margin-right: 15px;
    display: inline-flex;
    align-items: center;
}

.article-preview p {
    color: var(--light-text);
    margin-bottom: 20px;
}

.read-more {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
}

.read-more:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.article-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
    font-size: 0.85em;
    margin-bottom: 15px;
    font-weight: 600;
}

.blog-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 15px;
    font-size: 0.85em;
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #f0f7ff, #e6f2ff);
    padding: 40px 20px;
    border-radius: 8px;
    text-align: center;
    margin: 40px 0;
}

.cta-section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.cta-section p {
    color: var(--light-text);
    margin-bottom: 25px;
    font-size: 1.1rem;
}

/* Advantages */
.advantages {
    margin: 40px 0;
}

.advantages h2 {
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 10px;
}

.advantages > p {
    text-align: center;
    color: var(--light-text);
    margin-bottom: 30px;
}

.advantage-card {
    padding: 20px;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.advantage-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.advantage-card .icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.advantage-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.advantage-card p {
    color: var(--light-text);
}

/* Contact CTA */
.contact-cta {
    text-align: center;
    padding: 40px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
}

.contact-cta h2 {
    margin-bottom: 15px;
}

.contact-cta p {
    opacity: 0.9;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.contact-cta .btn {
    background: white;
    color: var(--primary-color);
}

.contact-cta .btn:hover {
    background: #f0f0f0;
}

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
}

footer p {
    margin-bottom: 10px;
    margin: 10px 0;
}

footer a {
    color: white;
    text-decoration: underline;
}

/* Pagination */
.pagination {
    text-align: center;
    margin: 30px 0;
}

.pagination a {
    display: inline-block;
    padding: 10px 20px;
    background: var(--bg-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 4px;
    margin: 0 10px;
    transition: all 0.3s;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Tags and Categories */
.categories {
    margin: 15px 0;
}

.categories a {
    display: inline-block;
    padding: 5px 12px;
    background: #f0f0f0;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.85rem;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.categories a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Article Detail Page */
.article-content {
    padding: 40px 30px;
    position: relative;
}

.article-content header {
    background: none;
    color: var(--text-color);
    padding: 0;
    box-shadow: none;
    text-align: left;
    margin-bottom: 30px;
}

.article-content header h1 {
    color: var(--dark-text);
    font-size: 2.8rem;
    margin-bottom: 15px;
    line-height: 1.3;
    font-weight: 700;
    position: relative;
    z-index: 20;
    padding: 10px 0;
}

.article-content > header {
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 5px solid var(--primary-color);
}

.article-content > header h1 {
    position: relative;
    z-index: 10;
    color: var(--dark-text);
}

.article-body {
    margin-top: 40px;
    position: relative;
    z-index: 5;
}

.article-body h1 {
    color: var(--dark-text);
    font-size: 2.5rem;
    margin-top: 50px;
    margin-bottom: 20px;
    line-height: 1.3;
    font-weight: 700;
    position: relative;
    z-index: 20;
    padding-top: 20px;
}

.article-body h2 {
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-top: 50px;
    margin-bottom: 20px;
    line-height: 1.3;
    font-weight: 600;
    padding: 10px 0;
    border-bottom: 3px solid var(--border-color);
}

.article-body h3 {
    color: var(--secondary-color);
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 15px;
    line-height: 1.3;
    font-weight: 600;
    padding-left: 15px;
    border-left: 4px solid var(--primary-color);
}

.article-body h4 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 10px;
    font-weight: 600;
}

.article-body p {
    margin-bottom: 18px;
    line-height: 1.8;
    font-size: 1.05rem;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.article-body th,
.article-body td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.article-body th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
}

.article-body tr:hover {
    background: #f8fbff;
}

.article-body ul,
.article-body ol {
    margin: 15px 0 25px 30px;
}

.article-body li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.article-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

/* Anchor links */
.article-body h1::before,
.article-body h2::before,
.article-body h3::before {
    content: "";
    display: block;
    height: 80px;
    margin-top: -80px;
    visibility: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    nav ul {
        flex-wrap: wrap;
    }
    
    .article-preview {
        padding: 20px 15px;
    }
    
    .article-preview h2 a {
        font-size: 1.4rem;
    }
    
    .article-content header h1 {
        font-size: 2rem;
    }
    
    .article-content > header {
        padding: 20px;
    }
    
    .article-body h1 {
        font-size: 2rem;
    }
    
    .article-body h2 {
        font-size: 1.8rem;
    }
    
    .article-body h3 {
        font-size: 1.5rem;
    }
    
    main {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 30px 15px;
    }
    
    header h1 {
        font-size: 1.6rem;
    }
    
    .article-content header h1 {
        font-size: 1.6rem;
    }
    
    .article-body h1 {
        font-size: 1.6rem;
    }
    
    .article-body h2 {
        font-size: 1.4rem;
    }
}

/* 图片大小控制 */
.article-content img,
.article-body img {
    max-width: 75%;
    height: auto;
    display: block;
    margin: 20px auto;
}

/* 特定图片的额外样式 */
figure {
    text-align: center;
    margin: 30px 0;
}

figure img {
    max-width: 70%;
    height: auto;
}

