﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    background: #c6e5ec;
    color: #222;
    font-size: 14px;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

.topbar {
    height: 58px;
    background: #67b4ba;
    color: #0f3134;
}

.wrap {
    width: 1200px;
    margin: 0 auto;
}

.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;
        color: #123236;
        outline: none;
    }

    .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;
}

.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;
        }

.auth {
    display: flex;
    gap: 10px;
}

    .auth a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 72px;
        height: 32px;
        border: 1px solid #111;
        background: #fff;
        font-size: 13px;
    }

.main {
    min-height: calc(100vh - 116px);
    padding: 14px 0 40px;
}

.layout {
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: 14px;
    align-items: stretch;
    min-height: 680px;
}

.left,
.content,
.right {
    display: flex;
    flex-direction: column;
}

.card {
    background: #fff;
    border: 1px solid #e5edf0;
}

.card-title {
    padding: 14px 16px 8px;
    font-size: 16px;
    font-weight: 700;
}

.info-list {
    padding: 6px 18px 18px;
}

    .info-list li {
        padding: 9px 0 9px 20px;
        position: relative;
        color: #555;
    }

        .info-list li::before {
            content: "";
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #64c9bf;
            position: absolute;
            left: 0;
            top: 18px;
        }

.side-section {
    margin-bottom: 14px;
    min-height: 680px;
}

.recommend-list {
    padding: 8px 16px 14px;
}

    .recommend-list li {
        height: 44px;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0 8px;
        border-bottom: 1px solid #edf1f3;
        color: #333;
    }

        .recommend-list li.active {
            background: #8ad5cc;
        }

.avatar {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e9f5f6;
    border: 1px solid #d8e8eb;
    font-size: 15px;
    flex: 0 0 auto;
}

.all-link {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #edf1f3;
    color: #45bfb7;
    font-weight: 600;
    font-size: 13px;
}

.quick {
    margin-bottom: 8px;
}

.quick-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 8px;
}

    .quick-head h2 {
        font-size: 16px;
        font-weight: 500;
    }

    .quick-head a {
        font-size: 13px;
        font-weight: 600;
    }

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0 16px 14px;
}

.quick-item {
    height: 62px;
    border: 1px solid #edf1f3;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
}

    .quick-item strong {
        display: block;
        font-weight: 600;
        color: #222;
        margin-bottom: 2px;
    }

    .quick-item span {
        color: #777;
        font-size: 12px;
    }

.tabs {
    height: 46px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #edf1f3;
    padding: 0 16px;
    gap: 22px;
}

    .tabs a {
        height: 30px;
        line-height: 30px;
        padding: 0 14px;
        color: #555;
    }

        .tabs a.active {
            background: #5cc8bf;
            color: #fff;
        }

.filter {
    margin-left: auto;
    color: #777;
    font-size: 13px;
}

.notice-row {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #edf1f3;
    padding: 0 18px;
    color: #333;
}

.pin {
    display: inline-block;
    margin-right: 8px;
    padding: 1px 5px;
    background: #ffe6eb;
    color: #e74b65;
    border-radius: 2px;
    font-size: 12px;
}

.date {
    color: #777;
    font-size: 13px;
    white-space: nowrap;
    margin-left: 12px;
}

.resource-panel {
    margin-top: 0;
    min-height: 680px;
}

.resource-head {
    height: 48px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #edf1f3;
}

    .resource-head h2 {
        font-size: 16px;
        font-weight: 700;
    }

.resource-list {
    padding: 0 18px 8px;
}

    .resource-list li {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        border-bottom: 1px solid #edf1f3;
    }

