/* ============================================
   资产「软件发布」详情页（goods_type=3）
   布局对齐 FileCR：1240 容器 + 渐变标题条 + main816/sidebar356 两栏 + sticky 侧栏
   仅被 app/index/view/goods/software.html 引用，不影响其他资产详情页
   ============================================ */
.sw-scope {
    --sw-primary: #1cbdf9;
    --sw-primary-dark: #0ea5d8;
    --sw-download: #fca120;
    --sw-download-hover: #e08c0a;
    --sw-gradient: linear-gradient(90deg, #05e6aa, #1cbdf9);
    --sw-border: #e9e9ef;
    --sw-text: #2d2d3a;
    --sw-text-light: #7a7a8a;
}

/* ---------- 渐变标题条：h1 + 面包屑 ---------- */
.sw-header {
    background: var(--sw-gradient);
}

.sw-header-inner {
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    padding: 18px 16px;
}

@media (min-width: 1200px) {
    .sw-header-inner {
        padding: 18px 20px;
    }
}

.sw-header-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    word-break: break-all;
}

.sw-breadcrumb {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, .88);
}

.sw-breadcrumb a {
    color: rgba(255, 255, 255, .88);
    text-decoration: none;
}

.sw-breadcrumb a:hover {
    color: #fff;
    text-decoration: underline;
}

.sw-breadcrumb .cur {
    color: #fff;
}

/* ---------- 容器与两栏骨架 ---------- */
.sw-container {
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

@media (min-width: 1200px) {
    .sw-container {
        padding: 24px 20px 60px;
    }
}

.sw-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 1200px) {
    .sw-content {
        flex-direction: row;
        align-items: flex-start;
    }
}

.sw-main {
    flex: 1;
    min-width: 0;
    max-width: 816px;
}

.sw-sidebar {
    flex: 0 0 356px;
    min-width: 270px;
    max-width: 356px;
}

@media (min-width: 1200px) {
    .sw-sidebar {
        position: sticky;
        top: 88px;
    }
}

/* ---------- 主栏 hero：预览图（图标角标）+ 简介 + 标签 + 统计 ---------- */
.sw-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--sw-border);
}

.sw-hero-cover {
    position: relative;
    flex: 0 0 300px;
    width: 300px;
    height: 190px;
    border-radius: 12px;
    background: #f7f7fb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sw-hero-cover > img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sw-hero-icon {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 40px;
    height: 40px;
    padding: 4px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sw-hero-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sw-hero-body {
    flex: 1;
    min-width: 0;
}

.sw-hero-sum {
    font-size: 14px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 10px;
}

.sw-hero-meta {
    margin-bottom: 8px;
}

.sw-hero-stat {
    font-size: 12px;
    color: var(--sw-text-light);
}

/* ---------- 主栏内容块 ---------- */
.sw-block {
    background: #fff;
    border: 1px solid var(--sw-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.sw-block:last-child {
    margin-bottom: 0;
}

.sw-post-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--sw-text);
}

.sw-post-sum {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--sw-text-light);
}

.sw-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--sw-text);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sw-border);
}

.sw-section-title .hint {
    float: right;
    font-size: 12px;
    font-weight: 400;
    color: var(--sw-text-light);
}

.sw-desc {
    font-size: 14px;
    line-height: 1.9;
    color: #555;
    word-break: break-word;
}

.sw-desc img {
    max-width: 100%;
    height: auto;
}

.sw-empty {
    padding: 40px 0;
    text-align: center;
    color: var(--sw-text-light);
    font-size: 14px;
}

/* ---------- 当前版本更新说明 ----------
   视觉参数复制自 .sw-desc，只多了 white-space: pre-line。
   后台 changelog 是 textarea 录入的多行文本，HTML 源码里的换行默认会被
   浏览器折叠成空格；不加 pre-line 会让多行说明塌成一行。 */
.sw-chlog {
    font-size: 14px;
    line-height: 1.9;
    color: #555;
    white-space: pre-line;
    word-break: break-word;
}

