/* CSS变量定义 */
:root {
    --primary-color: #8B4513;
    --secondary-color: #A0522D;
    --accent-color: #CD853F;
    --bg-color: #F8F4E3;
    --text-color: #333;
    --text-light: #666;
    --white: #FFFFFF;
    --section-padding: 80px 0;
    --transition: all 0.3s ease;
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 40px;
    height: 40px;
}

.nav-list {
    display: flex;
    list-style: none;
}

.nav-item {
    margin-left: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
}

/* 英雄区域样式 */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    background-color: var(--primary-color);
    overflow: hidden;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    color: var(--white);
    max-width: 500px;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    z-index: 1;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--accent-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 产品样式 */
.products {
    padding: var(--section-padding);
    background-color: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-item {
    background-color: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    display: block;
}

.product-item:hover .product-image img {
    transform: scale(1.1);
}

.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.product-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.product-info p {
    color: var(--text-light);
    margin-bottom: 15px;
}

.product-price {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-top: auto;
}

/* 产品特色样式 */
.features {
    padding: var(--section-padding);
    background-color: #F9F6F0;
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('features-bg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.05;
    z-index: 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 1;
}

.feature-item {
    background-color: var(--white);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background-color: #F9F6F0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary-color);
    font-size: 1.8rem;
    transition: var(--transition);
}

.feature-item:hover .feature-icon {
    background-color: var(--primary-color);
    color: var(--white);
}

.feature-item h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.feature-item p {
    color: var(--text-light);
}

/* 新闻资讯样式 */
.news {
    padding: var(--section-padding);
    background-color: var(--white);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.news-item {
    background-color: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.news-image {
    height: 180px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.news-item:hover .news-image img {
    transform: scale(1.1);
}

.news-content {
    padding: 20px;
}

.news-date {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.news-content h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.news-content p {
    color: var(--text-light);
}

/* 用户评价样式 */
.testimonials {
    padding: var(--section-padding);
    background-color: var(--primary-color);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.testimonials::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('testimonials-bg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: 0;
}

.testimonials .section-header h2 {
    color: var(--white);
}

.testimonials .section-header p {
    color: rgba(255, 255, 255, 0.8);
}

/* 修复用户评价轮播样式 */
.testimonial-slider {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    z-index: 1;
    overflow: hidden; /* 确保轮播项不会溢出容器 */
}

.testimonial-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out; /* 添加平滑过渡效果 */
    width: 100%; /* 确保wrapper宽度正确 */
}

.testimonial-item {
    width: 100%; /* 使用width而不是min-width，确保每个轮播项都是容器宽度 */
    flex-shrink: 0; /* 防止轮播项被压缩 */
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 30px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.testimonial-content {
    margin-bottom: 20px;
}

.rating {
    color: var(--accent-color);
    margin-bottom: 15px;
}

.rating i {
    font-size: 1.2rem;
    margin-right: 5px;
}

.testimonial-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.9;
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.testimonial-author img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.testimonial-author h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.testimonial-author p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.testimonial-prev,
.testimonial-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2;
}

.testimonial-prev:hover,
.testimonial-next:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.testimonial-prev {
    left: -60px;
}

.testimonial-next {
    right: -60px;
}

/* 页脚样式 */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.footer-logo img {
    width: 40px;
    height: 40px;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-links h4,
.footer-contact h4,
.footer-social h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h4::after,
.footer-contact h4::after,
.footer-social h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-links ul,
.footer-contact ul {
    list-style: none;
}

.footer-links li,
.footer-contact li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
}

.footer-contact li i {
    margin-right: 10px;
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}

.footer-friendship {
    margin-bottom: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-friendship h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.friendship-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.friendship-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.friendship-links a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero-content {
        left: 5%;
        max-width: 400px;
    }
    
    .hero-content h1 {
        font-size: 2.8rem;
    }
    
    .testimonial-prev,
    .testimonial-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .testimonial-prev {
        left: -50px;
    }
    
    .testimonial-next {
        right: -50px;
    }
}

@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background-color: var(--white);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: var(--transition);
        z-index: 999;
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        padding: 80px 20px;
    }
    
    .nav-item {
        margin-left: 0;
        margin-bottom: 20px;
    }
    
    .mobile-nav-toggle {
        display: block;
        z-index: 1000;
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin-top: 100px;
        z-index: 2;
    }
    
    .hero-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0.5;
    }
    
    .testimonial-prev {
        left: 10px;
    }
    
    .testimonial-next {
        right: 10px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-contact li {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .friendship-links {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .section-header h2 {
        font-size: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .products-grid,
    .features-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonial-item {
        padding: 20px;
    }
    
    .footer {
        padding: 40px 0 20px;
    }
}

/* 滚动动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

/* 加载动画 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}