/* === 文章详情页特有样式 === */
:root {
    --container-narrow: 1300px;  /* 仅在文章详情页使用 */
}

/* 2. 文章标题区 */
.article-header-section {
    padding-top: 160px;  /* 减小顶部间距，更适配移动端 */
    padding-bottom: 30px;
    background-color: var(--white);
}

.article-header-container {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 15px;  /* 添加左右内边距 */
    box-sizing: border-box;  /* 确保内边距计算正确 */
}

/* 面包屑导航 - 简化版本 */
.article-breadcrumb {
    margin-bottom: 20px;  /* 减小间距 */
    font-size: 14px;
}

.article-breadcrumb ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;  /* 使用gap代替margin */
}

.article-breadcrumb li {
    display: flex;
    align-items: center;
}

.article-breadcrumb a {
    color: var(--text-light);
    transition: var(--transition);
    display: flex;
    align-items: center;
    text-decoration: none;  /* 移除下划线 */
}

.article-breadcrumb a:hover {
    color: var(--primary);
}

.article-breadcrumb .home-icon {
    color: var(--text-light);
    font-size: 14px;
    margin-right: 6px;  /* 减小间距 */
}

.article-breadcrumb .separator {
    color: #ddd;  /* 使用更浅的颜色 */
    font-size: 12px;
    margin: 0 6px;  /* 减小间距 */
    display: flex;
    align-items: center;
}

/* 文章标题 */
.article-title {
    font-size: 36px;  /* 减小初始字体大小 */
    font-weight: 400;
    color: var(--dark);
    line-height: 1.3;  /* 增加行高提高可读性 */
    margin: 15px 0 25px 0;  /* 统一间距 */
    text-align: left;
    word-break: break-word;  /* 防止长单词溢出 */
}

/* 文章元信息栏 */
.article-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;  /* 使用更浅的背景色 */
    border-radius: var(--border-radius-xs);
    padding: 18px 20px;  /* 减小内边距 */
    margin-bottom: 40px;
    border: 1px solid #eee;  /* 添加细边框 */
    flex-wrap: wrap;  /* 允许换行 */
}

.meta-left {
    font-size: 14px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    flex-wrap: wrap;  /* 允许换行 */
    gap: 20px;  /* 使用gap代替margin */
}

.meta-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-to-list {
    font-size: 14px;
    color: var(--text);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;  /* 移除下划线 */
}

.back-to-list:hover {
    color: var(--primary);
}

/* 红色箭头按钮 */
.back-to-list .arrow-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: var(--primary);
    border-radius: 50%;
    transition: var(--transition);
    flex-shrink: 0;  /* 防止按钮变形 */
}

.back-to-list .arrow-circle i {
    font-size: 12px;
    color: var(--white);
    transform: rotate(45deg);
    transition: var(--transition);
}

.back-to-list:hover .arrow-circle {
    transform: translateX(3px);  /* 减小移动距离 */
}

/* 3. 文章正文内容区 */
.article-content-section {
    padding: 0 0 60px 0;  /* 减小底部间距 */
    background-color: var(--white);
}

.article-content-container {
    max-width: var(--container-narrow);
    margin: 0 auto;
    display: flex;
    padding: 0 15px;  /* 添加左右内边距 */
    box-sizing: border-box;
}

/* 左侧边栏 */
.article-sidebar {
    width: 205px;
    flex-shrink: 0;
    border-right: 1px solid #f0f0f0;  /* 更浅的边框色 */
    padding-right: 30px;  /* 减小内边距 */
    padding-top: 10px;
}

/* 专家咨询模块 */
.expert-consult {
    margin-bottom: 30px;  /* 减小间距 */
    padding-bottom: 25px;  /* 减小内边距 */
    border-bottom: 1px solid #f0f0f0;
}

.expert-title {
    font-size: 16px;
    font-weight: 400;
    color: #545454;
    margin-bottom: 15px;  /* 减小间距 */
}

.qrcode-box {
    background-color: #f8f9fa;  /* 使用更浅的背景色 */
    border-radius: 8px;
    padding: 18px;  /* 减小内边距 */
    text-align: center;
    border: 1px solid #eee;  /* 添加边框 */
}

