/* Articles list and detail page specific styles */

/* Common wrapper and ad styles - defined in page-specific.css */

/* Articles specific ad IDs */
#articles-list-right-top, #articles-list-right-bottom,
#articles-detail-right-top, #articles-detail-right-bottom {
    width: 100%;
    height: auto;
}

#articles-list-bottom, #articles-detail-bottom {
    width: 728px;
    height: 90px;
}

/* Ad positioning - defined in page-specific.css */

/* Common content container */
.page-content-container, .article-container {
    width: 100%;
    position: relative;
    flex-shrink: 0;
}

.page-title {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    text-align: left;
    margin-bottom: 24px;
}

/* Articles Grid Layout (List Page) */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 390px);
    gap: 30px;
    margin-top: 0;
    justify-content: center;
}

.article-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    width: 390px;
}

.article-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.article-item .article-thumbnail {
    width: 390px;
    height: 180px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
    flex-shrink: 0;
}

.article-item .article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.article-item .article-content {
    padding: 16px;
}

.article-item .article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
}

.article-item .article-source {
    color: #5182ED;
}

.article-item .article-time {
    color: #999;
}

.article-item h3 {
    font-size: 18px;
    font-weight: 600;
    color: #48484A;
    margin-bottom: 12px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-item p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
}

/* Pagination Styles (List Page) */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    padding: 20px 0;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
}

.pagination a:hover {
    background: #f5f5f5;
    border-color: #999;
}

.pagination .active {
    background: #5182ED;
    color: white;
    border-color: #5182ED;
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}


/* Article Detail Page Styles */

/* Breadcrumb navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #2196F3;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.breadcrumb a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #999;
    user-select: none;
}

.breadcrumb-current {
    color: #666;
    font-weight: 500;
}

.article-header {
    margin-bottom: 32px;
}

.article-title {
    font-size: 36px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #666;
    font-size: 14px;
}

.article-source {
    color: #5182ED;
    font-weight: 500;
}

.article-time {
    color: #999;
}

.article-detail-page .article-thumbnail {
    width: 100%;
    height: 400px;
    border-radius: 6px;
    overflow: hidden;
    margin: 20px 0;
}

.article-detail-page .article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-detail-page .article-content,
.article-content {
    font-size: 16px;
    line-height: 28px;
    color: #333;
}

.article-detail-page .article-content h1,
.article-content h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 20px;
    color: #333;
    line-height: 1.4;
}

.article-detail-page .article-content p,
.article-content p {
    margin-bottom: 16px;
}

.article-detail-page .article-content h2,
.article-content h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 32px 0 16px;
    color: #333;
}

.article-detail-page .article-content h3,
.article-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: #333;
}

.article-detail-page .article-content ul,
.article-detail-page .article-content ol,
.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.article-detail-page .article-content li,
.article-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Default image styles - for images not in paragraphs */
.article-detail-page .article-content img,
.article-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 6px;
}

/* Support multiple images in the same paragraph on PC */
/* Set font-size to 0 on paragraph to eliminate whitespace between inline-block images */
.article-detail-page .article-content p:has(img),
.article-content p:has(img) {
    font-size: 0;
    line-height: 0;
}

/* Force inline-block display for images inside paragraphs */
.article-detail-page .article-content p img,
.article-content p img {
    display: inline-block !important;
    vertical-align: top !important;
    margin: 10px 5px !important;
    height: auto !important;
    border-radius: 6px !important;
    font-size: 16px; /* Reset font-size for image alt text */
}

/* Single image in paragraph - full width */
.article-detail-page .article-content p img:only-child,
.article-content p img:only-child {
    max-width: 100% !important;
}

/* Two images in same paragraph - each takes ~50% width */
.article-detail-page .article-content p img:first-child:nth-last-child(2),
.article-detail-page .article-content p img:nth-child(2):nth-last-child(1),
.article-content p img:first-child:nth-last-child(2),
.article-content p img:nth-child(2):nth-last-child(1) {
    max-width: calc(50% - 10px) !important;
    width: calc(50% - 10px) !important;
}

/* Three images in same paragraph - each takes ~33% width */
.article-detail-page .article-content p img:first-child:nth-last-child(3),
.article-detail-page .article-content p img:nth-child(2):nth-last-child(2),
.article-detail-page .article-content p img:nth-child(3):nth-last-child(1),
.article-content p img:first-child:nth-last-child(3),
.article-content p img:nth-child(2):nth-last-child(2),
.article-content p img:nth-child(3):nth-last-child(1) {
    max-width: calc(33.333% - 10px) !important;
    width: calc(33.333% - 10px) !important;
}

.article-detail-page .article-content .video-container,
.article-content .video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin: 20px 0;
    border-radius: 6px;
    overflow: hidden;
}

.article-detail-page .article-content .video-container video,
.article-content .video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Iframe video styles - PC端 */
.article-detail-page .article-content iframe,
.article-content iframe {
    width: 810px;
    height: 455px; /* 16:9 比例 */
    max-width: 100%;
    margin: 20px 0;
    border-radius: 6px;
    border: none;
    display: block;
}

.image-gallery {
    display: flex;
    gap: 16px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.image-gallery.layout-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.image-gallery.layout-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.image-gallery img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 0;
}

.gallery-caption {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

/* Article Navigation (Detail Page) */
.article-navigation {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
    gap: 20px;
}

.nav-item {
    flex: 0 1 48%;
    max-width: 48%;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-item:hover:not(.disabled) {
    opacity: 0.7;
}

.nav-item.prev {
    justify-content: flex-start;
}

.nav-item.next {
    justify-content: flex-end;
    margin-left: auto;
}

.nav-arrow {
    font-size: 20px;
    color: #2196F3;
    flex-shrink: 0;
    line-height: 1.2;
    padding-top: 2px;
}

.nav-content {
    flex: 1;
}

.nav-item.prev .nav-content {
    text-align: left;
}

.nav-item.next .nav-content {
    text-align: right;
}

.nav-label {
    display: block;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.nav-title {
    display: block;
    font-size: 16px;
    color: #2196F3;
    font-weight: 500;
    line-height: 1.3;
}

.nav-item.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-item.disabled .nav-title {
    color: #999;
}

/* Mobile responsive styles */
@media screen and (max-width: 800px) {
    /* Iframe video styles - 移动端 */
    .article-detail-page .article-content iframe,
    .article-content iframe {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
    }

    /* On mobile, show images vertically even if multiple in same paragraph */
    .article-detail-page .article-content p img,
    .article-content p img {
        display: block !important;
        max-width: 100% !important;
        margin: 10px 0 !important;
    }

    .nav-item.next {
        justify-content: flex-end !important;
    }

    .nav-item.next .nav-content {
        text-align: right !important;
    }
}
