/* 書架頁面樣式 */

/* 書架容器 */
.bookshelfSection {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 135px - 40px - 84px);
    /* 減去 header(135px) + main的padding-bottom(40px) + footer(84px) */
}

/* Tab切換 */
.bookshelfTab {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    /* 不收縮 */
    background: var(--white-color);
    border-bottom: 1px solid var(--color-e0e0e0);
}

.bookshelfTab .tabItem {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-666);
    text-decoration: none;
    position: relative;
    transition: all 0.3s;
    background: transparent;
}

.bookshelfTab .tabItem:hover {
    color: var(--color-333);
}

.bookshelfTab .tabItem.active {
    color: var(--primary-color);
    font-weight: 600;
}

.bookshelfTab .tabItem.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color-2), var(--primary-color));
    border-radius: 3px 3px 0 0;
}

/* PC端：listBox 容器可滾動 */
.bookshelfSection .listBox {
    overflow-y: auto;
    flex: 1;
    /* 佔據剩餘空間 */
    min-height: 0;
    /* 修復 flex 子元素滾動問題 */
    align-content: flex-start;
    /* 內部項目從頂部開始排列 */
    padding-bottom: 15px;
    /* 隱藏滾動條但保留滾動功能 */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.bookshelfSection .listBox::-webkit-scrollbar {
    display: none;
}

/* PC端：翻頁固定在底部 */
.bookshelfSection .page {
    flex-shrink: 0;
    /* 不收縮 */
    padding-bottom: 0;
}

/* 書架特有樣式 - 卡片效果 */
.bookshelfSection .listBox-w5 .listItem {
    background: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s;
    padding: 15px;
    margin-right: 15px !important;
    margin-top: 15px !important;
}

/* PC端 - 每行最後一個（第5、10、15...）不要右邊距 */
.bookshelfSection .listBox-w5 .listItem:nth-child(5n+5) {
    margin-right: 0 !important;
}

.bookshelfSection .listBox-w5 .listItem:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.bookshelfSection .listBox-w5 .listImgBox {
    margin-bottom: 10px;
}

.bookshelfSection .listBox-w5 .listInfoBox {
    position: relative;
}

.bookshelfSection .listBox-w5 .itemName {
    font-size: 15px;
    font-weight: bold;
    line-height: 20px;
    height: auto;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.bookshelfSection .listBox-w5 .itemName a {
    color: var(--color-333);
    text-decoration: none;
    transition: all 0.3s;
}

.bookshelfSection .listBox-w5 .itemName a:hover {
    color: var(--primary-color);
}

.bookshelfSection .listBox-w5 .listItem:hover .itemName a {
    color: var(--primary-color);
}

.listBox-w5 .itemMeta {
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    gap: 6px;
    margin-top: 10px;
}

/* 每一行（標籤+按鈕） */
.listBox-w5 .itemMeta .itemMetaRow {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

/* 標籤文字 */
.listBox-w5 .itemMeta .metaLabel {
    font-size: 12px;
    color: var(--color-666);
    line-height: 1.4;
    flex-shrink: 0;
    /* 標籤不收縮 */
}

/* 上次閱讀按鈕 */
.listBox-w5 .itemMeta .itemLastRead {
    display: block;
    padding: 4px 10px;
    background: var(--color-efefef);
    color: var(--color-666);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    flex: 1;
    /* 佔滿剩餘空間 */
}

.listBox-w5 .itemMeta .itemLastRead:hover {
    background: linear-gradient(120deg, var(--primary-color-2), var(--primary-color));
    color: var(--white-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* 最新章節按鈕 */
.listBox-w5 .itemMeta .itemLatest {
    display: block;
    padding: 4px 10px;
    background: var(--color-efefef);
    color: var(--color-666);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    flex: 1;
    /* 佔滿剩餘空間 */
}

.listBox-w5 .itemMeta .itemLatest:hover {
    background: linear-gradient(120deg, var(--primary-color-2), var(--primary-color));
    color: var(--white-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* 更新時間文字 */
.listBox-w5 .itemMeta .itemUpdate {
    font-size: 11px;
    color: var(--color-999);
    line-height: 1.4;
}

/* 狀態標籤移到左上角 */
.bookshelfSection .listBox-w5 .listImgBox em {
    top: auto;
    bottom: 3px;
    left: 3px;
    right: auto;
}

/* 刪除按鈕 - 圖片右上角 */
.bookshelfSection .listBox-w5 .listImgBox {
    position: relative;
}

.listBox-w5 .deleteBtn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.listBox-w5 .deleteBtn::before,
.listBox-w5 .deleteBtn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    background: var(--white-color);
    transition: all 0.3s;
}

.listBox-w5 .deleteBtn::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.listBox-w5 .deleteBtn::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.listBox-w5 .deleteBtn:hover {
    background: rgba(255, 71, 87, 0.9);
    transform: scale(1.1);
}
.listBox-w5 .itemMeta{
    height: auto;
}
/* 響應式 - 移動端 */
@media screen and (max-width: 1080px) {
    .bookshelfSection {
        padding: 0;
        height: auto;
        /* 移動端不固定高度 */
        display: block;
        /* 移動端不使用 flex 布局 */
        padding-top: 40px;
        /* 為固定的 tab 留出空間 */
    }

    /* 移動端：Tab 固定在頂部 */
    .bookshelfTab {
        position: fixed;
        top: 100px;
        /* header 高度 */
        left: 0;
        right: 0;
        z-index: 998;
        background: var(--white-color);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        padding: 0 12px;
    }

    .bookshelfTab .tabItem {
        padding: 10px 18px;
        font-size: 14px;
    }

    /* 移動端：listBox 不滾動，正常流式布局 */
    .bookshelfSection .listBox {
        overflow-y: visible;
        flex: none;
        padding-bottom: 0;
        padding: 0 12px;
    }

    /* 本頁移動端仍使用分頁樣式，不走全局 loadmore */
    .bookshelfSection .page {
        display: block !important;
    }

    .bookshelfSection .listBox-w5 .listItem {
        padding: 8px;
        margin-top: 12px !important;
        margin-right: 12px !important;
    }

    /* 移動端 - 每行最後一個（第2、4、6...）不要右邊距 */
    .bookshelfSection .listBox-w5 .listItem:nth-child(2n+2) {
        margin-right: 0 !important;
    }

    .listBox-w5 .itemMeta {
        gap: 8px;
        margin-top: 10px;
    }

    .listBox-w5 .itemMeta .itemMetaRow {
        gap: 8px;
    }

    .listBox-w5 .itemMeta .metaLabel {
        font-size: 12px;
    }

    /* 移動端按鈕增大點擊區域，保持灰色 */
    .listBox-w5 .itemMeta .itemLastRead,
    .listBox-w5 .itemMeta .itemLatest {
        padding: 8px 12px;
        font-size: 13px;
        background: var(--color-efefef);
        color: var(--color-666);
        border-radius: 8px;
    }

    /* 移動端按鈕 hover 不變色 */
    .listBox-w5 .itemMeta .itemLastRead:hover,
    .listBox-w5 .itemMeta .itemLatest:hover {
        background: var(--color-efefef);
        color: var(--color-666);
        transform: none;
        box-shadow: none;
    }

    .listBox-w5 .itemMeta .itemUpdate {
        font-size: 11px;
    }

    .listBox-w5 .deleteBtn {
        width: 32px;
        height: 32px;
        top: 5px;
        right: 5px;
        /* background: rgba(255, 71, 87, 0.9); */
    }

    .listBox-w5 .deleteBtn::before,
    .listBox-w5 .deleteBtn::after {
        width: 14px;
    }
}