/* ================= 基础变量与全局 ================= */
:root {
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --text-color: #ffffff;
    --hover-bg: rgba(255, 255, 255, 0.25);
    --baidu-blue: #4e6ef2;
    --baidu-blue-hover: #4662d9;
    --success: #52c41a;
    --danger: #ff4757;
    --warning: #faad14;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(-45deg, #8ec5fc, #e0c3fc, #4facfe, #00f2fe);
    background-size: 400% 400%;
    animation: gradientBG 30s ease infinite;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ================= 蒙版玻璃容器 ================= */
.container {
    width: 100%;
    max-width: 1200px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    position: relative;
}

.container.tag-layout-cols-1 {
    max-width: 1080px;
}

/* 首页按钮 - 右上角 */
.home-nav {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 5;
}

.home-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: #fff;
    text-decoration: none;
    opacity: 0.75;
    transition: all 0.25s;
}

.home-nav a:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.home-nav svg {
    width: 17px;
    height: 17px;
}

/* ================= 站点标题（顶部） ================= */
.site-header {
    text-align: center;
    margin-bottom: 25px;
}

.site-header h1 {
    font-size: 42px;
    letter-spacing: 8px;
    margin-bottom: 8px;
    background: linear-gradient(to right, #ffffff, #cce7ff, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-header p {
    font-size: 15px;
    letter-spacing: 4px;
    color: #fff;
}

/* ================= 搜索栏 ================= */
.search-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    width: 100%;
    max-width: 500px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-input {
    flex: 1;
    border: none;
    padding: 0 20px;
    font-size: 15px;
    outline: none;
    color: #333;
    background: transparent;
}

.search-input::placeholder {
    color: #999;
}

.search-submit {
    width: 70px;
    border: none;
    background: var(--baidu-blue);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-submit:hover {
    background: var(--baidu-blue-hover);
}

/* ================= 筛选信息 ================= */
.filter-info {
    text-align: center;
    margin-bottom: 15px;
    font-size: 15px;
    color: #fff;
}

.clear-filter {
    color: #fff;
    margin-left: 10px;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.4);
}

.clear-filter:hover {
    border-bottom-color: #fff;
}

/* ================= 三栏布局 ================= */
.main-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 220px;
    gap: 20px;
    align-items: start;
}

.main-layout.tag-layout-cols-1 {
    grid-template-columns: 180px minmax(0, 1fr) 150px;
}

.content-area {
    min-width: 0;
}

