/* ==========================================
   云聊落地页 - 移动优先响应式设计
   基于蓝天白云主题 | Mobile-First架构
   ========================================== */

/* === 全局重置和基础样式 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
                 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* === 蓝天白云背景 === */
.sky-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* 蓝天渐变 */
    background: linear-gradient(
        to bottom,
        #4A90E2 0%,
        #5B9FE3 25%,
        #7AB8E8 50%,
        #A5D3F0 75%,
        #D4E9F7 100%
    );
}

/* === 云朵动画（移动端简化） === */
.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 100px;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* 云朵形状使用伪元素 */
.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 100px;
}

/* 云朵1 - 左上角（移动端简化） */
.cloud-1 {
    width: 120px;
    height: 40px;
    top: 8%;
    left: 3%;
    animation: float-cloud 40s infinite ease-in-out;
}

.cloud-1::before {
    width: 60px;
    height: 50px;
    top: -25px;
    left: 20px;
}

.cloud-1::after {
    width: 70px;
    height: 45px;
    top: -18px;
    right: 20px;
}

/* 云朵2 - 右上角（移动端简化） */
.cloud-2 {
    width: 100px;
    height: 35px;
    top: 15%;
    right: 5%;
    animation: float-cloud 50s infinite ease-in-out reverse;
}

.cloud-2::before {
    width: 50px;
    height: 45px;
    top: -22px;
    left: 15px;
}

.cloud-2::after {
    width: 60px;
    height: 40px;
    top: -15px;
    right: 15px;
}

/* 云朵3、4在移动端隐藏 */
.cloud-3,
.cloud-4 {
    display: none;
}

/* 云朵漂浮动画 */
@keyframes float-cloud {
    0%, 100% {
        transform: translateX(0) translateY(0);
        opacity: 0.5;
    }
    25% {
        transform: translateX(15px) translateY(-8px);
        opacity: 0.6;
    }
    50% {
        transform: translateX(0) translateY(-12px);
        opacity: 0.7;
    }
    75% {
        transform: translateX(-15px) translateY(-8px);
        opacity: 0.6;
    }
}

/* ==========================================
   移动优先基础样式（320px - 767px）
   ========================================== */

/* === 主容器（移动端：自然文档流） === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    position: relative;
    z-index: 1;
    /* 移动端不使用flex居中，避免vh问题 */
}

/* === Hero区域（移动端：最小化） === */
.hero-section {
    text-align: center;
    padding: 20px 15px 15px;
    animation: fade-in-up 0.8s ease-out;
    width: 100%;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo样式（移动端：60px 增大） */
.brand {
    margin-bottom: 15px;
}

.logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    filter: drop-shadow(0 8px 20px rgba(74, 144, 226, 0.3));
    animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.logo-svg {
    width: 100%;
    height: 100%;
}

/* 品牌名称（移动端：1.75rem = 28px 增大） */
.app-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2C5F8D;
    margin-bottom: 8px;
    text-shadow: 0 3px 15px rgba(74, 144, 226, 0.2);
    letter-spacing: 0.1em;
}

/* 标语（移动端：0.8rem = 12.8px 白色字体） */
.slogan {
    font-size: 0.8rem;
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 功能亮点（移动端：隐藏以节省空间） */
.features {
    display: none;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(74, 144, 226, 0.1);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(74, 144, 226, 0.2);
    background: rgba(255, 255, 255, 0.8);
}

.feature-icon {
    font-size: 1.3rem;
}

.feature-text {
    font-size: 0.8rem;
    color: #2C5F8D;
    font-weight: 500;
}

/* === 下载区域（移动端：最大化突出） === */
.download-section {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 30px 20px;
    margin: 20px 10px;
    width: calc(100% - 20px);
    box-shadow: 0 15px 40px rgba(74, 144, 226, 0.15);
    animation: fade-in-up 0.8s ease-out 0.2s both;
}

.section-title {
    text-align: center;
    font-size: 1.25rem;
    color: #2C5F8D;
    margin-bottom: 25px;
    font-weight: 600;
}

/* === 二维码容器（移动端：更大更突出） === */
.qrcode-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    width: 100%;
}

.qrcode-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.1);
    transition: all 0.3s ease;
}

.qrcode-box:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 35px rgba(74, 144, 226, 0.2);
}

.qrcode {
    width: 180px;
    height: 180px;
    padding: 8px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 如果qrcode.js未加载,显示占位符 */
.qrcode:empty::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4A90E2 0%, #2C5F8D 100%);
    border-radius: 10px;
    opacity: 0.1;
}

.qrcode-tip {
    margin-top: 12px;
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

/* === 下载按钮组（移动端：垂直排列） === */
.download-buttons {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border: 2px solid #E3F2FD;
    border-radius: 12px;
    text-decoration: none;
    color: #2C5F8D;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.08);
    width: 100%;
    justify-content: flex-start;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.15);
    border-color: #4A90E2;
}

.download-btn:active {
    transform: translateY(0);
}

