/* =========================================
   1. 全局重置与移动端基础适配
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* 禁用移动端点击高亮，让反馈完全交给自定义动画 */
    -webkit-tap-highlight-color: transparent; 
}

html, body, #app {
    width: 100%;
    height: 100%;
    /* 兜底高度 */
    background: #000;
    /* 禁止外层橡皮筋滚动，由 .page 内部接管 */
    overflow: hidden; 
}

.page {
    width: 100%;
    /* 核心：使用 JS 实时计算的 --vh 变量，完美适配各类手机高度 */
    min-height: 100vh; 
    min-height: calc(var(--vh, 1vh) * 100); 
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    background: #000;
    position: relative;
    /* 允许内部垂直滚动，防止小屏手机裁掉按钮 */
    overflow-y: auto; 
    overflow-x: hidden;
    /* iOS 丝滑滚动 */
    -webkit-overflow-scrolling: touch; 
}

/* =========================================
   2. 背景视频 (优化为 fixed 降低渲染开销)
   ========================================= */
.bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none; /* 确保不挡住点击事件 */
}

/* =========================================
   3. 顶部 Header
   ========================================= */
.top-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    height: 64px;
    /* 顶部阴影遮罩，增加文字辨识度 */
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 8px;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.85;
    color: #fff;
}

/* =========================================
   4. 中间图片 (居中展示)
   ========================================= */
.center-logo {
    position: absolute;
    z-index: 5;
    top: 25%; /* 针对视频内容适当微调位置 */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75%;
    height: auto;
    pointer-events: none;
}

/* =========================================
   5. 底部 CTA 区域 (含底部安全区适配)
   ========================================= */
.cta-section {
    position: absolute;
    /* 结合了距底间距与苹果底侧安全区 */
    bottom: calc(25px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}

.cta-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
    text-align: center;
    /* 霓虹发光标题：针对 videos 渠道增强氛围感 */
    text-shadow: 0 0 10px rgba(0, 122, 255, 0.8), 0 0 2px rgba(255, 255, 255, 0.5); 
}

/* =========================================
   6. 霓虹流光按钮主体 (丝滑交互增强版)
   ========================================= */
.cta-btn {
    position: relative; 
    display: flex;
    align-items: center;
    justify-content: center;
    width: 230px; 
    height: 62px;
    border-radius: 50px; 
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    background: #000; 
    border: none; 
    overflow: hidden; /* 裁掉超出的流光层 */
    
    /* 增加整体光晕 */
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.4), 0 0 30px rgba(0, 122, 255, 0.1); 
    
    /* 物理反馈：过渡动画 */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 硬件加速，防止动画卡顿 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);

    /* 默认霓虹呼吸动画 */
    animation: neon-btn-glow 2.5s ease-in-out infinite;
    -webkit-animation: neon-btn-glow 2.5s ease-in-out infinite;
}

/* 【点击瞬间的丝滑反馈】 */
.cta-btn:active {
    transform: scale(0.92); /* 物理缩放 */
    filter: brightness(1.2); /* 瞬间提亮 */
}

/* 1. 生成旋转的霓虹渐变层 (跑马灯层) */
.cta-btn::before {
    content: '';
    position: absolute;
    top: -50%; 
    left: -50%;
    width: 200%;
    height: 200%;
    /* 霓虹蓝-紫-粉色调 */
    background: conic-gradient(
        transparent,
        rgba(0, 122, 255, 1) 15%, 
        rgba(157, 0, 255, 1) 30%, 
        rgba(255, 0, 212, 1) 45%, 
        transparent 60%
    );
    /* 旋转速度加快，显得更有活力 */
    animation: neon-flow 1.8s linear infinite;
    -webkit-animation: neon-flow 1.8s linear infinite; 
}

/* 2. 生成黑色盖板 (向下兼容：弃用 inset) */
.cta-btn::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: rgba(10, 10, 10, 0.98); 
    border-radius: 50px; 
    z-index: 1; 
}

/* 3. 按钮内容层 */
.apple-icon,
.cta-btn-text {
    position: relative;
    z-index: 2; 
}

.apple-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
}

.cta-btn-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cta-btn-main {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.cta-btn-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

/* =========================================
   7. 动画定义
   ========================================= */

/* 霓虹流光旋转 */
@keyframes neon-flow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@-webkit-keyframes neon-flow {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

/* 按钮整体呼吸光晕 */
@keyframes neon-btn-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 122, 255, 0.4); }
    50% { box-shadow: 0 0 25px rgba(0, 122, 255, 0.7); }
}
@-webkit-keyframes neon-btn-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 122, 255, 0.4); }
    50% { box-shadow: 0 0 25px rgba(0, 122, 255, 0.7); }
}

/* =========================================
   8. 逻辑拦截状态 (对应 app.js 中的 .is-waiting)
   ========================================= */
.cta-section.is-waiting .cta-btn {
    pointer-events: none; /* 彻底禁止连点 */
    transform: scale(0.95);
    opacity: 0.8;
    animation: none; /* 停止呼吸 */
    filter: grayscale(0.2); /* 稍微变暗色表示处理中 */
}

/* 等待期间，让流光旋转变慢，给用户“后台正在响应”的体感 */
.cta-section.is-waiting .cta-btn::before {
    animation-duration: 4s; 
    opacity: 0.5;
}