/* ============================================================
   🥳 首页样式 - VitePress 风格
   ============================================================ */

/* 🌐 防止页面出现水平滚动条 */
html, body {
    overflow-x: hidden;
}

/* 🔗 Hero 区域 - 全宽布局，内容左对齐 */
.vp-hero {
    /* ◀️ 减少上下内边距，避免留白过大 */
    padding: 1rem 0;
    background: transparent;
    /* ◀️ 改为 visible 确保 Logo 光晕不被切割 */
    overflow: visible;
    position: relative;
}

/* ☀️ Hero 背景光晕效果 */
.vp-hero::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 10%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(100, 108, 255, 0.1) 0%, transparent 70%);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 0;
}

/* 🎯 Hero 容器 */
.vp-hero-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8rem;
    position: relative;
    z-index: 1;
    /* ◀️ 添加左右内边距避免内容太靠边 */
    padding-left: 60px;
    padding-right: 60px;
    /* ◀️ 移除最小高度，让内容决定高度，减少上下留白 */
    box-sizing: border-box;
}

.vp-hero-content {
    /* ◀️ 允许内容区域收缩以适应容器 */
    flex: 0 1 auto;
    text-align: center;
    /* ◀️ 确保内容区域不会超出容器 */
    max-width: 100%;
}

/* 🎨 渐变标题 */
.vp-hero-title {
    font-size: 6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #646cff 0%, #a855f7 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    /* ◀️ 确保长标题在小屏幕下正确换行 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 📝 副标题 - 带分割线 */
.vp-hero-subtitle {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--vp-c-text-1);
    margin-bottom: 1.5rem;
    line-height: 1.3;
    display: inline-block;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--vp-c-border);
}

.vp-hero-description {
    font-size: 2rem;
    color: var(--vp-c-text-2);
    margin-bottom: 3rem;
    /* ◀️ 确保长描述在小屏幕下正确换行 */
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
}

/* 🎨 描述中的渐变色文字 */
.vp-hero-desc-gradient {
    font-size: 2.5rem;
    font-weight: 700;
    /* ◀️ 渐变色效果 */
    background: linear-gradient(135deg, #646cff 0%, #a855f7 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 🔘 按钮组 - 横向排列，超过3个换行 */
.vp-hero-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.vp-hero-button .wp-block-button__link {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 24px;
    transition: all 0.25s ease;
}

.vp-hero-button-primary .wp-block-button__link {
    background: linear-gradient(135deg, #646cff 0%, #a855f7 100%);
    color: #ffffff;
    border: none;
}

.vp-hero-button-primary .wp-block-button__link:hover {
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 50%, #67e8f9 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.3);
}

/* ◀️ 🎨 自定义背景色支持 - 当设置了自定义颜色时覆盖默认样式 */
.vp-hero-button-primary[style*="--custom-btn-bg"] .wp-block-button__link {
    background: var(--custom-btn-bg);
}

.vp-hero-button-primary[style*="--custom-btn-hover-bg"] .wp-block-button__link:hover {
    background: var(--custom-btn-hover-bg);
}

/* ◀️ 📝 自定义文字颜色支持 */
.vp-hero-button-primary[style*="--custom-btn-text"] .wp-block-button__link {
    color: var(--custom-btn-text);
}

.vp-hero-button-primary[style*="--custom-btn-hover-text"] .wp-block-button__link:hover {
    color: var(--custom-btn-hover-text);
}

.vp-hero-button-secondary .wp-block-button__link {
    background: transparent;
    color: var(--vp-c-text-1);
    border: 2px solid var(--vp-c-border);
}

.vp-hero-button-secondary .wp-block-button__link:hover {
    border-color: #06b6d4;
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 50%, #67e8f9 100%);
    color: #ffffff;
}

/* ◀️ 🎨 次按钮自定义背景色支持 */
.vp-hero-button-secondary[style*="--custom-btn-bg"] .wp-block-button__link {
    background: var(--custom-btn-bg);
    border-color: var(--custom-btn-bg);
    color: #ffffff;
}

/* ◀️ 📝 次按钮自定义文字颜色支持 */
.vp-hero-button-secondary[style*="--custom-btn-text"] .wp-block-button__link {
    color: var(--custom-btn-text);
}

.vp-hero-button-secondary[style*="--custom-btn-hover-text"] .wp-block-button__link:hover {
    color: var(--custom-btn-hover-text);
}

.vp-hero-button-secondary[style*="--custom-btn-hover-bg"] .wp-block-button__link:hover {
    background: var(--custom-btn-hover-bg);
    border-color: var(--custom-btn-hover-bg);
}

/* 🖼️ Hero 视觉区域 - 3D Logo 效果 */
.vp-hero-visual {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* ◀️ 改为 visible 确保光晕动画完整显示，不被父级切割 */
    overflow: visible;
    /* ◀️ 增加 padding 为放大时的光晕预留空间 */
    padding: 150px;
    /* ◀️ 使用负 margin 抵消 padding 对布局的影响 */
    margin: -75px;
}

/* ✨ Logo 背景光晕 - 粉色渐变蓝色 */
.vp-hero-visual::before {
    content: '';
    position: absolute;
    /* ◀️ 调整尺寸确保在 150px padding 内完成动画 */
    width: 500px;
    height: 500px;
    /* ◀️ 粉色渐变蓝色：中心粉色(ec4899) → 中间紫色(a855f7) → 外围蓝色(646cff) */
    background: radial-gradient(circle, rgba(236, 72, 153, 0.45) 0%, rgba(168, 85, 247, 0.35) 35%, rgba(100, 108, 255, 0.25) 60%, transparent 80%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    /* ◀️ 居中定位 */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* ◀️ 添加缓慢放大缩小动画 */
    animation: glowPulse 4s ease-in-out infinite;
}

/* 💫 光晕呼吸动画 - 在 150px padding 范围内完成缩放 */
@keyframes glowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.85);
        opacity: 0.75;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}

.vp-hero-logo {
    position: relative;
    z-index: 1;
    margin: 0;
}

.vp-hero-logo img {
    width: 560px;
    height: auto;
    border-radius: 40px;
    /* ◀️ 移除了内阴影 inset 效果，避免产生分割线感 */
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.2);
    transform: perspective(1000px) rotateY(-10deg) rotateX(3deg);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.vp-hero-logo img:hover {
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg) scale(1.02);
    /* ◀️ 移除了内阴影 inset 效果 */
    box-shadow: 0 60px 100px -20px rgba(0, 0, 0, 0.25);
}

/* 🎯 特性展示区域 - 4列网格 */
.vp-features {
    /* 上下内边距 */
    padding: 1rem 12rem 60px;
    background: transparent;
}

.vp-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.vp-feature-item {
    text-align: left;
    padding: 1.75rem;
    border-radius: 16px;
    /* ◀️ 移除了背景色，避免与页面背景形成对比产生分割线感 */
    background: transparent;
    transition: all 0.25s ease;
}

.vp-feature-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--vp-shadow-2);
    /* ◀️ 添加背景色仅在 hover 时显示 */
    background: var(--vp-c-bg-soft);
}

