/* 导航栏样式 - PC端 */
.nav-bar {
    width: 100%;
}
.nav-list {
    display: flex;
    align-items: center;
    padding: 0 10px;
    flex-wrap: wrap;
}
.nav-item {
    padding: 10px 22px;
}
.nav-item a {
    color: #fff;
    font-size: 16px;
}
.nav-item.login-btn {
    margin-left: auto;
    background-color: #f05454;
}
.nav-item.login-btn a {
    /* font-weight: bold; */
}

/* 广告通栏样式 - PC端 */
.ad-bar {
    background-color: #71a9c4;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    font-size: 15px;
    width: 100%;
}
.ad-bar .down-arrow {
    color: red;
    /* font-weight: bold; */
}

/* 主内容区通用样式 - PC端 */
.main-content {
    margin-top: 5px;
    /* padding: 0 10px; */
    width: 100%;
}
.content-card {
    background-color: #fff;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 2px;
    width: 100%;
}

/* 面包屑导航 - PC端 */
.breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d0efed;
    width: 100%;
}
.breadcrumb a {
    color: #666;
}
.breadcrumb a:hover {
    color: #00b39e;
}

/* 小说核心信息区 - PC端 */
.book-info {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
    width: 100%;
    flex-wrap: wrap;
}
.book-cover {
    padding-left: 30px;
}
.book-cover img {
    width: 133px;
    height: 200px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid #dee2e6;
    padding: 1px;
}
.book-detail {
    flex: 1;
    min-width: 280px;
}
.book-title {
    font-size: 22px;
    /* font-weight: bold; */
    margin-bottom: 12px;
}
.book-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.meta-tag {
    padding: 3px 10px;
    color: #fff;
    border-radius: 2px;
    font-size: 14px;
}
/* PC端添加作者/更新时间前缀 */
.meta-tag.author::before {
    content: "作者：";
    margin-right: 5px;
}
.meta-tag.update-time::before {
    content: "更新时间：";
    margin-right: 5px;
}
.meta-tag.author {
    background-color: #f26e59;
}
.meta-tag.update-time {
    background-color: #adb3f3;
    color: white;
}
.book-status, .book-latest {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}
.book-status span, .book-latest span {
    color: #333;
    font-weight: 500;
}
.book-latest span {
    color: #168C84;
    font-weight: 500;
}
.book-btns {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}
.book-btns-mobile {
    display: none;
}
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 2px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}
.btn.add-shelf {
    background-color: #07B1A6;
}
.btn.read-now {
    background-color: #f26e59;
}

/* 小说简介区 - PC端 */
.book-desc {
    margin-bottom: 25px;
    padding-top: 15px;
    border-top: 1px dashed gray;
    width: 100%;
}
.desc-title {
    font-size: 16px;
    /* font-weight: bold; */
    margin-bottom: 10px;
}
.desc-content {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.3s ease;
}
.desc-content.expanded {
    -webkit-line-clamp: unset;
    height: auto;
}
.desc-toggle {
    color: #00bfa5;
    font-size: 13px;
    margin-top: 8px;
    cursor: pointer;
    display: inline-block;
}
.desc-toggle:hover {
    /* text-decoration: underline; */
}

/* 作者其它作品 - PC端 */
.other-works {
    margin-bottom: 15px;
    font-size: 14px;
    width: 100%;
    word-wrap: break-word;
    word-break: break-all;
}
.other-works .label {
    color: #f05454;
    font-weight: 500;
}
.other-works a {
    color: #d6336c;
    margin: 0 5px;
}
.other-works a:hover {
    /* text-decoration: underline; */
}

/* 分享功能区 - PC端 */
.share-box {
    display: flex;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e2e2e2;
    width: 100%;
}
.share-input {
    flex: 1;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #ccc;
    border-radius: 2px 0 0 2px;
    font-size: 14px;
    color: #c3c3c3;
}
.share-btn {
    height: 32px;
    padding: 0 18px;
    background-color: #028090;
    color: #fff;
    border: none;
    border-radius: 0 2px 2px 0;
    cursor: pointer;
    font-size: 14px;
}
/* 章节列表通用样式 - PC端 */
.chapter-section {
    margin-bottom: 5px;
    width: 100%;
}
.reverse-btn {
    padding: 4px 12px;
    background-color: #e67e22;
    color: #fff;
    border: none;
    border-radius: 2px;
    font-size: 13px;
    cursor: pointer;
}
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 10px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #c6f0eb;
    width: 100%;
}
.chapter-item {
    display: block !important;       /* 必须是块级元素 */
    width: 100% !important;          /* 宽度占满父容器 */
    /* 单行省略核心三要素 */
    white-space: nowrap !important;   /* 强制文本不换行 */
    overflow: hidden !important;      /* 超出部分隐藏 */
}
.chapter-item a {
    font-size: 14px;
    color: #333;
    display: block;
    padding: 4px 0;
}
.chapter-item a:hover {
    color: #00b39e;
    /* text-decoration: underline; */
}



/* 推荐标题 */
.recommend-title {
    color: #f05454;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 15px;
    padding-top: 20px;
    border-top: 1px dashed #e2e2e2;
    width: 100%;
}

