﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

/* 漫画内容容器 */
.comic-container {
    position: absolute;
    top: 44px;
    bottom: 60px; /* 预留底部工具栏高度 */
    width: 100%;
    overflow-y: scroll;
    /*display: flex;*/
    justify-content: center;
}

.comic-container img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

/* 底部固定工具栏 */
.footer-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 66px;
    background-color: #262626;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 10px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    padding: 0 10px;
    height: 40px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

    /* 图标用 background-url 实现 */
    .toolbar-btn::before {
        content: "";
        width: 20px;
        height: 20px;
        margin-right: 5px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }

/* 目录按钮 */
.btn-catalog::before {
    background-image: url('/assets/img/icon/mobile/catalog.png');
}

/* 上一章按钮 */
.btn-prev::before {
    background-image: url('/assets/img/icon/mobile/prev.png');
}

/* 下一章按钮 */
.btn-next::before {
    background-image: url('/assets/img/icon/mobile/next.png');
}

/* 夜间模式按钮 */
/*.btn-night::before {
    background-image: url('/assets/img/icon/mobile/night.png');
}*/

/* hover 效果 */
.toolbar-btn:hover {
    background-color: #444;
}

/* 侧边栏（底部右侧） - 优化为可伸缩 */
.sidebar {
    position: fixed;
    right: -2px;
    bottom: 83px; /* 高于底部工具栏 */
    background-color: #34B8A4;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s ease, width 0.3s ease, padding 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    width: 126px; /* 默认宽度 */
    font-size: 14px;
    border-radius: 16px 0 0 16px; /* 左侧圆角 */
}

.sidebar.collapsed {
    transform: translateX(calc(100% - 24px)); /* 向右侧收缩，只显示展开按钮 */
    width: 24px; /* 收缩后的宽度 */
    padding: 8px 6px; /* 收缩后的内边距 */
}

.sidebar::after {
    content: '>';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.sidebar.collapsed::after {
    transform: translateY(-50%) rotate(180deg); /* 收缩后箭头转向 */
}

.sidebar span {
    margin-left: 12px;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed span {
    opacity: 0;
    pointer-events: none;
}

/* 响应式适配 */
@media (max-width: 375px) {
    .footer-toolbar {
        height: 66px;
    }

    .toolbar-btn {
        font-size: 12px;
    }

    .toolbar-btn::before {
        width: 18px;
        height: 18px;
    }
}

/************************************************************/

/* 头部固定 */
.mobile-top-bar {
    position: fixed; /* 固定在顶部 */
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999; /* 确保层级最高 */
    /*display: none;*/ /* 默认隐藏 */
    height: 50px;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #f5f5f5;
    padding: 14px 15px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    font-weight: 500;
    font-size: 16px;
    color: #333333;
}
/* 手机端显示条件 */
@media (max-width: 768px) {
    .mobile-top-bar {
        display: inline-block;
    }
    /* 给main添加顶部内边距，避免内容被遮挡 */
    /*main {
        padding-top: 54px;
    }*/
}

.mobile-top-bar .back-btn {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
    float: left;
    padding-top: 3px;
}

.mobile-top-bar .title {
    font-size: 16px;
    font-weight: bold;
    flex: 1;
    text-align: center;
    margin: 0 10px; /* 避免挤压 */

    float: left;
    width: 76%;
    color: #333;
}

/******************************************************************************/
/* 夜间模式图标（初始展示） */
.btn-night::before {
    background-image: url('/assets/img/icon/mobile/night.png');
}

/* 日间模式图标（切换后展示） */
.btn-day::before {
    background-image: url('/assets/img/icon/mobile/day.png');
}

/* 夜间模式下 body 样式 */
body.night-mode {
    background-color: #1E1E1E;
}
