/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* 头部样式 */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.header__logo {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.header__nav {
    display: flex;
    list-style: none;
    gap: 30px;
}

.header__nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.header__nav a:hover {
    color: #007bff;
}

.header__actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header__cart {
    position: relative;
    color: #333;
    text-decoration: none;
    font-size: 18px;
}

/* 主要内容区域 */
.main {
    margin-top: 70px;
}

/* Hero 区域 */
.hero {
    position: relative;
    width: 100%;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    overflow: hidden;
}

/* 如果没有设置宽高比，使用默认高度 */
.hero:not([style*="aspect-ratio"]) {
    height: 80vh;
    min-height: 600px;
}

/* 设置了宽高比的Hero区域 */
.hero[style*="aspect-ratio"] {
    height: auto;
    min-height: 300px;
}

/* Hero容器模式 */
.hero--container {
    background: #f8f9fa;
    min-height: auto;
}

.hero__image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.hero__image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* 全屏显示模式 */
.hero--fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    z-index: 999;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero--fullscreen .hero__content {
    position: relative;
    z-index: 1000;
}

/* 完整显示模式 */
.hero--contain {
    background-size: contain;
    background-color: #f8f9fa;
}

/* 全屏模式下的关闭按钮 */
.hero--fullscreen::after {
    content: '×';
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.hero--fullscreen::after:hover {
    background: rgba(0,0,0,0.8);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1;
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    padding: 0 20px;
}

.hero__title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero__subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero__button {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero__button:hover {
    background: #0056b3;
}

/* 产品区域 */
.product-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.product-section--fullscreen {
    position: relative;
    min-height: 100vh;
    padding: 0;
    background: #000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    align-items: center;
}

.product-image {
    text-align: center;
}

.product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* 产品图片样式 */
.product-img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: block;
    transition: transform 0.3s ease;
}

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

.product-img--ratio {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    /* aspect-ratio 和 object-fit 通过内联样式设置 */
}

.product-img--ratio:hover {
    transform: scale(1.02);
}

.product-img--fullwidth {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.product-img--fullwidth:hover {
    transform: scale(1.01);
}

/* 图片区域样式 */
.section-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.section-img:hover {
    transform: scale(1.02);
}

.section-img--ratio {
    width: 100%;
    transition: transform 0.3s ease;
    /* aspect-ratio 和 object-fit 通过内联样式设置 */
}

.section-img--ratio:hover {
    transform: scale(1.02);
}

.section-img--fullwidth {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.section-img--fullwidth:hover {
    transform: scale(1.01);
}

/* 移动端触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .product-img:hover,
    .product-img--ratio:hover,
    .product-img--fullwidth:hover,
    .section-img:hover,
    .section-img--ratio:hover,
    .section-img--fullwidth:hover {
        transform: none;
    }

    .product-img:active,
    .product-img--ratio:active,
    .product-img--fullwidth:active,
    .section-img:active,
    .section-img--ratio:active,
    .section-img--fullwidth:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* 页脚 */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 40px 0;
}

.footer__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header__nav {
        display: none;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__subtitle {
        font-size: 1rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .container {
        padding: 0 15px;
    }

    /* 移动端Hero区域优化 */
    .hero {
        min-height: 40vh;
    }

    .hero:not([style*="aspect-ratio"]) {
        height: 60vh;
        min-height: 350px;
    }

    .hero[style*="aspect-ratio"] {
        min-height: 200px;
        max-height: 70vh;
    }

    .hero--container {
        min-height: 30vh;
    }

    .hero__image {
        max-width: 100%;
        max-height: 70vh;
    }

    /* 移动端图片优化 */
    .product-img,
    .section-img {
        border-radius: 5px;
        max-width: 100%;
        height: auto;
    }

    .product-img--ratio,
    .section-img--ratio {
        width: 100%;
        max-width: 100%;
        /* 在移动端限制最大高度，避免图片过高 */
        max-height: 70vh !important;
        object-fit: cover;
    }

    .product-img--fullwidth,
    .section-img--fullwidth {
        width: 100%;
        height: auto;
        max-width: 100%;
    }

    /* 确保所有图片在移动端都不会过大 */
    img {
        max-width: 100%;
        height: auto;
    }

    /* 移动端产品区域优化 */
    .product-section {
        padding: 40px 0;
    }

    .product-image {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .header__container {
        padding: 0 15px;
    }

    .container {
        padding: 0 10px;
    }

    /* 小屏幕Hero区域 */
    .hero {
        min-height: 35vh;
    }

    .hero:not([style*="aspect-ratio"]) {
        height: 45vh;
        min-height: 250px;
    }

    .hero[style*="aspect-ratio"] {
        min-height: 150px;
        max-height: 60vh;
    }

    .hero--container {
        min-height: 25vh;
    }

    .hero__title {
        font-size: 1.5rem;
    }

    .hero__button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    /* 小屏幕图片优化 */
    .product-img--ratio,
    .section-img--ratio {
        max-height: 60vh;
    }

    .product-section {
        padding: 30px 0;
    }

    .image-section {
        padding: 20px 0;
    }

    /* 文字内容优化 */
    .product-content h2,
    .hero__content h1 {
        font-size: 1.3rem;
        line-height: 1.4;
    }

    .product-content p,
    .hero__content p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .container {
        padding: 0 8px;
    }

    .hero {
        min-height: 30vh;
    }

    .hero:not([style*="aspect-ratio"]) {
        height: 40vh;
        min-height: 200px;
    }

    .hero[style*="aspect-ratio"] {
        min-height: 120px;
        max-height: 50vh;
    }

    .product-img--ratio,
    .section-img--ratio {
        max-height: 50vh;
    }

    .hero__title {
        font-size: 1.2rem;
    }

    .product-content h2 {
        font-size: 1.1rem;
    }
}
