/* ================================
   响应式样式 - 移动端适配
   ================================ */

/* WordPress图片响应式处理 - 适用于所有屏幕尺寸 */
/* 处理带有固定宽度的figure和wp-caption */
.wp-caption,
figure {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
}

.wp-caption img,
figure img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block;
}

.wp-caption-text,
figcaption {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-align: center;
    padding: var(--space-2) 0;
}

/* 文章内容中的图片响应式处理 */
.article-content img,
.post-content img,
.prose img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* 通用移动端样式 */
@media (max-width: 768px) {
    /* 移动端主布局调整已移至 layout.css */
    
    /* 移动端导航 */
    .mobile-menu-btn {
        display: flex; /* 移动端显示，使用flex布局以便居中内容 */
    }
    
    /* 隐藏导航链接激活状态的下划线 */
    .nav-link.active::after {
        display: none;
    }
    
    /* 隐藏Mega菜单中的特色推荐区域 */
    .mega-menu-featured {
        display: none;
    }
    
    .nav-actions {
        gap: var(--space-2);
    }
    
    .search-box {
        display: none;
    }
    
    .nav-content {
        justify-content: space-between;
        padding: var(--space-4) var(--space-2);
    }
    
    /* 移动端文章 */
    .article-title {
        font-size: var(--text-3xl);
    }
    
    .article-content {
        padding: var(--space-6);
    }
    
    /* 移动端图片优化 */
    .wp-caption,
    figure {
        margin: var(--space-4) 0 !important;
        padding: 0 !important;
    }
    
    .wp-caption-text,
    figcaption {
        font-size: var(--text-xs);
        padding: var(--space-2) var(--space-3);
    }
    
    /* 确保移动端图片不会溢出 */
    .article-content img,
    .post-content img,
    .prose img {
        border-radius: 8px;
        margin: var(--space-4) auto;
    }
    
    /* 博客列表相关的移动端响应式样式已移至 blog-list.css */
    
    /* 移动端评论 */
    .comments-area {
        margin-top: var(--space-12);
        padding: var(--space-6);
        border-radius: 12px;
    }
    
    .comments-title {
        font-size: var(--text-2xl);
        margin-bottom: var(--space-8);
    }
    
    .comment-body {
        padding: var(--space-5);
    }
    
    .comment-author {
        flex-direction: column;
        text-align: center;
        gap: var(--space-3);
    }
    
    .comment-author img {
        width: 40px;
        height: 40px;
    }
    
    .children {
        padding-left: var(--space-6);
    }
    
    .children::before {
        left: var(--space-3);
    }
    
    .comment-form {
        gap: var(--space-5);
    }
    
    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form input[type="url"],
    .comment-form textarea {
        padding: var(--space-3);
        border-radius: 10px;
    }
    
    .emoji-options {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--space-3) !important;
    }
    
    .emoji-option {
        padding: var(--space-3) !important;
    }
    
    .emoji-option div:first-child {
        font-size: 28px !important;
    }
    
    /* 移动端评论关闭状态 */
    .comments-section {
        margin-top: var(--space-12);
        padding-top: var(--space-8);
    }
    
    .comments-closed-notice {
        padding: var(--space-8);
    }
    
    .closed-icon {
        font-size: var(--text-3xl);
    }
    
    .closed-title {
        font-size: var(--text-lg);
    }
    
    /* 移动端回到顶部按钮 */
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }
    
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .comments-area {
        padding: var(--space-4);
        margin-top: var(--space-8);
    }
    
    .comments-title {
        font-size: var(--text-xl);
    }
    
    .comment-reply-title {
        font-size: var(--text-xl);
    }
    
    .form-submit .submit {
        padding: var(--space-3) var(--space-6);
        font-size: var(--text-sm);
    }
    
    .article-title {
        font-size: var(--text-2xl);
    }
    
    /* .post-title 移动端优化样式已移至 blog-list.css */
}

