/* ============================================
   fenfa_pro 融合版样式
   基于 fenfa10 现代化UI + fenfa全屏蒙层
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f5f5f7;
    --card-bg: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #aeaeb2;
    --blue: #007aff;
    --blue-hover: #0051d5;
    --green: #34c759;
    --orange: #ff9500;
    --red: #ff3b30;
    --border: #e5e5ea;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-card: 0 2px 12px rgba(0,0,0,0.08);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 40px;
    -webkit-text-size-adjust: 100%;
}

/* 防止iOS上的双击缩放手势 */
html {
    -webkit-text-size-adjust: 100%;
}

/* ===== 顶部应用信息区 ===== */
.app-header {
    background: var(--card-bg);
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border);
}

.app-header-top {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.app-logo {
    width: 100px;
    height: 100px;
    border-radius: 26px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-card);
}

.app-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.app-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.app-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.app-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.app-actions {
    display: flex;
    align-items: center;
    gap: 8px 12px;
    flex-wrap: wrap;
}

.btn-install {
    background: var(--blue);
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    letter-spacing: 0.3px;
    white-space: nowrap !important;
    word-break: keep-all;
    overflow-wrap: normal;
    writing-mode: horizontal-tb;
    text-wrap: nowrap;
    flex-shrink: 0;
    flex-basis: auto;
    min-width: 88px;
    width: auto;
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
}

.btn-install:active {
    transform: scale(0.96);
    background: var(--blue-hover);
}

.btn-help {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 14px;
    background: rgba(0,122,255,0.08);
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: keep-all;
}

.btn-help b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

/* ===== 统计栏 ===== */
/* ===== 统计栏（参考App Store风格） ===== */
.stats-bar {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 14px 8px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.stat-item {
    text-align: center;
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    gap: 2px;
}

/* 中间短竖线分隔（参考App Store，只在中间高度显示） */
.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 28px;
    background: var(--border);
}

/* 顶部小标题（如：100万个评分、年龄、版本、大小） */
.stat-title {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-bottom: 3px;
}

/* 中间大数字（如：4.9、18+、3.2、8） */
.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

/* 底部说明文字（如：★★★★★、岁、版本号、MB） */
.stat-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-top: 3px;
}

/* 评分项的星星（底部显示） */
.stat-stars {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-top: 3px;
}

.stat-stars svg {
    width: 11px;
    height: 11px;
}

/* ===== 卡片容器 ===== */
.section {
    margin: 12px 16px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 8px;
}

.section-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.section-body {
    padding: 0 16px 16px;
}

/* ===== 安装注意事项 ===== */
.notice-box {
    background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
    border: 1px solid #ffd4d4;
    border-radius: var(--radius-sm);
    padding: 14px;
    margin: 12px 16px;
}

