/* ==========================================================================
   内嵌商店详情页：扁平分区 + 收细字阶
   —— 去卡片盒子、细分隔线；标题/正文略收，避免过粗过大
   本文件在 index.html 中最后加载，靠「同特异性 + 后置」稳定覆盖 store 主题样式。
   仅改视觉，不改 DOM / JS / 数据结构；浅色与深色主题共用变量。
   ========================================================================== */

/* 分区之间取消卡片间距，改用整段留白 */
#store-window #storeDetailStack .store-detail-body {
    gap: 0;
}

/* 卡片盒子 → 扁平分区：透明底、无边框、底部细分隔线 */
#store-window[data-store-theme="light"] #storeDetailStack .detail-section-card,
#store-window[data-store-theme="dark"] #storeDetailStack .detail-section-card {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--mm-store-border-soft);
    border-radius: 0;
    padding: 20px 2px;
}

#store-window #storeDetailStack .detail-header-card {
    padding-top: 6px;
}

/* 最后一个分区（写评价表单）不再拖一条分隔线 */
#store-window #storeDetailStack .detail-section-card:last-of-type {
    border-bottom: 0;
}

/* 区块标题：略收，避免 700 过重 */
#store-window[data-store-theme="light"] #storeDetailStack .detail-section-card h2,
#store-window[data-store-theme="dark"] #storeDetailStack .detail-section-card h2 {
    font-size: var(--t-15, 15px);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.25;
    margin: 0 0 10px;
    padding: 0;
    border: none;
}

/* 头部：图标与标题略收 */
#store-window #storeDetailStack .detail-icon {
    width: 76px;
    height: 76px;
    border-radius: 17px;
    margin-top: 0;
}

#store-window #storeDetailStack .detail-header {
    gap: 16px;
    align-items: center;
}

#store-window #storeDetailStack .detail-name {
    font-size: var(--t-20, 20px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

#store-window #storeDetailStack .detail-tagline {
    font-size: var(--t-13, 13px);
    font-weight: 400;
    line-height: 1.45;
    margin-top: 4px;
    color: var(--mm-store-text-secondary);
}

#store-window #storeDetailStack .detail-meta-shelf {
    font-size: var(--t-12, 12px);
}

#store-window #storeDetailStack .sd-price-row {
    font-size: var(--t-13, 13px);
    font-weight: 450;
}

/* 详情页统一阅读宽。
   改之前：「应用介绍」被限到 640px（约 49 字/行），而「新功能」「系统要求」「评价」
   都是整幅 974px（约 75 字/行）。同一页并存两套宽度，正文右侧凭空空出 336px，
   看起来像渲染坏了；而那几个 75 字/行的区块本身也超出了中文的舒适阅读长度。
   现在整页共用一个居中的阅读栏：宽度一致、左右留白对称，行长回到约 60 字。 */
#store-window #storeDetailStack .store-detail-body > * {
    width: 100%;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}

/* 头部不走阅读宽：一行要放下图标、标题、副标题和三个下载按钮，
   限到 780px 会把副标题挤成 284px。但也不能完全不限——窗口最大化后容器有 1400px，
   图标贴最左、按钮贴最右会散架。1040px 对内嵌窗口（978px）无影响，只在全屏时收口。 */
#store-window #storeDetailStack .store-detail-body > .detail-header-card {
    max-width: 1040px;
}

/* 简介正文 */
#store-window #storeDetailStack #sd-detailDescription.detail-rich {
    font-size: var(--t-13, 13px);
    line-height: 1.6;
    font-weight: 400;
    max-width: none;
}

#store-window #storeDetailStack #sd-detailDescription.detail-rich > p:first-of-type {
    font-size: var(--t-14, 14px);
}

#store-window #storeDetailStack #sd-detailDescription.detail-rich h2,
#store-window #storeDetailStack #sd-detailDescription.detail-rich h3 {
    font-size: var(--t-14, 14px);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 1.35em 0 0.5em;
}

/* A 细线：功能章节（h3）上方淡分隔，深浅主题各配对比度 */
#store-window #storeDetailStack #sd-detailDescription.detail-rich > h3 {
    margin-top: 1.65em;
    padding-top: 1.05em;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

#store-window[data-store-theme="light"] #storeDetailStack #sd-detailDescription.detail-rich > h3 {
    border-top-color: rgba(0, 0, 0, 0.12);
}

#store-window #storeDetailStack .detail-block-body,
#store-window #storeDetailStack .detail-section-card .detail-text {
    font-size: var(--t-13, 13px);
    line-height: 1.55;
    font-weight: 400;
}

/* 截图：保持横向滑动，略作主角留白 */
#store-window #storeDetailStack .screenshots-grid {
    gap: 14px;
}

#store-window #storeDetailStack .screenshot-item {
    width: min(56vw, 520px);
    max-width: min(56vw, 520px);
    border-radius: 12px;
}

#store-window #storeDetailStack .screenshot-item img {
    max-width: min(56vw, 520px);
    max-height: min(60vh, 600px);
}

/* ---- 移动端：收窄内嵌窗口时保持左对齐与合理密度 ---- */
@media (max-width: 640px) {
    #store-window #storeDetailStack .detail-section-card {
        padding: 18px 0;
    }

    #store-window[data-store-theme="light"] #storeDetailStack .detail-section-card h2,
    #store-window[data-store-theme="dark"] #storeDetailStack .detail-section-card h2 {
        font-size: var(--t-15, 15px);
    }

    #store-window #storeDetailStack .detail-header {
        align-items: flex-start;
        gap: 12px;
    }

    #store-window #storeDetailStack .detail-icon {
        width: 68px;
        height: 68px;
        border-radius: 15px;
    }

    #store-window #storeDetailStack .detail-name {
        font-size: var(--t-20, 20px);
    }

    #store-window #storeDetailStack .detail-title-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    #store-window #storeDetailStack .detail-title-head .detail-download-actions {
        width: 100%;
    }

    #store-window #storeDetailStack .screenshot-item,
    #store-window #storeDetailStack .screenshot-item img {
        width: min(78vw, 440px);
        max-width: min(78vw, 440px);
    }
}
