/* --- 基础布局与背景 --- */
.how-it-works-section {
    position: relative;
    margin: 100px auto;
    padding: 0 20px;
    /* 确保这一块没有 overflow 问题 */
    overflow: visible; 
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.main-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.8rem;
    color: var(--theme-palette-color-4); /* Pure White */
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.2); /* 淡淡的紫色光晕 */
}

.sub-title {
    font-family: 'Inter', sans-serif;
    color: var(--theme-palette-color-3);
    font-size: 1.2rem;
    margin: 0 auto;
}

/* --- 时间轴容器 --- */
.timeline-container {
    position: relative;
    padding: 20px 0;
}

/* 中央连接线 (一条发光的线) */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(
        180deg, 
        rgba(139, 92, 246, 0) 0%, 
        var(--theme-palette-color-1) 20%, 
        var(--theme-palette-color-1) 80%, 
        rgba(139, 92, 246, 0) 100%
    );
    transform: translateX(-50%);
    z-index: 0;
    box-shadow: 0 0 15px var(--theme-palette-color-1); /* 发光效果 */
}

/* --- 时间轴单项 --- */
.timeline-item {
    position: relative;
    width: 50%; /* 桌面端：占据一半宽度，形成左右交错布局的基础 */
    padding: 20px 40px;
    box-sizing: border-box;
    z-index: 1;
}

/* 左右交错布局逻辑 (仅桌面端生效，移动端会被下面的 media query 覆盖) */

/* 奇数项在左 */
.timeline-item:nth-of-type(odd) {
    left: 0;
    text-align: right;
}

/* 偶数项在右 */
.timeline-item:nth-of-type(even) {
    left: 50%;
    text-align: left;
}

/* --- 呼吸灯节点 (Marker) --- */
.timeline-marker {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background-color: var(--theme-palette-color-1); /* Electric Violet */
    border-radius: 50%;
    border: 3px solid var(--theme-palette-color-7); /* 与背景融合的边框 */
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.3);
    
    /* 定位到中间线 */
    transform: translateY(-50%); 
    
    /* 动画：像心跳一样跳动 */
    animation: pulse-purple 2s infinite;
}

/* 修正节点位置 */
.timeline-item:nth-of-type(odd) .timeline-marker {
    right: -8px; /* 线宽的一半 + 自身的一半 */
}

.timeline-item:nth-of-type(even) .timeline-marker {
    left: -8px;
}

/* --- 卡片样式 (核心视觉) --- */
.timeline-card {
    background: var(--theme-palette-color-5);
    /* 玻璃拟态背景，如果你有背景图，这行很关键 */
    background: linear-gradient(145deg, rgba(51, 65, 85, 0.9), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(139, 92, 246, 0.1); /* 极淡的紫色边框 */
    border-radius: 16px;
    padding: 30px;
    position: relative;
    overflow: hidden; /* 为了切掉水印数字 */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* 弹性过渡 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* 卡片悬停动效 */
.timeline-card:hover {
    transform: translateY(-8px) scale(1.02); /* 上浮并微放大 */
    border-color: var(--theme-palette-color-1); /* 边框变亮 */
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15); /* 紫色投影 */
}

/* 巨大的背景数字水印 */
.watermark-number {
    position: absolute;
    top: -20px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 8rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.03); /* 极淡的透明度 */
    z-index: 0;
    line-height: 1;
    pointer-events: none;
    transition: transform 0.4s ease;
}

/* 左右布局时的水印位置 */
.timeline-item:nth-of-type(odd) .watermark-number { right: 10px; }
.timeline-item:nth-of-type(even) .watermark-number { left: 10px; }

/* 悬停时数字稍微移动 */
.timeline-card:hover .watermark-number {
    transform: translateY(-10px);
    color: rgba(139, 92, 246, 0.1); /* 变紫一点点 */
}

/* 卡片内容 */
.card-content {
    position: relative;
    z-index: 1;
}

.card-content h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    color: var(--theme-palette-color-4);
    margin-bottom: 10px;
}

.card-content p {
    font-family: 'Inter', sans-serif;
    color: var(--theme-palette-color-3);
    line-height: 1.6;
    font-size: 1rem;
}

/* --- CTA 按钮 --- */
.cta-container {
    text-align: center;
    margin-top: 80px;
}

.cta-container h3 {
    color: var(--theme-palette-color-4);
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.cta-note {
    /* 增加顶部间距，拉开与按钮的距离 */
    margin-top: 45px; 
    
    color: var(--theme-palette-color-3);
    font-style: italic;
    opacity: 0.8;
    font-size: 0.95rem; /* 稍微调大一点点字号，看起来更舒服 \*/
    letter-spacing: 0.5px;
}

/* --- CTA 按钮修复版 --- */
.glow-button {
    display: inline-block;
    padding: 16px 48px;
    background-color: var(--theme-palette-color-1);
    
    /* 强制文字颜色为白色 */
    color: #ffffff !important; 
    
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    
    /* 确保按钮在最上层 */
    position: relative;
    z-index: 10;
}

.glow-button:hover {
    background-color: var(--theme-palette-color-2); /* 变亮一点的紫色 */
    
    /* 关键修复：悬停时强制文字保持白色，防止变黑或变透明 */
    color: #ffffff !important; 
    
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.7);
}


/* --- 动画 Keyframes --- */
@keyframes pulse-purple {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); /* 扩散并消失 */
    }
    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

/* --- 移动端适配 (Critical Fix) --- */
@media screen and (max-width: 768px) {
    /* 将时间轴线移到最左侧 */
    .timeline-line {
        left: 20px; 
        transform: none; /* 移除居中偏移 */
    }
    
    /* 重置 item 宽度为 100% */
    .timeline-item {
        width: 100%;
        padding-left: 50px; /* 左侧留出空间给线 */
        padding-right: 0;
        margin-bottom: 30px; /* 增加卡片间距 */
    }
    
    /* 强制所有文本左对齐 */
    .timeline-item:nth-of-type(odd),
    .timeline-item:nth-of-type(even) {
        left: 0;
        text-align: left;
    }
    
    /* 强制节点定位到最左侧的线上 */
    .timeline-marker {
        left: 12px !important; /* 根据线的 left:20px 微调 */
        right: auto !important;
    }
    
    /* 修正奇数项的节点定位问题 */
    .timeline-item:nth-of-type(odd) .timeline-marker {
        left: 12px;
        right: auto;
    }
    
    /* 统一水印位置 */
    .watermark-number {
        right: 10px !important; 
        left: auto !important;
    }

    /* 修复标题在手机上可能过大的问题 */
    .main-title {
        font-size: 2.2rem;
    }
}
