/* 基础变量 */
:root {
    --primary-color: #2B5DE0;
    --secondary-color: #5C7CE0;
    --text-color: #333333;
    --light-gray: #F5F7FA;
    --border-color: #E5E7EB;
    --success-color: #10B981;
    --warning-color: #F59E0B;
}

/* 主要内容区域样式 */
.main-content {
    padding: 60px 0;
    min-height: calc(100vh - 200px);
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
}

.container {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

/* 面包屑导航样式优化 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    padding: 16px 24px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    color: #666;
    position: relative;
    overflow: hidden;
}

/* 添加背景动画效果 */
.breadcrumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.breadcrumb:hover::before {
    opacity: 1;
}

.breadcrumb-item {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    position: relative;
    padding: 6px 12px;
    border-radius: 8px;
    background: transparent;
    z-index: 1;
}

.breadcrumb i {
    color: #999;
    font-size: 16px;
    margin: 0 4px;
    transition: transform 0.3s ease;
}

/* 分隔符动画 */
.breadcrumb i {
    position: relative;
    transform-origin: center;
}

.breadcrumb-item:hover + i {
    transform: scale(1.2);
    color: var(--primary-color);
}

/* 项目悬停效果 */
.breadcrumb-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
    z-index: -1;
}

.breadcrumb-item:hover {
    color: #FFFFFF;
}

.breadcrumb-item:hover::before {
    opacity: 0.1;
}

/* 当前项样式 */
.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 500;
    background: var(--light-gray);
}

.breadcrumb-item.active::after {
    display: none;
}