/* ---------- 历史版本时间线 ----------
   视觉参照 layui 常规时间线：左侧竖线 + 空心圆点 + 右侧内容。
   不引 layui.css：那份 74KB 里含 body/li/h1~h6 等全局重置，会波及整页，
   且默认圆点依赖 layui-icon 图标字体（需另引 font.css），故自绘。
   竖线用 .sw-tl-item 的 ::before，圆点用 .sw-tl-dot 的 ::before 双层：
   外层描边圆 + 内层用 --sw-primary 填出 4px 实心，视觉等同 layui 的图标节点。 */
.sw-version-list {
    max-height: 330px;
    overflow-y: auto;
}

.sw-version-list.is-expanded {
    max-height: none;
}

.sw-tl-item {
    position: relative;
    padding: 0 0 18px 24px;
}

.sw-tl-item:last-child {
    padding-bottom: 0;
}

/* 竖线：top 对齐圆点中心，bottom 延伸到下一节点 */
.sw-tl-item::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 12px;
    bottom: -2px;
    width: 1px;
    background: var(--sw-border);
}

.sw-tl-item:last-child::before {
    display: none;
}

/* 圆点：6px 描边 + 4px 实心，直径 14px，与 1px 竖线同心（left:4px 为竖线中心） */
.sw-tl-dot {
    position: absolute;
    left: 0;
    top: 3px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--sw-primary);
    border-radius: 50%;
    background: #fff;
}

.sw-tl-body {
    min-width: 0;
}

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

.sw-tl-date {
    font-size: 13px;
    color: var(--sw-text-light);
}

.sw-tl-ver {
    font-size: 14px;
    font-weight: 600;
    color: var(--sw-text);
}

.sw-tl-meta {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--sw-text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 更新说明：mediumtext 可能很长，固定单行省略，title 属性给全文。
   模板里 changelog 走 think-template 的 default_filter=htmlentities，PHP 7.3 下
   它是 ENT_COMPAT：转义双引号但不转义单引号。这里安全只因 title 用双引号属性，
   若日后改单引号属性或把内容拼进 JS 字符串会裸奔。 */
.sw-tl-log {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--sw-text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sw-v-act {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sw-v-size {
    font-size: 12px;
    color: var(--sw-text-light);
    min-width: 68px;
    text-align: right;
}

.sw-v-btn {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 18px;
    border: none;
    background: var(--sw-primary);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
}

.sw-v-btn:hover {
    background: var(--sw-primary-dark);
}

.sw-v-btn.disabled {
    background: #d8d8e3;
    cursor: not-allowed;
}

.sw-show-more {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 9px 0;
    border: none;
    border-radius: 18px;
    background: #f5f5f8;
    color: var(--sw-text-light);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}

.sw-show-more:hover {
    background: #ececf2;
    color: var(--sw-primary);
}

/* ---------- 侧栏：下载卡片 ---------- */
.sw-panel {
    background: #fff;
    border: 1px solid var(--sw-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.sw-panel:last-child {
    margin-bottom: 0;
}

.sw-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--sw-text);
    margin: 0 0 14px;
}

.sw-dl-label {
    font-size: 12px;
    color: var(--sw-text-light);
    margin-bottom: 4px;
}

.sw-dl-ver {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--sw-text);
    word-break: break-all;
}

.sw-dl-meta {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--sw-text-light);
}

.sw-dl-meta span {
    margin-right: 10px;
}

.sw-dl-btn {
    display: block;
    width: 100%;
    height: 48px;
    line-height: 48px;
    margin-top: 18px;
    border: none;
    border-radius: 24px;
    background: var(--sw-download);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s;
}

.sw-dl-btn:hover {
    background: var(--sw-download-hover);
}

.sw-dl-btn.disabled {
    background: #d8d8e3;
    cursor: not-allowed;
}

/* 次要下载通道（如当前版本网盘 + 立即下载本站文件并存） */
.sw-dl-btn-sub {
    margin-top: 10px;
    background: transparent;
    border: 1px solid var(--sw-download);
    color: var(--sw-download);
}

.sw-dl-btn-sub:hover {
    background: var(--sw-download);
    color: #fff;
}

.sw-dl-tips {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--sw-text-light);
    text-align: center;
}