.qrcode-img {
    width: 100px;  /* 减小图片大小 */
    height: 100px;
    max-width: 100%;  /* 确保响应式 */
    display: block;
    margin: 0 auto 12px;  /* 减小间距 */
    border-radius: 4px;
    object-fit: cover;  /* 确保图片比例正确 */
}

.qrcode-tip {
    font-size: 12px;
    color: #666;  /* 使用深一点的颜色提高可读性 */
    line-height: 1.5;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 400;
    color: #545454;
    margin-bottom: 20px;  /* 减小间距 */
}

.hot-tags-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;  /* 使用gap代替margin */
}

.hot-tags-list li {
    margin: 0;  /* 移除li的margin，使用gap控制 */
}

/* 标签按钮 */
.tag-item, .tag-toggle {
    display: inline-block;
    padding: 6px 12px;  /* 减小内边距 */
    background-color: #f8f9fa;
    border-radius: 16px;  /* 更圆润 */
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    border: 1px solid #eee;  /* 添加边框 */
    text-align: center;
    white-space: nowrap;
    text-decoration: none;  /* 移除下划线 */
    transition: all 0.2s ease;
    max-width: 100%;  /* 防止溢出 */
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-item:hover, .tag-toggle:hover {
    background-color: #e9ecef;
    border-color: #ddd;
    color: var(--dark);
}

.tag-toggle {
    font-weight: 500;
    margin-top: 5px;
    position: relative;
    padding-right: 25px;
    height: 32px;  /* 减小高度 */
    width: 100%;  /* 占据整行 */
    max-width: 150px;  /* 限制最大宽度 */
}

/* 箭头图标 */
.tag-toggle::before {
    content: "›";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    font-size: 14px;
    font-weight: normal;
    transition: transform 0.3s ease;
}

/* 展开状态 */
.tag-toggle.expanded::before {
    transform: translateY(-50%) rotate(-90deg);
}

/* 右侧主内容区 */
.article-main {
    flex: 1;
    padding-left: 40px;  /* 减小内边距 */
    padding-right: 40px;
}

/* 文章正文内容 - 核心设置 */
.article-body {
    font-size: 16px;
    line-height: 1.8;  /* 使用相对单位 */
    color: var(--text);
    margin-bottom: 40px;
}

.article-body h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
    margin: 35px 0 18px 0;
    line-height: 1.3;
}

.article-body p {
    margin-bottom: 20px;
    text-align: justify;  /* 两端对齐 */
}

.article-body ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.article-body li {
    margin-bottom: 8px;  /* 减小间距 */
}

/* 文章TAG区域 */
.article-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;  /* 使用gap代替margin */
    margin-bottom: 30px;  /* 减小间距 */
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.article-tags-label {
    color: var(--text-light);
    flex-shrink: 0;  /* 防止标签被挤压 */
}

.article-tag-link {
    color: var(--text);
    transition: var(--transition);
    padding: 0 5px;
    text-decoration: none;  /* 移除下划线 */
}

.article-tag-link:hover {
    color: var(--primary);
}

.article-tag-separator {
    color: #ddd;
}

/* 上下篇导航 */
.article-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: var(--border-radius-sm);
    padding: 20px 25px;  /* 减小内边距 */
    border: 1px solid #eee;
    gap: 15px;  /* 添加间距 */
}

.nav-previous, .nav-next {
    flex: 1;
    min-width: 0;  /* 允许内容收缩 */
}

.nav-next {
    text-align: right;
}

.nav-label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 5px;
    display: block;
}

.nav-title {
    font-size: 15px;  /* 减小字体大小 */
    color: var(--dark);
    font-weight: 500;
    transition: var(--transition);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;  /* 超出部分显示省略号 */
    text-decoration: none;  /* 移除下划线 */
}

.nav-title:hover {
    color: var(--primary);
}

.nav-separator {
    margin: 0 20px;  /* 减小间距 */
    color: #ddd;
    font-size: 16px;
    flex-shrink: 0;  /* 防止分隔符被挤压 */
}

/* === 响应式设计优化 === */

