/*
Theme Name: SMX Red Cross
Author: SMX Red Cross Team
Description: 三门峡市红十字会官方网站主题
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: smx-redcross
Tags: red, charity, responsive, custom-header, custom-menu, featured-images, translation-ready
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}

.header-top {
    background-color: #fff;
    border-bottom: 1px solid #eaeaea;
    padding: 8px 0;
    font-size: 12px;
    color: #999;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-main {
    background-color: #fff;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.header-main .container {
    width: 1300px;
    height: 180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-image: url('./images/slogan.jpg');
    background-repeat: no-repeat;
    background-position: right;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    max-width: 100%;
    height: auto;
}

.search-bar {
    display: flex;
    align-items: center;
    flex: 1;
    margin: 0 100px;
}

.search-bar input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px 0 0 20px;
    width: 200px;
    font-size: 14px;
}

.search-bar button {
    background-color: #DA251D;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
}

.slogan {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 452px;
    height: 170px;
}

.nav {
    background-color: #DA251D;
    padding: 10px 0;
}

.nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.nav li {
    padding: 0 20px;
}

.nav a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: block;
}

.nav a:hover {
    background-color: rgba(255,255,255,0.2);
}

/* --- 二级菜单样式优化 --- */
/* --- 二级菜单样式优化 (强制竖向排列版) --- */

/* 确保父菜单项有相对定位 */
.nav li.menu-item-has-children {
    position: relative;
}

/* 子菜单容器：强制重置为非 flex 布局 */
.nav ul li ul.sub-menu,
.nav ul ul {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #DA251D;
    width: 200px;           /* 固定宽度 */
    display: block !important; /* 强制覆盖一级菜单的 display: flex */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    list-style: none;
    margin: 0;
    padding: 5px 0;
}

/* 解决最右侧菜单溢出 */
.nav li.menu-item-has-children:last-child .sub-menu,
.nav li.menu-item-has-children:nth-last-child(2) .sub-menu {
    left: auto;
    right: 0;
}

/* 子菜单项：强制独占一行 */
.nav ul ul li {
    width: 100% !important;
    display: block !important; /* 确保 li 不会并排 */
    padding: 0;
    margin: 0;
    float: none;              /* 防止浮动导致并排 */
}

/* 子菜单链接样式 */
.nav ul ul a {
    padding: 12px 20px;
    display: block !important;
    text-align: left;
    font-size: 15px;
    font-weight: normal;
    color: white;
    white-space: normal;      /* 允许长文字换行 */
    line-height: 1.5;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1); /* 增加分割线辅助视觉 */
}

.nav ul ul li:last-child a {
    border-bottom: none;
}

/* 悬停显示 */
.nav li.menu-item-has-children:hover > .sub-menu,
.nav li.menu-item-has-children:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav ul ul a:hover {
    background-color: rgba(255,255,255,0.2) !important;
}
/* --- 内容区域样式 --- */

