﻿
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 100px;
}
/* =========================================
           3. Layout Structure (页面布局)
           ========================================= */
.page-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0; /* Prevent flex overflow */
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 900px) {
    .page-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}

/* =========================================
           4. Article Detail (文章详情)
           ========================================= */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.article-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.article-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.4;
    color: var(--text-main);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tag-pill {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.featured-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 30px;
    display: block;
}

/* Rich Text Content */
.article-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-main);
}

    .article-content p {
        margin-bottom: 20px;
        text-align: justify;
    }

    .article-content h2 {
        font-size: 22px;
        font-weight: bold;
        margin: 30px 0 15px;
        padding-left: 10px;
        border-left: 4px solid var(--color-primary);
    }

    .article-content h3 {
        font-size: 19px;
        font-weight: bold;
        margin: 25px 0 10px;
    }

    .article-content img {
        max-width: 100%;
        border-radius: 8px;
        margin: 20px 0;
    }

    .article-content blockquote {
        background: var(--bg-body);
        border-left: 4px solid var(--text-muted);
        margin: 20px 0;
        padding: 15px 20px;
        color: var(--text-muted);
        font-style: italic;
    }

    .article-content ul {
        margin-bottom: 20px;
        padding-left: 20px;
    }

    .article-content li {
        margin-bottom: 8px;
    }

/* Actions */
.article-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-btns button {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    margin-left: 10px;
    transition: all 0.2s;
}

    .share-btns button:hover {
        border-color: var(--color-primary);
        color: var(--color-primary);
    }

/* =========================================
           5. Sidebar Widgets (侧边栏)
           ========================================= */
.widget {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-list-small {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-item-small {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.news-thumb-small {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-body);
    flex-shrink: 0;
}

.news-info-small {
    flex: 1;
    min-width: 0;
}

.news-title-small {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-date-small {
    font-size: 12px;
    color: var(--text-light);
}

.ad-banner {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
    border-radius: 12px;
}

a.ad-btn {
    display: inline-block;
    margin-top: 15px;
    background: white;
    color: #d97706;
    padding: 8px 20px;
    border-radius: 99px;
    font-weight: bold;
    font-size: 14px;
}

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

body.dark .loading-overlay {
    background: rgba(0,0,0,0.8);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .article-card {
        padding: 20px;
    }

    .article-title {
        font-size: 24px;
    }

    .article-content {
        font-size: 16px;
    }
}