/* ================= 侧边栏 ================= */
.sidebar {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 12px;
    position: sticky;
    top: 10px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    margin-top: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
    text-align: center;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 16px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-right .sidebar-item {
    font-size: 14px;
    padding-top: 6px;
    padding-bottom: 6px;
    min-width: 0;
    width: 100%;
    height: 34px;
}

.sidebar-right {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
}

.main-layout.tag-layout-cols-1 .sidebar-right {
    width: 150px;
    justify-self: end;
}

.tag-sidebar-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.tag-sidebar-list.cols-1 {
    grid-template-columns: 1fr;
}

.tag-sidebar-list.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tag-sidebar-list .sidebar-item {
    justify-content: flex-start;
    gap: 4px;
}

.tag-sidebar-list .sidebar-count {
    margin-left: 3px;
    padding: 1px 5px;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-item.active {
    background: rgba(78, 110, 242, 0.35);
    color: #fff;
    font-weight: 500;
}

.sidebar-count {
    margin-left: auto;
    font-size: 11px;
    color: #fff;
    background: rgba(0, 0, 0, 0.15);
    padding: 1px 7px;
    border-radius: 8px;
    flex-shrink: 0;
}

.cat-icon-sm {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.cat-icon-sm img {
    max-width: 16px;
    max-height: 16px;
    object-fit: contain;
}

.tag-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #fff;
}

/* ================= 分类子分类展开 ================= */
.cat-group {
    position: relative;
}

.cat-parent {
    cursor: pointer;
    text-decoration: none;
    color: #fff;
}

.cat-group {
    position: relative;
}

.cat-arrow {
    margin-left: auto;
    font-size: 15px;
    color: #fff;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

/* 悬停展开子分类 */
.cat-group:hover .cat-arrow {
    transform: rotate(90deg);
}

/* 子分类列表：悬停向右飞出 */
.cat-sub-list {
    position: absolute;
    left: calc(100% + 6px);
    top: -4px;
    min-width: 150px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 6px 4px;
    display: none;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 悬停显示子分类 */
.cat-group:hover>.cat-sub-list {
    display: block;
}

.cat-child {
    font-size: 15px;
    padding: 7px 11px;
    color: #fff;
}


.cat-child:hover {
    color: #fff;
}

.cat-child.active {
    background: rgba(78, 110, 242, 0.25);
    color: #fff;
}

/* ================= 软件卡片网格 ================= */
.sw-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.main-layout.tag-layout-cols-1 .sw-grid {
    grid-template-columns: repeat(2, 1fr);
}

.sw-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.25s;
    cursor: pointer;
    min-height: 130px;
}

.sw-card:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.sw-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sw-card-icon {
    font-size: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.sw-card-icon img {
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
}

.sw-card-name {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sw-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sw-card-line {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.sw-card-tags {
    display: flex;
    gap: 2px 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.sw-card-tag {
    font-size: 13px;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.6);
}

.sw-card-tag-neutral {
    color: rgba(255, 255, 255, 0.6);
}

/* ================= 分页 ================= */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 10px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--hover-bg);
}

.pagination .current {
    background: rgba(78, 110, 242, 0.5);
    border-color: rgba(78, 110, 242, 0.6);
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ================= 面包屑 ================= */
.breadcrumb {
    font-size: 13px;
    color: #fff;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #fff;
}

.breadcrumb .sep {
    margin: 0 6px;
}

/* ================= 详情页 ================= */
.detail-wrap {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.detail-left {
    flex-shrink: 0;
    text-align: center;
    min-width: 200px;
}

.detail-left .detail-icon {
    font-size: 80px;
    line-height: 1;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-left .detail-icon img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
}

.detail-left .detail-image {
    max-width: 200px;
    max-height: 260px;
    width: auto;
    height: auto;
    border-radius: 20px;
    object-fit: contain;
    border: 2px solid var(--glass-border);
    margin-bottom: 12px;
}

.detail-left .detail-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.detail-left .detail-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 15px;
    color: #fff;
    margin-bottom: 12px;
}

.detail-left .detail-tags {
    display: grid;
    grid-template-columns: repeat(5, auto);
    justify-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.detail-left .detail-tags span {
    font-size: 14px;
    padding: 3px 10px;
    border-radius: 10px;
}

.detail-left .download-count {
    font-size: 14px;
    color: #fff;
}

.detail-right {
    flex: 1;
    min-width: 0;
}

.detail-right .detail-section {
    margin-bottom: 25px;
}

.detail-right .detail-section h3 {
    font-size: 18px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--glass-border);
    color: #fff;
}

/* 图文混编内容样式 */
.detail-right .detail-section .rich-content {
    font-size: 17px;
    line-height: 1.9;
    color: #fff;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.detail-right .detail-section .rich-content p {
    margin-bottom: 14px;
}

.detail-right .detail-section .rich-content h2 {
    font-size: 22px;
    margin: 20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.detail-right .detail-section .rich-content h3 {
    font-size: 19px;
    margin: 18px 0 8px;
    border-bottom: none;
    padding-bottom: 0;
}

.detail-right .detail-section .rich-content ul,
.detail-right .detail-section .rich-content ol {
    margin: 10px 0 14px 24px;
}

.detail-right .detail-section .rich-content li {
    margin-bottom: 5px;
}

.detail-right .detail-section .rich-content blockquote {
    margin: 14px 0;
    padding: 12px 18px;
    border-left: 3px solid var(--baidu-blue);
    background: rgba(78, 110, 242, 0.1);
    border-radius: 0 8px 8px 0;
    color: #fff;
}

.detail-right .detail-section .rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 12px 0;
    border: 1px solid var(--glass-border);
    object-fit: contain;
}
.detail-right .detail-section .rich-content img[style*="float: left"],
.detail-right .detail-section .rich-content img[style*="float:left"] {
    max-width: 70%;
    margin: 4px 16px 8px 0;
}
.detail-right .detail-section .rich-content img[style*="float: right"],
.detail-right .detail-section .rich-content img[style*="float:right"] {
    max-width: 70%;
    margin: 4px 0 8px 16px;
}

.detail-right .detail-section .rich-content a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.detail-right .detail-section .rich-content a:hover {
    color: #8ec5fc;
}

.detail-right .detail-section .rich-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 14px 18px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 12px 0;
    font-size: 15px;
}

.detail-right .detail-section .rich-content code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 15px;
}

.detail-right .detail-section .rich-content pre code {
    background: none;
    padding: 0;
}

/* 截图画廊 */
.screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.screenshots img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: transform 0.3s;
    object-fit: contain;
}

.screenshots img:hover {
    transform: scale(1.03);
}

/* 图片灯箱 */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox.show {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
}

/* 下载按钮组 */
.dl-btn-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--baidu-blue);
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.dl-btn:hover {
    background: var(--baidu-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(78, 110, 242, 0.4);
}

.dl-btn-icon {
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dl-btn-pwd {
    font-size: 11px;
    font-weight: 400;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.dl-btn-pwd:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* 相关软件 */
.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.related-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    padding: 15px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
}

.related-item:hover {
    background: var(--hover-bg);
    transform: translateY(-3px);
}

.related-item .rel-icon {
    font-size: 28px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-item .rel-icon img {
    max-width: 28px;
    max-height: 28px;
    object-fit: contain;
}

.related-item .rel-name {
    font-size: 13px;
    text-align: center;
    color: #fff;
}

/* 返回链接 */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    margin-bottom: 15px;
    transition: color 0.3s;
}

.back-link:hover {
    color: #fff;
}

/* ================= 页脚 ================= */
.footer {
    margin-top: 25px;
    text-align: center;
    color: #fff;
    font-size: 13px;
}

/* ================= 空状态 ================= */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #fff;
    font-size: 16px;
}

.empty-state .empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

@media (max-width: 1040px) {
    .sw-grid {
        grid-template-columns: 1fr;
    }

    .main-layout.tag-layout-cols-1 .sw-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 970px) {
    .main-layout.tag-layout-cols-1 .sw-grid {
        grid-template-columns: 1fr;
    }
}

/* ================= 响应式 ================= */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .sidebar-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .tag-sidebar-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .sidebar-item {
        padding: 6px 12px;
    }

    .sidebar-count {
        display: none;
    }

    .cat-sub-list {
        position: static;
        left: auto;
        top: auto;
        display: none;
        padding: 4px 0 4px 16px;
        background: transparent;
        backdrop-filter: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin-left: 8px;
        min-width: auto;
        z-index: auto;
    }

    .cat-group:hover>.cat-sub-list,
    .cat-group.expanded .cat-sub-list {
        display: block !important;
    }

    .detail-wrap {
        flex-direction: column;
        align-items: center;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sw-grid {
        grid-template-columns: 1fr;
    }

    .home-nav {
        top: 10px;
        right: 14px;
    }

    @media (max-width: 600px) {
        .site-header h1 {
            font-size: 30px;
            letter-spacing: 4px;
        }

        .container {
            padding: 20px 15px;
        }

        .related-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .sw-grid {
            grid-template-columns: 1fr;
        }

        .sw-card {
            padding: 14px 16px;
        }
    }