@charset "UTF-8";

/* 手机端（768以下）主样式 */

/* 手机端基础样式，不再导入外部文件 */

/* 单栏布局基础样式 - 浅灰色背景 */
body {
    background-color: #f5f7fa !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    touch-action: manipulation !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 单栏布局容器样式 - 浅灰色背景 */
.mobile-container {
    background-color: #edeef0 !important;
    padding-bottom: 60px !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 内容区域样式 - 浅灰色背景，使用position: sticky自动适应header高度 */
#content {
    background-color: #f5f7fa !important;
    padding: 0 0 60px 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* 主内容区域样式 - 确保内容不满时铺满屏幕 */
#main-content {
    min-height: calc(100vh - 60px) !important;
    box-sizing: border-box !important;
    background-color: #f5f7fa !important;
}

/* 设置tri-layout-middle-contents背景色 */
.tri-layout-middle-contents {
    background-color: #f5f7fa !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
}

/* 确保内容卡片不设固定高度 */
.content-wrap.card {
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    margin-bottom: 8px !important;
}

/* 确保标签面板内容自适应高度 */
.book-tab-panel {
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
}

/* 主内容区域 - 重置顶部padding，避免与#content重复 */
#main-content {
    padding-top: 0 !important;
    box-sizing: border-box !important;
}

/* 卡片容器 - 重置顶部margin和padding，避免与#content重复 */
.card.content-wrap {
    padding-top: 0 !important;
    margin-top: 0 !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

/* 栏目容器样式 - 白底、阴影、圆角 */
.mb-xl {
    background-color: #ffffff !important;
    border-radius: 0 !important;
    padding: 8px !important;
    margin: 0 10px 16px 10px !important;
    border: none !important;
    width: calc(100% - 20px) !important;
    box-sizing: border-box !important;
    display: block !important;
}

/* 章节标题容器 - 适配栏目容器 */
.section-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 16px !important;
    padding: 0 0 12px 0 !important;
    background-color: transparent !important;
    border-bottom: 1px solid #f0f0f0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 章节标题样式 */
.section-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333333 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 标题链接样式 */
.section-header a.refresh-btn {
    color: #07c160 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
}

/* 手机端布局基础样式 */
.container {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 手机端触摸反馈 */
button, a, input, select, textarea {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

/* 手机端滚动优化 */
::-webkit-scrollbar {
    width: 4px !important;
    height: 4px !important;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border-radius: 2px !important;
}

/* 手机端菜单基础样式 */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background-color: white;
    overflow-y: auto;
}

.mobile-menu-open {
    display: block;
}

/* 适配不同栏目区块的统一样式 */
#recent-books-list, #popular-books-list, .recommended-reading-container, .hot-reading-list {
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 移动端隐藏特定元素 */
h1.site-title, .wr_index_page_header_search_tag_pre, .category-nav, .tri-layout-mobile-tabs {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    top: -9999px !important;
}

/* 移动端main-content的padding减少到8 */
#main-content {
    padding: 0 !important;
}

/* 移动端只保留3条书目内容 */
.books-grid .book-card:nth-child(n+4),
.book-grid .book-card:nth-child(n+4) {
    display: none !important;
}

/* 确保grid half v-center内容一行显示 */
.grid.half.v-center {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    width: 100% !important;
}

/* 手机端h1统一样式 */
h1 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'SimHei', '黑体', 'Heiti SC', sans-serif !important;
    font-size: 18px !important;
    font-weight: bold !important;
    color: dimgray;
}

/* 深色模式支持 */
html.dark-mode body {
    background-color: #1a1a1a !important;
}

html.dark-mode .mobile-container {
    background-color: #1a1a1a !important;
}

html.dark-mode #content {
    background-color: #1a1a1a !important;
}

html.dark-mode .mb-xl {
    background-color: #2d2d2d !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

html.dark-mode .section-header {
    border-bottom-color: #3d3d3d !important;
}

html.dark-mode .section-title {
    color: #e5e7eb !important;
}

html.dark-mode .section-header a.refresh-btn {
    color: #07c160 !important;
}

/* 书架样式已移至shelves.css，优先级更高 */