/* ========== 移动端适配 (768px以下) - 核心优化 ========== */
@media screen and (max-width: 768px) {
    /* 主内容区 - 核心规整 */
    .main-content {
        margin-top: 0;
        padding: 0 5px;
    }
    .content-card {
        padding: 10px 5px;
        margin-bottom: 5px;
        border-radius: 0;
        box-shadow: none;
        background-color: #fff;
    }

    /* 面包屑 - 简化且规整 */
    .breadcrumb {
        font-size: 14px;
        color: #666;
        margin-bottom: 8px;
        padding-bottom: 5px;
        border-bottom: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 小说信息区 - 彻底解决混乱 */
    .book-info {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 0;
        align-items: flex-start;
    }
    .book-cover img {
        width: 80px;
        height: 120px;
        border-radius: 3px;
        flex-shrink: 0;
    }
    .book-detail {
        flex: 1;
        /* width: calc(100% - 88px); */
    }
    .book-title {
        font-size: 17px;
        /* font-weight: bold; */
        margin-bottom: 5px;
        line-height: 1.3;
        color: #333;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .book-meta {
        flex-direction: column;
        gap: 2px;
        align-items: flex-start;
        margin-bottom: 3px;
    }
    .meta-tag {
        padding: 0;
        color: #666;
        font-size: 13px;
        background-color: transparent; /* 移动端背景透明 */
        display: block;
        width: 100%;
    }
    .meta-tag.author::before {
        content: "作者：";
        color: #333;
        font-weight: 500;
    }
    .meta-tag.update-time::before {
        content: "更新时间：";
        color: #333;
        font-weight: 500;
    }
    .book-status, .book-latest {
        font-size: 13px;
        color: #666;
        margin-bottom: 3px;
        line-height: 1.5;
        width: 100%;
    }
    .book-status span, .book-latest span {
        color: #333;
        font-weight: 500;
    }
    .book-latest span {
        color: #168C84;
        font-weight: 500;
    }
    .book-btns {
        flex-direction: row;
        gap: 10px;
        margin-top: 0;
        width: 100%;
    }
    .book-btns-mobile {
        display: none;
    }
    .btn {
        padding: 8px 0;
        font-size: 14px;
        flex: 1;
        border-radius: 3px;
        text-align: center;
        font-weight: 500;
    }
    .btn.add-shelf {
        background-color: #ff9800;
    }
    .btn.read-now {
        background-color: #00bfa5;
    }

    /* 小说简介 - 解决文字溢出，保留折叠功能 */
    .book-desc {
        margin-bottom: 12px;
        padding-top: 8px;
        border-top: none;
    }
    .desc-title {
        font-size: 14px;
        margin-bottom: 5px;
        color: #333;
        font-weight: 500;
    }
    .desc-content {
        font-size: 12px;
        color: #666;
        line-height: 1.6;
        word-wrap: break-word;
        word-break: break-all;
        -webkit-line-clamp: 3;
    }
    .desc-toggle {
        font-size: 12px;
        margin-top: 5px;
    }

    /* 作者其他作品 - 规整排版 */
    .other-works {
        font-size: 12px;
        margin-bottom: 12px;
        line-height: 1.5;
        color: #666;
        word-wrap: break-word;
        word-break: break-all;
    }
    .other-works .label {
        font-weight: 500;
        display: block;
        margin-bottom: 3px;
    }
    .other-works a {
        color: #333;
        margin: 0 3px;
    }
    .other-works .split-line {
        color: #f77474;
    }
    /* 分享栏 - 取消漂浮，放在其它作品后面 */
    .share-box {
        position: static;
        background-color: #fff;
        padding: 0;
        border-top: none;
        border-bottom: 1px dashed #e2e2e2;
        z-index: auto;
        width: 100%;
        height: auto;
        padding-bottom: 12px;
    }
    .share-input {
        height: 38px;
        font-size: 12px;
        border-radius: 3px 0 0 3px;
        border: 1px solid #ccc;
        padding: 0 8px;
    }
    .share-btn {
        height: 38px;
        padding: 0 12px;
        border-radius: 0 3px 3px 0;
        font-size: 14px;
        background-color: #00bfa5;
    }

    /* 新书推荐 - 移动端隐藏 */
    .new-book-recommend {
        display: none !important;
    }

    /* 章节列表 - 移动端适配（改为2列布局） */
    .chapter-section {
        margin-bottom: 5px;
    }
    .section-header {
        margin-bottom: 10px;
        padding-bottom: 5px;
    }
    .section-title {
        font-size: 14px;
        padding-bottom: 5px;
        margin-bottom: -5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .reverse-btn {
        padding: 3px 8px;
        font-size: 12px;
    }
    .chapter-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 5px;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    .chapter-item a {
        font-size: 12px;
        padding: 3px 0;
        padding-left: 5px;
        border-bottom: 1px solid #f5f5f5;
    }

    

    /* 推荐标题 - 移动端适配 */
    .recommend-title {
        font-size: 13px;
        margin-bottom: 10px;
        padding-top: 10px;
        padding-left: 5px;
    }
}

/* 小屏手机适配 (480px以下) - 极致适配 */
@media screen and (max-width: 480px) {
    .nav-item {
        padding: 5px 8px;
        font-size: 12px;
    }
    .book-cover {
        padding-left: 0;
    }
    .book-cover img {
        width: 100px;
        height: 142px;
    }
    .book-detail {
        /* width: calc(100% - 78px); */
        min-width: auto;
        display: grid;
    }
    .book-title {
        font-size: 20px;
    }
    .btn {
        padding: 7px 0;
        font-size: 13px;
    }
    .share-input {
        height: 35px;
        font-size: 13px;
    }
    .share-btn {
        height: 35px;
        padding: 0 10px;
        font-size: 13px;
    }
    .chapter-grid {
        grid-template-columns: 1fr;
    }
    .meta-tag.author {
        background-color: inherit;
        color: #666;
    }
    .meta-tag.update-time {
        background-color: inherit;
        color: #666;
    }
    .book-btns-pc {
        display: none;
    }
    .book-btns-mobile {
        display: flex;
    }
}
