/* ============================================================================
 * 前台详情页公共样式（应用详情 extend/appView.php / 插件详情 extend/marketView.php）
 * ----------------------------------------------------------------------------
 * 这两页不加载 Codebase/Bootstrap，共用这一层：字体、重置、顶部导航、页脚、
 * 按钮、内容区块、图片预览、时间线（应用详情的「更新记录」与插件详情的「版本历史」）。
 * 各页自己的主体布局（product-* / plugin-* 等）仍写在各页的 <style> 里。
 *
 * 注意：首页 index.php 不引本文件 —— 它加载 Codebase，且用「全量 reset」会把
 * Bootstrap reboot 给标题/段落的默认间距清掉，导致首页排版回归。
 * ========================================================================== */

/* 自定义字体（与 assets/css/custom.css 中的定义同源，详情页不加载 custom.css） */
@font-face {
    font-family: "HarmonyOS Sans SC";
    src: url("../fonts/wenfont/HarmonyOS_Sans_SC_Medium.subset.woff2") format("woff2");
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "HarmonyOS Sans SC", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #fafafa;
    color: #262626;
    line-height: 1.6;
}

/* 顶栏外壳（.site-header / .site-header-inner / .site-header-logo）见 site.css */

/* 详情页独有的「返回首页」链接 */
.store-back {
    color: #737373;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.store-back:hover {
    color: #262626;
}