/* 添加图标 */
.breadcrumb::after {
    content: '';
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    opacity: 0.1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .breadcrumb {
        padding: 12px 20px;
        margin-bottom: 20px;
    }
    
    .breadcrumb-item {
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .breadcrumb {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .breadcrumb i {
        font-size: 14px;
    }
    
    .breadcrumb-item {
        padding: 3px 6px;
    }
}

/* 文章内容区域 */
.article-content {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 40px;
    margin-bottom: 30px;
}

.article-header {
    margin-bottom: 30px;
    text-align: center;
}

.article-title {
    font-size: 32px;
    font-weight: 700;
    color: #1A1A1A;
    margin-bottom: 20px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item i {
    font-size: 16px;
    color: var(--primary-color);
}

/* 文章正文样式 */
.article-body {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.article-summary {
    font-size: 18px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--light-gray);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.article-body h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1A1A1A;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.article-body h2.visible {
    opacity: 1;
    transform: translateY(0);
}

.article-body h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1A1A1A;
    margin: 30px 0 15px;
}

.article-body p {
    margin-bottom: 20px;
}

.article-body ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.article-body li {
    margin-bottom: 15px;
}

/* 信息框样式 */
.info-box {
    background: #F8FAFF;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    border: 1px solid rgba(43, 93, 224, 0.1);
}

/* 引用框样式 */
.quote-box {
    position: relative;
    padding: 30px 40px;
    margin: 30px 0;
    background: linear-gradient(135deg, #F8FAFF, #FFFFFF);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.quote-box i {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 24px;
    color: var(--primary-color);
    opacity: 0.2;
}

.quote-box p {
    font-size: 18px;
    font-style: italic;
    color: #1A1A1A;
    margin: 0;
}

/* 问答部分样式 */
.qa-section {
    margin: 30px 0;
}

.qa-item {
    margin-bottom: 20px;
    padding: 20px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.qa-item:hover {
    transform: translateY(-2px);
}

.question {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.question i {
    font-size: 20px;
    color: var(--primary-color);
}

.question h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1A1A1A;
    margin: 0;
}

.answer {
    padding-left: 30px;
}

.answer p {
    margin: 0;
    color: #666;
}

/* 文章底部样式 */
.article-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tags {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-label {
    color: #666;
    font-size: 14px;
}

.tag {
    padding: 6px 12px;
    background: var(--light-gray);
    border-radius: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(43, 93, 224, 0.1);
}

/* 分享按钮样式优化 */
.share-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-label {
    color: #666;
    font-size: 14px;
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.share-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-btn i {
    font-size: 20px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

/* 微信分享按钮 */
.share-btn.weixin {
    background: #07C160;
}

.share-btn.weixin i {
    color: #FFFFFF;
}

/* QQ分享按钮 */
.share-btn.qq {
    background: #12B7F5;
}

.share-btn.qq i {
    color: #FFFFFF;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-btn:hover::before {
    opacity: 0.1;
}

/* 微信分享弹窗样式优化 */
.share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.qrcode-container {
    background: #FFFFFF;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.share-overlay.visible .qrcode-container {
    transform: translateY(0);
}

.qrcode-container h3 {
    font-size: 18px;
    color: #1A1A1A;
    margin-bottom: 20px;
}

.qrcode-container .qrcode {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    background: #F5F7FA;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-container p {
    color: #666;
    font-size: 14px;
    margin: 15px 0;
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    font-size: 24px;
    padding: 8px;
}

/* 上下文导航样式优化 */
.context-nav {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    gap: 20px;
    position: relative;
}

.nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: #FFFFFF;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(120deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.nav-item i {
    font-size: 24px;
    color: #666;
    transition: all 0.3s ease;
    z-index: 2;
}

.nav-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
    flex: 1;
}

.nav-text .label {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.nav-text .title {
    font-size: 16px;
    font-weight: 500;
    color: #1A1A1A;
    transition: color 0.3s ease;
    line-height: 1.4;
}

/* 上一篇样式 */
.nav-item.prev {
    text-align: left;
    padding-left: 20px;
}

/* 下一篇样式 */
.nav-item.next {
    text-align: right;
    padding-right: 20px;
}

.nav-item.next .nav-text {
    align-items: flex-end;
}

/* 悬停效果 */
.nav-item:hover {
    transform: translateY(-2px);
    border-color: transparent;
}

.nav-item:hover::before {
    opacity: 0.05;
}

.nav-item:hover i {
    color: var(--primary-color);
    transform: translateX(-3px);
}

.nav-item.next:hover i {
    transform: translateX(3px);
}

.nav-item:hover .nav-text .label {
    color: var(--primary-color);
}

.nav-item:hover .nav-text .title {
    color: var(--primary-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .context-nav {
        flex-direction: column;
        gap: 15px;
        margin: 30px 0;
    }

    .nav-item {
        padding: 20px;
    }

    .nav-text .title {
        font-size: 15px;
    }

    .nav-text .label {
        font-size: 12px;
    }

    .nav-item i {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .context-nav {
        gap: 12px;
        margin: 25px 0;
    }

    .nav-item {
        padding: 16px;
    }

    .nav-text .title {
        font-size: 14px;
    }

    .nav-text .label {
        font-size: 11px;
    }

    .nav-item i {
        font-size: 18px;
    }
}

/* 相关推荐样式优化 */
.related-articles {
    margin-top: 60px;
    background: #FFFFFF;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.section-title span {
    background: #FFFFFF;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border-color);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.article-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--light-gray);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.article-item:hover {
    transform: translateY(-2px);
    background: linear-gradient(to right, var(--light-gray), #FFFFFF);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.article-item .article-title {
    font-size: 15px;
    font-weight: 500;
    color: #1A1A1A;
    margin: 0;
    flex: 1;
    margin-right: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.article-item:hover .article-title {
    color: var(--primary-color);
}

.article-item .article-date {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .articles-grid {
        gap: 15px;
    }

    .article-item {
        padding: 14px 16px;
    }

    .article-item .article-title {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .related-articles {
        padding: 30px 20px;
        margin-top: 40px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .article-item {
        padding: 12px 15px;
    }

    .article-item .article-title {
        font-size: 14px;
    }

    .article-item .article-date {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .related-articles {
        padding: 20px 15px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
}

/* 阅读进度条 */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    z-index: 1000;
    transition: width 0.1s ease;
}

/* 图片预览遮罩层 */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.image-overlay img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

/* ====== 广告位相关样式 ====== */
/* 广告位基础样式 */
.ad-container {
    margin: 30px 0;
    width: 100%;
    position: relative;
    background: var(--light-gray);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 广告包装器 */
.ad-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 广告标签 */
.ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #FFFFFF;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1;
}

/* 广告内容区域 */
.ad-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 广告图片样式 */
.ad-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 各个位置广告位尺寸设置 */
/* 文章头部广告位 */
.ad-header {
    height: 120px;
    margin: 20px 0 30px;
}

/* 文章内容顶部广告位 */
.ad-content-top {
    height: 100%;
    margin: 30px 0;
    background: #FFFFFF;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* 文章中间广告位 */
.ad-content-middle {
    height: 200px;
    margin: 40px 0;
}

/* 文章底部广告位 */
.ad-footer {
    height: 150px;
    margin: 30px 0;
}

/* 广告位悬停效果 */
.ad-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 响应式布局调整 */
@media (max-width: 992px) {
    .ad-content-top {
        height: 160px;
    }
}

@media (max-width: 768px) {
    .ad-header {
        height: 100px;
    }
    .ad-content-top,
    .ad-content-middle {
        height: 120px;
    }
    .ad-footer {
        height: 100%;
    }
}

@media (max-width: 480px) {
    .ad-header {
        height: 80px;
    }
    .ad-content-top,
    .ad-content-middle,
    .ad-footer {
        height: 100%;
    }
}

/* 广告位占位符样式 - 在没有广告内容时可以显示 */
.ad-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #f5f7fa 25%, #e4e7eb 25%, #e4e7eb 50%, #f5f7fa 50%, #f5f7fa 75%, #e4e7eb 75%, #e4e7eb);
    background-size: 20px 20px;
    opacity: 0.5;
}

/* 页面加载进度条 */
.page-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    z-index: 9999;
    transition: width 0.2s ease;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 40px;
    height: 40px;
    background: #FFFFFF;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top i {
    font-size: 20px;
    color: var(--primary-color);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* 文章阅读优化 */
.article-body {
    line-height: 1.8;
    letter-spacing: 0.3px;
}

.article-body p:not(.article-summary) {
    text-indent: 2em;
    margin-bottom: 1.5em;
}

.article-body h2 {
    margin: 2em 0 1em;
    position: relative;
    padding-left: 1em;
}

.article-body h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .back-to-top {
        right: 20px;
        bottom: 20px;
        width: 36px;
        height: 36px;
    }

    .back-to-top i {
        font-size: 18px;
    }
}

/* 文章内容区域响应式优化 */
@media (max-width: 768px) {
    .main-content {
        padding: 20px 0;
    }

    .article-content {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .article-title {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .article-meta {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .article-summary {
        font-size: 15px;
        padding: 15px;
        margin-bottom: 20px;
    }

    .article-body {
        font-size: 15px;
    }

    .article-body h2 {
        font-size: 20px;
        margin: 25px 0 15px;
    }

    .article-body h3 {
        font-size: 18px;
    }

    .info-box {
        padding: 15px;
        margin: 20px 0;
    }

    .quote-box {
        padding: 20px;
        margin: 20px 0;
    }

    .quote-box p {
        font-size: 16px;
    }
}

/* 移动端特别优化 */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .article-content {
        padding: 15px;
        border-radius: 12px;
    }

    .article-title {
        font-size: 20px;
    }

    .article-meta {
        font-size: 12px;
        gap: 12px;
    }

    .meta-item i {
        font-size: 14px;
    }

    .article-summary {
        font-size: 14px;
        padding: 12px;
    }

    .article-body {
        font-size: 14px;
    }

    /* 文章底部样式调整 */
    .article-footer {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .tags {
        flex-wrap: wrap;
        gap: 8px;
    }

    .tag {
        padding: 4px 10px;
        font-size: 12px;
    }

    .share-box {
        width: 100%;
        justify-content: center;
    }

    /* 相关推荐样式调整 */
    .related-articles {
        padding: 20px 15px;
    }

    .articles-grid {
        gap: 10px;
    }

    .article-item {
        padding: 12px;
    }

    .article-item .article-title {
        font-size: 13px;
        margin-right: 10px;
    }

    .article-item .article-date {
        font-size: 12px;
    }
}

/* iPhone 特别优化 */
@media screen and (max-width: 430px) {
    .main-content {
        padding: 15px 0;
    }

    .breadcrumb {
        padding: 8px 12px;
        margin-bottom: 15px;
    }

    .breadcrumb-item {
        font-size: 12px;
    }

    .breadcrumb i {
        font-size: 12px;
    }

    /* 上下文导航特别优化 */
    .nav-item {
        padding: 12px;
    }

    .nav-text .title {
        font-size: 13px;
    }

    .nav-text .label {
        font-size: 10px;
    }

    /* QA部分优化 */
    .qa-item {
        padding: 15px;
    }

    .question h4 {
        font-size: 15px;
    }

    .answer {
        padding-left: 20px;
        font-size: 13px;
    }
}

/* 处理超长文本 */
.article-title,
.article-summary,
.article-body p,
.article-item .article-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 图片响应式处理 */
.article-body img {
    max-width: 100%;
    height: auto;
}

/* 表格响应式处理 */
.article-body table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

/* 代码块响应式处理 */
.article-body pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 15px;
    box-sizing: border-box;
}

/* 基础响应式规则 */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

/* 处理iOS设备上的特殊问题 */
@supports (-webkit-touch-callout: none) {
    .main-content {
        /* 防止iOS设备上的回弹效果导致布局问题 */
        overflow-x: hidden;
    }
    
    /* 修复iOS设备上的点击延迟 */
    .article-content,
    .nav-item,
    .share-btn,
    .back-to-top {
        cursor: pointer;
    }
}

/* 优化移动端触摸体验 */
@media (hover: none) {
    .article-item,
    .nav-item,
    .share-btn {
        -webkit-tap-highlight-color: rgba(0,0,0,0);
    }
}

/* iPhone 14 Pro Max 特定优化 */
@media screen and (device-width: 430px) and (device-height: 932px) {
    .container {
        width: 100%;
        overflow-x: hidden;
    }
    
    .article-content {
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
        border-radius: 0;
    }
    
    /* 处理安全区域 */
    .main-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .back-to-top {
        bottom: calc(30px + env(safe-area-inset-bottom));
    }
}

/* 移动端菜单样式 */
.mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu.active {
        display: block;
        position: fixed;
        top: 60px; /* 根据header高度调整 */
        left: auto; /* 修改这里，从左侧改为右侧 */
        right: 0;
        bottom: 0;
        width: 70%; /* 添加宽度 */
        max-width: 300px; /* 最大宽度 */
        background: #FFFFFF;
        z-index: 1000;
        padding: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1); /* 添加左侧阴影 */
        transform: translateX(100%); /* 初始位置在屏幕右侧 */
        transition: transform 0.3s ease; /* 添加过渡动画 */
    }

    .mobile-menu.active {
        transform: translateX(0); /* 显示时滑入 */
    }

    /* 添加菜单背景遮罩 */
    .mobile-menu::before {
        content: '';
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-menu.active::before {
        opacity: 1;
    }
}

/* 处理移动端菜单开启时的页面滚动 */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* 菜单动画优化 */
@media (prefers-reduced-motion: no-preference) {
    .mobile-menu {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* 处理 iPhone 安全区域 */
@supports (padding-top: env(safe-area-inset-top)) {
    @media (max-width: 768px) {
        .mobile-menu.active {
            padding-top: calc(20px + env(safe-area-inset-top));
            padding-right: calc(20px + env(safe-area-inset-right));
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
} 