.main-content {
    max-width: 1300px;
    margin: 20px auto;
    padding: 0;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.ppt-sidebar{
    width: 50%;
}

.ppt-sidebar .section{
    margin-bottom: 10px;
}

.main-slider {
    margin-top: 10px;
    width: 700px;
    height: 400px;
    position: relative;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.slider-link {
    display: block;
    width: 100%;
    height: 100%;
}

.slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(218, 37, 29, 0.6);
    color: white;
    padding: 10px 15px;
    font-size: 14px;
}

.slider-dots {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    cursor: pointer;
}

.slider-dot.active {
    background-color: white;
}

.content-wrapper {
    flex: 1;
    margin-right: 0;
}

.sidebar {
    width: 290px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 1000px) {
    .sidebar {
        width: 30%;
    }
}

.section {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.content-wrapper .section {
    width: 100% !important;
}

.content-wrapper .single-title{
    font-size: 22px;
    padding:20px 0;
    text-align: center !important;
    width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #DA251D;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #DA251D;
    text-align: center;
}

.section-more {
    font-size: 12px;
    color: #999;
    text-decoration: none;
}

.news-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

.news-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.news-item:last-child {
    border-bottom: none;
}

.news-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 17px / 36px "微软雅黑";
}

.news-title a {
    color: #000000;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.news-title a:hover {
    color: #DA251D;
}

.news-title a[target="_blank"] i {
    font-style: normal;
    color: #999;
    margin-right: 5px;
}

.news-title a:not([target="_blank"])::before {
    content: "▶";
    display: inline-block;
    color: #999;
    margin-right: 5px;
    font-size: 12px;
    line-height: 1;
    position: relative;
    top: -1px;
}

.sidebar .section .news-title a:not([target="_blank"])::before {
    content: "›";
    display: inline-block;
    color: #DA251D;
    margin-right: 6px;
    width: 10px;
    height: 10px;
    font-weight: bold;
}

.sidebar .section .news-item:hover {
    background-color: #DA251D;
    color: white;
    border-radius: 4px;
}

.sidebar .section .news-item:hover .news-title a {
    color: white;
    font-weight: bold;
}

.sidebar .section .news-item:hover .news-date {
    color: white;
}

.news-date {
    color: #999;
    font-size: 12px;
    margin-left: 10px;
}

.tag-cloud {
    padding: 10px 0;
    line-height: 1.6;
}

.tag-cloud a {
    color: #DA251D;
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid #eee;
    border-radius: 3px;
    display: inline-block;
    margin: 3px;
    transition: all 0.3s ease;
}

.tag-cloud a:hover {
    background-color: #DA251D;
    color: white;
    border-color: #DA251D;
}

.post-meta {
    background-color: #f9f9f9;
    padding: 15px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

.post-meta a{
    color:rgb(104, 101, 101);
    text-decoration: none;
}

.post-meta span {
    margin-right: 15px;
}

.post-content {
    line-height: 1.8;
    font-size: 16px;
}

.post-navigation {
    width: 100%;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(50% - 10px);
}

.post-navigation .nav-previous {
    text-align: left;
    margin-right: 10px;
}

.post-navigation .nav-next {
    text-align: right;
    margin-left: 10px;
}

.post-navigation a {
    color: #DA251D;
    text-decoration: none;
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-navigation a:hover {
    text-decoration: underline;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination .nav-links {
    display: inline-block;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
}

.pagination .page-numbers.current {
    background-color: #DA251D;
    color: white;
    border-color: #DA251D;
}

.pagination a.page-numbers:hover {
    background-color: #f5f5f5;
}

.category-description {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.search-no-results {
    text-align: center;
    color: #666;
}

.quote-banner {
    background-color: #DA251D;
    color: white;
    border-radius: 4px;
    margin: 20px 0;
    position: relative;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    height: 137px;
}

.quote-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 1300px;
    height: 137px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.quote-slide.active {
    opacity: 1;
}

.quote-slide img {
    width: 1300px;
    height: 137px;
    object-fit: cover;
}

.quote-slider-dots {
    position: absolute;
    bottom: 10px;
    right: 20px;
    display: flex;
    gap: 5px;
    z-index: 2;
}

.quote-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    cursor: pointer;
}

.quote-dot.active {
    background-color: white;
}

.category-sections {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.footer-donation {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 20px auto;
    display: flex;
    gap: 20px;
    align-items: center;
    max-width: 1300px;
    padding-left: 20px;
    padding-right: 20px;
}

.donation-title {
    background-color: #DA251D;
    color: white;
    padding: 15px;
    border-radius: 4px;
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 18px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.donation-content {
    flex: 1;
    display: flex;
    gap: 20px;
}

.qr-code {
    width: 100px;
    height: 100px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.donation-info {
    flex: 1;
}

.donation-info img {
    height: 85%;
    margin-top: 15px;
}

.follow-us {
    background-color: #DA251D;
    color: white;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    min-width: 60px;
    margin-left: 20px;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
}

.follow-qr {
    width: 180px;
    height: 180px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden;
}

.follow-qr img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.follow-us h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.footer {
    background-color: #DA251D;
    color: white;
    text-align: center;
    padding: 30px 0;
    font-size: 14px;
    line-height: 180%;
}

.footer p {
    margin: 5px 0;
}

.footer a {
    color: white;
    text-decoration: none;
}

.footer a:link, .footer a:visited, .footer a:hover, .footer a:active {
    color: white;
    text-decoration: none;
}

.screen-reader-text {
    display: none !important;
}

/* --- 响应式适配 --- */

@media (max-width: 768px) {
    .header-main .container {
        flex-direction: column;
        text-align: center;
        height: auto;
        background-image: none;
    }
    
    .logo {
        margin-bottom: 15px;
        justify-content: center;
    }
    
    .search-bar {
        margin: 10px 0;
    }
    
    .slogan {
        position: static;
        transform: none;
        margin: 15px auto;
        text-align: center;
        max-width: 100%;
    }
    
    .nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav li {
        padding: 5px 10px;
    }
    
    .nav a {
        font-size: 16px;
        padding: 6px 10px;
    }
    
    .nav ul ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        width: 100%;
        box-shadow: none;
    }
    
    .nav li:hover > ul {
        display: block;
    }
    
    .main-content {
        flex-direction: column;
        padding: 0 10px;
    }
    
    .category-sections {
        grid-template-columns: 1fr;
    }
    
    .footer-donation {
        flex-direction: column;
    }
    
    .donation-title {
        writing-mode: horizontal-tb;
        text-align: center;
        padding: 10px;
    }
    
    .main-slider {
        width: 100%;
        height: auto;
        aspect-ratio: 7/4;
    }
    
    .sidebar {
        width: 100%;
    }

    .quote-slide, .quote-slide img {
        aspect-ratio: 1300/137;
        height: auto;
    }
}

@media (min-width: 1300px) {
    .header-top .container,
    .header-main .container,
    .nav ul,
    .main-content,
    .quote-banner,
    .footer-donation {
        max-width: 1300px;
    }
    
    .quote-slide {
        width: 1300px;
        height: 137px;
        left: calc(50% - 650px);
    }
}