/* 平板端适配 */
@media (max-width: 1024px) {
    .mega-menu {
        width: 95vw;
    }
    
    .mega-menu-content {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .mega-menu-featured {
        order: -1;
    }
    
    .search-input {
        width: 150px;
    }
    
    .search-input:focus {
        width: 200px;
    }
    

}

/* 高分辨率优化 - 1600px+ */
@media (min-width: 1600px) {
    /* 导航优化 */
    .mega-menu {
        width: 1100px;
    }
    
    .mega-menu-content {
        grid-template-columns: repeat(3, 1fr) 350px;
        gap: var(--space-12);
    }
    
    .nav-link {
        font-size: var(--text-lg);
        padding: var(--space-4) var(--space-6);
    }
    
    /* 文章优化 */
    .prose {
        font-size: var(--text-xl);  /* 超高分辨率下适度增大字号 */
        line-height: 1.8;
    }

    .prose h2 {
        font-size: var(--text-3xl);  /* 标题也相应增大 */
        margin: var(--space-16) 0 var(--space-8) 0;  /* 更大的标题间距 */
    }

    .prose h3 {
        font-size: var(--text-2xl);
        margin: var(--space-12) 0 var(--space-6) 0;
    }
    
    .prose p {
        margin-bottom: var(--space-8);  /* 段落间距更大 */
    }
    
    .prose blockquote {
        padding: var(--space-8);  /* 引用块更大的内边距 */
        margin: var(--space-12) 0;
    }
    
    .code-container {
        border-radius: 16px;
        margin: var(--space-12) 0;
    }

    .prose pre {
        font-size: var(--text-base);  /* 高分辨率下代码字号也适度增大 */
        padding: var(--space-8);
    }
    
    /* 单文章页面优化 */
    .single-post .post-content {
        font-size: var(--text-xl);  /* 20px，与.prose保持一致 */
        line-height: 1.8;
        padding: var(--space-12);  /* 增加内边距 */
    }
    
    /* 确保所有子元素都继承正确的字体大小 */
    .single-post .post-content p,
    .single-post .post-content ul,
    .single-post .post-content ol,
    .single-post .post-content li {
        font-size: inherit !important;
    }
    
    /* 标题也相应调整 */
    .single-post .post-content h2 {
        font-size: var(--text-3xl);  /* 30px */
    }
    
    .single-post .post-content h3 {
        font-size: var(--text-2xl);  /* 24px */
    }
    
    /* 单文章页面标题优化 */
    .single-post .post-title {
        font-size: var(--text-4xl);  /* 保持一致 */
    }
    
    .single-post .post-subtitle {
        font-size: var(--text-2xl);  /* 从20px增大到24px */
    }
    
    /* 博客列表相关的1600px+响应式样式已移至 blog-list.css */
    

}

/* 超高分辨率优化 - 1920px+ */
@media (min-width: 1920px) {
    /* 导航优化 */
    .brand {
        font-size: var(--text-2xl);
    }
    
    .nav-link {
        font-size: var(--text-lg);
    }
    
    .nav-content {
        padding: var(--space-6) 0;
    }
    
    /* 单文章页面优化 */
    .single-post .post-content {
        padding: var(--space-16);  /* 超高分辨率下更大的内边距 */
    }
    
    .single-post .post-header {
        margin-bottom: var(--space-12);
    }
    
    /* 博客列表相关的1920px+响应式样式已移至 blog-list.css */
    

}

/* 桌面端评论表单优化 */
@media (min-width: 768px) {
    .comment-form-fields-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
        margin-bottom: var(--space-6);
    }
    
    .comment-form-author,
    .comment-form-email {
        margin-bottom: 0;
    }
}

/* 移动端评论表单优化 */
@media (max-width: 767px) {
    .comment-form-fields-row {
        display: block;
    }
    
    .comment-form-author,
    .comment-form-email {
        margin-bottom: var(--space-6);
    }
}