/* 乐尔康移动端响应式补丁 */

/* 基础适配 */
@media screen and (max-width: 768px) {
    body {
        font-size: 16px;
        line-height: 1.6;
    }

    /* 导航栏适配 */
    #main-nav ul li {
        display: block;
        width: 100%;
        text-align: center;
        padding: 12px 0;
    }

    /* 首页搜索框 */
    .search-form,
    form[role="search"],
    input[type="search"],
    input[name="s"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        font-size: 16px !important;
    }

    /* 首页最新文章列表 */
    #recent-posts li,
    .recent-posts li,
    ul li a {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* 延伸阅读模块 */
    #lrk-related-posts {
        max-width: 100% !important;
        padding: 16px !important;
        margin: 20px 8px 0 !important;
    }
    #lrk-related-posts a {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    #lrk-related-posts a span:last-child {
        margin-left: 0 !important;
        margin-top: 4px;
    }

    /* 知识库卡片网格 */
    .lrk-knowledge-cards {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        margin: 16px 8px !important;
    }

    /* 文章内容图片 */
    .entry-content img,
    .post-content img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* 表格溢出 */
    .entry-content table,
    .post-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 代码块 */
    .entry-content pre,
    .post-content pre {
        white-space: pre-wrap;
        word-wrap: break-word;
        overflow-x: auto;
        font-size: 13px;
    }

    /* 避免 iOS 字体缩放 */
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* 小屏手机进一步优化 */
@media screen and (max-width: 480px) {
    body {
        font-size: 15px;
    }

    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.3rem !important; }
    h3 { font-size: 1.15rem !important; }

    #lrk-related-posts h3 {
        font-size: 18px !important;
    }
}
