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

/* 设计令牌 */
:root {
    /* 颜色系统 */
    --color-primary: #3d2914;
    --color-secondary: #8b7355;
    --color-accent: #c8a97e;
    --color-background: #faf8f5;
    --color-surface: #f5f2ed;
    --color-text-primary: #3d2914;
    --color-text-secondary: #666666;
    --color-text-light: #999999;
    
    /* 间距系统 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    
    /* 排版系统 */
    --font-size-xs: 0.875rem;
    --font-size-sm: 1rem;
    --font-size-md: 1.125rem;
    --font-size-lg: 1.5rem;
    --font-size-xl: 2rem;
    --font-size-2xl: 3rem;
    
    /* 圆角系统 */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    
    /* 阴影系统 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* 基础排版 */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.6;
    font-size: var(--font-size-sm);
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid rgba(139, 115, 85, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: var(--font-size-lg);
    font-weight: 300;
    color: var(--color-primary);
    text-decoration: none;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
    list-style: none;
}

.nav-links a {
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--color-accent);
}

.nav-links a.active {
    color: var(--color-primary);
    font-weight: 500;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-accent);
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* 主视觉区 */
.hero {
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(135deg, #faf8f5 0%, #f5f2ed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(200, 169, 126, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(30px, -30px) rotate(180deg); }
}

.hero-content {
    text-align: center;
    z-index: 2;
    padding: var(--spacing-xl);
}

.hero-title {
    font-size: var(--font-size-2xl);
    font-weight: 200;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
    letter-spacing: 4px;
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    font-weight: 300;
    letter-spacing: 2px;
    animation: fadeInUp 1s ease-out 0.3s both;
}

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

/* 内容区块 */
.section {
    padding: var(--spacing-xl) 0;
}

.section-title {
    font-size: var(--font-size-xl);
    font-weight: 300;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    letter-spacing: 2px;
}

.section-description {
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--spacing-lg);
    line-height: 1.8;
}

/* 网格布局 */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

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

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

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

/* 卡片样式 */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: linear-gradient(135deg, #e8dcc6 0%, #d4c5b0 100%);
}

.card-content {
    padding: var(--spacing-md);
}

.card-title {
    font-size: var(--font-size-lg);
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
    font-weight: 400;
}

.card-description {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

/* 材质展示 */
.material-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
}

.material-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #f0e6d2 0%, #e0d5c1 100%);
}

.material-content h3 {
    font-size: var(--font-size-lg);
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    font-weight: 400;
}

.material-content p {
    color: var(--color-text-secondary);
    line-height: 1.8;
}

/* 系法展示 */
.tying-item {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.tying-image {
    width: 300px;
    height: 400px;
    object-fit: cover;
    margin: 0 auto var(--spacing-md);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #e8dcc6 0%, #d4c5b0 100%);
}

.tying-title {
    font-size: var(--font-size-lg);
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    font-weight: 400;
}

.tying-description {
    color: var(--color-text-secondary);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.8;
}

/* 图片瀑布流 */
.gallery-grid {
    column-count: 4;
    column-gap: var(--spacing-sm);
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-caption {
    background: var(--color-surface);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    text-align: center;
}

/* 页脚 */
.footer {
    background: var(--color-surface);
    border-top: 1px solid rgba(139, 115, 85, 0.1);
    padding: var(--spacing-lg) 0;
    text-align: center;
    margin-top: var(--spacing-xl);
}

.footer-content {
    color: var(--color-text-light);
    font-size: var(--font-size-xs);
    letter-spacing: 1px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .gallery-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .nav-links {
        gap: var(--spacing-md);
    }
    
    .hero-title {
        font-size: var(--font-size-xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-md);
    }
    
    .material-item {
        flex-direction: column;
        text-align: center;
    }
    
    .material-image {
        width: 100%;
        max-width: 300px;
    }
    
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .nav-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: var(--font-size-lg);
    }
    
    .section {
        padding: var(--spacing-lg) 0;
    }
    
    .gallery-grid {
        column-count: 1;
    }
}

/* 灯箱效果 */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    color: white;
    font-size: var(--font-size-xl);
    cursor: pointer;
    background: none;
    border: none;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(200, 169, 126, 0.3);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 平滑过渡 */
.transition {
    transition: all 0.3s ease;
}

/* 文本截断 */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 可访问性 */
.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;
}

/* 焦点样式 */
*:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* 选择文本样式 */
::selection {
    background: var(--color-accent);
    color: white;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--color-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}