﻿:root {
    --blue: #4f6cf7;
    --blue-dark: #3f5fe9;
    --border: #dcdfe6;
    --muted: #777;
    --soft: #f6f6f6;
    --paper: #fff;
    --page: #f7f7f7;
    --red: #e62424;
}

* {
    box-sizing: border-box
}

html, body {
    margin: 0;
    padding: 0
}

body {
    font-family: Arial,"Microsoft YaHei","PingFang SC",sans-serif;
    color: #111;
    background: #fff;
    font-size: 14px;
}

a {
    color: inherit;
    text-decoration: none
}

.logo {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    font-size: 25px;
    color: var(--blue);
    letter-spacing: -1px;
    white-space: nowrap;
}

.logo-icon {
    width: 30px;
    height: 25px;
    border-radius: 6px;
    background: linear-gradient(135deg,#1c9bff 0%,#6859ff 92%);
    position: relative;
    display: inline-block;
    box-shadow: 0 1px 0 rgba(0,0,0,.08) inset;
}

    .logo-icon:before {
        content: "";
        position: absolute;
        left: 7px;
        top: 8px;
        width: 13px;
        height: 8px;
        border: 3px solid #fff;
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 4px;
        border-bottom-color: #fff;
    }

    .logo-icon:after {
        content: "";
        position: absolute;
        left: 12px;
        top: 5px;
        width: 10px;
        height: 8px;
        border: 3px solid #fff;
        border-left: 0;
        border-bottom: 0;
        border-radius: 11px 11px 0 0;
        transform: rotate(17deg);
        opacity: .95;
    }

.page-header {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
}

.header-inner {
    width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-search {
    width: 520px;
    margin-left: auto;
    display: flex;
    border: 1px solid var(--blue);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

    .nav-search input {
        width: 100%;
        height: 38px;
        padding: 0 13px;
        border: 0;
        outline: 0;
        font-size: 14px;
        color: #333;
    }

    .nav-search button {
        position: relative;
        width: 56px;
        height: 38px;
        flex: 0 0 56px;
        border: 0;
        background: var(--blue);
        cursor: pointer;
    }

        .nav-search button:hover {
            background: var(--blue-dark);
        }

        .nav-search button:before {
            content: "";
            position: absolute;
            left: 18px;
            top: 9px;
            width: 13px;
            height: 13px;
            border: 3px solid #fff;
            border-radius: 50%;
        }

        .nav-search button:after {
            content: "";
            position: absolute;
            left: 32px;
            top: 23px;
            width: 10px;
            height: 3px;
            background: #fff;
            border-radius: 2px;
            transform: rotate(45deg);
        }

.main-wrap {
    background: var(--page);
    min-height: calc(100vh - 64px);
    padding: 22px 0 34px
}

.page-layout {
    width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0,1fr) 260px;
    gap: 24px;
    align-items: start;
}

.home-section {
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 6px;
    padding: 18px 20px;
    text-align: left;
}

    .home-section + .home-section {
        margin-top: 18px
    }

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: #222;
    font-size: 18px;
    font-weight: 700;
}

    .section-title:before {
        content: "";
        display: inline-block;
        width: 4px;
        height: 18px;
        border-radius: 4px;
        background: var(--blue);
    }

.section-sub {
    margin-left: auto;
    color: #999;
    font-size: 13px;
    font-weight: 400;
}

.categories {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.category-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 24px;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fafafa;
    font-weight: 600;
    white-space: nowrap;
    flex: 0 0 auto;
}

    .category-link:hover {
        color: var(--blue)
    }

    .category-link.active {
        color: #fff;
        background: var(--blue);
        border-color: var(--blue);
    }

.resource-list {
    border-top: 1px solid #f0f0f0;
}

.resource-row {
    display: flex;
    align-items: center;
    min-height: 38px;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
    line-height: 1.4;
}

    .resource-row:hover {
        color: var(--blue)
    }

.resource-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.dash {
    flex: 0 0 auto;
    color: #bbb;
}

.resource-time {
    flex: 0 0 auto;
    color: #999;
    font-size: 13px;
}

.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding-top: 18px;
}

    .pager a, .pager span {
        min-width: 32px;
        height: 32px;
        padding: 0 11px;
        border: 1px solid #e5e5e5;
        border-radius: 3px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #fff;
    }

    .pager .active {
        background: var(--blue);
        color: #fff;
        border-color: var(--blue)
    }

    .pager a:hover {
        color: var(--blue);
        border-color: var(--blue)
    }

.sidebar {
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 6px;
    overflow: hidden;
    text-align: left;
}

.sidebar-img {
    display: block;
    width: 100%;
    height: 86px;
    object-fit: cover;
    background: #f3f4f8;
}

.sidebar-body {
    padding: 14px 16px 18px;
}

.sidebar-title {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 700;
}

.hot-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .hot-list li + li {
        border-top: 1px solid #f1f1f1
    }

.hot-link {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 36px;
}

    .hot-link:hover {
        color: var(--blue)
    }

.hot-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f0f2ff;
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
}

.footer {
    text-align: center;
    color: #666;
    font-size: 14px;
    line-height: 1.8;
    margin-top: 30px;
}

@media (max-width:1200px) {
    .page-layout, .header-inner {
        width: 94%
    }
}

@media (max-width:900px) {
    .page-layout {
        grid-template-columns: 1fr
    }

    .header-inner {
        width: 92%
    }

    .sidebar-img {
        height: 110px
    }
}

