/* 基础设置 */
:root {
    --primary-color: #7c4dff;
    --secondary-color: #6940de;
    --accent-color: #ff4d8c;
    --light-color: #f5f5f9;
    --dark-color: #333;
    --transition: all 0.3s ease;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --spacing: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.5;
    color: var(--dark-color);
    background-color: #f0f0f5;
    padding-bottom: 60px;
}

/* 头部样式 */
header {
    width: 100%;
    padding: 15px 0 0;
}

/* 定义头部横幅样式 */
.header-banner {
    /* 设置背景渐变，从白色到接近白色的色调 */
    background: linear-gradient(135deg, #ffffff 0%, hwb(255 95% 3%) 100%);
    /* 设置文本颜色为白色 */
    color: white;
    /* 设置圆角，使用全局变量 --radius */
    border-radius: var(--radius);
    /* 设置外边距，上下为 0，左右为 15px，底部为 20px */
    margin: 0 15px 20px;
    /* 注释掉的内边距设置，可根据需要启用 */
    /* padding: 20px; */
    /* 设置为相对定位，为子元素的绝对定位提供参考 */
    position: relative;
    /* 溢出部分隐藏 */
    overflow: hidden;
    /* 设置阴影效果，使用全局变量 --shadow */
    box-shadow: var(--shadow);
}

/* 为.header-banner元素添加一个伪元素，用于创建背景渐变效果 */
.header-banner::before {
    /* 设置伪元素的内容为空 */
    content: '';
    /* 设置伪元素为绝对定位 */
    position: absolute;
    /* 设置伪元素的顶部位置为 -50% */
    top: -50%;
    /* 设置伪元素的左侧位置为 -50% */
    left: -50%;
    /* 设置伪元素的宽度为 200% */
    width: 200%;
    /* 设置伪元素的高度为 200% */
    height: 200%;
    /* 设置伪元素的背景为径向渐变，从白色半透明到完全透明 */
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    /* 设置伪元素的层级为 0 */
    z-index: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.logo-img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}


.website {
    font-size: 1.1rem;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.banner-image {
    display: flex;
    justify-content: center;
    margin: 15px 0;
    position: relative;
    z-index: 1;
}

.banner-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.banner-icon:hover {
    transform: scale(1.05) rotate(5deg);
}

.banner-description {
    font-size: 0.85rem;
    opacity: 0.85;
    text-align: center;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* 卡片样式 */
.card-container {
    padding: 0 15px;
}

.product-card {
    background-color: white;
    border-radius: var(--radius);
    margin-bottom: 15px;
    display: flex;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.product-card:hover::after {
    transform: scaleX(1);
}

.card-left {
    width: 30%;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(124, 77, 255, 0.04);
}

.card-img {
    width: 100%;
    max-width: 80px;
    height: auto;
    border-radius: 8px;
    transition: all 0.3s ease;
    object-fit: contain;
}

.product-card:hover .card-img {
    transform: scale(1.1);
}

.card-right {
    width: 70%;
    padding: 15px 15px 15px 0;
    display: flex;
    flex-direction: column;
}

.card-title {
    color: #6a38e8;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.product-card:hover .card-title {
    color: var(--accent-color);
}

.card-desc {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 10px;
    flex-grow: 1;
}

.action-btn {
    align-self: flex-start;
    background-color: #f0f0f5;
    color: #6a38e8;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.action-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.action-btn:hover::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }

    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.action-btn:hover {
    background-color: #e5e0ff;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(106, 56, 232, 0.2);
}

/* 页脚样式 */
footer {
    background-color: white;
    color: #666;
    text-align: center;
    padding: 15px;
    font-size: 0.8rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* 加载中样式 */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.loading {
    background: linear-gradient(90deg, #f0f0f5 25%, #e1e1e8 50%, #f0f0f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* 顶部加载进度条 */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    z-index: 1000;
    transition: width 0.3s ease;
}

/* Toast 样式 */
.toast {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* 响应式调整 */
@media (min-width: 768px) {
    .card-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product-card {
        margin-bottom: 0;
    }
}

@media (max-width: 350px) {
    .product-card {
        flex-direction: column;
    }

    .card-left,
    .card-right {
        width: 100%;
    }

    .card-left {
        padding-bottom: 0;
    }
}

/* 轮播图容器 */
/* 轮播图容器 */
/* 合并后的 slider-container 样式 */
.slider-container {
    /* .header-banner 的样式 */
    /* 设置背景渐变，从白色到接近白色的色调 */
    background: linear-gradient(135deg, #ffffff 0%, hwb(255 95% 3%) 100%);
    /* 设置文本颜色为白色 */
    color: white;
    /* 设置圆角，使用全局变量 --radius */
    border-radius: var(--radius);
    /* 设置外边距，上下为 0，左右为 15px，底部为 20px */
    margin: 0 15px 20px;
    /* 设置为相对定位，为子元素的绝对定位提供参考 */
    position: relative;
    /* 溢出部分隐藏 */
    overflow: hidden;
    /* 设置阴影效果，使用全局变量 --shadow */
    box-shadow: var(--shadow);
    /* width: auto;  */

    /* 为 slider-container 添加一个伪元素，用于创建背景渐变效果 */
    &::before {
        /* 
 * 此伪元素用于为.slider-container创建背景渐变效果。
 * 它是一个绝对定位的元素，覆盖整个容器，并使用径向渐变来创建从白色半透明到完全透明的效果。
 * 这样可以为容器添加一个微妙的光影效果，增强视觉吸引力。
 */
        content: '';
        /* 设置伪元素的内容为空 */
        position: absolute;
        /* 设置伪元素为绝对定位 */
        top: -50%;
        /* 设置伪元素的顶部位置为 -50%，使其超出容器顶部 */
        left: -50%;
        /* 设置伪元素的左侧位置为 -50%，使其超出容器左侧 */
        width: 200%;
        /* 设置伪元素的宽度为 200%，确保覆盖整个容器 */
        height: 200%;
        /* 设置伪元素的高度为 200%，确保覆盖整个容器 */
        background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
        /* 设置伪元素的背景为径向渐变，从白色半透明到完全透明 */
        z-index: 0;
        /* 设置伪元素的层级为 0，使其位于容器内容的下方 */
    }

    /* 原 .slider-container 的样式 */
    /* width: 100%; */
    height: 160px;
    overflow: hidden;
}

/* 轮播图 */
.slider {
    display: flex;
    width: 300%;
    /* 图片数量 * 100% */
    height: 100%;
    transition: transform 0.5s ease;
}

/* 轮播图项 */
.slide {
    width: 33.333%;
    /* 100% / 图片数量 */
    height: 100%;
}

.slide img {
    width: 100%;
    height: 100%;
    /* 修改 object-fit 属性为 contain */
    /* object-fit: contain;  */
}

/* 轮播图导航按钮 */
.slider-nav {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    margin: 0 5px;
    cursor: pointer;
}

.nav-dot.active {
    background-color: white;
}

/* 消息条 */
.news-bar {
    background-color: var(--primary-color);
    color: white;
    padding: 10px;
    font-size: 0.9rem;
    /* 添加圆角和阴影效果，与.slider-container类似 */
    border-radius: var(--radius);
    margin: 0 15px 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, #ffffff 0%, hwb(255 95% 3%) 100%);
    color: var(--dark-color);
    /* 调整文字颜色以适应新背景 */
}

.news-bar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 0;
}

.news-bar a {
    color: var(--dark-color);
    /* 调整链接颜色以适应新背景 */
    text-decoration: none;
    margin: 0 10px;
}

/* 修改原有卡片悬停效果 */
.product-card {
    position: relative; /* 添加定位上下文 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 新增卡片链接样式 */
.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 15px;
}

.product-card-link:hover .product-card {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-card-link:hover .card-title {
    color: var(--accent-color);
}

/* 在文件末尾添加以下样式 */
.wechat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1001;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: var(--radius);
    width: 80%;
    max-width: 300px;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qrcode-img {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
    color: var(--dark-color);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--accent-color);
}

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