/* 引入 Google 字体，让文本更好看 */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif, 'Microsoft YaHei', sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* 将背景修改为 bg.png，并使其覆盖整个页面 */
    background: url('bg.png') no-repeat center center/cover;
    background-attachment: fixed; /* 背景图片固定，不随滚动条滚动 */
    /* 为整个页面添加微妙的景深效果 */
    perspective: 1000px;
}

.container {
    position: relative;
    text-align: center;
    padding: 20px;
}

.container h1 {
    color: #fff;
    font-size: 2.5em;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    /* 添加液态玻璃效果到标题（无模糊） */
    backdrop-filter: saturate(180%) brightness(110%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 20px 40px;
    display: inline-block;
}

.cards-grid {
    display: grid;
    /* 在大屏幕上显示4列 */
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    justify-content: center;
}

.card {
    /* 液态玻璃效果核心样式 */
    position: relative;
    width: 280px;
    height: 350px;
    
    /* 主要的液态玻璃效果（无模糊） */
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: saturate(180%) brightness(110%);
    -webkit-backdrop-filter: saturate(180%) brightness(110%);
    
    /* 3D厚度感边框 */
    border: 2px solid transparent;
    border-radius: 24px;
    padding: 20px;
    
    /* 增强的多层阴影，模拟玻璃厚度 */
    box-shadow: 
        /* 主要阴影 */
        0 12px 40px rgba(0, 0, 0, 0.25),
        /* 玻璃厚度阴影 */
        0 4px 8px rgba(0, 0, 0, 0.15),
        /* 内部高光 */
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        inset 0 -2px 4px rgba(255, 255, 255, 0.2),
        /* 左侧高光 */
        inset 2px 0 4px rgba(255, 255, 255, 0.3),
        /* 右侧阴影 */
        inset -2px 0 4px rgba(0, 0, 0, 0.1),
        /* 外边缘光晕 */
        0 0 0 1px rgba(255, 255, 255, 0.1),
        /* 玻璃反射光 */
        0 0 20px rgba(255, 255, 255, 0.05);
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #fff;
    
    /* 平滑过渡 */
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* 3D变换准备 */
    transform-style: preserve-3d;
    transform: translateZ(0);
    
    /* 玻璃厚度视觉效果 */
    position: relative;
    overflow: visible;
    
    /* 添加背景折射效果的关键属性 */
    isolation: isolate;
}

/* 玻璃边缘折射效果 - 平滑的厚度变化 */
.card::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    
    /* 创建平滑的渐变边框，模拟玻璃边缘折射 */
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.05) 40%,
        transparent 50%,
        rgba(255, 255, 255, 0.05) 60%,
        rgba(255, 255, 255, 0.2) 80%,
        rgba(255, 255, 255, 0.4) 100%
    );
    
    border-radius: 27px;
    z-index: -1;
    opacity: 0.5;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* 玻璃厚度效果 */
    transform: translateZ(-2px) scale(1);
}

/* 玻璃厚度的侧面效果 - 更平滑的过渡 */
.card::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: -6px;
    bottom: -6px;
    
    /* 模拟玻璃侧面的厚度，使用更平滑的渐变 */
    background: linear-gradient(45deg, 
        transparent 0%,
        rgba(0, 0, 0, 0.05) 25%,
        rgba(0, 0, 0, 0.1) 45%,
        rgba(0, 0, 0, 0.15) 60%,
        rgba(0, 0, 0, 0.2) 80%,
        rgba(0, 0, 0, 0.25) 100%
    );
    
    border-radius: 24px;
    z-index: -2;
    opacity: 0.4;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* 玻璃厚度的3D位置 */
    transform: translateZ(-4px) translateX(1.5px) translateY(1.5px) scale(1);
    
    /* 侧面轻微模糊效果 */
    filter: blur(0.5px);
}

.card:before {
    /* 使用伪元素选择器创建内部高光 */
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: 22px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.1) 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.05) 75%,
        rgba(255, 255, 255, 0.15) 100%
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

/* 内部玻璃高光层，增强折射效果 - 平滑过渡 */
.card-inner-light {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 22px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.08) 30%,
        transparent 50%,
        rgba(255, 255, 255, 0.05) 70%,
        rgba(255, 255, 255, 0.12) 100%
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover .card-inner-light {
    opacity: 0.8;
    transform: scale(1.005);
}

/* 玻璃边缘效果（去除变色） */
.card-edge-refraction {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 25px;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.12) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(255, 255, 255, 0.12) 75%,
        rgba(255, 255, 255, 0.08) 100%
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover .card-edge-refraction {
    opacity: 0.5;
}

.card:hover {
    /* 悬停时增强液态效果（无模糊，无变色） */
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: saturate(200%) brightness(120%);
    -webkit-backdrop-filter: saturate(200%) brightness(120%);
    
    /* 3D变换，模拟液态玻璃的厚度感和倾斜 */
    transform: translateY(-12px) translateZ(30px) rotateX(3deg);
    
    /* 增强阴影，模拟玻璃厚度和光线聚焦 */
    box-shadow: 
        /* 主要阴影增强 */
        0 25px 50px rgba(0, 0, 0, 0.35),
        /* 玻璃厚度阴影增强 */
        0 8px 16px rgba(0, 0, 0, 0.2),
        /* 内部高光增强 */
        inset 0 3px 6px rgba(255, 255, 255, 0.7),
        inset 0 -3px 6px rgba(255, 255, 255, 0.3),
        /* 左侧高光增强 */
        inset 3px 0 6px rgba(255, 255, 255, 0.5),
        /* 右侧阴影增强 */
        inset -3px 0 6px rgba(0, 0, 0, 0.15),
        /* 外边缘光晕增强 */
        0 0 0 2px rgba(255, 255, 255, 0.2),
        /* 玻璃反射光增强 */
        0 0 40px rgba(255, 255, 255, 0.15);
}

