/* 卫衣概念展示网站 - 全局样式文件 */
/* 基于Tailwind.css的响应式布局和动画效果 */

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

/* 页面整体布局 */
html {
    scroll-behavior: smooth;
}

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

/* 响应式容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* 英雄区域样式 */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

/* 网格布局样式 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 图片悬停效果 */
.image-hover {
    position: relative;
    overflow: hidden;
}

.image-hover img {
    transition: transform 0.5s ease, opacity 0.5s ease;
}

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

.image-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.image-hover:hover::before {
    opacity: 1;
}

/* 详情页图片查看器 */
.image-viewer {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 12px;
}

.image-viewer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.image-thumbnails {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    overflow-x: auto;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.thumbnail.active {
    opacity: 1;
    border: 2px solid #2d3748;
}

/* 颜色选择器 */
.color-selector {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.color-option.active {
    border-color: #2d3748;
    transform: scale(1.1);
}

/* 页脚样式 */
.footer {
    background-color: #f8f9fa;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid #e9ecef;
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2d3748;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .hero-section {
        height: 70vh;
    }
    
    .image-viewer {
        height: 400px;
    }
    
    .container {
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .hero-section {
        height: 60vh;
    }
    
    .image-viewer {
        height: 300px;
    }
}

/* 无障碍访问支持 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点样式 */
button:focus, 
a:focus, 
.color-option:focus, 
.thumbnail:focus {
    outline: 2px solid #2d3748;
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    .navbar,
    .footer {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}