/* 主体容器（宽度取 site.css 的 --site-max-width：2026-09-25 宽屏改版 1200 → 1680） */
.store-container {
    max-width: var(--site-max-width);
    margin: 0 auto;
    padding: 32px 24px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

/* 按钮双端显示：桌面只显示文字、手机只显示图标（前台不加载 Bootstrap，故不用 d-*-* 工具类） */
.btn-ico {
    display: none;
}

.btn-primary {
    background: #171717;
    color: #fff;
}

.btn-primary:hover {
    background: #404040;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: #fff;
    color: #262626;
    border: 1px solid #e5e5e5;
}

.btn-secondary:hover {
    background: #fafafa;
    border-color: #d4d4d4;
}

.btn-success {
    background: linear-gradient(135deg, #86efac 0%, #4ade80 100%);
    color: #166534;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

/* 内容区块（应用介绍 / 产品截图 / 更新记录 / 插件介绍 …） */
.content-section {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #171717;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #737373;
    font-size: 16px;
}

.section-content {
    color: #525252;
    font-size: 15px;
    line-height: 1.8;
    /* 长 URL / 无空格长串不撑破卡片 */
    word-break: break-word;
    /* 宽屏改版（2026-09-25）：卡片跟着容器变宽了，但正文别跟着拉到 1600px ——
       一行太长读起来累，这里给正文限一个「舒适行宽」（约 70 字符），卡片本身仍是满宽 */
    max-width: 1100px;
}

.section-content p {
    margin-bottom: 12px;
}

.section-content p:last-child {
    margin-bottom: 0;
}

/* ===== 富文本内容（.rich-text，2026-10-16）=====
   应用介绍 / 安装教程 / 插件介绍：内容来自后台 CKEditor 产出的 HTML，
   前台经 richTextRender() 白名单净化后输出（见 include/common.php）。
   这里给排版元素补齐样式（此前这些字段按纯文本渲染，从没有过富文本样式）。 */
.rich-text > *:first-child {
    margin-top: 0;
}

.rich-text > *:last-child {
    margin-bottom: 0;
}

.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text h5,
.rich-text h6 {
    color: #171717;
    font-weight: 700;
    line-height: 1.4;
    margin: 24px 0 10px;
}

.rich-text h1 { font-size: 22px; }
.rich-text h2 { font-size: 19px; }
.rich-text h3 { font-size: 17px; }
.rich-text h4,
.rich-text h5,
.rich-text h6 { font-size: 15px; }

.rich-text ul,
.rich-text ol {
    margin: 0 0 12px;
    padding-left: 24px;
}

.rich-text ul { list-style: disc; }
.rich-text ol { list-style: decimal; }

.rich-text li { margin: 4px 0; }

.rich-text li > ul,
.rich-text li > ol { margin: 4px 0 0; }

.rich-text blockquote {
    margin: 0 0 12px;
    padding: 10px 16px;
    border-left: 3px solid #d4d4d4;
    background: #fafafa;
    color: #525252;
    border-radius: 0 8px 8px 0;
}

.rich-text pre {
    margin: 0 0 12px;
    padding: 12px 16px;
    background: #1f2937;
    color: #e5e7eb;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
}

.rich-text code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: .92em;
    background: #f5f5f5;
    color: #b91c1c;
    padding: 1px 5px;
    border-radius: 4px;
}

.rich-text pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.rich-text a {
    color: #2563eb;
    text-decoration: none;
    border-bottom: 1px solid rgba(37, 99, 235, .3);
}

.rich-text a:hover {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
}

.rich-text img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.rich-text figure { margin: 0 0 12px; }

.rich-text figcaption {
    margin-top: 6px;
    font-size: 12px;
    color: #a3a3a3;
    text-align: center;
}

.rich-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 12px;
    font-size: 14px;
}

.rich-text th,
.rich-text td {
    border: 1px solid #e5e5e5;
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}

.rich-text th {
    background: #fafafa;
    font-weight: 600;
    color: #171717;
}

.rich-text hr {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 18px 0;
}

.rich-text mark {
    background: #fef08a;
    padding: 0 2px;
}

/* 页脚外壳（.site-footer / .site-footer-inner）见 site.css */
/* 详情页的页脚是 body 直接子元素（首页的在 .home-wrapper 里，靠 flex 贴底），
   所以只给详情页留出与内容之间的间距 */
body > .site-footer {
    margin-top: 48px;
}

/* 图片预览（两页共用一类名，JS 也是同一套 showImagePreview/closeImagePreview） */
.image-preview-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.image-preview-overlay.show {
    display: flex;
}

.image-preview-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

/* 预览里的左右切换箭头与计数（只有一张图时箭头由 JS 隐藏） */
.preview-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.preview-arrow:hover {
    background: rgba(255, 255, 255, 0.32);
}

.preview-prev {
    left: 24px;
}

.preview-next {
    right: 24px;
}

.preview-counter {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    letter-spacing: 1px;
}

@media (max-width: 576px) {
    .image-preview-overlay img {
        max-width: 95%;
        max-height: 80%;
    }

    .preview-arrow {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .preview-prev {
        left: 8px;
    }

    .preview-next {
        right: 8px;
    }

    .preview-counter {
        bottom: 16px;
        font-size: 12px;
    }
}

/* 2026-10-16：这里原有 .btn-txt { display: none } —— 窄屏把「演示地址」按钮的文字藏掉、
   只留图标（用户看到的就是详情页手机上只剩一个眼睛图标）。按要求移除：手机端也显示文字，
   按钮本身在 ≤768px 已改成等宽排布（见 appView.php 的 .product-actions 规则），文字放得下。 */
@media (max-width: 575.98px) {
    .btn-ico {
        display: inline-block;
    }
}

@media (max-width: 768px) {
    .store-back {
        font-size: 13px;
    }

    .store-container {
        padding: 20px 16px;
    }

    .content-section {
        padding: 20px;
        margin-bottom: 16px;
    }

    .section-title {
        font-size: 18px;
        margin-bottom: 16px;
        padding-bottom: 12px;
        gap: 8px;
    }

    .section-content {
        font-size: 14px;
        line-height: 1.7;
    }

    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    /* 页脚的移动端规则见 site.css */
    body > .site-footer {
        margin-top: 32px;
    }
}

/* ============================================================================
 * 更新记录 / 版本历史时间线（应用详情 extend/appView.php 与插件详情 extend/marketView.php 共用）
 * 原先只写在应用详情页的 <style> 里，插件详情页要加「版本历史」时上移到本文件，
 * 避免同一套时间线样式在两个页面里各维护一份。
 * ========================================================================== */
/* 更新记录 - 左右分布时间线样式 */
.timeline {
    position: relative;
    /* 2026-10-11：原为 1000px 居中限宽，应用/插件详情页都要求「两边占满」，改为不限宽 */
    max-width: none;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(to bottom, #e5e5e5 0%, #d4d4d4 100%);
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 40px 32px 0;
    box-sizing: border-box;
}

.timeline-item:nth-child(even) {
    margin-left: 50%;
    padding: 0 0 32px 40px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -3px;
    top: 6px;
    width: 6px;
    height: 6px;
    background: #262626;
    border-radius: 50%;
    z-index: 1;
    transition: all 0.3s;
}

.timeline-item:nth-child(even)::before {
    right: auto;
    left: -3px;
}

.timeline-item:hover::before {
    background: #171717;
    transform: scale(1.3);
}

.timeline-content {
    background: #fafafa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    transition: all 0.2s;
}

.timeline-content:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.timeline-version {
    font-weight: 700;
    color: #171717;
    margin-bottom: 6px;
    font-size: 16px;
}

.timeline-date {
    font-size: 13px;
    color: #a3a3a3;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-date::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #d4d4d4;
    border-radius: 50%;
}

.timeline-text {
    color: #525252;
    font-size: 14px;
    line-height: 1.8;
}

/* 更新记录折叠：默认只显示最近若干条（老应用有 70+ 条，全展开会把页面撑到上万像素） */
.timeline-item.is-hidden {
    display: none;
}

.timeline.expanded .timeline-item.is-hidden {
    display: block;
}

.timeline-toggle {
    text-align: center;
    margin-top: 28px;
}

.timeline-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 26px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #262626;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s;
}

.timeline-toggle button:hover {
    background: #fafafa;
    border-color: #d9d9d9;
}

@media (max-width: 768px) {
    .timeline::before {
        left: 15px;
        transform: none;
        top: 6px;
        bottom: 6px;
    }

    .timeline-item {
        width: 100%;
        padding: 0 0 20px 36px;
        margin-left: 0 !important;
    }

    .timeline-item:nth-child(even) {
        padding: 0 0 20px 36px;
    }

    .timeline-item::before,
    .timeline-item:nth-child(even)::before {
        left: 12px;
        right: auto;
        top: 6px;
    }

    .timeline-content {
        padding: 16px;
    }

    .timeline-version {
        font-size: 14px;
    }

    .timeline-date {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .timeline-text {
        font-size: 13px;
        line-height: 1.7;
    }
}

/* =====================================================================
   前台详情页公共：支付弹窗 + 轻提示（2026-09-25 从应用详情页抽到公共层）
   应用详情页 / 插件详情页共用同一套 .modal-* / .form-* / .custom-toast*，
   改这里两边同时生效；页面自己的按钮与列表样式不要写进这一段。
   ===================================================================== */
        /* 弹窗 */
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            z-index: 1000;
            justify-content: center;
            align-items: center;
            padding: 20px;
            animation: modalFadeIn 0.25s ease;
        }

        .modal-overlay.show {
            display: flex;
        }

        @keyframes modalFadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: translateY(-20px) scale(0.95);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .modal-box {
            background: #fff;
            border-radius: 16px;
            width: 100%;
            /* 中号（2026-09-25）：原 480 太窄 —— 在线授权弹窗有 5 个字段 + 档位选择器 + 金额行，
               480 下每行都挤成一条、档位卡片只能排 2 个；720 下两列字段并排、档位一行 3~4 个 */
            max-width: 720px;
            max-height: calc(100vh - 40px);   /* 遮罩上下各 20px 内边距，扣掉后正好不被裁 */
            max-height: calc(100dvh - 40px);
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
            animation: modalSlideIn 0.3s ease;
        }

        .modal-header {
            padding: 24px 24px 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-title {
            font-size: 20px;
            font-weight: 600;
            color: #171717;
        }

        .modal-close {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            border: none;
            background: #f5f5f5;
            color: #737373;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .modal-close:hover {
            background: #e5e5e5;
            color: #262626;
        }

        .modal-body {
            padding: 24px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-label {
            display: block;
            font-size: 14px;
            font-weight: 500;
            color: #262626;
            margin-bottom: 8px;
        }

        /* ===== 授权档位价目表（应用详情 / 插件详情的价格区共用）=====
           2026-09-25 从 marketView 抽到公共层（应用授权也改成时长分级）。 */
        .tier-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .tier-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 14px;
            background: #fafafa;
            border: 1px solid #f0f0f0;
            border-radius: 10px;
        }

        .tier-days {
            font-size: 13px;
            color: #737373;
        }

        .tier-price {
            font-size: 16px;
            font-weight: 700;
            color: #262626;
        }

        /* ===== 授权档位选择器 + 金额行（应用详情 / 插件详情的「在线开通」弹窗共用）=====
           2026-09-25 从 marketView 抽到公共层：应用授权也改成时长分级价位后，
           两个详情页的档位选择必须长得一模一样。 */
        .mk-hide {
            display: none !important;
        }

        .mk-tier-choose {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
            gap: 8px;
        }

        .mk-tier-option {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 14px;
            border: 1px solid #e5e5e5;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .mk-tier-option:hover {
            border-color: #b9b9b9;
        }

        .mk-tier-option input {
            accent-color: #262626;
            margin: 0;
        }

        .mk-tier-name {
            font-size: 14px;
            color: #262626;
        }

        .mk-tier-money {
            font-size: 15px;
            font-weight: 700;
            color: #171717;
            margin-left: auto;   /* 价格右对齐，与价格区的档位价目表一致 */
        }

        .mk-pay-total {
            display: flex;
            flex-wrap: wrap;
            align-items: baseline;
            justify-content: space-between;
            gap: 4px 12px;
            margin-bottom: 20px;
            padding: 12px 16px;
            background: #fafafa;
            border: 1px solid #f0f0f0;
            border-radius: 10px;
            font-size: 14px;
            color: #737373;
        }

        /* 提示文案（如「再次提交即续费」）单独占一行，别跟金额挤在一起 */
        .mk-pay-total .mk-pay-tip {
            flex: 0 0 100%;
            margin-top: 0;
        }

        /* 只给「应付金额」那个直接子元素加价签样式：提示文案里的 <strong> 不能被带成 20px 红字
           （否则会撑破行高、压住旁边的灰字，实测就是这个表现） */
        .mk-pay-total > strong {
            font-size: 20px;
            color: #ef4444;
        }

        .mk-pay-tip {
            display: block;
            margin-top: 6px;
            font-size: 12px;
            color: #a3a3a3;
        }

        .mk-pay-tip strong {
            color: #737373;
            font-weight: 600;
        }

        /* 字段下方的小字提示（如授权标识栏的「再次提交即续费」说明） */
        .pay-tip {
            margin-top: 6px;
            font-size: 12px;
            line-height: 1.5;
            color: #a3a3a3;
        }

        .form-input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid #e5e5e5;
            border-radius: 10px;
            font-size: 15px;
            transition: all 0.2s;
        }

        .form-input:focus {
            outline: none;
            border-color: #262626;
        }

        .form-input-group {
            display: flex;
            gap: 12px;
            /* 行内按钮与输入框等高：不设的话输入框会被 flex 拉成按钮的 48px（其它字段是 41px，
               同一张表单里两个高度，实测就是这个观感不一致） */
            align-items: center;
        }

        .form-input-group .form-input {
            flex: 1;
            /* 与行内按钮严格等高（输入框 auto 高度在不同缩放下会比按钮高 1~2px） */
            height: 41px;
        }

        .form-input-group .btn {
            /* 与 .form-input 严格等高：靠 padding 凑容易差 2~3px，直接定高 */
            height: 41px;
            padding: 0 22px;
        }

        /* 两个短字段并排一行（弹窗中号后才有空间；<640 自动落回单列） */
        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0 20px;
        }

        @media (max-width: 640px) {
            .form-row {
                grid-template-columns: 1fr;
            }
        }

        .modal-footer {
            padding: 0 24px 24px;
            display: flex;
            gap: 12px;
        }

        .modal-footer .btn {
            flex: 1;
            justify-content: center;
        }

        @media (max-width: 576px) {
            .modal-overlay {
                padding: 16px;
            }

            .modal-box {
                border-radius: 12px;
            }

            .modal-header {
                padding: 20px 20px 0;
            }

            .modal-title {
                font-size: 18px;
            }

            .modal-body {
                padding: 20px;
            }

            .modal-footer {
                padding: 0 20px 20px;
                flex-direction: column;
            }

            .form-input {
                font-size: 16px;
                padding: 10px 14px;
            }

            .form-label {
                font-size: 13px;
            }

            .form-group {
                margin-bottom: 16px;
            }
        }

        /* 通知条（.custom-toast*）2026-10-16 已统一移到 site.css：改成底部居中黑灰条，
           首页/应用详情/插件详情共用一份（原来这里是一套白底彩边、右上角的实现）。
           本文件仍被详情页加载，但不再定义通知条样式。 */
