/* ========== 基础样式 ========== */
:root {
    --primary-green: #38a660;
    --light-green: #6c9f3d;
    --dark-green: #1e7e34;
    --accent-pink: #e91e63;
    --nav-gradient: linear-gradient(135deg, #4CAF50, #45a049);
    --header-height: 70px;
    --tabs-height: 60px;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    font-weight: 400;
    max-width: 100vw !important;
    height: 100vh;
    background-color: #F6F6F6;
    overflow-x: hidden;
}

/* ========== 主要内容区域 ========== */
.main-content {
    padding: 0;
    min-height: calc(100vh - 70px - 440px - 60px); /* 减去头部导航、轮播图和标签导航的高度 */
}

.page-title {
    color: var(--primary-green);
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

/* ========== 面包屑导航 ========== */
.breadcrumb-nav {
    padding: 10px 0;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.breadcrumb-item {
    color: #666;
}

.breadcrumb-item.active {
    color: var(--primary-green);
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #999;
}

/* ========== 标签页导航 - 二级吸顶效果 ========== */
.tabs-container {
    width: 100vw;
    height: var(--tabs-height);
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: -webkit-sticky; /* Safari支持 */
    position: sticky;
    top: var(--header-height);
    z-index: 998;
    margin-left: calc(-50vw + 50%); /* 使元素突破容器限制，实现全宽 */
    margin-right: calc(-50vw + 50%);
    padding: 0;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    /* 确保sticky效果正常工作 */
    will-change: transform;
}

.tabs-container.sticky {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ========== tabs-container响应式优化 ========== */
@media (min-width: 769px) and (max-width: 1024px) {
    .tabs-container {
        height: 55px;
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .tabs-container {
        height: 50px;
        top: 60px;
        padding: 0 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .tabs-container::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 480px) {
    .tabs-container {
        height: 48px;
        padding: 0 8px;
    }
}

/* ========== 标签页内容 ========== */
.tab-content {
    background: #fff;
    padding: 10px 170px;
    transition: padding 0.3s ease;
}

.tab-pane {
    display: block;
    border-bottom: 2px dashed #e5e5e5;
}
.tab-pane:last-child {
    border-bottom: none;
}

.section-title {
    color: #333333;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 13px;
    padding-bottom: 12px;
    padding-top: 20px;
    scroll-margin-top: 140px; /* 为锚点导航预留空间 */
}

.content-text p, .org-text p, .org-description p {
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 16px;
    text-align: justify;
}

/* ========== 组织架构图 ========== */
.org-chart {
    margin: 40px 0;
    text-align: center;
    position: relative;
}

.org-title {
    background: var(--primary-green);
    color: white;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 60px;
    display: inline-block;
    min-width: 200px;
    position: relative;
    z-index: 2;
}

/* 添加从标题到部门的连线 */
.org-title::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 30px;
    background: var(--primary-green);
    z-index: 1;
}

.org-departments {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: 0;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    padding: 0 20px;
}

/* 动态水平连线 */
.org-departments::before {
    content: '';
    position: absolute;
    top: -30px;
    left: var(--connection-left, 50%);
    transform: translateX(-50%);
    width: var(--connection-width, calc(100% - 40px));
    height: 3px;
    background: #20a659;
    border-radius: 2px;
    z-index: 1;
    animation: connectionPulse 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

/* 智能计算连接点 */
.org-departments::after {
    content: '';
    position: absolute;
    top: -33px;
    left: var(--connection-left, 0);
    width: var(--connection-width, 100%);
    height: 9px;
    background: transparent;
    z-index: 2;
    transition: all 0.3s ease;
}

/* 动态连接点系统 - 通过CSS变量精确定位 */
.org-departments.dynamic-connections::after {
   
}

/* 动态连接系统生效时的优化样式 */
.org-departments.dynamic-connections::before {
    left: var(--connection-left);
    width: var(--connection-width);
    transform: none;
}

.dept-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    flex: 1;
    min-width: 120px;
    max-width: 160px;
    margin: 0 6px;
}

/* 为每个部门卡片添加顶部连接线 */
.dept-card::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 30px;
    background: var(--primary-green);
    z-index: 1;
}

.dept-card:hover {
    background: #e9f7ef;
    border-color: var(--primary-green);

    box-shadow: 0 4px 12px rgba(56, 166, 96, 0.2);
}

.dept-card.active {
    background: var(--primary-green);
    color: white !important;
    border-color: var(--primary-green);
    box-shadow: 0 6px 16px rgba(56, 166, 96, 0.3);
}
.dept-card.active span {
    color: white !important;
}

.dept-card.active:hover {
    background: var(--dark-green);
}

.dept-card.main-dept {
    background: var(--primary-green);
    color: white;
    font-weight: 600;
}

.dept-card.main-dept.active {
    background: var(--dark-green);
    border-color: var(--dark-green);
}

.dept-card.main-dept:hover {
    background: var(--dark-green);
}

.dept-card span {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    display: block;
    color: #38a660;
}

/* ========== 部门职能描述区域 ========== */
.dept-description {
    margin-top: 20px;
    padding: 30px;
    text-align: left;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.description-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
    margin: 0;
    text-align: justify;
}

/* ========== 信息卡片样式 ========== */
.info-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-green);
}

.info-card h4 {
    color: var(--primary-green);
    font-weight: 600;
    margin-bottom: 16px;
    font-size: 1.3rem;
}

.info-card p {
    margin-bottom: 12px;
    color: #666;
    display: flex;
    align-items: center;
}

.info-card p:last-child {
    margin-bottom: 0;
}

.info-card i {
    margin-right: 8px;
    color: var(--primary-green);
    width: 16px;
}

/* ========== 文本样式 ========== */
.main-content p {
    font-size: 15px;
    font-family: SourceHanSansSC-regular;
    text-indent: 2em;
    line-height: 28px;
    color: #6c6c6c;
    margin-bottom: 1.2rem;
}

/* ========== 占位内容样式 ========== */
.placeholder-content {
    min-height: 800px;
    padding: 20px 0;
}

.placeholder-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 12px;
}

/* 大屏幕优化 */
@media (min-width: 1200px) {
    .dept-card {
        min-width: 150px;
        max-width: 180px;
        padding: 16px 12px;
        margin: 0 8px;
    }
    
    .dept-card span {
        font-size: 16px;
    }
}

/* ========== 现任领导样式 ========== */
.current-leaders {
    margin: 30px 0 50px 0;
    padding: 25px;
    background-color: #f1f7f1;
    border-radius: 12px;


}

.current-title {
    color: var(--primary-green);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.current-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-green);
    border-radius: 2px;
}