.resource-title {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

    .resource-title a {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.tag {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 6px;
    background: #f2f6f7;
    color: #6d7d83;
    font-size: 12px;
    font-weight: 400;
    border: 1px solid #e3ebee;
    white-space: nowrap;
}

.dash {
    color: #999;
    margin: 0 2px;
}

.resource-time {
    width: 84px;
    text-align: right;
    color: #777;
    font-size: 13px;
    white-space: nowrap;
}

.post-card {
    padding: 18px;
    border-bottom: 1px solid #edf1f3;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #777;
    font-size: 13px;
    margin-bottom: 8px;
}

.post-title {
    font-size: 16px;
    font-weight: 700;
    margin: 8px 0 14px;
}

.hidden-box {
    width: 420px;
    max-width: 100%;
    background: #f5f6f7;
    border: 1px solid #e5e8ea;
    padding: 14px;
    color: #666;
}

    .hidden-box .lock {
        color: #222;
        font-weight: 600;
        margin-bottom: 10px;
    }

    .hidden-box button {
        margin-top: 12px;
        height: 28px;
        padding: 0 16px;
        border: 1px solid #64c9bf;
        background: #fff;
        color: #36aaa2;
        cursor: pointer;
    }

.post-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    color: #8a9aa0;
    font-size: 13px;
}

    .post-actions .comment {
        margin-left: auto;
        color: #42b9b1;
    }

.right-card {
    margin-bottom: 14px;
    min-height: 680px;
    padding: 16px;
}

.side-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.side-list li {
    padding: 9px 0;
    border-bottom: 1px solid #edf1f3;
    font-size: 13px;
    color: #333;
}

    .side-list li:last-child {
        border-bottom: 0;
    }

.side-list a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-list .type {
    color: #51bfb8;
    margin-right: 4px;
}

.login-box {
    padding: 18px;
}

    .login-box h3 {
        color: #58c7c0;
        font-size: 15px;
        margin-bottom: 8px;
    }

    .login-box p {
        color: #333;
        margin-bottom: 18px;
    }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 20px;
    background: #5cc8bf;
    color: #fff;
    border: 0;
    cursor: pointer;
}

.announcement {
    margin-top: 18px;
    border-top: 1px solid #edf1f3;
    padding-top: 10px;
}

    .announcement li {
        padding: 8px 0 8px 18px;
        position: relative;
        color: #444;
        font-size: 13px;
    }

        .announcement li::before {
            content: "";
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #64c9bf;
            position: absolute;
            left: 0;
            top: 17px;
        }

.center-link {
    display: block;
    text-align: center;
    padding: 12px 0;
    border-top: 1px solid #edf1f3;
    font-weight: 600;
}

.signin {
    padding: 18px;
    text-align: center;
}

.signin-title {
    color: #d8378a;
    font-weight: 600;
    margin-bottom: 18px;
}

.signin-actions {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin-bottom: 14px;
}

    .signin-actions a {
        height: 34px;
        line-height: 34px;
        padding: 0 18px;
        color: #fff;
    }

        .signin-actions a:first-child {
            background: #1ca5dc;
        }

        .signin-actions a:last-child {
            background: #e75b86;
        }

.rank-list {
    padding-top: 6px;
}

    .rank-list li {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 7px 0;
        border-bottom: 1px solid #edf1f3;
        text-align: left;
    }

    .rank-list .user {
        flex: 1;
    }

        .rank-list .user strong {
            display: block;
            font-weight: 500;
        }

        .rank-list .user span {
            color: #999;
            font-size: 12px;
        }

    .rank-list .score {
        color: #555;
        font-size: 12px;
        background: #f5f6f7;
        padding: 3px 7px;
        border-radius: 3px;
    }

.footer {
    margin-top: 24px;
    text-align: center;
    color: #6b8f96;
    font-size: 13px;
    padding-bottom: 30px;
}

@media (max-width: 1220px) {
    .wrap {
        width: 96%;
    }

    .layout {
        grid-template-columns: 220px 1fr 250px;
    }
}

@media (max-width: 980px) {
    .layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .side-section,
    .resource-panel,
    .right-card {
        min-height: auto;
    }

    .topbar .wrap,
    .header .wrap {
        height: auto;
        min-height: 58px;
        flex-wrap: wrap;
        gap: 12px;
        padding: 10px 0;
    }

    .quick-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .top-links,
    .nav {
        gap: 14px;
        flex-wrap: wrap;
    }

    .top-search {
        width: 100%;
    }

    .quick-grid {
        grid-template-columns: 1fr;
    }

    .resource-title {
        display: block;
    }

    .tag {
        margin-right: 6px;
    }

    .dash {
        display: none;
    }
}


/* =========================================================
       手机端顶部重排补丁 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;
        }
}