/* 平板设备 (992px以下) */
@media (max-width: 992px) {
    .article-title {
        font-size: 32px;
        line-height: 1.2;
    }
    
    .article-header-section {
        padding-top: 140px;  /* 进一步减小顶部间距 */
    }
    
    .article-content-container {
        flex-direction: column;
        gap: 40px;  /* 添加间距 */
    }
    
    .article-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding-right: 0;
        padding-bottom: 30px;
        margin-bottom: 30px;
        display: flex;
        flex-wrap: wrap;
        gap: 40px;  /* 添加间距 */
    }
    
    .expert-consult {
        flex: 1;
        min-width: 200px;
        margin-bottom: 0;
        border-bottom: none;
    }
    
    .hot-tags-section {
        flex: 2;
        min-width: 200px;
    }
    
    .article-main {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
    }
    
    .article-meta-bar {
        flex-direction: row;  /* 保持水平布局 */
    }
}

/* 小屏幕平板/大手机 (768px以下) */
@media (max-width: 768px) {
    .article-title {
        font-size: 28px;
        margin: 10px 0 20px 0;
    }
    
    .article-header-section {
        padding-top: 120px;
        padding-bottom: 20px;
    }
    
    .article-meta-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
    }
    
    .meta-left {
        gap: 15px;
        font-size: 13px;
    }
    
    .meta-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .article-sidebar {
        flex-direction: column;
        gap: 30px;
    }
    
    .expert-consult, .hot-tags-section {
        min-width: 100%;
    }
    
    .article-body {
        font-size: 15px;
        line-height: 1.7;
    }
    
    .article-body h2 {
        font-size: 22px;
        margin: 30px 0 15px 0;
    }
    
    .article-navigation {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 18px 20px;
    }
    
    .nav-separator {
        display: none;
    }
    
    .nav-previous, .nav-next {
        text-align: center;
        width: 100%;
    }
    
    .nav-title {
        font-size: 14px;
    }
    
    .back-to-list {
        font-size: 13px;
    }
}

/* 手机设备 (576px以下) */
@media (max-width: 576px) {
    .article-header-section {
        padding-top: 100px;
    }
    
    .article-title {
        font-size: 24px;
        line-height: 1.3;
    }
    
    .article-header-container,
    .article-content-container {
        padding: 0 12px;
    }
    
    .article-meta-bar {
        padding: 12px 15px;
        margin-bottom: 30px;
    }
    
    .meta-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 12px;
    }
    
    .meta-left span {
        display: block;
    }
    
    .article-breadcrumb {
        font-size: 12px;
    }
    
    .article-breadcrumb ul {
        gap: 4px;
    }
    
    .article-breadcrumb .separator {
        margin: 0 4px;
    }
    
    .article-content-section {
        padding-bottom: 40px;
    }
    
    .article-sidebar {
        padding-bottom: 25px;
        margin-bottom: 25px;
        gap: 25px;
    }
    
    .expert-consult {
        margin-bottom: 0;
    }
    
    .qrcode-box {
        padding: 15px;
    }
    
    .qrcode-img {
        width: 90px;
        height: 90px;
    }
    
    .article-main {
        padding-left: 0;
        padding-right: 0;
    }
    
    .article-body {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 30px;
    }
    
    .article-body h2 {
        font-size: 20px;
        margin: 25px 0 12px 0;
    }
    
    .article-body p {
        margin-bottom: 15px;
        text-align: left;  /* 小屏幕取消两端对齐 */
    }
    
    .article-tags {
        gap: 6px;
        margin-bottom: 25px;
        padding-bottom: 25px;
        font-size: 13px;
    }
    
    .tag-item, .tag-toggle {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .tag-toggle {
        height: 30px;
        max-width: 120px;
    }
    
    .article-navigation {
        padding: 15px 18px;
        gap: 15px;
    }
    
    .nav-label {
        font-size: 12px;
    }
    
    .nav-title {
        font-size: 13px;
    }
    
    .back-to-list .arrow-circle {
        width: 22px;
        height: 22px;
    }
}

/* 超小手机设备 (400px以下) */
@media (max-width: 400px) {
    .article-title {
        font-size: 22px;
    }
    
    .article-header-section {
        padding-top: 90px;
    }
    
    .article-body {
        font-size: 13.5px;
        line-height: 1.5;
    }
    
    .article-body h2 {
        font-size: 18px;
    }
    
    .hot-tags-list {
        gap: 6px;
    }
    
    .tag-item {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .article-meta-bar {
        padding: 10px 12px;
    }
    
    .meta-left {
        font-size: 11px;
    }
    
    .back-to-list {
        font-size: 12px;
    }
}