/* ==========================================================================
   布局系统 (Layout System)
   基于 Flexbox & CSS Grid
   用于定义页面结构、网格系统及核心组件布局
   ========================================================================== */

/* --- 基础容器 (Containers) --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding, 20px);
    box-sizing: border-box;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--container-padding, 20px);
}

.container-fluid {
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

/* --- 区块 (Sections) --- */
section {
    position: relative;
    padding: var(--section-spacing, 80px) 0;
    width: 100%;
    box-sizing: border-box;
}

/* 首页全屏区域 */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* --- 导航栏 (Navigation) --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1000;
    background-color: var(--color-bg-light, #F8F8F8);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding, 20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    z-index: 1002;
}

.nav-menu {
    display: flex;
    gap: 3rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-toggle {
    display: none; /* 默认桌面端隐藏 */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
    z-index: 1002;
}

/* --- 通用网格系统 (Grid System) --- */
.grid-container {
    display: grid;
    gap: 2rem;
    width: 100%;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* --- 首页特定布局 --- */
/* 轮播图 */
.carousel-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s;
    background-size: cover;
    background-position: center;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* 半透明遮罩 */
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
    color: #fff;
}

/* 特色栏目预览 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* 视觉故事 */
.visual-story-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
}

/* --- 风格指南页布局 --- */
.style-quadrant {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1px;
    background-color: var(--color-border, #ddd); /* 网格线颜色 */
    border: 1px solid var(--color-border, #ddd);
}

.quadrant-item {
    background-color: #fff;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

/* --- 衣橱必备页布局 --- */
.essentials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 9宫格基础 */
    gap: 3rem 2rem;
}

.essential-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- 季节趋势页布局 --- */
.timeline-container {
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr 4fr;
    gap: 3rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--color-border-light, #eee);
}

/* --- 页脚布局 (Footer) --- */
.site-footer {
    padding: 60px 0 40px;
    text-align: center;
    border-top: 1px solid var(--color-border, #eee);
    margin-top: auto; /* 保持页脚在底部 */
}

/* --- 辅助布局类 (Utility) --- */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 图片容器比例控制 */
.img-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: block;
}

.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.ratio-1-1 { aspect-ratio: 1 / 1; }
.ratio-3-2 { aspect-ratio: 3 / 2; }
.ratio-4-3 { aspect-ratio: 4 / 3; }
.ratio-16-9 { aspect-ratio: 16 / 9; }

/* 隐藏与显示 */
.hidden { display: none !important; }
.block { display: block !important; }