/* 轮播图样式 - 优化版（使用CSS变量） */

/* 轮播图容器 */
.carousel {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--spacing-xl);
}

/* 轮播图内容区域 */
.carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 轮播图项目 */
.carousel-item {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 60px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* 轮播图背景图案 */
.carousel-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255,255,255,0.05) 0%, transparent 30%);
    z-index: 1;
}

/* 轮播图装饰形状 */
.carousel-shape {
    position: absolute;
    z-index: 1;
    opacity: 0.3;
}

.carousel-shape-1 {
    top: -50px;
    right: 100px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255,255,255,0.2), transparent);
    animation: floatShape 8s ease-in-out infinite;
}

.carousel-shape-2 {
    bottom: -30px;
    left: 80px;
    width: 150px;
    height: 150px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: linear-gradient(-45deg, rgba(255,255,255,0.15), transparent);
    animation: floatShape 10s ease-in-out infinite reverse;
}

.carousel-shape-3 {
    top: 50px;
    left: -40px;
    width: 180px;
    height: 180px;
    border-radius: 0;
    transform: rotate(45deg);
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    animation: rotateShape 15s linear infinite;
}

.carousel-shape-4 {
    bottom: 60px;
    right: 50px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    animation: pulseShape 4s ease-in-out infinite;
}

.carousel-shape-5 {
    top: -40px;
    left: 50%;
    width: 250px;
    height: 80px;
    border-radius: 40px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: slideShape 6s ease-in-out infinite;
}

.carousel-shape-6 {
    bottom: 20px;
    left: 120px;
    width: 100px;
    height: 100px;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    background: rgba(255,255,255,0.15);
    animation: rotateShape 12s linear infinite reverse;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes rotateShape {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulseShape {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.5; }
}

@keyframes slideShape {
    0%, 100% { transform: translateX(-30px); opacity: 0.2; }
    50% { transform: translateX(30px); opacity: 0.4; }
}

/* 轮播图内容 */
.carousel-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    text-align: center;
    color: white;
    animation: fadeInUp 0.8s ease-out;
}

/* 轮播图徽章 */
.carousel-badge {
    display: inline-block;
    padding: 8px 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    animation: slideInDown 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 装饰线 */
.carousel-decor-line {
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    margin: 25px auto 0;
    animation: expandLine 1s ease-out 0.8s backwards;
}

@keyframes expandLine {
    from { width: 0; opacity: 0; }
    to { width: 100px; opacity: 1; }
}

/* 标题动画 */
.carousel-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    animation: slideInLeft 0.8s ease-out;
    background: linear-gradient(135deg, #ffffff 0%, #fdcb6e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 副标题动画 */
.carousel-content p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    opacity: 0.95;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.8s ease-out 0.2s backwards;
}

/* 按钮组 */
.carousel-content .cta-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    animation: fadeIn 0.8s ease-out 0.4s backwards;
}

/* 主按钮 */
.carousel-content .btn-primary {
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    background: white;
    color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.carousel-content .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.carousel-content .btn-primary:hover::before {
    left: 100%;
}

.carousel-content .btn-primary:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(225, 112, 85, 0.4);
}

/* 次要按钮 */
.carousel-content .btn-secondary {
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.carousel-content .btn-secondary:hover {
    background: white;
    color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 左右控制按钮 */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-control:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.carousel-control:active {
    transform: translateY(-50%) scale(1.05);
}

.carousel-control.prev {
    left: 30px;
}

.carousel-control.next {
    right: 30px;
}

/* 指示器容器 */
.carousel-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

/* 指示器按钮 */
.indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: white;
    transition: all 0.3s ease;
}

.indicator.active {
    width: 36px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.8);
}

.indicator.active::before {
    width: 30px;
    height: 30px;
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

/* 进度条 */
.carousel-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), #fdcb6e);
    z-index: 10;
    transition: width 0.1s linear;
}

/* 触摸提示 */
.carousel-touch-hint {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 5;
}

.carousel:hover .carousel-touch-hint {
    opacity: 1;
}

/* 悬浮卡片效果 */
.carousel-floating-card {
    position: absolute;
    width: 200px;
    height: 280px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    z-index: 3;
    animation: float 6s ease-in-out infinite;
}

.carousel-floating-card:nth-child(1) {
    top: 50px;
    left: 50px;
    animation-delay: 0s;
}

.carousel-floating-card:nth-child(2) {
    bottom: 50px;
    right: 50px;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* 进度条动画 */
.carousel-progress.active {
    animation: progress 5s linear infinite;
}

@keyframes progress {
    from { width: 0; }
    to { width: 100%; }
}

/* 动画定义 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .carousel {
        height: 400px;
    }
    
    .carousel-item {
        padding: 20px 30px;
    }
    
    .carousel-content h1 {
        font-size: 2rem;
    }
    
    .carousel-content p {
        font-size: 1.2rem;
    }
    
    .carousel-content .cta-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .carousel-content .btn-primary,
    .carousel-content .btn-secondary {
        padding: 14px 32px;
        font-size: 1rem;
    }
    
    .carousel-control {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .carousel-control.prev {
        left: 15px;
    }
    
    .carousel-control.next {
        right: 15px;
    }
    
    .carousel-floating-card {
        display: none;
    }
}

@media (max-width: 480px) {
    .carousel {
        height: 350px;
    }
    
    .carousel-content h1 {
        font-size: 1.75rem;
    }
    
    .carousel-content p {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .carousel-content .cta-group {
        gap: 10px;
    }
    
    .carousel-content .btn-primary,
    .carousel-content .btn-secondary {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}

/* 触摸支持 */
.carousel.touch-active {
    cursor: grab;
}

.carousel.touch-active:active {
    cursor: grabbing;
}

/* 键盘导航提示 */
.carousel-keyboard-hint {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 12px;
    color: white;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.carousel:focus-within .carousel-keyboard-hint {
    opacity: 1;
}

/* 暂停/播放按钮 */
.carousel-pause {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-pause:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* 悬浮装饰元素 */
.carousel-decoration {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

.carousel-decoration:nth-child(1) {
    top: -100px;
    right: -100px;
    animation: rotate 20s linear infinite;
}

.carousel-decoration:nth-child(2) {
    bottom: -100px;
    left: -100px;
    animation: rotate 30s linear infinite reverse;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}