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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Serif SC', serif;
    color: #333333;
    line-height: 1.6;
    background-color: #F8EDEB;
    overflow-x: hidden;
}

/* 字体导入确认 */
.font-playfair {
    font-family: 'Playfair Display', serif;
}

.font-noto {
    font-family: 'Noto Serif SC', serif;
}

/* 自定义动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.animate-on-scroll {
    opacity: 0;
}

/* 响应式导航栏 */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease;
        z-index: 100;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .menu-toggle {
        display: block;
        z-index: 101;
    }
}

/* 图片hover效果增强 */
.hover-zoom {
    transition: transform 0.5s ease;
}

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

/* 按钮效果增强 */
.btn-primary {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background-color: rgba(0, 0, 0, 0.1);
    transition: height 0.3s ease;
    z-index: -1;
}

.btn-primary:hover::after {
    height: 100%;
}

/* 表单输入框焦点效果 */
input:focus,
textarea:focus,
select:focus {
    transition: all 0.3s ease;
    box-shadow: 0 0 0 3px rgba(216, 160, 166, 0.25);
}

/* 卡片阴影效果 */
.card {
    transition: all 0.3s ease;
}

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

/* 模态框动画 */
#gallery-modal {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#gallery-modal:not(.hidden) {
    opacity: 1;
}

#gallery-modal img {
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#gallery-modal:not(.hidden) img {
    transform: scale(1);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #D8A0A6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c79097;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #D8A0A6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 响应式调整 */
@media (max-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .flex-col-reverse {
        flex-direction: column-reverse;
    }
    
    .text-[clamp(2rem,5vw,3.5rem)] {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }
}

/* 打印样式 */
@media print {
    body {
        background-color: white;
    }
    
    .no-print {
        display: none;
    }
    
    a {
        text-decoration: none;
        color: black;
    }
}

/* 无障碍访问 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #a63f4c;
        --secondary-color: #f0d9da;
        --text-color: #000000;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #f0f0f0;
        --card-bg: #2a2a2a;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .bg-light {
        background-color: var(--card-bg);
    }
}