﻿:root {
    --blue: #4f6cf7;
    --blue-dark: #3f5fe9;
    --border: #dcdfe6;
    --muted: #777;
    --soft: #f6f6f6;
    --paper: #fff;
    --page: #f7f7f7;
    --red: #e62424;
    --green: #0cb326;
    --teal: #19b5ad;
}

* {
    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: 31px;
    color: var(--blue);
    letter-spacing: -1px;
    white-space: nowrap;
}

.logo-icon {
    width: 36px;
    height: 29px;
    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: 8px;
        top: 9px;
        width: 16px;
        height: 10px;
        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: 14px;
        top: 6px;
        width: 12px;
        height: 9px;
        border: 3px solid #fff;
        border-left: 0;
        border-bottom: 0;
        border-radius: 11px 11px 0 0;
        transform: rotate(17deg);
        opacity: .95;
    }

.search {
    display: flex;
    border: 1px solid var(--blue);
    border-radius: 4px;
    overflow: hidden;
    background: white;
}

    .search input {
        width: 100%;
        height: 42px;
        padding: 0 14px;
        border: 0;
        outline: 0;
        font-size: 16px;
        color: #333;
    }

    .search button {
        width: 62px;
        border: 0;
        background: var(--blue);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: relative;
    }

        .search button:hover {
            background: var(--blue-dark)
        }

        .search button:before {
            content: "";
            width: 15px;
            height: 15px;
            border: 4px solid #fff;
            border-radius: 50%;
            display: block;
        }

        .search button:after {
            content: "";
            width: 12px;
            height: 4px;
            background: #fff;
            position: absolute;
            transform: translate(11px,11px) rotate(45deg);
            border-radius: 2px;
        }

.page-header {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
}

.header-inner {
    width: 1190px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

    .header-inner .logo {
        font-size: 25px
    }

    .header-inner .logo-icon {
        width: 30px;
        height: 25px
    }

    .header-inner .search {
        width: 624px
    }

        .header-inner .search input {
            height: 38px;
            font-size: 14px
        }

        .header-inner .search button {
            height: 38px
        }

.main-wrap {
    background: var(--page);
    min-height: calc(100vh - 64px);
    padding-top: 22px
}

.container {
    width: 840px;
    margin: 0 auto
}

.folder {
    width: 30px;
    height: 25px;
    display: inline-block;
    position: relative;
    flex: 0 0 30px;
    border-radius: 2px;
    background: #ffc327;
    border: 2px solid #ffb400;
}

    .folder:before {
        content: "";
        position: absolute;
        left: 2px;
        top: -7px;
        width: 14px;
        height: 8px;
        background: #ffc327;
        border: 2px solid #ffb400;
        border-bottom: 0;
        border-radius: 2px 2px 0 0;
    }

    .folder:after {
        content: "";
        position: absolute;
        left: 4px;
        top: 6px;
        width: 18px;
        height: 10px;
        border: 2px solid rgba(255,255,255,.65);
        border-radius: 1px;
    }

.footer {
    text-align: center;
    color: #666;
    font-size: 14px;
    line-height: 1.8;
    margin-top: 42px;
}

.btn {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 2px;
    padding: 8px 13px;
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

    .btn.primary {
        background: var(--blue);
        border-color: var(--blue);
        color: #fff
    }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    height: 26px;
    background: #fff;
    border: 1px solid #d8d8d8;
    color: #606266;
}

.result-card {
    background: #fff;
    border: 1px solid #d7d7d7;
    border-radius: 4px;
    margin-bottom: 13px;
    padding: 26px 24px 19px 24px;
}

.file-list {
    white-space: pre-line;
    line-height: 1.75;
    color: #111;
    font-size: 15px;
    margin: 16px 0 20px 44px;
}

.hl-red {
    color: var(--red)
}

body.home {
    background: #fff
}

.home-center {
    width: 1180px;
    margin: 72px auto 0;
}

.home-top {
    text-align: center;
}

.home .logo {
    justify-content: center;
    margin-bottom: 42px
}

.home .search {
    width: 565px;
    margin: 0 auto
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) 260px;
    gap: 24px;
    align-items: start;
    margin-top: 22px;
}

.home-main {
    min-width: 0;
}

.tags {
    max-width: 840px;
    margin: 18px auto 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    justify-content: center;
    align-items: center;
    line-height: 26px;
}

.tag {
    background: transparent;
    border: 0;
    border-radius: 0;
    min-width: auto;
    height: auto;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    flex: 0 0 auto;
}

    .tag + .tag {
        border-left: 1px solid #ddd;
    }

    .tag:hover, .category-link:hover, .resource-row:hover, .hot-link:hover {
        color: var(--blue);
    }

.home-section {
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 6px;
    margin-top: 20px;
    padding: 18px 20px;
    text-align: left;
}

.home-main .home-section:first-child {
    margin-top: 0;
}

.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);
    }

.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 span {
        display: none;
    }

.resource-list {
    border-top: 1px solid #f0f0f0;
}

.resource-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    border-bottom: 1px solid #f0f0f0;
    gap: 16px;
    line-height: 1.4;
}

.resource-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.resource-time {
    flex: 0 0 auto;
    color: #999;
    font-size: 13px;
}

.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-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;
}

.home .footer {
    margin-top: 34px
}

@media (max-width:1200px) {
    .home-center {
        width: 94%
    }
}

@media (max-width:900px) {
    .home-center {
        width: 92%;
        margin-top: 44px
    }

    .home .search {
        width: 100%
    }

    .home-layout {
        grid-template-columns: 1fr
    }

    .sidebar-img {
        height: 110px
    }
}

@media (max-width:520px) {
    .tags {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .tag {
        padding: 0 10px
    }

    .resource-row {
        align-items: flex-start;
        flex-direction: column;
        padding: 10px 0;
        gap: 3px
    }
}


/* ===== 手机端兼容增强 ===== */
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
    }
}
