/* 首页样式 */
.index-main {
    padding-top: 80px;
}

.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/ai-pattern.svg') center/cover;
    opacity: 0.1;
    animation: float1 20s linear infinite;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 2rem;
    padding-right: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content h2 {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 1.2rem;
    color: white;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.2);
}

.hero-content p {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    color: #eaeaea;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.hero-buttons {
    display: flex;
    gap: 2rem;
    justify-content: flex-start; /* 按钮对齐左边 */
}

.hero-image {
    margin-top: 5px;
    flex: 1;
    position: relative;
    animation: fadeIn 1s ease 0.9s backwards;
}

.hero-image img {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.floating {
    animation: float 6s ease-in-out infinite;
}

.features {
    padding: 5rem 1rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    position: relative;
    overflow: hidden;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/pattern.svg') center/cover;
    opacity: 0.05;
    animation: float1 20s linear infinite;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.feature-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon img {
    transform: scale(1.1);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.feature-list li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
    color: #666;
}

.feature-list li::before {
    content: "→";
    color: #3498db;
    position: absolute;
    left: 0;
    transition: transform 0.3s ease;
}

.feature-list li:hover::before {
    transform: translateX(5px);
}

.mission-vision {
    padding: 6rem 2rem;
    /* background: linear-gradient(135deg, #ffffff, #f8f9fa); */
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;
    margin: 4rem auto;
    /* max-width: 1200px; */
    border-radius: 24px;
    /* box-shadow: 0 15px 30px rgba(0,0,0,0.05); */
}

.mission-vision::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/pattern.svg') center/cover;
    opacity: 0.03;
    animation: float1 20s linear infinite;
}

.content-wrapper {
    display: flex;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.mission, .vision {
    flex: 1;
    padding: 3rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.mission:hover, .vision:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.mission h3, .vision h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.mission h3::after, .vision h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: #3498db;
    border-radius: 2px;
}

.mission p, .vision p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #4a5568;
    margin: 0;
    text-align: left;
}

.section-title {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #3498db;
    margin: 5px auto 0;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .mission-vision {
        padding: 4rem 1rem;
        margin: 2rem auto;
    }

    .content-wrapper {
        flex-direction: column;
        gap: 2rem;
    }

    .mission, .vision {
        padding: 2rem;
    }

    .mission h3, .vision h3 {
        font-size: 1.5rem;
    }

    .mission p, .vision p {
        font-size: 1.1rem;
    }
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-number {
    width: 40px;
    height: 40px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.testimonials {
    padding: 4rem 0;
    position: relative;
    height: 500px;
    overflow: hidden;
    background: linear-gradient(135deg, #f6f9fc, #eef2f7);
}

/* 添加动态背景效果 */
.testimonials::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(52, 152, 219, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(46, 204, 113, 0.05) 0%, transparent 50%);
    animation: backgroundShift 15s ease-in-out infinite alternate;
}

@keyframes backgroundShift {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

.testimonial-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 2rem 0;
}

.testimonial-track {
    display: flex;
    animation: scroll 30s linear infinite;
    width: fit-content;
}

.testimonial-card {
    flex: 0 0 300px;
    margin: 0 1rem;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonial-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 1rem;
}

.user-name {
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.user-title {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0 0;
}

.cta-section {
    padding: 5rem 1rem;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    text-align: center;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.cta-button.primary {
    background: white;
    color: #3498db;
}

.cta-button.secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.cta-button.secondary:hover {
    background: rgba(255,255,255,0.1);
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes float1 {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-100%) rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@media (max-width: 768px) {
    .hero {
        min-height: 60vh;
    }
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    .hero-content h2 {
        font-size: 2.5rem;
    }
    .hero-buttons {
        justify-content: center;
    }
    .feature-grid {
        grid-template-columns: 1fr;
    }
    .steps-container {
        flex-direction: column;
    }
    .testimonial-track {
        animation: scroll 30s linear infinite;
    }
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-300px * 3));
    }

}

.testimonial-track:hover {
    animation-play-state: paused;
}

.chinese-cuisine {
    padding: 4rem 2rem;
    /* background-color: #f8f9fa; */
    position: relative;
}

.cuisine-carousel {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

.cuisine-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 2rem;
    padding: 0 40px;
    width: calc(100% + 2rem); /* 补偿最后一个卡片的间距 */
}

.cuisine-card {
    flex: 0 0 calc((100% - 4rem) / 3);  /* 固定显示3个卡片 */
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cuisine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.cuisine-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.cuisine-card h4 {
    padding: 1.2rem 1.2rem 0.8rem;
    font-size: 1.3rem;
    color: #333;
    font-weight: 600;
}

.cuisine-card p {
    padding: 0 1.2rem 1.2rem;
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-button:hover {
    background: #f0f0f0;
    transform: translateY(-50%) scale(1.1);
}

.carousel-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.carousel-button.prev {
    left: 0;
}

.carousel-button.next {
    right: 0;
}

.carousel-button i {
    color: #333;
    font-size: 1.4rem;
}

@media (max-width: 1024px) {
    .cuisine-card {
        flex: 0 0 calc((100% - 2rem) / 2);  /* 平板端显示2个卡片 */
    }
    .cuisine-track {
        width: calc(100% + 1rem); /* 补偿最后一个卡片的间距 */
    }
}

@media (max-width: 768px) {
    .cuisine-track {
        padding: 0 30px;
        width: 100%; /* 移动端不需要补偿间距 */
    }
    
    .cuisine-card {
        flex: 0 0 calc(100% - 2rem);  /* 移动端显示1个卡片 */
    }
    
    .carousel-button {
        width: 40px;
        height: 40px;
    }
    
    .cuisine-card img {
        height: 200px;
    }
    
    .cuisine-card h4 {
        font-size: 1.2rem;
        padding: 1rem 1rem 0.6rem;
    }
    
    .cuisine-card p {
        font-size: 0.95rem;
        padding: 0 1rem 1rem;
    }
}

.danmu-container {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 20px 0;
}

.danmu-item {
    position: absolute;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: danmu-move linear infinite;
    opacity: 0;
    animation-fill-mode: forwards;
    cursor: pointer;
}

.danmu-item:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    animation-play-state: paused;
    background: #f0f0f0;
}

.danmu-item .user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.danmu-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.danmu-item .user-name {
    color: #3498db;
    font-weight: 600;
    font-size: 0.95rem;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.danmu-item .testimonial-text {
    color: #2c3e50;
    font-size: 0.9rem;
    line-height: 1.4;
}

@keyframes danmu-move {
    0% {
        transform: translateX(100vw);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* 为每个弹幕设置不同的动画延迟和位置 */
.danmu-item:nth-child(1) { 
    top: 10%; 
    animation-duration: 15s;
    animation-delay: 0s;
}
.danmu-item:nth-child(2) { 
    top: 30%; 
    animation-duration: 18s;
    animation-delay: 3s;
}
.danmu-item:nth-child(3) { 
    top: 50%; 
    animation-duration: 20s;
    animation-delay: 6s;
}
.danmu-item:nth-child(4) { 
    top: 70%; 
    animation-duration: 16s;
    animation-delay: 9s;
}
.danmu-item:nth-child(5) { 
    top: 25%; 
    animation-duration: 22s;
    animation-delay: 12s;
}
.danmu-item:nth-child(6) { 
    top: 60%; 
    animation-duration: 19s;
    animation-delay: 15s;
}

/* 添加渐变遮罩效果 */
.testimonials::before,
.testimonials::after {
    content: '';
    position: absolute;
    top: 0;
    width: 200px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.testimonials::before {
    left: 0;
    background: linear-gradient(to right, #f6f9fc, transparent);
}

.testimonials::after {
    right: 0;
    background: linear-gradient(to left, #f6f9fc, transparent);
}


.card-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.5rem;
}

.card-content h4 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0 0 1rem 0;
    font-weight: 600;
    line-height: 1.4;
}

.card-content p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    flex: 1;
}


.read-time, .article-date {
    font-size: 0.85rem;
    color: #999;
}

.card-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-top: 1px solid #f0f0f0;
}

.card-link i {
    transition: transform 0.3s ease;
}

.knowledge-header {
    padding: 1.5rem 2rem;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: background-color 0.3s ease;
    position: relative;
    gap: 1rem;
}

.knowledge-header:hover {
    background-color: #f8f9fa;
}

.knowledge-header-content {
    flex: 1;
    min-width: 0; /* 允许内容收缩 */
}

.knowledge-header h4 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    line-height: 1.4;
    word-wrap: break-word;
}

.knowledge-header p {
    font-size: 1rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}

.knowledge-header .toggle-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin-left: 1rem;
    flex-shrink: 0;
}

.knowledge-header:hover .toggle-icon {
    background: #3498db;
    color: white;
}

.toggle-icon i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    color: #666;
}

.knowledge-header:hover .toggle-icon i {
    color: white;
}

.knowledge-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: #fafafa;
    position: relative;
}

.floating-collapse {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.knowledge-item.active .floating-collapse {
    opacity: 1;
    visibility: visible;
}

.floating-collapse-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.floating-collapse-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
}

.floating-collapse-btn:active {
    transform: translateY(0);
}

.floating-collapse-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.floating-collapse-btn:hover i {
    transform: translateY(-1px);
}

.knowledge-image-container {
    padding: 2rem;
    background: white;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.knowledge-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.knowledge-placeholder {
    padding: 3rem 2rem;
    text-align: center;
    color: #999;
}

.knowledge-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.knowledge-placeholder p {
    font-size: 1.1rem;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nutrition-knowledge {
        padding: 4rem 1rem;
        margin: 2rem auto;
    }
    
    .knowledge-intro p {
        font-size: 1.1rem;
    }
    
    .knowledge-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .knowledge-card {
        height: auto;
        min-height: 250px;
    }
    
    .knowledge-header {
        padding: 1.2rem 1.5rem;
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: 1rem;
    }
    
    .knowledge-header-content {
        flex: 1;
        padding-right: 3rem;
    }
    
    .knowledge-header .toggle-icon {
        position: absolute;
        top: 1.2rem;
        right: 1.5rem;
        margin-left: 0;
        flex-shrink: 0;
    }
    
    .knowledge-header h4 {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }
    
    .knowledge-header p {
        font-size: 0.95rem;
    }
    
    .floating-collapse {
        right: 15px;
    }
    
    .floating-collapse-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .knowledge-image-container {
        padding: 1.5rem;
    }
    
    .knowledge-placeholder {
        padding: 2rem 1.5rem;
    }
    
    .knowledge-placeholder i {
        font-size: 2.5rem;
    }
    
    .knowledge-placeholder p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .nutrition-knowledge {
        padding: 3rem 1rem;
        margin: 1rem auto;
    }
    
    .knowledge-intro {
        margin-bottom: 2rem;
    }
    
    .knowledge-intro p {
        font-size: 1rem;
    }
    
    .knowledge-header {
        padding: 1rem 1.2rem;
        gap: 0.8rem;
    }
    
    .knowledge-header-content {
        padding-right: 2.5rem;
    }
    
    .knowledge-header .toggle-icon {
        top: 1rem;
        right: 1.2rem;
        width: 35px;
        height: 35px;
    }
    
    .knowledge-header h4 {
        font-size: 1.1rem;
    }
    
    .knowledge-header p {
        font-size: 0.9rem;
    }
    
    .floating-collapse {
        right: 10px;
    }
    
    .floating-collapse-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .knowledge-image-container {
        padding: 1rem;
    }
    
    .knowledge-placeholder {
        padding: 1.5rem 1rem;
    }
    
    .knowledge-placeholder i {
        font-size: 2rem;
    }
    
    .knowledge-placeholder p {
        font-size: 0.95rem;
    }
}

