/* 基础容器自适应 */
.main-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    box-sizing: border-box;
}
.main-img img{
    width:100%;
    object-fit: cover;
    max-height:600px;
}
/* 选项卡容器 - 关键：用flex垂直布局固定标题+内容顺序 */
.tab-container {
    width: 100%;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column; /* 强制子元素垂直排列，确保标题在上、内容在下 */
}

/* 选项卡标题栏 - 自适应布局，固定在顶部 */
.tab-nav {
    width: 100%;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
    overflow-x: auto; /* 移动端横向滚动 */
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0; /* 防止标题栏被压缩 */
}

.tab-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    white-space: nowrap; /* 禁止换行 */
}

.tab-nav-item {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

/* 激活状态（与原有风格保持一致） */
.tab-nav-item.active {
    color: #007bff; /* 替换为你原有风格的主色 */
    border-bottom-color: #007bff;
    font-weight: 500;
}

.tab-nav-item:hover {
    color: #007bff;
}

/* 选项卡内容区 - 固定在标题栏下方，占满剩余空间 */
.tab-content {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    flex: 1; /* 自动填充容器剩余高度 */
    min-height: 300px; /* 保证内容区最小高度，避免空内容时塌陷 */
}

.tab-panel {
    display: none;
    width: 100%;
    height: 100%;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 文章内容自适应 */
.article-content {
    width: 100%;
    line-height: 1.6;
    font-size: 14px;
    color: #666;
    height: 100%;
}

/* 图片自适应 */
.article-content img {
    width:100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
}


/* 媒体查询 - 移动端适配 */
@media (max-width: 768px) {
    .tab-nav-item {
        padding: 10px 15px;
        font-size: 13px;
    }
    .tab-content {
        padding: 15px;
        min-height: 200px; /* 移动端减小最小高度 */
    }
    .article-content {
        font-size: 13px;
    }
}

/* 淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 隐藏滚动条但保留滚动功能（可选，优化视觉） */
.tab-nav::-webkit-scrollbar {
    height: 0;
}