@media (max-width:620px) {
    .page-header {
        height: auto;
        padding: 14px 0
    }

    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px
    }

    .nav-search {
        width: 100%;
        margin-left: 0
    }

    .main-wrap {
        padding-top: 14px
    }

    .home-section {
        padding: 16px 14px
    }

    .resource-row {
        min-height: 42px
    }

    .category-link {
        padding: 0 18px
    }
}


.detail-card {
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 6px;
    padding: 22px 24px;
}

.detail-title {
    margin: 0 0 14px;
    font-size: 22px;
    line-height: 1.45;
    font-weight: 700;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #888;
    font-size: 13px;
}

.detail-content {
    padding-top: 18px;
    line-height: 1.9;
    color: #333;
}

    .detail-content > p:first-child {
        margin-bottom: 14px;
    }

    .detail-content > p:first-child {
        margin-bottom: 12px;
        font-weight: 500;
    }

    .detail-content p {
        margin: 0 0 10px
    }

.detail-files {
    margin: 14px 0 0;
    padding: 14px 16px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    line-height: 1.9;
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 18px;
    border-radius: 4px;
    border: 1px solid var(--blue);
    color: #fff;
    background: var(--blue);
    font-weight: 700;
}

    .detail-btn.secondary {
        background: #fff;
        color: var(--blue);
    }

@media (max-width:620px) {
    .detail-card {
        padding: 18px 14px
    }

    .detail-title {
        font-size: 19px
    }

    .detail-actions {
        flex-direction: column
    }
}


/* ===== 手机端兼容增强 ===== */
img {
    max-width: 100%;
    height: auto
}

input, button, a {
    -webkit-tap-highlight-color: transparent
}

body {
    min-width: 0;
    overflow-x: hidden
}

@media (max-width:768px) {
    .page-header {
        height: auto;
        padding: 12px 0
    }

    .header-inner {
        width: 92%;
        flex-direction: column;
        align-items: stretch;
        gap: 12px
    }

        .header-inner .logo, .logo {
            font-size: 23px
        }

        .header-inner .search, .nav-search {
            width: 100%;
            margin-left: 0
        }

    .main-wrap {
        padding: 14px 0 26px;
        min-height: auto
    }

    .container, .page-layout, .home-center {
        width: 92%;
        max-width: 100%
    }

    .page-layout, .home-layout {
        grid-template-columns: 1fr;
        gap: 16px
    }

    .home-center {
        margin-top: 36px
    }

    .home .logo {
        margin-bottom: 28px
    }

    .home-section, .detail-card {
        border-radius: 8px
    }

    .section-title {
        font-size: 17px
    }

    .sidebar {
        order: 2
    }

    .sidebar-img {
        height: 92px
    }

    .footer {
        font-size: 12px;
        margin-top: 24px;
        padding: 0 14px
    }
}

@media (max-width:520px) {
    body {
        font-size: 13px;
        background: var(--page)
    }

    .logo-icon {
        width: 28px;
        height: 23px
    }

    .search input, .nav-search input {
        height: 40px;
        font-size: 14px;
        padding: 0 12px
    }

    .search button, .nav-search button {
        height: 40px;
        width: 50px;
        flex-basis: 50px
    }

    .tags, .categories {
        margin-left: -2px;
        margin-right: -2px;
        padding-bottom: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch
    }

    .tag {
        font-size: 13px;
        padding: 0 9px
    }

    .category-link {
        min-height: 38px;
        padding: 0 16px;
        font-size: 13px
    }

    .home-section {
        padding: 15px 13px
    }

    .section-title {
        margin-bottom: 12px
    }

    .section-sub {
        display: none
    }

    .resource-row {
        min-height: auto;
        padding: 10px 0;
        gap: 4px;
        align-items: flex-start;
        flex-direction: column
    }

    .resource-name {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.55
    }

    .dash {
        display: none
    }

    .resource-time {
        min-width: 0;
        height: auto;
        padding: 0;
        background: transparent;
        border-radius: 0;
        font-size: 12px;
        color: #999
    }

    .pager {
        flex-wrap: wrap;
        gap: 6px;
        padding-top: 14px
    }

        .pager a, .pager span {
            min-width: 30px;
            height: 30px;
            padding: 0 9px
        }

    .hot-link {
        height: 34px
    }
}

@media (max-width:380px) {
    .container, .page-layout, .home-center, .header-inner {
        width: 94%
    }

    .home-section, .detail-card {
        padding-left: 12px;
        padding-right: 12px
    }

    .detail-title {
        font-size: 18px
    }
}


/* ===== 评论展示区 ===== */
.comment-section {
    margin-top: 18px;
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 6px;
    padding: 20px 24px;
}

.comment-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.comment-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #222;
}

.comment-count {
    color: #999;
    font-size: 13px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid #f1f1f1;
}

.comment-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2ff;
    color: var(--blue);
    font-weight: 700;
}

.comment-main {
    min-width: 0;
    flex: 1
}

.comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-user {
    font-weight: 700;
    color: #333
}

.comment-date {
    font-size: 12px;
    color: #999
}

.comment-text {
    margin: 0;
    color: #444;
    line-height: 1.75
}

.comment-empty {
    margin: 0;
    padding: 16px 0 4px;
    color: #999;
    border-top: 1px solid #f1f1f1;
}

@media (max-width:620px) {
    .comment-section {
        padding: 18px 14px;
        border-radius: 8px
    }

    .comment-item {
        gap: 10px;
        padding: 13px 0
    }

    .comment-avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        font-size: 13px
    }

    .comment-title {
        font-size: 17px
    }

    .comment-text {
        font-size: 13px
    }
}

