﻿/* MrDoc 二次开发 - 移动端优化样式（全站统一引入） */

/* 通用：内容元素不溢出 */
@media screen and (max-width: 768px) {
    .doc-content img, .content img, #content img {
        max-width: 100% !important;
        height: auto !important;
    }
    .doc-content table, .content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    pre, .codehilite, .hljs {
        overflow-x: auto;
        max-width: 100%;
    }
    iframe {
        max-width: 100%;
    }
}

/* 首页页头 */
@media screen and (max-width: 768px) {
    .layui-header .layui-layout-left,
    .layui-header .layui-layout-right {
        padding-left: 8px;
        padding-right: 8px;
    }
    /* 小屏隐藏LOGO，保留搜索入口（移动端搜索图标） */
    .layui-header .logo {
        display: none !important;
    }
}

@media screen and (max-width: 480px) {
    .layui-header .logo img {
        height: 22px !important;
        max-width: 150px !important;
    }
    .login-form {
        padding: 20px 20px !important;
        margin-top: 10% !important;
        width: 92%;
        box-sizing: border-box;
    }
    .login-form .layui-input-inline {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* 首页文集列表 */
@media screen and (max-width: 768px) {
    .layui-container a.layui-btn-xs {
        display: inline-block;
        margin-bottom: 4px;
    }
    .project-item-list {
        height: auto !important;
        min-height: 100px;
        padding: 10px 12px;
    }
    .project-item-list td,
    .project-item-list .layui-elip {
        font-size: 13px;
    }
    .layui-laypage {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* 文档阅读页 */
@media screen and (max-width: 768px) {
    .layui-side {
        display: none !important;
    }
    .layui-body {
        left: 0 !important;
    }
    .doc-content {
        padding: 10px 12px !important;
    }
    .doc-title {
        font-size: 20px !important;
    }
    .doc-info {
        font-size: 12px;
    }
}

/* 搜索页 */
@media screen and (max-width: 768px) {
    #search-input {
        width: 100% !important;
    }
    .layui-container {
        padding-left: 10px;
        padding-right: 10px;
    }
    .search-result-title {
        word-break: break-all;
    }
}

/* 评论区 / 反馈 */
@media screen and (max-width: 768px) {
    #doc-comment-section {
        padding: 10px 4px !important;
    }
    #doc-comment-content,
    #feedback-content,
    #selection-feedback-content {
        width: 100% !important;
    }
    .doc-comment-item {
        word-break: break-all;
    }
}


/* 白板编辑器/查看器：移动端高度自适应 */
@media screen and (max-width: 768px) {
    #whiteboard-container,
    #whiteboard-container iframe,
    #excalidraw-viewer {
        height: 420px !important;
        position: static !important;
    }
}

/* 首页移动端搜索图标靠右，避免与LOGO重叠 */
@media screen and (max-width: 768px) {
    .layui-header > div:nth-child(3) {
        padding-left: 0 !important;
        margin-left: auto !important;
    }
}

/* 文档页正文最小高度与底部评论区间距 */
@media screen and (max-width: 768px) {
    .doc-body-content-div {
        max-width: 100% !important;
    }
    #doc-comment-section {
        margin-top: 12px !important;
    }
}
