/*
Theme Name: 简洁新闻主题升级版
Theme URI: https://example.com
Description: 一个简洁现代的WordPress新闻模板，具有轮播图、广告小工具、智能摘要、社交分享、SEO优化等完整功能。升级版包含首页轮播图、侧边栏广告小工具、Facebook/X/Telegram分享、Logo管理、面包屑导航、结构化数据等先进特性。
Author: MiniMax Agent
Version: 2.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: simple-news-theme
Tags: news, magazine, responsive, custom-logo, custom-menu, featured-images, sticky-post, translation-ready, carousel, seo-optimized
*/

/* =========================================
   CSS重置和基础样式
   ========================================= */

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

ol, ul {
  list-style-type: none; /* 取消列表的编号或项目符号 */
  margin: 0;            /* 取消默认的外边距 */
  padding: 0;           /* 取消默认的内边距 */
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #212529;
    background-color: #ffffff;
}

a {
    color: #007BFF;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   页面布局
   ========================================= */

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

/* 头部样式 */
.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #E9ECEF;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    color: #212529;
}

.site-logo img {
    max-height: 40px;
    width: auto;
}

.site-description {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 24px;
}

.main-navigation a {
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.main-navigation a:hover {
    background-color: #f8f9fa;
}

/* 主内容区域 */
.site-main {
    padding: 40px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.featured-posts {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.featured-posts .section-title {
    font-size: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #007BFF;
    padding-left: 10px;
    color: #333;
}

.featured-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.featured-item {
    flex: 1 1 calc(20% - 20px);
    min-width: 180px;
}

.featured-thumb img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    transition: transform 0.3s ease;
}
.featured-thumb img:hover {
    transform: scale(1.05);
}

.featured-info {
    margin-top: 8px;
}
.featured-title {
    font-size: 15px;
    margin: 0 0 5px;
}
.featured-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}
.featured-title a:hover {
    color: #007BFF;
}
.featured-date {
    font-size: 13px;
    color: #6c757d;
}


/* =========================================
   Tab导航样式
   ========================================= */

.news-tabs {
    margin-bottom: 32px;
}

.tab-navigation {
    display: flex;
    border-bottom: 1px solid #E9ECEF;
    margin-bottom: 24px;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    color: #007BFF;
}

.tab-button.active {
    color: #007BFF;
    border-bottom-color: #007BFF;
}

.tab-content {
    min-height: 400px;
    position: relative;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #E9ECEF;
    border-top: 3px solid #007BFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* =========================================
   新闻卡片样式
   ========================================= */

.news-list {
    display: grid;
    gap: 24px;
}

.news-card {
    display: flex;
    background-color: #ffffff;
    border: 1px solid #E9ECEF;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #007BFF;
}

.news-thumbnail {
    flex: 0 0 200px;
    margin-right: 16px;
}

.news-thumbnail img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.news-content {
    flex: 1;
}

.news-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    color: #212529;
}

.news-excerpt {
    color: #6c757d;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #6c757d;
}

/* =========================================
   分页导航
   ========================================= */

.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination .nav-links {
    display: inline-flex;
    gap: 8px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #E9ECEF;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #007BFF;
    color: #ffffff;
    border-color: #007BFF;
}

.pagination .current {
    background-color: #007BFF;
    color: #ffffff;
    border-color: #007BFF;
}

/* =========================================
   侧边栏样式
   ========================================= */

.sidebar {
    background-color: #f8f9fa;
    padding: 24px;
    border-radius: 8px;
    height: fit-content;
}

.widget {
    margin-bottom: 32px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #212529;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 8px 0;
    border-bottom: 1px solid #E9ECEF;
}

.widget li:last-child {
    border-bottom: none;
}

/* =========================================
   单篇文章页面样式
   ========================================= */

.single-post .article-header {
    text-align: center;
    margin-bottom: 32px;
    border-bottom: 1px solid #E9ECEF;
}

.single-post .article-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
    color: #212529;
}

.single-post .article-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    color: #6c757d;
    font-size: 14px;
}

.single-post .article-content {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 40px;
}

.single-post .article-content h2,
.single-post .article-content h3,
.single-post .article-content h4 {
    margin: 24px 0 16px;
    color: #212529;
}

.single-post .article-content p {
    margin-bottom: 16px;
}

/* =========================================
   响应式设计
   ========================================= */

@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        /*flex-direction: column;*/
        gap: 16px;
    }
    
    .main-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    
    .news-card {
        flex-direction: column;
    }
    
    .news-thumbnail {
        flex: none;
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .tab-navigation {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-button {
        flex-shrink: 0;
        padding: 12px 16px;
    }
    
    .single-post .article-title {
        font-size: 24px;
    }
    
    .single-post .article-meta {
        justify-content: space-around;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .site-main {
        padding: 24px 0;
    }
    
    .news-card {
        padding: 12px;
    }
    
    .news-title {
        font-size: 16px;
    }
    
    .news-excerpt {
        font-size: 14px;
    }
    
    .tab-button {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* =========================================
   实用工具类
   ========================================= */

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

.hidden {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 动画和过渡效果 */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.slide-up {
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.5s ease-out forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =========================================
   首页轮播图样式
   ========================================= */

.carousel-container {
    width: 100%;
    margin-bottom: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.carousel-slide {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
}

.carousel-content {
    position: relative;
    z-index: 2;
    color: white;
    width: 100%;
}

.carousel-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.carousel-description {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 24px;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    max-width: 600px;
}

.carousel-btn {
    display: inline-block;
    background-color: #007BFF;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.carousel-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    color: white;
}

/* Swiper 自定义样式 */
.carousel-swiper .swiper-pagination-bullet {
    background-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
    width: 12px;
    height: 12px;
}

.carousel-swiper .swiper-pagination-bullet-active {
    background-color: #007BFF;
}

.carousel-swiper .swiper-button-next,
.carousel-swiper .swiper-button-prev {
    color: white;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    transition: all 0.3s ease;
}

.carousel-swiper .swiper-button-next:hover,
.carousel-swiper .swiper-button-prev:hover {
    background-color: rgba(0, 123, 255, 0.8);
}

.carousel-swiper .swiper-button-next::after,
.carousel-swiper .swiper-button-prev::after {
    font-size: 18px;
    font-weight: 700;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .carousel-container {
        margin-bottom: 24px;
        border-radius: 4px;
    }
    
    .carousel-title {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .carousel-description {
        font-size: 16px;
        margin-bottom: 16px;
    }
    
    .carousel-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .carousel-swiper .swiper-button-next,
    .carousel-swiper .swiper-button-prev {
        display: none;
    }
}

/* =========================================
   面包屑导航样式
   ========================================= */

.breadcrumb-navigation {
    margin-bottom: 24px;
    padding: 12px 0;
    border-bottom: 1px solid #E9ECEF;
    
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: #007BFF;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.breadcrumb-item.current span {
    color: #6c757d;
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #6c757d;
}

@media (max-width: 768px) {
    .breadcrumb-navigation {
        margin-bottom: 16px;
        padding: 8px 0;
    }
    
    .breadcrumb-list {
        font-size: 13px;
    }
    
    .breadcrumb-separator {
        margin: 0 6px;
    }
}
