/* Desktop-only enhancements for home page; mobile remains unchanged */
.pt-pc-header {
    display: none;
}

@media (max-width: 767px) {
    .pt-home-main {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .pt-recomment-cont,
    .pt-update-cont {
        width: 100%;
    }

    .pt-recomment-item,
    .pt-update-item {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        align-items: flex-start;
    }

    /* 封面與文字區：文字列可伸縮、省略號生效 */
    .pt-recomment-item > a:first-child,
    .pt-update-item > a:first-child {
        flex-shrink: 0;
        display: block;
        overflow: hidden;
    }

    /* 站長推薦：封面略大 */
    .pt-recomment-item > a:first-child img {
        width: 18vw;
        height: 24vw;
        max-width: 92px;
        max-height: 123px;
        object-fit: cover;
        display: block;
    }

    /* 覆蓋 global 中 .pt-update-item>a 的寬高，避免封面錨點撐破佈局 */
    .pt-update-item > a:first-child {
        width: 11.5vw !important;
        max-width: 68px !important;
        height: auto !important;
        line-height: 0;
    }

    /* 最新更新：封面較小，給書名/章節留足寬度 */
    .pt-update-item > a:first-child img {
        width: 11.5vw;
        height: 15.3vw;
        max-width: 68px;
        max-height: 91px;
        object-fit: cover;
        display: block;
    }

    .pt-recomment-item > .flex-item,
    .pt-update-item > .flex-item,
    .pt-update-item > .pt-update-text {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        width: auto !important;
    }

    /* 站長推薦：書名 + 人在追 */
    .pt-recomment-item .flex-between > .size14:first-child {
        flex: 1 1 0;
        min-width: 0;
        padding-right: 0.06rem;
    }

    .pt-recomment-item .flex-between > .size14:first-child a {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pt-recomment-item .flex-between > .color2.size14 {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .pt-recomment-item .compulsory-row {
        min-width: 0;
    }

    /* 最新更新：書名 + 日期 */
    .pt-update-item .flex-between > .size14:first-child {
        flex: 1 1 0;
        min-width: 0;
        padding-right: 0.06rem;
    }

    .pt-update-item .flex-between > .size14:first-child a {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pt-update-item .flex-between > .color4.size12 {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .pt-update-item .compulsory-row-one {
        min-width: 0;
    }

    .pt-update-item .compulsory-row-one a {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 作者與分類一行 */
    .pt-recomment-item .flex-between:last-child .authorlabel,
    .pt-update-item .flex-between:last-child .authorlabel {
        flex: 1 1 0;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pt-recomment-item .flex-between:last-child .pt-recomment-label,
    .pt-update-item .flex-between:last-child .pt-recomment-label {
        flex-shrink: 0;
        margin-left: 0.06rem;
        max-width: 36%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pt-update-list-pc {
        display: none !important;
    }

    .pt-home-top {
        display: block;
    }

    .pt-home-top .pt-nav {
        flex-wrap: wrap;
        height: auto;
        padding-bottom: .1rem;
    }

    .pt-home-top .pt-nav-search-wrap {
        width: 100%;
        min-width: 0;
        padding: .08rem 0 0 !important;
    }

    .pt-friendlink {
        display: none !important;
    }
}

@media (min-width: 768px) {
    body {
        background: #f5f6fa !important;
    }

    .pt-home-main {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 76px 12px 0;
    }

    .pt-pc-header {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background: #fff;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

    .pt-pc-header-inner {
        max-width: none;
        height: 64px;
        margin: 0;
        padding: 0 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .pt-pc-logo {
        font-size: 24px;
        font-weight: 700;
        line-height: 1;
    }

    .pt-pc-menu {
        display: flex;
        align-items: center;
        gap: 18px;
    }

    .pt-pc-menu-item {
        font-size: 15px;
        color: #333;
        padding: 8px 12px;
        border-radius: 6px;
        transition: background-color .2s ease, color .2s ease;
    }

    .pt-pc-menu-item:visited {
        color: #333;
    }

    .pt-pc-menu-item:hover {
        color: #f55;
        background: #fff1f1;
    }

    .pt-nav,
    .pt-new,
    .pt-recomment,
    .pt-update,
    .pt-friendlink {
        border-radius: 10px;
        margin-bottom: 12px;
    }

    .pt-nav {
        justify-content: flex-start;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 0;
        padding: 10px 20px;
        height: auto;
        min-height: 54px;
    }

    .pt-search {
        width: 100%;
        max-width: 560px;
        height: 36px;
        margin-top: 8px;
    }

    .pt-home-top .pt-search {
        max-width: none;
        margin-top: 0;
    }

    .pt-home-top .pt-nav-search-wrap .pt-search-icon {
        width: 18px;
        height: 18px;
    }

    .pt-home-top .pt-nav-search-wrap input {
        font-size: 13px;
        line-height: 1;
    }

    .pt-home-top .pt-nav-search-wrap {
        flex: 0 1 360px;
        width: auto;
        min-width: 280px;
        margin: 0;
        padding: 0 0 0 10px;
        background: transparent !important;
    }

    .pt-new-cont {
        overflow-x: auto;
    }

    .pt-new-item {
        width: 150px;
    }

    .pt-new-item img {
        width: 120px;
        height: 162px;
    }

    .pt-recomment-item img,
    .pt-update-item img,
    .pt-update-item > a {
        width: 100px;
        height: 136px;
    }

    .pt-recomment-cont {
        display: flex !important;
        flex-wrap: wrap;
        align-items: stretch;
        justify-content: space-between;
        gap: 0;
    }

    .pt-recomment-item {
        flex: 0 0 calc(50% - 9px);
        max-width: calc(50% - 9px);
        width: calc(50% - 9px);
        min-width: 0;
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .pt-recomment-item > .flex-item {
        max-width: none !important;
        width: auto !important;
        min-width: 0;
    }

    .pt-update-cont {
        display: flex !important;
        flex-wrap: wrap;
        align-items: stretch;
        justify-content: space-between;
        gap: 0;
    }

    .pt-update-item {
        flex: 0 0 calc(50% - 9px);
        max-width: calc(50% - 9px);
        width: calc(50% - 9px);
        min-width: 0;
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .pt-update-item > .flex-item {
        max-width: none !important;
        width: auto !important;
        min-width: 0;
    }

    .pt-update-list-pc {
        display: none;
    }

    .pt-update-line {
        display: flex;
        align-items: center;
        height: 56px;
        line-height: 56px;
        border-bottom: 1px solid #ececec;
        font-size: 14px;
        color: #666 !important;
    }

    .pt-update-line:hover {
        background: #fafafa;
    }

    .pt-update-line > a {
        text-decoration: none;
        min-width: 0;
    }

    .pt-update-sort {
        width: 16%;
        color: #666;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pt-update-book {
        width: 26%;
        color: #333;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pt-update-chapter {
        width: 34%;
        color: #666;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pt-update-author {
        width: 14%;
        text-align: right;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pt-update-date {
        width: 10%;
        text-align: right;
        color: #666;
        white-space: nowrap;
    }

    @media (min-width: 1400px) {
        .pt-recomment-item {
            flex-basis: calc(33.3333% - 12px);
            max-width: calc(33.3333% - 12px);
            width: calc(33.3333% - 12px);
        }

        .pt-update-item {
            flex-basis: calc(33.3333% - 12px);
            max-width: calc(33.3333% - 12px);
            width: calc(33.3333% - 12px);
        }
    }

    .pt-update-cont {
        display: none !important;
    }

    .pt-update-list-pc {
        display: block;
        padding: 0 15px 8px;
    }

    /* PC 首頁隱藏底部書架/書城/完本導航（頂部已有入口） */
    .pt-tabbar {
        display: none !important;
    }

    .pt-copyright {
        margin-bottom: 0.2rem;
    }

    .pt-friendlink {
        padding: 16px 0 20px;
        overflow: hidden;
    }

    .pt-friendlink-title {
        margin-left: 20px;
        margin-bottom: 12px;
        padding-left: 8px;
        border-left: 4px solid #f55;
        font-size: 16px;
        line-height: 1.4;
    }

    .pt-friendlink-cont {
        padding: 8px 20px 4px;
        line-height: 2.2;
        font-size: 14px;
    }

    .pt-friendlink-cont a {
        display: inline-block;
        margin-right: 12px;
        padding: 6px 0;
        color: #666;
    }

    .pt-friendlink-cont a:visited {
        color: #666;
    }

    .pt-friendlink-cont a:hover {
        color: #f55;
    }

    @media (max-width: 1100px) {
        .pt-home-top .pt-nav-search-wrap {
            flex-basis: 100%;
            width: 100%;
            min-width: 0;
            padding: 0 !important;
        }

        .pt-home-top .pt-nav-search-wrap .pt-search {
            height: 42px;
        }

        .pt-home-top .pt-nav-search-wrap .pt-search-icon {
            width: 21px;
            height: 21px;
        }

        .pt-home-top .pt-nav-search-wrap input {
            font-size: 14px;
        }
    }
}

@media (min-width: 960px) {
    .pt-home-main {
        max-width: 960px;
        margin: 0 auto;
        padding-left: 0;
        padding-right: 0;
    }

    .pt-pc-header-inner {
        max-width: 960px;
        margin: 0 auto;
        padding: 0 20px;
    }
}
