/* --- 公共组件样式 --- */
/* 自定义弹窗样式 */
.custom-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.custom-dialog {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 85%;
    max-width: 360px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.custom-dialog-content {
    margin-bottom: 20px;
    text-align: center;
    font-size: 16px;
    color: #333;
    line-height: 1.5;
}

.custom-dialog-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.custom-dialog-button {
    flex: 1;
    padding: 12px 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
}

.custom-dialog-button.cancel {
    background-color: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.custom-dialog-button.cancel:hover {
    background-color: #f5f5f5;
}

.custom-dialog-button.confirm {
    background-color: #E63935;
    color: #fff;
    border: none;
}

.custom-dialog-button.confirm:hover {
    background-color: #c0322e;
}



/* 1. APP内打开按钮 (悬浮胶囊样式) */
.app-open-btn {
    position: fixed !important;
    /* 修改位置：增加与底部广告的距离 */
    bottom: 100px !important;
    /* 修改位置：居中悬浮 */
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 9999 !important;
    /* 修改颜色：改为品牌红实色，更醒目 */
    background: #E63935 !important;
    color: white !important;
    border-radius: 30px !important;
    padding: 10px 18px 10px 14px !important;
    min-height: 50px !important;
    /* 修改阴影：红色系阴影 */
    box-shadow: 0 4px 12px rgba(230, 57, 53, 0.4) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* 确保元素始终在最顶层 */
    pointer-events: auto !important;
    user-select: none !important;
    /* 增强固定定位稳定性 */
    transform-style: preserve-3d !important;
    backface-visibility: hidden !important;
    will-change: transform !important;
}

.app-open-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(230, 57, 53, 0.5);
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logo-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.btn-text {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* =========================================
   1. 底部广告横幅 (复刻原型图底部白条)
   ========================================= */
.top-banner {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9998 !important;
    
    /* 外观：纯白背景 + 顶部细微阴影 */
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px); /* 磨砂玻璃效果 */
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03) !important;
    
    /* 布局与间距 - 优化内边距和最小高度 */
    padding: 12px 20px !important;
    /* 适配 iPhone X+ 底部安全区 */
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    min-height: 65px;
    display: flex;
    align-items: center;
}

.banner-content {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.banner-logo {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

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

.banner-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-tagline {
    font-size: 15px;
    font-weight: normal;
    color: #333;
    line-height: 1.2;
    margin-bottom: 2px;
}

.app-desc {
    font-size: 11px;
    color: #999;
    line-height: 1.2;
}

/* =========================================
   2. APP内打开按钮 (复刻原型图红色胶囊)
   ========================================= */
.app-open-btn {
    position: fixed !important;
    /* 位置：居中，且位于底部Banner上方 */
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: 75px !important; /* 距离底部的高度，留出Banner的空间 */
    z-index: 9999 !important;

    /* 外观：品牌红 + 胶囊圆角 + 投影 */
    background: #EB332B !important; /* 原型图的红色 */
    color: #fff !important;
    border-radius: 100px !important; /* 胶囊形状 */
    box-shadow: 0 6px 16px rgba(230, 57, 53, 0.35) !important;
    
    /* 尺寸与布局 - 进一步减小纵向高度并保持横向长度 */
    padding: 4px 30px 4px 20px !important; /* 进一步减小上下内边距 */
    min-width: 180px; /* 保持最小宽度 */
    width: auto; /* 允许自动宽度 */
    max-width: 80%; /* 设置最大宽度防止溢出 */
    height: 26px; /* 进一步减小高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

/* 点击时的按压效果 */
.app-open-btn:active {
    transform: translateX(-50%) scale(0.96) !important;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* 图标容器：去除白色底色 */
.btn-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px; /* 图标与文字间距 */
    flex-shrink: 0;
}

/* 图标图片 */
.btn-logo-img {
    width: 24px; /* 调整图片大小以填充容器 */
    height: 24px;
    object-fit: contain;
}

/* 按钮文字 */
.btn-text {
    font-size: 15px;
    font-weight: 300;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* =========================================
   3. 响应式微调 (小屏幕适配)
   ========================================= */
@media (max-width: 360px) {
    .app-open-btn {
        bottom: 85px !important;
        min-width: 170px;
        padding: 4px 25px 4px 20px !important;
        max-width: 85%;
        height: 26px;
    }
    .btn-text {
        font-size: 14px;
    }
}