.notice-box h4 {
    font-size: 14px;
    color: var(--red);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notice-box p {
    font-size: 13px;
    color: #c0392b;
    line-height: 1.7;
}

/* ===== 简介 ===== */
.intro-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ===== 评分详情 ===== */
.rating-detail {
    display: flex;
    gap: 20px;
    padding: 8px 0;
}

.rating-big {
    text-align: center;
    min-width: 80px;
}

.rating-big .score {
    font-size: 56px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -2px;
}

.rating-big .stars {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin: 6px 0;
}

.rating-big .stars svg {
    width: 16px;
    height: 16px;
    fill: var(--orange);
}

.rating-big .count {
    font-size: 12px;
    color: var(--text-tertiary);
}

.rating-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-bar-label {
    font-size: 12px;
    color: var(--text-tertiary);
    width: 20px;
    text-align: right;
}

.rating-bar-track {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: var(--orange);
    border-radius: 3px;
}

.rating-bar-pct {
    font-size: 11px;
    color: var(--text-tertiary);
    width: 32px;
}

/* ===== 评论区 ===== */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-card {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.review-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.review-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.review-avatar.green { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.review-avatar.orange { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.review-avatar.blue { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.review-avatar.purple { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
.review-avatar.red { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }

.review-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.review-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.review-rating {
    display: flex;
    gap: 2px;
}

.review-rating svg {
    width: 12px;
    height: 12px;
    fill: var(--orange);
}

.review-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.review-body {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-date {
    font-size: 12px;
    color: var(--text-tertiary);
}

.review-like {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    transition: background 0.2s;
}

.review-like:active {
    background: var(--border);
}

.review-like svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-tertiary);
    fill: none;
    stroke-width: 2;
}

.review-like.liked svg {
    fill: var(--red);
    stroke: var(--red);
}

.review-like.liked {
    color: var(--red);
}

/* ===== 信息列表 ===== */
.info-list {
    list-style: none;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
}

.info-value.blue {
    color: var(--blue);
}

/* ===== 新功能 ===== */
.version-badge {
    display: inline-block;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 10px;
    margin-bottom: 8px;
}

/* ============================================
   融合功能1：fenfa 风格的微信全屏统一蒙层
   （全屏背景色 + 全屏提示图，参考fenfa模板）
   ============================================ */
.wechat-mask {
    display: none;
    position: fixed;
    z-index: 9998;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #444444;
    overflow: hidden;
}

.wechat-mask-content {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 全屏提示箭头图（参考fenfa的jiantou样式，宽度100%） */
.wechat-tip-img {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 4%;
    left: 0;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
}

.wechat-tip-text {
    display: none;
    position: fixed;
    top: 40%;
    left: 0;
    right: 0;
    z-index: 9999;
    text-align: center;
    color: #fff;
    font-size: 18px;
    line-height: 1.8;
    letter-spacing: 2px;
}

.wechat-tip-text strong {
    display: block;
    font-size: 22px;
    margin-bottom: 12px;
    color: #fff;
}

.wechat-tip-text p {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
}

/* 禁止页面滚动 */
body.wechat-blocked {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ============================================
   融合功能2：Safari 非Safari 提示弹窗
   ============================================ */
.safari-tip-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.safari-tip-modal.show {
    display: flex;
}

.safari-tip-box {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 88%;
    max-width: 340px;
    overflow: hidden;
    animation: safariTipIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

@keyframes safariTipIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.safari-tip-header {
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
    border-bottom: 1px solid var(--border);
}

.safari-tip-header h3 {
    font-size: 18px;
    color: var(--red);
    margin-bottom: 6px;
}

.safari-tip-header p {
    font-size: 13px;
    color: #c0392b;
}

.safari-tip-body {
    padding: 20px;
}

.safari-tip-url {
    background: var(--bg);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    word-break: break-all;
    border: 1px solid var(--border);
}

.safari-tip-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}

.safari-tip-btn:active {
    background: var(--blue-hover);
}

.safari-tip-btn.secondary {
    background: var(--bg);
    color: var(--text-secondary);
    margin-top: 8px;
}

.safari-tip-btn.secondary:active {
    background: var(--border);
}

/* ============================================
   iOS 安装教程弹窗（继承自 fenfa10）
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-box {
    background: #fff;
    margin: 8% auto;
    width: 92%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: modalIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    transition: background 0.2s;
}

.modal-close:active {
    background: var(--border);
}

.modal-body {
    padding: 16px 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.step-item {
    margin-bottom: 20px;
}

.step-item:last-child {
    margin-bottom: 0;
}

.step-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-img {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.step-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* ===== 底部安全区 ===== */
.safe-bottom {
    height: env(safe-area-inset-bottom, 20px);
}

/* 隐藏元素 */
.hidden { display: none !important; }

/* PC 端二维码样式 */
.pc-download-box {
    display: none;
    max-width: 500px;
    margin: 60px auto;
    text-align: center;
    padding: 40px 30px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.pc-download-box.show {
    display: block;
}

.pc-download-box .pc-app-info {
    margin-bottom: 25px;
}

.pc-download-box .pc-app-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.pc-download-box .pc-app-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.pc-qrcode {
    width: 220px;
    height: 220px;
    margin: 0 auto 20px;
    background: #fff;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
}

.pc-qrcode canvas,
.pc-qrcode img {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.pc-download-tip {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.pc-download-url {
    font-size: 13px;
    color: var(--text-tertiary);
    word-break: break-all;
    margin-top: 10px;
    padding: 10px;
    background: var(--bg);
    border-radius: 8px;
}

/* 响应式 */
@media (max-width: 480px) {
    .wechat-tip-img {
        width: 220px;
    }
}