/* ---------- 侧栏：收藏 + 历史版本锚点 ---------- */
.sw-collect {
    display: flex;
    gap: 10px;
}

.sw-collect-btn {
    flex: 1;
    height: 42px;
    line-height: 42px;
    border: 1px solid var(--sw-border);
    border-radius: 21px;
    background: #fff;
    color: var(--sw-text-light);
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
}

.sw-collect-btn:hover {
    border-color: var(--sw-primary);
    color: var(--sw-primary);
}

.sw-collect-btn[data-collected="1"] {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, .08);
    color: #4CAF50;
}

.sw-history-link {
    flex: 0 0 auto;
    height: 42px;
    line-height: 42px;
    padding: 0 16px;
    border-radius: 21px;
    background: #f5f5f8;
    color: var(--sw-text-light);
    font-size: 13px;
    text-decoration: none;
    transition: all .2s;
}

.sw-history-link:hover {
    background: #ececf2;
    color: var(--sw-primary);
}

.sw-block-link {
    display: block;
    text-align: center;
    margin-top: 10px;
}

/* ---------- 侧栏：统计 ---------- */
.sw-stats {
    display: flex;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--sw-border);
}

.sw-stat {
    flex: 1;
    text-align: center;
}

.sw-stat-num {
    font-size: 16px;
    font-weight: 700;
    color: var(--sw-primary);
}

.sw-stat-label {
    margin-top: 2px;
    font-size: 12px;
    color: var(--sw-text-light);
}

/* ---------- 侧栏：Product Information ---------- */
.sw-info-row {
    display: flex;
    gap: 12px;
    padding: 7px 0;
    font-size: 13px;
    line-height: 1.7;
    border-bottom: 1px dashed var(--sw-border);
}

.sw-info-row:last-child {
    border-bottom: none;
}

.sw-info-label {
    flex: 0 0 96px;
    color: var(--sw-text-light);
}

.sw-info-val {
    flex: 1;
    min-width: 0;
    color: var(--sw-text);
    word-break: break-word;
}

.sw-tags {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--sw-border);
}

.sw-tag {
    display: inline-block;
    padding: 2px 10px;
    margin: 0 8px 8px 0;
    border-radius: 10px;
    font-size: 12px;
    color: var(--sw-primary);
    background: rgba(28, 189, 249, .12);
    text-decoration: none;
}

a.sw-tag:hover {
    color: #fff;
    background: var(--sw-primary);
}

/* ---------- 侧栏：Related Products ---------- */
.sw-rel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--sw-border);
    text-decoration: none;
    transition: background .2s;
}

.sw-rel-item:last-child {
    border-bottom: none;
}

.sw-rel-item:hover .sw-rel-title {
    color: var(--sw-primary);
}

.sw-rel-thumb {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: #f7f7fb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sw-rel-thumb img {
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
}

.sw-rel-body {
    flex: 1;
    min-width: 0;
}

.sw-rel-title {
    font-size: 14px;
    color: var(--sw-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sw-rel-meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--sw-text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- 收费提示 ---------- */
.sw-pan {
    background: linear-gradient(135deg, #fca120, #e08c0a);
    border-radius: 12px;
    padding: 18px 22px;
    color: #fff;
    margin-bottom: 20px;
}

.sw-pan h3 {
    font-size: 15px;
    margin: 0 0 8px;
    font-weight: 600;
}

.sw-pan .link {
    font-size: 14px;
    line-height: 1.8;
    opacity: .95;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 768px) {
    .sw-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .sw-hero-cover {
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        min-height: 120px;
        padding: 12px;
    }

    .sw-hero-cover > img {
        max-height: 260px;
    }

    .sw-hero-icon {
        width: 36px;
        height: 36px;
    }

    /* 时间线头部换行：平台/架构整体另起一行，动作区靠右 */
    .sw-tl-head {
        gap: 6px 8px;
    }

    .sw-tl-meta {
        flex: 0 0 100%;
        order: 3;
    }

    .sw-v-act {
        width: 100%;
        justify-content: flex-end;
    }

    .sw-sidebar {
        max-width: 100%;
    }

    .sw-info-label {
        flex: 0 0 84px;
    }
}