.card:hover::before {
    opacity: 0.8;
    transform: translateZ(-2px) scale(1.01);
}

.card:hover::after {
    opacity: 0.6;
    transform: translateZ(-4px) translateX(2px) translateY(2px) scale(1.01);
    filter: blur(0.8px);
}

/* 点击时的液态波纹效果 */
.card:active {
    transform: translateY(-4px) translateZ(10px) scale(0.98);
    transition: all 0.1s ease;
}

/* 卡片内容样式优化 */
.card-icon {
    font-size: 3.5em;
    margin-bottom: 20px;
    /* 添加图标的液态玻璃效果 */
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.card:hover .card-icon {
    transform: scale(1.1) translateZ(10px);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
}

.card-title {
    font-size: 1.5em;
    margin-bottom: 10px;
    font-weight: 600;
    /* 文字的液态玻璃效果 */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.card:hover .card-title {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

.card-description {
    font-size: 0.9em;
    font-weight: 300;
    opacity: 0.9;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.card:hover .card-description {
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* 玻璃厚度的底部阴影 - 平滑过渡 */
.card-bottom-shadow {
    position: absolute;
    bottom: -8px;
    left: 4px;
    right: -4px;
    height: 8px;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(0, 0, 0, 0.1) 15%,
        rgba(0, 0, 0, 0.2) 30%,
        rgba(0, 0, 0, 0.25) 50%,
        rgba(0, 0, 0, 0.2) 70%,
        rgba(0, 0, 0, 0.1) 85%,
        transparent 100%
    );
    border-radius: 0 0 20px 20px;
    z-index: -3;
    filter: blur(1.5px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover .card-bottom-shadow {
    bottom: -12px;
    left: 5px;
    right: -5px;
    height: 12px;
    filter: blur(2.5px);
}

/* 右侧玻璃厚度阴影 - 平滑过渡 */
.card-right-shadow {
    position: absolute;
    top: 4px;
    right: -6px;
    bottom: -4px;
    width: 6px;
    background: linear-gradient(180deg, 
        transparent 0%,
        rgba(0, 0, 0, 0.08) 15%,
        rgba(0, 0, 0, 0.15) 30%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.15) 70%,
        rgba(0, 0, 0, 0.08) 85%,
        transparent 100%
    );
    border-radius: 0 20px 20px 0;
    z-index: -3;
    filter: blur(0.8px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover .card-right-shadow {
    right: -7px;
    width: 7px;
    filter: blur(1.2px);
}

/* 响应式设计：当屏幕宽度小于1200px时，变为2x2布局 */
@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 响应式设计：当屏幕宽度小于768px时（手机），变为单列布局 */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .container h1 {
        font-size: 2em;
    }
    .card {
        width: 100%;
        max-width: 320px;
    }
}

/* --- 加载动画样式 --- */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 液态玻璃风格的加载背景（无模糊） */
    background: rgba(22, 22, 35, 0.4);
    backdrop-filter: saturate(150%) brightness(105%);
    -webkit-backdrop-filter: saturate(150%) brightness(105%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.75s, visibility 0.75s;
    opacity: 1;
    visibility: visible;
}

/* 用于隐藏加载动画的类 */
.loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
}

.sakura-loader {
    font-size: 5em;
    animation: rotate-sakura 2s linear infinite;
    /* 液态玻璃风格的樱花效果 */
    text-shadow: 
        0 0 20px rgba(255, 105, 180, 0.8),
        0 0 40px rgba(255, 105, 180, 0.5),
        0 0 60px rgba(255, 105, 180, 0.3);
    filter: drop-shadow(0 0 20px rgba(255, 105, 180, 0.6));
}

@keyframes rotate-sakura {
    from { 
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    to { 
        transform: rotate(360deg) scale(1);
    }
}

/* 液态玻璃效果的CSS自定义属性（无模糊） */
:root {
    --glass-blur: 0px;
    --glass-saturation: 180%;
    --glass-brightness: 110%;
    --glass-border-opacity: 0.2;
    --glass-bg-opacity: 0.12;
    --refraction-strength: 2px;
}

/* 增强的液态玻璃工具类（无模糊） */
.liquid-glass {
    backdrop-filter: saturate(var(--glass-saturation)) brightness(var(--glass-brightness));
    -webkit-backdrop-filter: saturate(var(--glass-saturation)) brightness(var(--glass-brightness));
    background: rgba(255, 255, 255, var(--glass-bg-opacity));
    border: 1px solid rgba(255, 255, 255, var(--glass-border-opacity));
}

/* 模拟边缘折射效果的动画（无模糊） */
@keyframes edge-refraction {
    0%, 100% { 
        filter: contrast(100%);
        transform: scale(1);
    }
    50% { 
        filter: contrast(105%);
        transform: scale(1.002);
    }
}

/* 液态波纹效果 */
@keyframes liquid-ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* 为卡片添加点击波纹效果 */
.card-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    animation: liquid-ripple 0.6s ease-out;
    pointer-events: none;
}