/**
 * 应用中心专属样式（AC-01 ~ AC-04）
 *
 * 复用 common.css 全局变量与 navbar/footer 等通用类
 */

/* ====== 页面顶 banner ====== */
.apps-banner {
    background: linear-gradient(135deg, #0D47A1 0%, #1976D2 60%, #2196F3 100%);
    color: #FFF;
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
}
.apps-banner::before {
    content: '';
    position: absolute;
    top: -150px; right: -120px;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.apps-banner::after {
    content: '';
    position: absolute;
    bottom: -180px; left: 10%;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.apps-banner-inner {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}
.apps-banner h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}
.apps-banner p {
    font-size: 15px;
    opacity: .92;
    line-height: 1.9;
    margin-bottom: 32px;
}
.apps-search-box {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}
.apps-search-input {
    width: 100%;
    height: 52px;
    padding: 0 98px 0 22px;
    border-radius: 26px;
    border: none;
    background: #FFF;
    font-size: 15px;
    color: var(--color-text);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    outline: none;
}
.apps-search-input::placeholder { color: var(--color-text-muted); }
/* 清除关键词 X：位于搜索按钮左侧，有内容时由 JS 切换 .is-visible */
.apps-search-clear {
    position: absolute;
    right: 82px; top: 50%;
    transform: translateY(-50%);
    width: 30px; height: 30px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    color: #8a909c;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    z-index: 2;
}
.apps-search-clear.is-visible { display: flex; }
.apps-search-clear:hover { background: rgba(0,0,0,0.12); color: #4a4f59; }
.apps-search-btn {
    position: absolute;
    right: 6px; top: 6px;
    height: 40px;
    padding: 0 22px;
    border-radius: 20px;
    border: none;
    background: var(--color-primary);
    color: #FFF;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .2s;
}
.apps-search-btn:hover { opacity: .9; }

/* ====== 主体布局：侧栏 + 内容 ====== */
.apps-main {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    margin-top: -48px;     /* 拉到 banner 上做"卡片浮起"效果 */
    position: relative;
    z-index: 2;
}
.apps-sidebar {
    background: var(--color-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 20px 0;
    height: fit-content;
    position: sticky;
    top: 88px;
}
.sidebar-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 0 24px 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.sidebar-list { list-style: none; }
.sidebar-list li {
    padding: 12px 24px;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.sidebar-list li:hover {
    background: var(--color-bg-section);
    color: var(--color-primary);
}
.sidebar-list li.active {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    border-left-color: var(--color-primary);
    font-weight: 600;
}
.sidebar-list .cat-name {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-list .cat-icon { font-size: 16px; }
.sidebar-list .cat-count {
    font-size: 12px;
    color: var(--color-text-muted);
    background: var(--color-bg-section);
    padding: 1px 8px;
    border-radius: 8px;
}
.sidebar-list li.active .cat-count {
    background: #FFF;
    color: var(--color-primary-dark);
}
/* 产业两级分类：大类行（手风琴折叠）+ 子类缩进行 */
.sidebar-list li.cat-group { display: block; padding: 0; font-weight: 600; }
.sidebar-list .cat-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-left: 3px solid transparent;
}
.sidebar-list .cat-arrow {
    display: inline-block;
    margin-right: 8px;
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-muted);
    transition: transform .15s ease;
}
.sidebar-list li.cat-group.expanded > .cat-group-head .cat-arrow { transform: rotate(90deg); }
.sidebar-list .cat-children { list-style: none; display: none; }
.sidebar-list li.cat-group.expanded > .cat-children { display: block; }
/* 折叠容器自身不响应 hover/active 底色，作用于标题行 */
.sidebar-list li.cat-group:hover { background: transparent; color: inherit; }
.sidebar-list li.cat-group.active { background: transparent; color: inherit; }
.sidebar-list .cat-group-head:hover {
    background: var(--color-bg-section);
    color: var(--color-primary);
}
.sidebar-list li.cat-group.active { border-left-color: transparent; }
.sidebar-list li.cat-group.active > .cat-group-head {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    border-left-color: var(--color-primary);
}
.sidebar-list li.cat-sub {
    padding: 9px 24px 9px 46px;
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-muted);
}
.sidebar-list li.cat-sub .cat-icon { font-size: 13px; }
.sidebar-list li.cat-sub.active { font-weight: 600; }
@media (max-width: 768px) {
    /* 移动端：产业类型全部展开（不折叠），但按 PC 端大类顺序分区——
       大类为整行分区标题（加粗+浅底色），子类为其下的小 chips，避免大小类混堆 */
    .sidebar-list li.cat-group { display: contents; }
    .sidebar-list .cat-arrow { display: none; }
    .sidebar-list .cat-group-head {
        flex: 0 0 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 4px;
        padding: 7px 14px;
        border-radius: 10px;
        border-left: 0;
        background: var(--color-bg-section);
        font-size: 14px;
        font-weight: 700;
        color: var(--color-text);
    }
    .sidebar-list .cat-group-head:hover { background: var(--color-bg-section); color: var(--color-text); }
    .sidebar-list li.cat-group.active > .cat-group-head {
        background: var(--color-primary-light);
        color: var(--color-primary-dark);
        border-left: 0;
    }
    /* 子类容器整行，内部小 chips 换行，左侧轻微缩进体现归属；
       显式覆盖桌面手风琴的 expanded/收起两种 display 规则，移动端始终全部可见 */
    .sidebar-list li.cat-group:not(.expanded) > .cat-children,
    .sidebar-list li.cat-group.expanded > .cat-children {
        display: flex;
        flex: 0 0 100%;
        flex-wrap: wrap;
        gap: 6px;
        padding: 2px 0 4px 10px;
    }
    .sidebar-list li.cat-sub {
        padding: 6px 14px;
        font-size: 12.5px;
        border-radius: 16px;
        border: 1px solid var(--color-border-light);
        border-left: 1px solid var(--color-border-light);
        background: #FFF;
    }
    .sidebar-list li.cat-sub.active {
        border-color: var(--color-primary);
        background: var(--color-primary-light);
    }
}

/* ====== 内容区 ====== */
.apps-content {
    background: var(--color-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 24px 28px 32px;
}
/* ====== 形态/场景平铺筛选 ====== */
.apps-filters {
    background: var(--color-bg-section);
    border: 1px solid var(--color-border-light);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.apps-filters .filter-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.apps-filters .filter-row + .filter-row { margin-top: 10px; }
.apps-filters .filter-label {
    flex: 0 0 34px;
    padding-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}
.apps-filters .filter-chips {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.apps-filters .filter-chip {
    padding: 5px 14px;
    border-radius: 16px;
    border: 1px solid var(--color-border-light);
    background: #FFF;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s ease;
}
.apps-filters .filter-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
/* 形态单选：主蓝色；场景多选：绿色；「不限」选中：中性深灰 */
.apps-filters .filter-chip.form.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #FFF;
}
.apps-filters .filter-chip.scene.active {
    background: #e8f8f0;
    border-color: #2fbf71;
    color: #15804a;
    font-weight: 600;
}
.apps-filters .filter-chip.chip-all.active {
    background: #eef0f4;
    border-color: #c2c8d2;
    color: var(--color-text);
    font-weight: 600;
}
/* 标签后相关应用计数徽标 */
.apps-filters .chip-count {
    display: inline-block;
    min-width: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 10px;
    background: #eef0f4;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
}
.apps-filters .filter-chip.form.active .chip-count { background: rgba(255,255,255,.25); color: #FFF; }
.apps-filters .filter-chip.scene.active .chip-count { background: rgba(47,191,113,.18); color: #15804a; }
.apps-filters .filter-chip.chip-all.active .chip-count { background: rgba(0,0,0,.12); color: var(--color-text); }
/* 0 个应用的标签弱化（仍可点击，点出空状态） */
.apps-filters .filter-chip.zero { opacity: .55; }
@media (max-width: 768px) {
    .apps-content { padding: 16px 14px 24px; }
    .apps-filters { padding: 12px; margin-bottom: 14px; border-radius: 10px; }
    .apps-filters .filter-label { flex-basis: 32px; font-size: 12.5px; }
    .apps-filters .filter-chip { padding: 4px 12px; font-size: 12.5px; }
}

.apps-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-border-light);
}
.apps-count {
    font-size: 14px;
    color: var(--color-text-secondary);
}
.apps-count .num {
    color: var(--color-primary-dark);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.sort-tabs {
    display: flex;
    gap: 4px;
}
.sort-tab {
    padding: 7px 16px;
    font-size: 13px;
    border-radius: 18px;
    border: 1px solid var(--color-border-light);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all .15s;
}
.sort-tab:hover {
    color: var(--color-primary);
    border-color: rgba(25,118,210,0.4);
}
.sort-tab.active {
    background: var(--color-primary);
    color: #FFF;
    border-color: var(--color-primary);
    font-weight: 500;
}

/* ====== 应用卡片网格 ====== */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gap);
}
.app-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    transition: all .25s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.app-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
    border-color: rgba(25,118,210,0.25);
}
.app-cover {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
}
.app-card:nth-child(6n+1) .app-cover { background: linear-gradient(135deg, #E3F2FD, #BBDEFB); }
.app-card:nth-child(6n+2) .app-cover { background: linear-gradient(135deg, #FFF3E0, #FFE0B2); }
.app-card:nth-child(6n+3) .app-cover { background: linear-gradient(135deg, #E8F5E9, #C8E6C9); }
.app-card:nth-child(6n+4) .app-cover { background: linear-gradient(135deg, #FCE4EC, #F8BBD0); }
.app-card:nth-child(6n+5) .app-cover { background: linear-gradient(135deg, #F3E5F5, #E1BEE7); }
.app-card:nth-child(6n+6) .app-cover { background: linear-gradient(135deg, #E0F2F1, #B2DFDB); }

.app-tag {
    position: absolute;
    top: 12px; left: 12px;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 10px;
    background: rgba(255,255,255,0.92);
    color: var(--color-primary-dark);
}
.app-tag.hot { background: #FFEBEE; color: #C62828; }
.app-tag.new { background: #E8F5E9; color: #2E7D32; }
.app-tag.free { background: #E3F2FD; color: #1565C0; }
/* 原厂官方产品角标（封面右上角，official_badge=1） */
.app-tag.vendor-official {
    top: 12px; right: 12px; left: auto;
    background: linear-gradient(135deg, #1E3A8A, #3B5BFD);
    color: #fff; font-weight: 700;
    box-shadow: 0 2px 8px rgba(30,58,138,.28);
}
/* 硬件产品封面角标（左下角橙色） */
.app-tag.hw-corner {
    top: auto; bottom: 12px; left: 12px;
    background: rgba(234,88,12,.92); color: #fff; font-weight: 600;
}
/* 卡片正文硬件标签 / 型号行 */
.app-form-tag.app-hw-tag { background: #FFEDD5; color: #C2410C; }
.app-hw-model { font-size: 12px; color: #C2410C; margin-bottom: 8px; line-height: 1.5; }

.app-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.app-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
    /* 标题独占一行，超长省略号 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 第二行：应用类型 / 形态 / 场景标签（允许换行，标签不拆字） */
.app-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.app-tags > span { white-space: nowrap; }
.app-dev {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}
.app-category-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--tag-default-bg);
    color: var(--tag-default-color);
    font-weight: 500;
}
/* 形态标签徽标（真源：采集标签库，应用中心卡片展示） */
.app-form-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #EEF2FF;
    color: #2F54EB;
    font-weight: 500;
}
/* 场景标签徽标（可多个，绿色系与分类紫/形态蓝区分） */
.app-scene-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #ECFDF5;
    color: #047857;
    font-weight: 500;
}

/* ====== 生成式封面（cover_url 为空时的确定性兜底，与应用采集端详情封面同款：渐变底+完整应用名+左下大类胶囊，不存库） ====== */
.gen-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    user-select: none;
}
/* 中央完整应用名（字号由 JS 按名称长度自适应） */
.gen-cover .gc-name {
    max-width: 90%;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 1px;
    padding: 0 16px;
    box-sizing: border-box;
    line-height: 1.25;
}
/* 左下「大类 / 子类」半透明胶囊 */
.gen-cover .gc-cls {
    position: absolute;
    left: 10px;
    bottom: 8px;
    font-size: 11px;
    color: #fff;
    background: rgba(0, 0, 0, .28);
    padding: 2px 9px;
    border-radius: 10px;
    z-index: 1;
    white-space: nowrap;
}
/* 小方块变体（详情头部 88px）：渐变封面缩略，居中显示完整应用名（最多两行，字号 JS 按长度分档） */
.gen-cover-icon { border-radius: inherit; }
.gen-cover-icon .gc-name-icon {
    max-width: 86%;
    color: #fff;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .5px;
    text-align: center;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .28);
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.screenshot-main .gen-cover { min-height: 220px; border-radius: 8px; }
.screenshot-main .gen-cover .gc-cls { font-size: 12px; padding: 3px 10px; border-radius: 11px; left: 12px; bottom: 10px; }
.app-description {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.app-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 0 14px;
    border-bottom: 1px dashed var(--color-border-light);
    font-size: 12px;
    color: var(--color-text-muted);
}
.app-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.app-meta .star { color: #FFA000; }
.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
}
.app-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary-dark);
}
.app-price.free { color: var(--color-success); }
.app-price .unit { font-size: 12px; font-weight: 400; }

/* ====== 分页器 ====== */
.apps-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border-light);
}
.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--color-border-light);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}
.page-btn:hover:not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}
.page-btn.active {
    background: var(--color-primary);
    color: #FFF;
    border-color: var(--color-primary);
    font-weight: 500;
}
.page-ellipsis {
    color: var(--color-text-muted);
    padding: 0 4px;
}

/* ====== 空状态 ====== */
.apps-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--color-text-muted);
}
.apps-empty .empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: .5;
}
.apps-empty p {
    font-size: 14px;
    line-height: 1.8;
}

/* ====== 加载占位骨架 ====== */
.app-card.skeleton .app-cover,
.app-card.skeleton .app-name,
.app-card.skeleton .app-description,
.app-card.skeleton .app-meta,
.app-card.skeleton .app-footer {
    background: linear-gradient(90deg, #F0F0F0 25%, #FAFAFA 50%, #F0F0F0 75%);
    background-size: 200% 100%;
    animation: skeleton 1.4s ease-in-out infinite;
    color: transparent;
}
@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.app-card.skeleton .app-cover { height: 160px; }
.app-card.skeleton .app-name { height: 18px; margin-bottom: 8px; width: 70%; border-radius: 4px; }
.app-card.skeleton .app-description { height: 38px; border-radius: 4px; }
.app-card.skeleton .app-meta { height: 16px; }
.app-card.skeleton .app-footer { height: 32px; }

/* ===================================== */
/* ====== 详情页 detail.html ====== */
/* ===================================== */
.detail-page {
    background: var(--color-bg-section);
    min-height: calc(100vh - 68px);
}
.detail-back {
    padding: 20px 0;
    font-size: 14px;
    color: var(--color-text-secondary);
}
.detail-back a {
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .15s;
}
.detail-back a:hover { color: var(--color-primary); }

.detail-main {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    margin-bottom: 48px;
}

/* 左：内容主区 */
.detail-left {
    background: var(--color-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.detail-hero {
    padding: 32px 36px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    border-bottom: 1px solid var(--color-border-light);
    background: linear-gradient(180deg, var(--color-primary-light) 0%, transparent 100%);
}
.detail-icon {
    width: 88px; height: 88px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: #FFF;
    box-shadow: var(--shadow-card);
    flex-shrink: 0;
    overflow: hidden;
}
.detail-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}
.detail-head-info { flex: 1; }
.detail-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.detail-dev {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 14px;
}
.detail-dev .v {
    color: var(--color-primary-dark);
    font-weight: 600;
}
.detail-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.detail-tags .tag {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    background: #FFF;
    color: var(--color-primary-dark);
    border: 1px solid rgba(25,118,210,0.2);
}
/* 未登录提示条：醒目引导注册登录，否则无法体验应用 */
.need-login-tip {
    margin-top: 14px;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(47,84,235,0.09), rgba(114,46,209,0.06));
    border: 1.5px solid rgba(47,84,235,0.45);
    border-radius: 10px;
    font-size: 14px;
    color: #1B2541;
    line-height: 1.6;
    flex-wrap: wrap;
    gap: 10px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(47,84,235,0.08);
}
.need-login-tip a.btn-sm {
    height: 32px;
    line-height: 30px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
}
.need-login-tip a.btn-sm + a.btn-sm {
    background: #fff !important;
    color: var(--color-primary-dark) !important;
    border: 1.5px solid var(--color-primary) !important;
}
.detail-desc {
    padding: 28px 36px;
    border-bottom: 1px solid var(--color-border-light);
}
.detail-desc h3,
.detail-features h3,
.detail-versions h3,
.detail-screenshots h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 3px solid var(--color-primary);
}
.detail-desc p {
    font-size: 14.5px;
    color: var(--color-text-secondary);
    line-height: 1.9;
}
.detail-features {
    padding: 28px 36px;
    border-bottom: 1px solid var(--color-border-light);
}
.detail-feature-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}
.detail-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.7;
}
.detail-feature-item::before {
    content: '✓';
    color: var(--color-success);
    font-weight: 700;
    flex-shrink: 0;
}

.detail-screenshots {
    padding: 28px 36px;
    border-bottom: 1px solid var(--color-border-light);
}
.screenshot-main {
    width: 100%;
    height: 360px;
    border-radius: var(--radius-card);
    overflow: hidden;
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    position: relative;
}
.screenshot-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.screenshot-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}
.screenshot-thumb {
    flex-shrink: 0;
    width: 96px;
    height: 60px;
    border-radius: 8px;
    background: var(--color-bg-section);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    overflow: hidden;
}
.screenshot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.screenshot-thumb.active { border-color: var(--color-primary); }
.screenshot-thumb:hover { border-color: rgba(25,118,210,0.4); }

.detail-versions {
    padding: 28px 36px 36px;
}
.version-list {
    border-left: 2px solid var(--color-border-light);
    padding-left: 20px;
}
.version-item {
    position: relative;
    padding-bottom: 24px;
}
.version-item:last-child { padding-bottom: 0; }
.version-item::before {
    content: '';
    position: absolute;
    left: -26px; top: 6px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(25,118,210,0.15);
}
.version-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}
.version-num {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary-dark);
}
.version-date {
    font-size: 12px;
    color: var(--color-text-muted);
}
.version-log {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.7;
    padding-left: 2px;
}

/* 右：信息卡 + 评分 + CTA */
.detail-right { display: flex; flex-direction: column; gap: 20px; }
.detail-card {
    background: var(--color-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 24px;
}
.detail-card .card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 16px;
}
.detail-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
}
.detail-price-row .price {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-primary-dark);
    line-height: 1;
}
.detail-price-row .price.free { color: var(--color-success); }
.detail-price-row .unit { font-size: 14px; color: var(--color-text-muted); }
.detail-price-note {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 18px;
}
.detail-cta {
    width: 100%;
    height: 52px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .15s ease, filter .15s ease;
    letter-spacing: 1px;
}
.detail-cta:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(24, 144, 255, .18); }
.detail-cta:active { transform: translateY(1px); }
.btn-free {
    background: linear-gradient(135deg, #52C41A 0%, #73D13D 100%) !important;
    color: #FFF !important;
}
.detail-info-list .value a {
    max-width: 200px;
    display: inline-block;
}
/* 按钮组：统一堆叠，每颗按钮之间留 14px 呼吸间隙 */
.detail-cta-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
}
.detail-cta-row { display: flex; gap: 10px; }
.detail-cta-row .detail-cta { margin-bottom: 0; }