.btn-icon {
    width: 36px;
    height: 36px;
    color: #4A90E2;
    flex-shrink: 0;
}

.btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.btn-label {
    font-size: 0.7rem;
    color: #999;
    font-weight: 400;
}

.btn-platform {
    font-size: 0.95rem;
    color: #2C5F8D;
    font-weight: 600;
}

/* 特定平台颜色 */
.btn-ios:hover .btn-icon {
    color: #000;
}

.btn-android:hover .btn-icon {
    color: #3DDC84;
}

.btn-windows:hover .btn-icon {
    color: #00A4EF;
}

.btn-mac:hover .btn-icon {
    color: #000;
}

/* === 版本信息 === */
.version-info {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(74, 144, 226, 0.2);
    width: 100%;
}

.version-info p {
    font-size: 0.75rem;
    color: #999;
}

/* === 页脚（移动端：紧凑） === */
.footer {
    text-align: center;
    padding: 20px 15px;
    color: #2C5F8D;
    margin-top: 20px;
    width: 100%;
}

.footer p {
    margin-bottom: 8px;
    font-size: 0.75rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.footer-links a {
    color: #4A90E2;
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #2C5F8D;
    text-decoration: underline;
}

.footer-links span {
    display: none; /* 移动端隐藏分隔符 */
    color: #999;
}

/* ==========================================
   平板断点：768px+（渐进增强）
   ========================================== */

@media (min-width: 768px) {
    /* 容器增加padding */
    .container {
        padding: 15px;
    }

    /* Hero区域增加间距 */
    .hero-section {
        padding: 30px 20px 25px;
    }

    .brand {
        margin-bottom: 20px;
    }

    .logo {
        width: 80px;
        height: 80px;
        margin-bottom: 12px;
    }

    .app-name {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }

    .slogan {
        font-size: 1.1rem;
        margin-bottom: 15px;
        /* 白色保持继承 */
    }

    /* 显示功能特性 */
    .features {
        display: flex;
        justify-content: center;
        gap: 25px;
        flex-wrap: wrap;
        margin-top: 20px;
    }

    /* 下载区域增加间距 */
    .download-section {
        padding: 40px 35px;
        margin: 30px auto;
        max-width: 700px;
        border-radius: 25px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    .qrcode-container {
        margin-bottom: 30px;
    }

    .qrcode-box {
        padding: 25px;
    }

    /* 下载按钮横排 */
    .download-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 18px;
        max-width: 600px;
        margin: 0 auto 30px;
    }

    .download-btn {
        flex: 1;
        min-width: 200px;
        max-width: 280px;
    }

    /* Footer横排 */
    .footer {
        padding: 25px 20px;
        margin-top: 30px;
    }

    .footer p {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }

    .footer-links {
        flex-direction: row;
        gap: 12px;
    }

    .footer-links a {
        font-size: 0.85rem;
    }

    .footer-links span {
        display: inline; /* 平板显示分隔符 */
    }

    /* 云朵恢复完整样式 */
    .cloud {
        opacity: 0.7;
    }

    .cloud-1 {
        width: 160px;
        height: 50px;
    }

    .cloud-2 {
        width: 140px;
        height: 42px;
    }
}

/* ==========================================
   桌面断点：1024px+（完整体验）
   ========================================== */

@media (min-width: 1024px) {
    /* 启用垂直居中（仅桌面） */
    .container {
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: 100vh;
        justify-content: center;
    }

    /* Hero区域使用流式设计 */
    .hero-section {
        padding: clamp(40px, 5vh, 60px) 20px clamp(30px, 4vh, 40px);
    }

    .brand {
        margin-bottom: clamp(25px, 4vh, 40px);
    }

    .logo {
        width: clamp(100px, 15vw, 180px);
        height: clamp(100px, 15vw, 180px);
        margin-bottom: clamp(15px, 2vh, 25px);
        filter: drop-shadow(0 10px 30px rgba(74, 144, 226, 0.3));
    }

    .app-name {
        font-size: clamp(3rem, 6vw, 4rem);
        margin-bottom: clamp(10px, 1vh, 15px);
    }

    .slogan {
        font-size: clamp(1.2rem, 2vw, 1.5rem);
        margin-bottom: clamp(20px, 3vh, 30px);
        /* 白色保持继承 */
    }

    /* 功能特性使用流式间距 */
    .features {
        gap: clamp(25px, 4vw, 40px);
        margin-top: clamp(20px, 3vh, 30px);
    }

    .feature-item {
        padding: clamp(12px, 2vh, 15px) clamp(18px, 3vw, 25px);
        gap: clamp(6px, 1vh, 8px);
        border-radius: clamp(15px, 2vw, 20px);
    }

    .feature-item:hover {
        transform: translateY(-5px);
    }

    .feature-icon {
        font-size: clamp(1.5rem, 3vw, 2rem);
    }

    .feature-text {
        font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    }

    /* 下载区域使用流式设计 */
    .download-section {
        padding: clamp(45px, 5vh, 50px) clamp(35px, 4vw, 40px);
        margin: clamp(30px, 4vh, 40px) auto;
        max-width: 900px;
        border-radius: clamp(25px, 3vw, 30px);
    }

    .section-title {
        font-size: clamp(1.6rem, 3vw, 2rem);
        margin-bottom: clamp(30px, 4vh, 40px);
    }

    .qrcode-container {
        margin-bottom: clamp(30px, 4vh, 40px);
    }

    .qrcode-box {
        padding: clamp(20px, 3vw, 25px);
        border-radius: clamp(15px, 2vw, 20px);
    }

    .qrcode {
        width: clamp(180px, 20vw, 200px);
        height: clamp(180px, 20vw, 200px);
        padding: clamp(8px, 1vw, 10px);
    }

    .qrcode-tip {
        margin-top: clamp(12px, 1.5vh, 15px);
        font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    }

    /* 下载按钮流式设计 */
    .download-buttons {
        gap: clamp(15px, 2vw, 20px);
        margin-bottom: clamp(25px, 3vh, 30px);
    }

    .download-btn {
        gap: clamp(12px, 2vw, 15px);
        padding: clamp(16px, 2vh, 18px) clamp(20px, 3vw, 25px);
        border-radius: clamp(12px, 2vw, 15px);
    }

    .btn-icon {
        width: clamp(36px, 5vw, 40px);
        height: clamp(36px, 5vw, 40px);
    }

    .btn-label {
        font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    }

    .btn-platform {
        font-size: clamp(0.95rem, 2vw, 1.1rem);
    }

    /* 版本信息 */
    .version-info {
        padding-top: clamp(15px, 2vh, 20px);
    }

    .version-info p {
        font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    }

    /* Footer */
    .footer {
        padding: clamp(25px, 3vh, 30px) 20px;
        margin-top: clamp(30px, 4vh, 40px);
    }

    .footer p {
        margin-bottom: clamp(10px, 1vh, 10px);
        font-size: clamp(0.85rem, 1.5vw, 0.9rem);
    }

    .footer-links {
        gap: clamp(12px, 2vw, 15px);
    }

    .footer-links a {
        font-size: clamp(0.85rem, 1.5vw, 0.9rem);
    }

    /* 云朵完整显示 */
    .cloud {
        background: rgba(255, 255, 255, 0.8);
        box-shadow: 0 8px 30px rgba(255, 255, 255, 0.3);
    }

    .cloud::before,
    .cloud::after {
        background: rgba(255, 255, 255, 0.8);
    }

    .cloud-1 {
        width: 200px;
        height: 60px;
    }

    .cloud-1::before {
        width: 100px;
        height: 80px;
        top: -40px;
        left: 30px;
    }

    .cloud-1::after {
        width: 120px;
        height: 70px;
        top: -30px;
        right: 30px;
    }

    .cloud-2 {
        width: 180px;
        height: 50px;
    }

    .cloud-2::before {
        width: 90px;
        height: 70px;
        top: -35px;
        left: 25px;
    }

    .cloud-2::after {
        width: 110px;
        height: 60px;
        top: -25px;
        right: 25px;
    }

    /* 显示云朵3、4 */
    .cloud-3 {
        display: block;
        width: 150px;
        height: 45px;
        bottom: 25%;
        left: 15%;
        animation: float-cloud 45s infinite ease-in-out;
        animation-delay: -10s;
    }

    .cloud-3::before {
        width: 75px;
        height: 60px;
        top: -30px;
        left: 20px;
    }

    .cloud-3::after {
        width: 95px;
        height: 55px;
        top: -22px;
        right: 20px;
    }

    .cloud-4 {
        display: block;
        width: 160px;
        height: 48px;
        bottom: 15%;
        right: 8%;
        animation: float-cloud 55s infinite ease-in-out reverse;
        animation-delay: -20s;
    }

    .cloud-4::before {
        width: 80px;
        height: 65px;
        top: -32px;
        left: 22px;
    }

    .cloud-4::after {
        width: 100px;
        height: 58px;
        top: -24px;
        right: 22px;
    }

    /* 云朵动画恢复完整强度 */
    @keyframes float-cloud {
        0%, 100% {
            transform: translateX(0) translateY(0);
            opacity: 0.8;
        }
        25% {
            transform: translateX(20px) translateY(-10px);
            opacity: 0.9;
        }
        50% {
            transform: translateX(0) translateY(-15px);
            opacity: 1;
        }
        75% {
            transform: translateX(-20px) translateY(-10px);
            opacity: 0.9;
        }
    }
}

/* === 可访问性增强 === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .download-btn {
        border-width: 3px;
    }

    .feature-item {
        border: 2px solid #4A90E2;
    }
}

/* === 打印样式 === */
@media print {
    .cloud,
    .footer-links {
        display: none;
    }

    body {
        background: white;
    }

    .sky-background {
        display: none;
    }
}
