﻿* {
    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.7;
}

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;
        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;
    white-space: nowrap;
}

.nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

    .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;
}

.breadcrumb {
    color: #8a9aa0;
    font-size: 14px;
}

    .breadcrumb a {
        color: #333;
    }

.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;
    }

.layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 14px;
    align-items: start;
}

.card {
    background: #fff;
    border: 1px solid #e5edf0;
}

.detail-card {
    min-height: 720px;
    padding: 26px 28px 30px;
}

.detail-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #edf1f3;
}

.title-block {
    flex: 1;
    min-width: 0;
}

.resource-type {
    display: inline-block;
    color: #8a9aa0;
    font-size: 13px;
    margin-bottom: 8px;
}

.detail-title {
    font-size: 22px;
    line-height: 1.45;
    font-weight: 700;
    color: #111;
    margin-bottom: 10px;
}

.name-time {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
    flex-wrap: wrap;
}

    .name-time strong {
        color: #333;
        font-weight: 500;
    }

    .name-time .dash {
        color: #999;
    }

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tag {
    height: 24px;
    line-height: 22px;
    padding: 0 9px;
    border: 1px solid #dfe8eb;
    background: #f7fafb;
    color: #6d7d83;
    font-size: 12px;
}

.meta-box {
    width: 190px;
    background: #f7fafb;
    border: 1px solid #edf1f3;
    padding: 12px;
    color: #555;
    font-size: 13px;
}

    .meta-box p {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid #edf1f3;
        padding: 6px 0;
    }

        .meta-box p:last-child {
            border-bottom: 0;
        }

.section-title {
    font-size: 17px;
    font-weight: 700;
    margin: 24px 0 12px;
    padding-left: 10px;
    border-left: 4px solid #5cc8bf;
    line-height: 1.2;
}

.intro-box {
    background: #f8fafb;
    border: 1px solid #edf1f3;
    padding: 18px;
    color: #333;
}

    .intro-box p {
        margin-bottom: 10px;
    }

        .intro-box p:last-child {
            margin-bottom: 0;
        }

.info-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #edf1f3;
    background: #fff;
}

    .info-table th,
    .info-table td {
        border-bottom: 1px solid #edf1f3;
        padding: 12px 14px;
        text-align: left;
        vertical-align: top;
    }

    .info-table th {
        width: 120px;
        background: #f8fafb;
        color: #666;
        font-weight: 500;
    }

    .info-table tr:last-child th,
    .info-table tr:last-child td {
        border-bottom: 0;
    }

.get-box {
    border: 1px solid #d8ebed;
    background: #f9fcfc;
    padding: 18px;
    margin-top: 12px;
}

    .get-box p {
        color: #555;
        margin-bottom: 14px;
    }

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.get-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 138px;
    height: 38px;
    padding: 0 18px;
    background: #5cc8bf;
    color: #fff;
    border: 1px solid #5cc8bf;
    font-weight: 600;
}

    .get-btn.secondary {
        background: #fff;
        color: #36aaa2;
    }

.tips {
    margin-top: 18px;
    background: #fff8ee;
    border: 1px solid #f0dfc4;
    color: #7a5a2b;
    padding: 12px 14px;
    font-size: 13px;
}

.related-list {
    border-top: 1px solid #edf1f3;
    margin-top: 10px;
}

    .related-list li {
        display: flex;
        justify-content: space-between;
        gap: 14px;
        min-height: 42px;
        align-items: center;
        border-bottom: 1px solid #edf1f3;
        color: #333;
    }

    .related-list a {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .related-list time {
        color: #777;
        white-space: nowrap;
        font-size: 13px;
    }

.side-card {
    margin-bottom: 14px;
    padding: 16px;
}

.right-card {
    margin-bottom: 14px;
    min-height: 680px;
    padding: 16px;
}

.side-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.author-box {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf1f3;
}

.avatar {
    width: 48px;
    height: 48px;
    background: #e8f3f5;
    border: 1px solid #dcecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.author-box strong {
    display: block;
    font-size: 16px;
}

.author-box span {
    color: #777;
    font-size: 13px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    padding-top: 14px;
}

    .stat-grid strong {
        display: block;
        font-size: 16px;
    }

    .stat-grid span {
        color: #777;
        font-size: 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;
}


.comment-section {
    margin-top: 24px;
    border-top: 1px solid #edf1f3;
    padding-top: 6px;
}

.comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 24px 0 12px;
}

    .comment-head .section-title {
        margin: 0;
    }

.comment-count {
    color: #7d8b90;
    font-size: 13px;
}

.comment-list {
    border: 1px solid #edf1f3;
    background: #fff;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #edf1f3;
}

    .comment-item:last-child {
        border-bottom: 0;
    }

.comment-avatar {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e8f3f5;
    border: 1px solid #dcecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #45aaa4;
    font-weight: 700;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
    color: #8a9aa0;
    font-size: 13px;
}

.comment-user {
    color: #333;
    font-weight: 600;
}

.comment-floor {
    color: #51bfb8;
}

.comment-content {
    color: #333;
    line-height: 1.8;
    word-break: break-word;
}

.comment-empty {
    border: 1px dashed #d8ebed;
    background: #f9fcfc;
    color: #7d8b90;
    padding: 16px;
    text-align: center;
}

.footer {
    margin-top: 24px;
    text-align: center;
    color: #6b8f96;
    font-size: 13px;
}

@media (max-width: 1220px) {
    .wrap {
        width: 96%;
    }
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .detail-top {
        display: block;
    }

    .meta-box {
        width: 100%;
        margin-top: 14px;
    }

    .right-card {
        min-height: auto;
    }
}

@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 {
        gap: 14px;
        flex-wrap: wrap;
    }

    .top-search,
    .page-search {
        width: 100%;
    }

    .detail-card {
        padding: 18px 16px 24px;
    }

    .detail-title {
        font-size: 19px;
    }

    .related-list li {
        display: block;
        padding: 9px 0;
    }

    .related-list time {
        display: block;
        margin-top: 2px;
    }


    .comment-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .comment-item {
        padding: 14px 12px;
    }

    .comment-avatar {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        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;
        }
}