.detail-info-list { list-style: none; }
.detail-info-list li {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    font-size: 13px;
    border-bottom: 1px dashed var(--color-border-light);
}
.detail-info-list li:last-child { border-bottom: none; }
.detail-info-list .label { color: var(--color-text-muted); }
.detail-info-list .value { color: var(--color-text); font-weight: 500; }

.detail-rating-block .rating-overall {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}
.detail-rating-block .rating-score {
    font-size: 36px;
    font-weight: 800;
    color: var(--color-primary-dark);
    line-height: 1;
}
.detail-rating-block .rating-max { font-size: 14px; color: var(--color-text-muted); }
.detail-rating-block .rating-count {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 14px;
}
.rating-stars {
    display: flex;
    gap: 4px;
    font-size: 18px;
    color: #E0E0E0;
}
.rating-stars .star.filled { color: #FFA000; }
.rating-submit {
    margin-top: 14px;
    width: 100%;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--color-primary);
    background: var(--color-bg);
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.rating-submit:hover {
    background: var(--color-primary);
    color: #FFF;
}

/* ====== 详情页响应式 ====== */
/* ====== 移动端顺序优化 ======
   ≤1100px：display:contents 透明化 detail-left/detail-right，
   所有 section 成为 detail-main 的直接 flex item，用 order 重排。
   PC 端 >1100px 不受影响，保持原始 grid 双栏。
   移动端顺序：Hero → 介绍 → 截图 → 能力 → 版本 → 询价CTA → 应用信息 → 评分 → 相关推荐
   （介绍在截图前；CTA 提前到版本后，不再埋最深处）
*/
@media (max-width: 1100px) {
    .detail-main {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .detail-left, .detail-right {
        display: contents;
    }
    /* 左栏5段补白卡（detail-left 被透明化后失去父级白底）
       注意：不用 catch-all，.detail-related 有自己的卡片样式不加 */
    .detail-hero, .detail-desc, .detail-features, .detail-screenshots, .detail-versions {
        background: var(--color-bg);
        border-radius: var(--radius-card);
        box-shadow: var(--shadow-card);
    }
    /* 移动端视觉顺序（显式类名，零 catch-all） */
    .detail-hero        { order: 1; }
    .detail-desc        { order: 2; }
    .detail-screenshots { order: 3; }
    .detail-features    { order: 4; }
    .detail-versions    { order: 5; }
    .detail-right > .detail-card:nth-child(1) { order: 6; }  /* 询价CTA */
    .detail-right > .detail-card:nth-child(2) { order: 7; }  /* 应用信息 */
    .detail-rating-block { order: 8; }
    .detail-related     { order: 9; }
}
@media (max-width: 960px) {
    .apps-main { grid-template-columns: 1fr; }
    .apps-sidebar {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 12px;
    }
    .sidebar-title { display: none; }
    .sidebar-list { display: flex; flex-wrap: wrap; gap: 6px; }
    .sidebar-list li {
        padding: 6px 14px;
        border-radius: 16px;
        border: 1px solid var(--color-border-light);
        border-left-width: 1px;
    }
    .sidebar-list li.active { border-color: var(--color-primary); }
    .apps-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .apps-banner { padding: 56px 0 80px; }
    .apps-banner h1 { font-size: 26px; }
    .apps-content { padding: 18px; }
    .apps-grid { grid-template-columns: 1fr; }
    .apps-toolbar { flex-direction: column; align-items: flex-start; gap: 12px; }
    .detail-hero { flex-direction: column; padding: 24px; }
    .detail-desc, .detail-features, .detail-screenshots, .detail-versions { padding: 20px; }
    .detail-feature-list { grid-template-columns: 1fr; }
    .screenshot-main { height: 220px; }
}

/* ====== 相关应用推荐 ====== */
.detail-related {
    background: #fff;
    border: 1px solid var(--color-border-light, #E5E7EB);
    border-radius: 14px;
    padding: 22px 26px 26px;
    margin-top: 20px;
}
.detail-related h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text, #1F2937);
    margin: 0 0 18px;
    position: relative;
    padding-left: 12px;
}
.detail-related h3::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 16px;
    background: var(--color-primary, #4467F5);
    border-radius: 2px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.related-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border: 1px solid var(--color-border-light, #E5E7EB);
    border-radius: 10px;
    background: #FAFBFC;
    transition: all .18s ease;
    cursor: pointer;
}
.related-card:hover {
    border-color: var(--color-primary, #4467F5);
    background: #fff;
    box-shadow: 0 6px 18px rgba(68, 103, 245, 0.12);
    transform: translateY(-2px);
}
.related-cover {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    overflow: hidden;
}
.related-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}
.related-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.related-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #1F2937);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.related-cat {
    font-size: 12px;
    color: var(--color-text-muted, #9CA3AF);
}
.related-bottom {
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.related-price {
    font-size: 13px;
    font-weight: 600;
    color: #F59E0B;
}
.related-price.free {
    color: #16A34A;
}
.related-rating {
    font-size: 12px;
    color: var(--color-text-muted, #9CA3AF);
}

/* ====== 相关推荐响应式 ====== */
@media (max-width: 960px) {
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .detail-related { padding: 18px 16px; }
    .related-grid { grid-template-columns: 1fr; }
}

/* ====== 形态/场景标签胶囊（开发者发布表单） ====== */
.tag-chip-box { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
    display: inline-flex; align-items: center;
    padding: 4px 12px; border-radius: 999px; cursor: pointer; user-select: none;
    font-size: 12.5px; line-height: 1.6;
    background: #F3F4F6; color: #4B5563; border: 1px solid #E5E7EB;
    transition: all .15s;
}
.tag-chip:hover { border-color: #3B5BFD; color: #3B5BFD; }
.tag-chip.on { background: rgba(59,91,253,.08); color: #3B5BFD; border-color: #3B5BFD; font-weight: 500; }
.tag-chip.custom { border-style: dashed; }
.tag-chip.custom.on { background: #F5F3FF; color: #7C3AED; border-color: #7C3AED; }

/* ====== 移动端筛选条（≤960px 收纳分类/形态/场景，桌面隐藏） ====== */
#mobileFilterBar { display: none; }
#mobileFilterMask, #mobileFilterPanel { display: none; }

@media (max-width: 960px) {
    /* 侧栏分类与形态/场景平铺块整体收纳，只留筛选条 */
    .apps-sidebar { display: none; }
    .apps-filters { display: none !important; }

    #mobileFilterBar {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin: 2px 0 14px;
    }
    .mfb-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        height: 38px;
        padding: 0 6px;
        border: 1px solid var(--color-border-light, #E5E7EB);
        background: #FFF;
        border-radius: 10px;
        font-size: 13px;
        line-height: 1;
        transition: all .15s ease;
    }
    .mfb-btn:active { background: var(--color-bg-section, #F3F4F6); }
    .mfb-btn .mfb-name { color: var(--color-text-muted, #9CA3AF); flex: 0 0 auto; }
    .mfb-btn .mfb-val {
        max-width: 88px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 600;
        color: var(--color-text, #1F2937);
    }
    .mfb-btn .mfb-arrow { font-size: 10px; color: #9CA3AF; transition: transform .2s ease; flex: 0 0 auto; }
    .mfb-btn.has {
        border-color: var(--color-primary, #4467F5);
        background: var(--color-primary-light, #EEF2FF);
    }
    .mfb-btn.has .mfb-name,
    .mfb-btn.has .mfb-val { color: var(--color-primary-dark, #2F54EB); }
    .mfb-btn.active .mfb-arrow { transform: rotate(180deg); }

    /* 遮罩 + 浮层 */
    #mobileFilterMask.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(17, 24, 39, .32);
        z-index: 1250;
    }
    /* 底部抽屉：贴屏幕底部升起，内容多少都自适应；超高时仅内容区滚动，底部按钮永远可见 */
    #mobileFilterPanel.show {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1260;
        max-height: 72vh;
        max-height: 72dvh;
        background: #FFF;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -10px 36px rgba(17, 24, 39, .20);
        overflow: hidden;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        animation: mfpSlideUp .22s ease-out;
    }
    @keyframes mfpSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
    /* 抽屉顶部抓手 */
    #mobileFilterPanel.show::before {
        content: '';
        flex: 0 0 auto;
        width: 38px;
        height: 4px;
        margin: 8px auto 2px;
        border-radius: 2px;
        background: var(--color-border-light, #E5E7EB);
    }
    .mfp-body { display: none; }
    .mfp-body.show {
        display: block;
        flex: 1 1 auto;
        min-height: 0;           /* flex 子项允许收缩，overflow 才会生效 */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 16px 12px;
    }
    .mfp-body-title {
        font-size: 12.5px;
        font-weight: 600;
        color: var(--color-text-muted, #9CA3AF);
        padding: 0 2px 10px;
    }
    .mfp-foot {
        flex: 0 0 auto;   /* 底部操作区永不被压缩/挤出 */
        display: flex;
        gap: 10px;
        padding: 10px 16px 14px;
        border-top: 1px solid var(--color-border-light, #E5E7EB);
        background: #FFF;
    }
    .mfp-foot button {
        height: 40px;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
    }
    #mfpReset {
        flex: 0 0 92px;
        border: 1px solid var(--color-border-light, #D1D5DB);
        background: #FFF;
        color: var(--color-text-secondary, #4B5563);
    }
    #mfpDone {
        flex: 1;
        border: 0;
        background: var(--color-primary, #4467F5);
        color: #FFF;
    }
    #mfpDone:active { opacity: .88; }

    /* 面板内·分类纵向列表（覆盖侧栏平铺/手风琴的移动端规则） */
    #mobileFilterPanel .sidebar-list { display: block; }
    /* 大类标题行：恢复展开箭头（提示点击可展开看小类） */
    #mobileFilterPanel .sidebar-list .cat-arrow {
        display: inline-block;
        color: var(--color-text-muted, #9CA3AF);
    }
    #mobileFilterPanel .sidebar-list li.cat-group.expanded > .cat-group-head .cat-arrow { transform: rotate(90deg); }
    #mobileFilterPanel .sidebar-list li {
        padding: 0;
        border: 0;
        border-left: 3px solid transparent;
        border-radius: 0;
        background: transparent;
    }
    #mobileFilterPanel .sidebar-list li.cat-group { display: block; font-weight: 400; }
    #mobileFilterPanel .sidebar-list .cat-group-head {
        display: flex;
        margin: 0;
        padding: 11px 12px;
        border-radius: 0;
        border-left: 3px solid transparent;
        background: transparent;
        font-size: 14px;
        font-weight: 600;
        color: var(--color-text, #1F2937);
    }
    #mobileFilterPanel .sidebar-list li.cat-group.active > .cat-group-head {
        background: var(--color-primary-light, #EEF2FF);
        color: var(--color-primary-dark, #2F54EB);
        border-left-color: var(--color-primary, #4467F5);
    }
    #mobileFilterPanel .sidebar-list .cat-children {
        display: none;
        padding: 0;
        flex-wrap: nowrap;
    }
    #mobileFilterPanel .sidebar-list li.cat-group.expanded > .cat-children { display: block; }
    #mobileFilterPanel .sidebar-list li.cat-sub {
        padding: 10px 12px 10px 36px;
        font-size: 13.5px;
        font-weight: 400;
        border: 0;
        border-left: 3px solid transparent;
        border-radius: 0;
        background: transparent;
        color: var(--color-text-secondary, #4B5563);
    }
    #mobileFilterPanel .sidebar-list > li[data-id="0"] {
        padding: 12px;
        font-weight: 600;
        font-size: 14px;
        border-left: 3px solid transparent;
    }
    #mobileFilterPanel .sidebar-list li:hover { background: transparent; }
    #mobileFilterPanel .sidebar-list li.active {
        border-color: transparent;
        background: var(--color-primary-light, #EEF2FF);
        color: var(--color-primary-dark, #2F54EB);
        border-left-color: var(--color-primary, #4467F5);
    }
    #mobileFilterPanel .sidebar-list .cat-count {
        background: rgba(0, 0, 0, .05);
    }

    /* 面板内·形态/场景胶囊（节点从 .apps-filters 搬入，外观在此复刻） */
    #mobileFilterPanel .filter-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 9px;
    }
    #mobileFilterPanel .filter-chip {
        padding: 7px 14px;
        border-radius: 17px;
        border: 1px solid var(--color-border-light, #E5E7EB);
        background: #FFF;
        font-size: 13px;
        line-height: 1.4;
        color: var(--color-text-secondary, #4B5563);
        white-space: nowrap;
    }
    #mobileFilterPanel .filter-chip.form.active {
        background: var(--color-primary, #4467F5);
        border-color: var(--color-primary, #4467F5);
        color: #FFF;
    }
    #mobileFilterPanel .filter-chip.scene.active {
        background: #e8f8f0;
        border-color: #2fbf71;
        color: #15804a;
        font-weight: 600;
    }
    #mobileFilterPanel .filter-chip.chip-all.active {
        background: #eef0f4;
        border-color: #c2c8d2;
        color: var(--color-text, #1F2937);
        font-weight: 600;
    }
    #mobileFilterPanel .chip-count {
        display: inline-block;
        min-width: 20px;
        margin-left: 6px;
        padding: 0 6px;
        border-radius: 10px;
        background: #eef0f4;
        color: var(--color-text-muted, #9CA3AF);
        font-size: 11px;
        font-weight: 600;
        line-height: 16px;
        text-align: center;
    }
    #mobileFilterPanel .filter-chip.form.active .chip-count { background: rgba(255,255,255,.25); color: #FFF; }
    #mobileFilterPanel .filter-chip.scene.active .chip-count { background: rgba(47,191,113,.18); color: #15804a; }
    #mobileFilterPanel .filter-chip.chip-all.active .chip-count { background: rgba(0,0,0,.12); color: var(--color-text, #1F2937); }
    #mobileFilterPanel .filter-chip.zero { opacity: .55; }
}

@media (max-width: 600px) {
    /* 小屏：筛选条按钮更紧凑，值最多显示 5 个汉字避免挤压换行 */
    .mfb-btn { font-size: 12.5px; gap: 3px; }
    .mfb-btn .mfb-val { max-width: 64px; }
}

/* ==================== AI 语义扩展搜索提示条（P3） ==================== */
.semantic-tip {
    display: none;
    margin: 0 0 14px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #EEF2FF 0%, #F5F3FF 100%);
    border: 1px solid #C7D2FE;
    border-radius: 10px;
    font-size: 13.5px;
    color: #4338CA;
    line-height: 1.6;
}
.semantic-tip .st-terms { font-weight: 600; }
