﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    background: #c6e5ec;
    color: #111;
    font-size: 14px;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

.wrap {
    width: 1200px;
    margin: 0 auto;
}

.topbar {
    height: 58px;
    background: #67b4ba;
    color: #0f3134;
}

    .topbar .wrap {
        height: 58px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

.top-links {
    display: flex;
    gap: 34px;
    font-weight: 600;
}

.top-search {
    display: flex;
    align-items: center;
    width: 290px;
    height: 34px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(0,0,0,.08);
}

    .top-search select {
        width: 68px;
        height: 100%;
        border: 0;
        background: transparent;
        padding-left: 10px;
        color: #123236;
        outline: none;
    }

    .top-search input {
        flex: 1;
        height: 100%;
        border: 0;
        background: transparent;
        padding: 0 8px;
        outline: none;
        color: #123236;
    }

    .top-search button {
        width: 42px;
        height: 100%;
        border: 0;
        background: transparent;
        cursor: pointer;
        font-size: 18px;
    }

.header {
    background: #fff;
    border-bottom: 1px solid #d9eef2;
}

    .header .wrap {
        height: 58px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

.logo {
    font-size: 24px;
    letter-spacing: 1px;
    font-weight: 500;
    white-space: nowrap;
}

.nav {
    display: flex;
    align-items: center;
    gap: 28px;
    color: #222;
}

    .nav a {
        height: 58px;
        display: flex;
        align-items: center;
        border-bottom: 3px solid transparent;
        font-weight: 500;
    }

        .nav a.active {
            color: #4fc3c1;
            border-bottom-color: #f24848;
        }

.main {
    min-height: calc(100vh - 116px);
    padding: 14px 0 42px;
}

.page-bar {
    height: 52px;
    background: #fff;
    border: 1px solid #e5edf0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    margin-bottom: 14px;
}

.page-tabs {
    display: flex;
    align-items: center;
    gap: 26px;
    height: 100%;
}

    .page-tabs a {
        height: 52px;
        display: flex;
        align-items: center;
        border-bottom: 2px solid transparent;
        font-size: 15px;
        font-weight: 500;
    }

        .page-tabs a.active {
            border-bottom-color: #f24848;
        }

.page-search {
    width: 260px;
    height: 34px;
    border-radius: 18px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: #888;
}

    .page-search span {
        font-size: 18px;
        margin-right: 6px;
        color: #111;
    }

    .page-search input {
        flex: 1;
        border: 0;
        background: transparent;
        outline: none;
        color: #333;
    }

.list-card {
    background: #fff;
    border: 1px solid #e5edf0;
    min-height: 720px;
}

.list-head {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #edf1f3;
}

    .list-head h1 {
        font-size: 17px;
        font-weight: 700;
    }

    .list-head span {
        color: #8a9aa0;
        font-size: 13px;
    }

.resource-list li {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 16px;
    border-bottom: 1px solid #edf1f3;
}

    .resource-list li:hover {
        background: #fafafa;
    }

.resource-main {
    flex: 1;
    min-width: 0;
}

.resource-type {
    display: block;
    color: #9ba9af;
    font-size: 14px;
    margin-bottom: 3px;
}

.resource-title {
    display: flex;
    align-items: center;
    min-width: 0;
    font-size: 16px;
    color: #111;
    font-weight: 500;
}

    .resource-title a {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.dash {
    color: #999;
    padding: 0 10px;
    flex: 0 0 auto;
}

.resource-time {
    width: 110px;
    text-align: right;
    color: #777;
    font-size: 14px;
    white-space: nowrap;
    flex: 0 0 auto;
}

.pager {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid #edf1f3;
}

    .pager a {
        min-width: 32px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #dfe8eb;
        background: #fff;
        color: #555;
        padding: 0 10px;
    }

        .pager a.active {
            background: #5cc8bf;
            color: #fff;
            border-color: #5cc8bf;
        }

.footer {
    margin-top: 24px;
    text-align: center;
    color: #6b8f96;
    font-size: 13px;
}

@media (max-width: 1220px) {
    .wrap {
        width: 96%;
    }
}

@media (max-width: 760px) {
    .topbar .wrap,
    .header .wrap,
    .page-bar {
        height: auto;
        min-height: 58px;
        flex-wrap: wrap;
        gap: 12px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .top-links,
    .nav,
    .page-tabs {
        gap: 14px;
        flex-wrap: wrap;
    }

    .top-search,
    .page-search {
        width: 100%;
    }

    .resource-list li {
        align-items: flex-start;
    }

    .resource-title {
        display: block;
    }

    .dash {
        display: none;
    }

    .resource-time {
        width: 86px;
        font-size: 13px;
    }
}


/* =========================================================
       手机端顶部重排补丁 v2
       目的：修复 320px - 430px 手机宽度下顶部错版、导航换行、搜索框挤压
       ========================================================= */
@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        font-size: 14px;
    }

    .wrap {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 8px;
        padding-right: 8px;
    }

    /* 顶部公告 + 搜索：改成上下两行，避免挤在 58px 固定高度内 */
    .topbar {
        height: auto !important;
        min-height: 0 !important;
    }

        .topbar .wrap {
            height: auto !important;
            min-height: 0 !important;
            display: block !important;
            padding-top: 6px !important;
            padding-bottom: 8px !important;
        }

    .top-links {
        width: 100%;
        height: 24px;
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: 18px !important;
        flex-wrap: nowrap !important;
        font-size: 12px;
        line-height: 24px;
        overflow: hidden;
        white-space: nowrap;
    }

    .top-search {
        width: 100% !important;
        height: 30px !important;
        margin-top: 5px;
        flex: none !important;
        background: rgba(255,255,255,.28);
    }

        .top-search select {
            width: 62px;
            min-width: 62px;
            padding-left: 6px;
            font-size: 12px;
        }

        .top-search input {
            min-width: 0;
            font-size: 12px;
            padding-left: 6px;
        }

        .top-search button {
            width: 34px;
            min-width: 34px;
            font-size: 16px;
        }

    /* Logo 独占一行，分类导航独占一行横向滑动，不再自动换行 */
    .header .wrap {
        height: auto !important;
        min-height: 0 !important;
        display: block !important;
        padding-top: 6px !important;
        padding-bottom: 0 !important;
    }

    .logo {
        display: block !important;
        width: 100%;
        height: 34px;
        line-height: 34px;
        margin: 0 !important;
        font-size: 20px !important;
        font-weight: 500;
        white-space: nowrap;
    }

    .nav {
        width: 100%;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: flex-start;
        gap: 20px !important;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

        .nav::-webkit-scrollbar {
            display: none;
        }

        .nav a {
            flex: 0 0 auto !important;
            height: 36px !important;
            line-height: 36px;
            display: inline-flex !important;
            align-items: center;
            font-size: 13px;
            white-space: nowrap;
            border-bottom-width: 2px;
        }

    /* 页面二级顶部：搜索框和分类都改为可横向滑动/独占行 */
    .page-bar {
        height: auto !important;
        min-height: 0 !important;
        display: block !important;
        padding: 8px !important;
        margin-bottom: 10px;
    }

    .breadcrumb {
        display: block;
        width: 100%;
        margin-bottom: 8px;
        font-size: 13px;
        line-height: 1.6;
        white-space: normal;
        word-break: break-word;
    }

    .page-search {
        width: 100% !important;
        height: 34px !important;
    }

    .page-tabs {
        width: 100%;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 18px !important;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 8px;
    }

        .page-tabs::-webkit-scrollbar {
            display: none;
        }

        .page-tabs a {
            flex: 0 0 auto !important;
            height: 30px !important;
            line-height: 30px;
            font-size: 13px;
            display: inline-flex !important;
            align-items: center;
        }

    .main {
        padding-top: 10px;
    }
}

/* 375px 以下进一步压缩顶部间距 */
@media (max-width: 420px) {
    .wrap {
        padding-left: 7px;
        padding-right: 7px;
    }

    .top-links {
        gap: 16px !important;
    }

    .nav {
        gap: 18px !important;
    }

        .nav a {
            font-size: 12px;
        }

    .logo {
        font-size: 19px !important;
    }
}

/* 内容区窄屏补强：防止顶部修好后列表本身继续横向撑破 */
@media (max-width: 520px) {
    .resource-list li {
        min-width: 0;
    }

    .resource-title,
    .resource-main,
    .title-block,
    .comment-body {
        min-width: 0;
    }

        .resource-title a,
        .side-list a,
        .related-list a {
            white-space: normal !important;
            word-break: break-word;
        }

    .resource-time,
    .related-list time {
        white-space: nowrap;
    }

    .btn-row,
    .signin-actions,
    .comment-meta {
        width: 100%;
    }

    .get-btn,
    .btn {
        width: 100%;
    }
}

/* 首页资源列表：小屏改为上下结构，时间不再挤压标题 */
@media (max-width: 520px) {
    .content .resource-list li {
        display: block !important;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .content .resource-time {
        display: block;
        width: auto !important;
        text-align: left !important;
        margin-top: 5px;
        font-size: 12px;
    }
}

/* 最新资源列表页：时间列下移，避免标题区过窄 */
@media (max-width: 520px) {
    .list-card .resource-list li {
        display: block !important;
    }

    .list-card .resource-time {
        display: block;
        width: auto !important;
        text-align: left !important;
        margin-top: 5px;
        font-size: 12px;
    }

    .pager {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 8px;
        scrollbar-width: none;
    }

        .pager::-webkit-scrollbar {
            display: none;
        }

        .pager a {
            flex: 0 0 auto;
        }
}
