/* 首页专用样式 */

/* 纵向轮播图样式 */
.carousel-container {
    position: relative;
    width: 100%;
    height: 400px;
    perspective: 1000px;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 纵向长轮播图特殊样式 - 匹配图片比例 */
.carousel-container.vertical-carousel {
    height: 600px;
    max-width: 400px;
    margin: 0 auto;
    aspect-ratio: 2/3; /* 纵向长比例，类似手机屏幕 */
}

.carousel-stage {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 纵向长轮播图stage样式 - 保持横向布局 */
.carousel-stage.vertical-stage {
    transform-style: preserve-3d;
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

/* 纵向长轮播图item样式 - 保持横向滚动 */
.vertical-carousel .carousel-item {
    height: 100%;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.vertical-carousel .carousel-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.vertical-carousel .carousel-item.active {
    transform: translateY(0) scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    border: 2px solid #ec4899;
}

/* 纵向长轮播图图片优化 */
.vertical-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 16px;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.carousel-item:hover img {
    transform: scale(1.05);
}

/* 轮播图导航按钮 - 默认隐藏，悬停时显示 */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0; /* 默认隐藏 */
    visibility: hidden; /* 默认不可见 */
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* 轮播图容器悬停时显示导航按钮 */
.carousel-container:hover .carousel-nav {
    opacity: 1;
    visibility: visible;
}

.carousel-prev {
    left: 16px;
}

.carousel-next {
    right: 16px;
}

.carousel-nav svg {
    width: 20px;
    height: 20px;
    color: #374151;
}

/* 轮播图指示点 - 隐藏 */
.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* 隐藏导航点 */
    gap: 8px;
    z-index: 10;
}

.carousel-nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-nav-dot.active {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

.carousel-nav-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

/* 自动播放按钮 */
.carousel-autoplay {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 10px;
}

.carousel-autoplay:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.carousel-autoplay.active {
    background: rgba(236, 72, 153, 0.8);
}

/* 粒子效果 */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: float 6s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* 轮播图响应式设计 */
@media (max-width: 1024px) {
    .carousel-container.vertical-carousel {
        height: 550px;
        max-width: 350px;
    }
}

@media (max-width: 768px) {
    .carousel-container {
        height: 300px;
        border-radius: 16px;
    }
    
        /* 纵向长轮播图移动端样式 - 匹配图片比例 */
        .carousel-container.vertical-carousel {
            height: 500px;
            max-width: 300px;
            aspect-ratio: 3/5; /* 移动端纵向长比例 */
        }
        
        .vertical-carousel .carousel-item {
            height: 100%;
        }
    
    .carousel-nav {
        width: 40px;
        height: 40px;
    }
    
    .carousel-prev {
        left: 12px;
    }
    
    .carousel-next {
        right: 12px;
    }
    
    .carousel-nav svg {
        width: 16px;
        height: 16px;
    }
    
    .carousel-dots {
        bottom: 16px;
        gap: 6px;
    }
    
    .carousel-nav-dot {
        width: 10px;
        height: 10px;
    }
    
    .carousel-autoplay {
        width: 36px;
        height: 36px;
        top: 16px;
        right: 16px;
        font-size: 9px;
    }
}

/* 小屏幕设备优化 */
@media (max-width: 480px) {
    .carousel-container.vertical-carousel {
        height: 450px;
        max-width: 280px;
        aspect-ratio: 5/8; /* 更窄的纵向长比例 */
    }
}

/* 轮播图动画效果 - 由JavaScript动态设置3D位置 */

/* 轮播图激活状态 */
.carousel-item.active {
    transform: translateZ(200px) rotateY(0deg) !important;
    z-index: 10 !important;
}

/* 轮播图过渡动画 */
.carousel-stage.rotating {
    animation: rotate 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rotate {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(var(--rotation, 0deg));
    }
}

/* 搜索框样式 */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    padding-left: 50px;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 18px;
}

.search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(236, 72, 153, 0.3);
}

.search-button:hover {
    transform: translateY(-50%) translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(236, 72, 153, 0.4);
}

/* 等级卡片样式 */
.level-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.level-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.level-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.level-card:hover .level-image {
    transform: scale(1.05);
}

.level-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.level-content {
    padding: 20px;
}

.level-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.3;
}

.level-description {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.level-actions {
    display: flex;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(236, 72, 153, 0.4);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #ec4899;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 占位符动画 */
.placeholder-card {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 16px;
    height: 300px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-input {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 14px 18px;
        padding-left: 45px;
    }
    
    .search-icon {
        left: 15px;
        font-size: 16px;
    }
    
    .search-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .level-card {
        margin-bottom: 16px;
    }
    
    .level-image {
        height: 160px;
    }
    
    .level-content {
        padding: 16px;
    }
    
    .level-title {
        font-size: 16px;
    }
    
    .level-description {
        font-size: 13px;
    }
    
    .level-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* 无障碍访问优化 */
.search-input:focus,
.search-button:focus,
.btn-primary:focus,
.btn-secondary:focus {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .level-card {
        border: 2px solid #000;
    }
    
    .search-input {
        border: 2px solid #000;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .level-card,
    .search-input,
    .search-button,
    .btn-primary,
    .btn-secondary {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
    
    .placeholder-card {
        animation: none;
    }
}