.vp-feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.vp-feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--vp-c-text-1);
    margin-bottom: 0.5rem;
}

.vp-feature-desc {
    font-size: 0.9375rem;
    color: var(--vp-c-text-2);
    line-height: 1.6;
    margin: 0;
}

/* 📱 响应式设计 */
@media (max-width: 1600px) {
    .vp-hero-container {
        /* ◀️ 保持左右内边距一致 */
        padding-left: 50px;
        padding-right: 50px;
        gap: 6rem;
    }
}

@media (max-width: 1400px) {
    .vp-hero-container {
        /* ◀️ 保持左右内边距一致 */
        padding-left: 45px;
        padding-right: 45px;
        gap: 5rem;
    }

    .vp-hero-title {
        font-size: 5rem;
    }

    .vp-hero-subtitle {
        font-size: 3rem;
    }

    .vp-hero-logo img {
        width: 450px;
    }
}

@media (max-width: 1200px) {
    .vp-hero-container {
        /* ◀️ 保持左右内边距一致 */
        padding-left: 40px;
        padding-right: 40px;
        gap: 4rem;
    }

    .vp-hero-title {
        font-size: 4rem;
    }

    .vp-hero-subtitle {
        font-size: 2.5rem;
    }

    .vp-hero-description {
        font-size: 1.5rem;
    }

    .vp-hero-button .wp-block-button__link {
        font-size: 0.9375rem;
        padding: 0.625rem 1.25rem;
    }

    .vp-hero-logo img {
        width: 350px;
    }

    .vp-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .vp-feature-title {
        font-size: 1.125rem;
    }

    .vp-feature-desc {
        font-size: 0.875rem;
    }
}

@media (max-width: 968px) {
    .vp-hero {
        /* ◀️ 减少移动端上下内边距 */
        padding: 2rem 0;
    }

    .vp-hero-container {
        /* ◀️ 保持左右内边距一致 */
        padding-left: 30px;
        padding-right: 30px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 3rem;
    }

    /* ◀️ 移动端：图片显示在标题上方 */
    .vp-hero-visual {
        order: -1;
    }

    .vp-hero-content {
        text-align: center;
        /* ◀️ 小屏幕下限制最大宽度，确保内容不会溢出 */
        max-width: 100%;
        width: 100%;
    }

    .vp-hero-title {
        font-size: 3.5rem;
    }

    .vp-hero-subtitle {
        font-size: 2rem;
    }

    .vp-hero-description {
        font-size: 1.25rem;
    }

    .vp-hero-desc-gradient {
        font-size: 1.5rem;
    }

    .vp-hero-buttons {
        justify-content: center;
    }

    .vp-hero-visual {
        margin-left: 0;
    }

    .vp-hero-logo img {
        width: 300px;
    }
}

@media (max-width: 600px) {
    .vp-hero-container {
        /* ◀️ 保持左右内边距一致 */
        padding-left: 20px;
        padding-right: 20px;
    }

    .vp-hero-title {
        font-size: 2.5rem;
    }

    .vp-hero-subtitle {
        font-size: 1.5rem;
    }

    .vp-hero-description {
        font-size: 1rem;
    }

    .vp-hero-desc-gradient {
        font-size: 1.25rem;
    }

    .vp-hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .vp-hero-button {
        width: 100%;
        max-width: 280px;
    }

    .vp-hero-logo img {
        width: 220px;
    }

    .vp-features-grid {
        grid-template-columns: 1fr;
    }

    .vp-feature-icon {
        font-size: 2rem;
    }

    .vp-feature-title {
        font-size: 1.125rem;
    }

    .vp-feature-desc {
        font-size: 0.875rem;
    }
}

/* 🌆 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    .vp-hero::before {
        background: radial-gradient(circle, rgba(100, 108, 255, 0.15) 0%, transparent 70%);
    }

    .vp-hero-visual::before {
        background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, rgba(236, 72, 153, 0.2) 50%, transparent 70%);
    }

    .vp-hero-logo img {
        box-shadow:
            0 40px 80px -20px rgba(0, 0, 0, 0.4),
            0 0 0 2px rgba(255, 255, 255, 0.05) inset;
    }

    .vp-feature-item {
        background: var(--vp-c-bg-soft);
    }
}
