/* CSS 变量定义 */
:root {
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --primary-text-color: #212529;
    --secondary-text-color: #6c757d;
    --accent-color: #007bff;
    --font-family: 'Montserrat', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--primary-text-color);
    line-height: 1.6;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary-text-color);
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    font-weight: 400;
    font-size: 1rem;
    color: var(--primary-text-color);
}

/* 英雄区样式 */
.hero {
    text-align: center;
    padding: 12rem 1rem 6rem;
    background: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.9)), url('https://source.unsplash.com/random/1600x900?minimal,white') no-repeat center center/cover;
    color: var(--primary-text-color);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    color: var(--secondary-text-color);
    font-weight: 300;
}

/* 商品网格布局 */
main {

}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 5%;
}

/* 商品卡片样式 - 核心部分 */
.product-card {
    position: relative;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease;
    color: #ffffff; /* 文本颜色保持白色，因为背景是图片和深色遮罩 */
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.product-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: backdrop-filter 0.4s ease, background-color 0.4s ease;
}

.product-card:hover .product-info {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.product-title {
    font-size: 1.5rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.product-description {
    font-size: 0.9rem;
    font-weight: 300;
    color: #e0e0e0; /* 描述文本使用稍暗的白色 */
    height: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: height 0.4s ease, opacity 0.4s ease, transform 0.4s ease;
}

.product-card:hover .product-description {
    height: 45px; /* 根据需要调整 */
    opacity: 1;
    transform: translateY(0);
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 10px 0;
    color: #ffffff;
}

.buy-button {
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.buy-button:hover {
    background-color: #0056b3;
    transform: scale(1.02);
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    background-color: var(--background-color);
    color: var(--secondary-text-color);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 2000;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #ccc;
}