.current-leader-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.leader-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;

    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.leader-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(56, 166, 96, 0.2);
}

.leader-position {
    color: var(--primary-green);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.leader-name {
    color: #333;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.leader-period {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* ========== 时间线样式 ========== */
.timeline {
    position: relative;
    margin: 40px 0;
    padding-left: 60px;
}

.timeline-title {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 35px;
    padding-left: 0;
    margin-left: -60px;
    position: relative;
}



.timeline::before {
    content: '';
    position: absolute;
    left: 25px;
    top: 66px;
    bottom: 20px;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-green) 0%, #90c695 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(56, 166, 96, 0.3);
}

.timeline-item {
    position: relative;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    opacity: 0;
    animation: fadeInLeft 0.6s ease forwards;
}

.timeline-item:nth-child(even) {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(odd) {
    animation-delay: 0.2s;
}

.timeline-dot {
    position: absolute;
    left: -42px;
    top: 30px;
    width: 16px;
    height: 16px;
    background: white;
    border: 4px solid var(--primary-green);
    border-radius: 50%;
    z-index: 3;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 rgba(56, 166, 96, 0.4);
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(56, 166, 96, 0.2);
    background: var(--primary-green);
}

.timeline-content {
    background: white;
    padding: 20px 10px;
    /* border: 1px solid #e8e8e8; */
    border-left: 2px solid var(--primary-green);
    width: 100%;
    position: relative;
   background-color: #f1f7f1;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: row;
}

/* .timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), #20c997, var(--primary-green));
    background-size: 200% 100%;
    animation: gradientSlide 3s ease-in-out infinite;
} */

.timeline-content::after {
    content: '';
    position: absolute;
    left: -12px;
    top: 15px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 12px solid white;
    filter: drop-shadow(-1px 0 1px rgba(0, 0, 0, 0.1));
}

.timeline-item:hover .timeline-content {
    transform: translateX(5px);
    box-shadow: 0 6px 25px rgba(56, 166, 96, 0.15);
}

.timeline-year {
    font-size: 13px;
    color: var(--primary-green);
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;

    padding: 3px 8px;
    border-radius: 12px;
}

.timeline-name {
    font-size: 18px;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0;
    line-height: 1.4;
}

/* 动画效果 */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes gradientSlide {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 0%;
    }
}

/* ========== 平板端优化 (768px - 1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
    .tab-content {
        padding: 10px 80px;
    }
    
    .main-content {
        min-height: calc(100vh - 70px - 380px - 60px);
    }
    
    .org-departments {
        max-width: 100%;
        padding: 0 10px;
        gap: 8px;
    }
    
    .dept-card {
        min-width: 100px;
        max-width: 140px;
        padding: 10px 6px;
    }
    
    .dept-card span {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .dept-description {
        margin-top: 30px;
        padding: 25px;
    }
    
    .current-leader-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .timeline {
        padding-left: 50px;
    }
    
    .timeline-content {
        padding: 18px 22px;
    }
}

/* ========== 手机端优化 (最大768px) ========== */
@media (max-width: 768px) {
    /* 主体布局优化 */
    .main-content {
       
        min-height: calc(100vh - 70px - 320px - 60px);
    }
    
    .tab-content {
        padding: 10px 20px;
    }
    
    /* 组织架构部分需要特殊处理，突破容器限制 */
    .org-chart {
        margin-left: -15px;
        margin-right: -15px;
    }
    
    .page-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    /* 面包屑导航移动端优化 */
    .breadcrumb-nav {
        padding: 8px 0;
        font-size: 13px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .breadcrumb-item {
        display: inline-block;
    }
    
    /* 标签页内容移动端优化 */
    .section-title {
        font-size: 18px;
        scroll-margin-top: 120px;
        margin-bottom: 15px;
        padding-bottom: 8px;
        padding-top: 15px;
        text-align: center;
        color: var(--primary-green);
        position: relative;
    }
    .section-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 10%;
        transform: translateX(-50%);
        width: 60px;
        height: 2px;
        background: var(--primary-green);
        border-radius: 1px;
    }
    
    .content-text p, .org-text p {
        font-size: 0.95rem;
        line-height: 1.7;
        margin-bottom: 15px;
        text-align: left;
        padding: 0 5px;
    }
    
    /* 组织架构移动端大幅优化 */
    .org-chart {
        margin: 25px 0;
    }
    
    .org-title {
        padding: 12px 20px;
        font-size: 1.1rem;
        margin-bottom: 25px;
        border-radius: 25px;
        min-width: auto;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    
    .org-title::after {
        display: none;
    }
    
    .org-departments {
        display: flex;
        flex-direction: row; /* 横向排列 */
        gap: 8px;
        margin-top: 10px;
        padding: 10px 15px 10px 15px; /* 左右都加足够的padding确保完全显示 */
        overflow-x: auto; /* 横向滚动 */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
        position: relative;
        /* 确保滚动区域完整 */
        box-sizing: border-box;
        /* 添加滚动吸附 */
        scroll-snap-type: x mandatory;
    }
    
    .org-departments::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .org-departments::before {
        display: none;
    }
    
    .dept-card {
        padding: 8px 4px;
        margin: 0;
        flex: none; /* 防止压缩 */
        min-width: 50px; /* 适应用户调整的尺寸 */
        max-width: 50px; 
        height: 135px; /* 适应用户调整的高度 */
        border-radius: 8px;
        background: linear-gradient(135deg, #f8f9fa, #e9ecef);
        border: 2px solid transparent;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        /* 确保最后一个元素完全可见 */
        scroll-snap-align: start;
    }
    
    /* 确保第一个和最后一个卡片有足够的边距 */
    .dept-card:first-child {
        margin-left: 5px;
    }
    
    .dept-card:last-child {
        margin-right: 5px;
    }
    
    .dept-card:hover {
        background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
        border-color: rgba(56, 166, 96, 0.5);
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(56, 166, 96, 0.2);
    }
    
    .dept-card.active {
        background: linear-gradient(135deg, var(--primary-green), #20a659) !important;
        border-color: var(--primary-green) !important;
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(56, 166, 96, 0.4);
        position: relative;
        z-index: 2;
    }
    
    .dept-card span {
        font-size: 0.8rem;
        font-weight: 600;
        color: #333;
        line-height: 1.1;
        writing-mode: vertical-rl; /* 竖向排列文字 */
        text-orientation: upright; /* 文字直立显示 */
        text-align: center;
        letter-spacing: 1.5px; /* 适当字间距 */
        height: 100%;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.3s ease;
    }
    
    .dept-card.active span {
        color: white !important;
        font-weight: 700;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
    
    .dept-card::before {
        display: none;
    }
    
    .dept-description {
        margin-top: 20px;
        padding: 20px 15px;
        background: white;
        border-radius: 12px;
        border: 1px solid #e0e0e0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    
    .description-content p {
        font-size: 0.9rem;
        line-height: 1.6;
        color: #666;
        text-align: justify;
        margin-bottom: 0;
        padding: 0;
    }
    
    /* 现任领导移动端优化 */
    .current-leaders {
        margin: 20px 0 30px 0;
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .current-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .current-leader-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .leader-card {
        padding: 18px 15px;
        border-radius: 12px;
    }
    
    .leader-position {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .leader-name {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .leader-period {
        font-size: 13px;
    }
    
    /* 时间线移动端优化 */
    .timeline {
        padding-left: 35px;
        margin: 30px 0;
    }
    
    .timeline::before {
        left: 15px;
        width: 2px;
        top: 45px;
    }
    
    .timeline-title {
        margin-left: -35px;
        font-size: 16px;
        margin-bottom: 25px;
        text-align: center;
        color: var(--primary-green);
    }
    
    .timeline-title::after {
        left: 50%;
        transform: translateX(-50%);
        width: 30px;
    }
    
    .timeline-item {
        margin-bottom: 20px;
    }
    
    .timeline-dot {
        left: -28px;
        width: 10px;
        height: 10px;
        border-width: 2px;
        top: 8px;
    }
    
    .timeline-content {
        padding: 15px 18px;

        background: #f1f7f1;
    }
    
    .timeline-content::after {
        left: -8px;
        top: 14px;
        border-right-width: 8px;
        border-top-width: 6px;
        border-bottom-width: 6px;
    }
    
    .timeline-year {
        font-size: 11px;
        padding: 2px 8px;
        margin-bottom: 8px;
        border-radius: 8px;
    }
    
    .timeline-name {
        font-size: 15px;
        line-height: 1.3;
    }
    
    .timeline-item:hover .timeline-content {
        transform: translateX(2px);
    }
    
    /* 触摸优化 */
    .dept-card, .leader-card, .timeline-content {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

/* ========== 小屏幕手机进一步优化 (最大480px) ========== */
@media (max-width: 480px) {
    .tab-content {
        padding: 10px 15px;
    }
    
    .section-title {
        font-size: 16px;
        margin-bottom: 12px;
        text-align: left;
    }
    
    .content-text p, .org-text p {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 12px;
        padding: 0;
    }
    
    .org-title {
        padding: 10px 16px;
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .org-departments {
        padding: 10px 20px 10px 75px; /* 小屏幕左右都加足够padding */
        gap: 6px; /* 减少间距节省空间 */
    }
    
    .dept-card {
        padding: 8px 3px;
        min-width: 50px;
        max-width: 50px;
        height: 135px;
        border-radius: 6px;
    }
    
    .dept-card span {
        font-size: 0.75rem;
        letter-spacing: 1px;
        line-height: 1.0;
    }
    
    .dept-card.active span {
        font-weight: 700;
    }
    
    /* 小屏幕下确保第一个和最后一个卡片边距 */
    .dept-card:first-child {
        margin-left: 5px;
    }
    
    .dept-card:last-child {
        margin-right: 8px;
    }
    
    .dept-description {
        padding: 15px 12px;
        margin-top: 15px;
    }
    
    .description-content p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .current-leaders {
        padding: 15px 12px;
        margin: 15px 0 25px 0;
    }
    
    .current-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .leader-card {
        padding: 15px 12px;
    }
    
    .leader-position {
        font-size: 14px;
    }
    
    .leader-name {
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .leader-period {
        font-size: 12px;
    }
    
    .timeline {
        padding-left: 30px;
    }
    
    .timeline::before {
        left: 12px;
        top: 40px;
    }
    
    .timeline-title {
        margin-left: -30px;
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .timeline-dot {
        left: -21px;
        width: 8px;
        height: 8px;
        border-width: 2px;
        top: 25px;
    }
    
    .timeline-content {
        
    }
    
    .timeline-year {
        font-size: 10px;
        padding: 1px 6px;
        margin-bottom: 6px;
    }
    
    .timeline-name {
        font-size: 14px;
    }
}