/* ===== 下载模块公共样式（全部 rem） ===== */

/* 分类工具栏 */
.resource-toolbar {
    background: #fff;
    border: 0.0625rem solid var(--page-divider, #e2e8f0);
    border-radius: 0.75rem;
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    box-shadow: 0 0.25rem 0.75rem rgba(15, 23, 42, 0.05);
}

.toolbar-chip {
    text-decoration: none;
    color: var(--text-main, #475569);
    border: 0.0625rem solid #cbd5e1;
    border-radius: 999rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.84rem;
    background: #fff;
    transition: all 0.2s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.toolbar-chip:hover {
    border-color: var(--primary, #2563eb);
    color: var(--primary, #2563eb);
}

.toolbar-chip.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
    font-weight: 600;
}

.chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.25rem;
    padding: 0 0.4rem;
    border-radius: 999rem;
    background: #f1f5f9;
    color: var(--text-muted, #64748b);
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.toolbar-chip:hover .chip-count {
    background: #eff6ff;
    color: var(--primary, #2563eb);
}

.toolbar-chip.active .chip-count {
    background: #ffffff;
    color: #2563eb;
}

/* 子分类工具栏（与主工具栏区分） */
.resource-toolbar.sub-toolbar {
    background: #f8fafc;
    border-style: dashed;
    padding: 0.5rem 0.75rem;
}

/* ===== 下载首页 ===== */

/* 双栏布局 */
.download-split {
    display: grid;
    grid-template-columns: 1fr 23.75rem;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 74.9988rem) {
    .download-split {
        grid-template-columns: 1fr 18.75rem;
    }
}

@media (max-width: 61.9988rem) {
    .download-split {
        grid-template-columns: 1fr;
    }
}

/* 面板通用 */
.dl-panel {
    background: #fff;
    border: 0.0625rem solid var(--page-divider, #e2e8f0);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.25rem 0.75rem rgba(15, 23, 42, 0.05);
}

.dl-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    border-bottom: 0.0625rem solid #f1f5f9;
}

.dl-panel-head h5 {
    margin: 0;
    color: var(--text-strong, #0f172a);
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dl-panel-head i {
    color: var(--primary, #2563eb);
}

.dl-panel-head span {
    color: var(--text-soft, #94a3b8);
    font-size: 0.78rem;
}

/* 资源列表行 */
.dl-resource-row {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 0.0625rem solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.dl-resource-row:last-child {
    border-bottom: none;
}

.dl-resource-row:hover {
    background: #f8fafc;
}

.dl-resource-row:hover .dl-resource-title span {
    color: var(--primary, #2563eb);
}

.dl-resource-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    color: var(--bs-secondary, #64748b);
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.dl-resource-row:hover .dl-resource-icon {
    transform: scale(1.05);
}

.dl-resource-row.dl-cat-manual:hover {
    background: var(--hover-bg, #f8fafc);
}

.dl-resource-row.dl-cat-dev:hover {
    background: var(--hover-bg, #f8fafc);
}

.dl-resource-row.dl-cat-tutorial:hover {
    background: var(--hover-bg, #f8fafc);
}

.dl-resource-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    color: var(--text-strong, #0f172a);
    font-size: 0.95rem;
    line-height: 1.45;
}

.dl-resource-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.dl-resource-subtitle {
    color: var(--text-muted, #64748b);
    font-size: 0.78rem;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.dl-resource-subtitle .dl-date {
    color: var(--text-soft, #94a3b8);
    font-variant-numeric: tabular-nums;
}

.dl-resource-category {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 0.5rem;
}

.dl-category-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.22rem 0.65rem;
    border-radius: 999rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    border: 0.0625rem solid transparent;
    background: transparent;
    color: var(--text-muted, #64748b);
}

@media (max-width: 40rem) {
    .dl-resource-row {
        grid-template-columns: 2rem minmax(0, 1fr);
    }

    .dl-resource-category {
        display: none;
    }
}

/* 常用下载（精简列表） */
.common-download-list {
    list-style: none;
    padding: 0.4rem 0 0.6rem;
    margin: 0;
}

.common-download-list li {
    border-bottom: 0.0625rem solid #f1f5f9;
    border-left: 0.1875rem solid transparent;
}

.common-download-list li:last-child {
    border-bottom: none;
}

.common-download-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.7rem 1.1rem;
    color: var(--text-main, #475569);
    text-decoration: none;
    transition: all 0.15s ease;
}

.common-download-list a:hover {
    background: #f8fafc;
    color: var(--primary, #2563eb);
}

.common-download-title {
    flex: 1;
    min-width: 0;
    font-size: 0.88rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.common-download-cat {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    background: transparent;
    border-radius: 999rem;
    padding: 0.1rem 0.5rem;
    line-height: 1.3;
}

/* ===== 详情页 ===== */

.dl-detail-page {
    --detail-border: #e5e7eb;
    --detail-muted-border: #f1f5f9;
    padding-bottom: 2rem;
}

.dl-detail-wrapper {
    background: #fff;
    border: 0.0625rem solid var(--detail-border);
    border-radius: 0.75rem;
    padding: 1.1rem 2.25rem 2rem;
    box-shadow: 0 0.25rem 0.75rem rgba(15, 23, 42, 0.05);
}

.dl-detail-header {
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 0.0625rem solid var(--detail-muted-border);
    text-align: center;
}

.dl-detail-title {
    font-size: clamp(1.55rem, 2vw, 2.05rem);
    font-weight: 760;
    color: var(--text-strong, #0f172a);
    margin: 0 0 0.55rem;
    line-height: 1.35;
    letter-spacing: 0;
    text-align: center;
}

.dl-detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem 1.1rem;
    color: var(--text-soft, #94a3b8);
    font-size: 0.84rem;
    text-align: center;
}

.dl-detail-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.dl-detail-meta-row i {
    color: var(--primary, #2563eb);
}

.dl-detail-body {
    line-height: 1.85;
    color: var(--text-main, #334155);
    font-size: 0.98rem;
}

.dl-detail-body h1 {
    font-size: 1.32rem;
    font-weight: 700;
    margin: 2rem 0 0.95rem;
    color: var(--text-strong, #0f172a);
}

.dl-detail-body h2 {
    font-size: 1.16rem;
    font-weight: 700;
    margin: 1.8rem 0 0.85rem;
    color: var(--text-strong, #0f172a);
}

.dl-detail-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.6rem 0 0.75rem;
    color: var(--text-main, #334155);
}

.dl-detail-body h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.3rem 0 0.6rem;
    color: var(--text-muted, #64748b);
}

.dl-detail-body p {
    margin-bottom: 1rem;
}

.dl-detail-body ul,
.dl-detail-body ol {
    margin-bottom: 1.1rem;
    padding-left: 1.35rem;
}

.dl-detail-body li {
    margin-bottom: 0.55rem;
}

.dl-detail-body a {
    color: var(--primary, #2563eb);
    text-decoration: underline;
    text-underline-offset: 0.125rem;
}

.dl-detail-body a:hover {
    color: #2563eb;
}

.dl-detail-body code {
    background: #f1f5f9;
    color: #334155;
    border-radius: 0.25rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.dl-detail-body pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin-bottom: 1.1rem;
    line-height: 1.6;
    font-size: 0.88rem;
}

.dl-detail-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

.dl-detail-body img {
    max-width: 100%;
    border-radius: 0.5rem;
    border: 0.0625rem solid var(--detail-muted-border);
    margin: 1.25rem 0;
}

.dl-detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 0.0625rem solid #e2e8f0;
}

.dl-detail-body th {
    background: #f8fafc;
    color: var(--text-strong, #0f172a);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.65rem 1rem;
    text-align: left;
    border-bottom: 0.125rem solid #e2e8f0;
}

.dl-detail-body td {
    padding: 0.6rem 1rem;
    border-bottom: 0.0625rem solid #f1f5f9;
    font-size: 0.92rem;
}

.dl-detail-body tr:last-child td {
    border-bottom: none;
}

.dl-detail-body blockquote {
    border-left: 0.1875rem solid var(--primary, #2563eb);
    background: #f8fafc;
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 0.8rem 1.2rem;
    margin: 1.25rem 0;
    color: #2563eb;
    font-size: 0.95rem;
}

.dl-detail-body hr {
    border: none;
    border-top: 0.0625rem solid #edf2f7;
    margin: 2rem 0;
}

.dl-detail-body > *:first-child {
    margin-top: 0;
}

/* 详情页侧边栏 */
.dl-detail-sidebar {
    position: sticky;
    top: var(--sticky-offset, 5rem);
}

.dl-side-card {
    background: #fff;
    border-radius: 0.625rem;
    box-shadow: none;
    border: 0.0625rem solid var(--detail-border);
    padding: 1rem;
    margin-bottom: 0.8rem;
}

.dl-side-head {
    font-weight: 700;
    color: var(--text-strong, #0f172a);
    margin-bottom: 0.7rem;
    padding-bottom: 0.6rem;
    border-bottom: 0.0625rem solid var(--detail-muted-border);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.dl-side-head i {
    color: var(--primary, #2563eb);
}

/* 详情页侧边 - 相关文章（与首页常用下载一致） */
.dl-side-related {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dl-side-related li {
    border-bottom: 0.0625rem solid #f1f5f9;
}

.dl-side-related li:last-child {
    border-bottom: none;
}

.dl-side-related a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.65rem 0.25rem;
    color: var(--text-main, #475569);
    text-decoration: none;
    transition: all 0.15s ease;
}

.dl-side-related a:hover {
    color: var(--primary, #2563eb);
}

.dl-side-related .related-title {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dl-side-related .related-cat {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    background: transparent;
    border-radius: 999rem;
    padding: 0.1rem 0.5rem;
    line-height: 1.3;
}

.dl-side-related a:hover .related-cat {
    color: var(--primary, #2563eb);
}

@media (max-width: 61.9988rem) {
    .dl-detail-wrapper {
        padding: 1.5rem 1.35rem;
    }

    .dl-detail-title {
        font-size: 1.42rem;
    }
}

@media (max-width: 40rem) {
    .dl-detail-page {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .dl-detail-wrapper,
    .dl-side-card {
        border-radius: 0.5625rem;
    }

    .dl-detail-meta-row {
        gap: 0.45rem 0.8rem;
    }
}

/* ===== 详情页软件下载横幅卡片 ===== */
.dl-software-section {
    background: #fff;
    border: 0.0625rem solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem 1.75rem;
    margin: 1.25rem 0;
    box-shadow: 0 0.25rem 0.75rem rgba(15, 23, 42, 0.05);
}

.dl-software-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dl-software-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.75rem;
    flex-shrink: 0;
    object-fit: contain;
}

.dl-software-headline {
    flex: 1;
    min-width: 0;
}

.dl-software-name-row {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    margin-bottom: 0.3rem;
}

.dl-software-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-strong, #0f172a);
    margin: 0;
    line-height: 1.3;
}

.dl-software-version {
    font-size: 0.8rem;
    font-weight: 500;
    color: #2563eb;
    background: #eff6ff;
    padding: 0.1rem 0.55rem;
    border-radius: 0.375rem;
    white-space: nowrap;
}

.dl-software-tagline {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    margin: 0;
    line-height: 1.5;
}

.dl-software-desc {
    color: var(--text-main, #334155);
    font-size: 0.9rem;
    line-height: 1.75;
    margin: 0 0 1.1rem;
}

.dl-software-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.9rem;
    border-top: 0.0625rem solid #f1f5f9;
}

.dl-software-meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-muted, #64748b);
    font-size: 0.82rem;
}

.dl-software-meta .meta-sep {
    color: #cbd5e1;
}

.dl-software-footer .btn {
    padding: 0.55rem 1.3rem;
    font-size: 0.9rem;
    font-weight: 500;
}

@media (max-width: 47.9988rem) {
    .dl-software-section {
        padding: 1.15rem 1rem;
    }

    .dl-software-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dl-software-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .dl-software-footer .btn {
        width: 100%;
        justify-content: center;
    }
}
