/* 全局样式 */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --accent-color: #FF9800;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}
.section-title {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    position: relative;
}

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

/* 主容器样式 */
.nutrients-main {
    width: 100%;
    margin: 0;
    padding-top: 80px;
}

/* 英雄区域样式 */
.nutrients-hero {
    position: relative;
    text-align: center;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    overflow: hidden;
    margin-bottom: 0;
    border-radius: 0;
    width: 100%;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 二维码区域样式 */
.qr-section {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.qr-container {
    text-align: center;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem;
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}


.qr-container::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.2) 100%);
    border-radius: 26px;
    z-index: -1;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.qr-code {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.qr-code:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

.qr-text {
    margin-top: 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

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

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

.nutrients-hero h2 {
    font-size: 4rem;
    margin-bottom: 2rem;
    position: relative;
    animation: fadeInUp 1s ease;
    z-index: 1;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.nutrients-hero p {
    font-size: 1.8rem;
    max-width: 800px;
    margin: 0 auto 3rem;
    position: relative;
    animation: fadeInUp 1s ease 0.3s backwards;
    z-index: 1;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}




/* 内容区域样式 */
.content-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* 数据支撑部分样式 */
.data-support {
    /* margin-bottom: 6rem; */
    padding: 4rem 0;
    background: var(--light-gray);
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
    max-width: 1200px;
    margin: 3rem auto 0;
    padding: 0 2rem;
}

.data-card {
    background: var(--white);
    padding: 3rem 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.data-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.data-icon {
    margin-bottom: 2rem;
}

.data-icon img {
    width: 80px;
    height: 80px;
    transition: var(--transition);
}

.data-card:hover .data-icon img {
    transform: scale(1.2);
}

.data-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.data-card p {
    font-size: 1.2rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.data-card ul {
    list-style: none;
    padding: 0;
    text-align: left;
}

.data-card li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.8rem;
    color: #666;
    font-size: 1.1rem;
    line-height: 1.5;
}

.data-card li::before {
    content: "•";
    color: var(--secondary-color);
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* 计算营养学概念部分样式 - 保持原本风格 */
.computational-nutrition {
    padding: 5rem 1rem;
    background: #f8f9fa;
    margin-bottom: 4rem;
}

.computational-nutrition .section-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 3rem;
}

.concept-intro {
    margin-bottom: 3rem;
    max-width: 1200px;
    margin: 0 auto 3rem;
}

.concept-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-color);
    text-align: justify;
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-left: 5px solid var(--secondary-color);
    margin-bottom: 2rem;
}

.methodology-section {
    margin-bottom: 3rem;
    max-width: 1200px;
    margin: 0 auto 3rem;
}

.methodology-section h3 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.methodology-section h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.methodology-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    border-left: 5px solid var(--secondary-color);
}

.methodology-text p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.methodology-text p:last-child {
    margin-bottom: 0;
}

.concept-diagrams {
    margin-top: 3rem;
    max-width: 1400px; /* 增加最大宽度 */
    margin: 3rem auto 0;
}

.concept-diagrams h3 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.concept-diagrams h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.diagram-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 桌面端固定三列 */
    gap: 2rem;
    margin-top: 2rem;
    align-items: start;
}

.diagram-item {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%; /* 自适应高度 */
}

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

.diagram-image {
    padding: 2.5rem; /* 增加内边距 */
    text-align: center;
    background: white;
    border-radius: 20px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    align-items: center; /* 水平居中对齐 */
}

.diagram-image:hover {
    background: #f8f9fa;
}

.diagram-image img {
    width: 100%;
    height: clamp(320px, 28vw, 500px); /* 响应式高度：最小320，典型28vw，最大500 */
    object-fit: contain;
    display: block;
    margin: 0 auto 1rem;
    border-radius: 10px;
    /* box-shadow: 0 2px 8px rgba(0,0,0,0.1); */
    transition: var(--transition);
    flex-shrink: 0;
    /* background: white; */
}

/* .diagram-image:hover img {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
} */

.diagram-image p {
    font-size: 1.3rem; /* 增加字体大小 */
    color: var(--text-color);
    font-weight: 500;
    margin: 0;
    margin-top: auto;
    padding-top: 1rem;
    text-align: center;
    width: 100%;
}

/* 解决方案部分样式 */
.solutions {
    margin-bottom: 4rem;
    /* padding: 2rem 1rem; */
    background: white;
}

.solution-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.tab-button {
    padding: 1rem 2rem;
    border: none;
    background: var(--light-gray);
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.tab-button.active {
    background: var(--secondary-color);
    color: var(--white);
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.solution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.solution-card {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
}

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

.solution-card h2,
.solution-card h3 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.solution-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.solution-icon {
    flex-shrink: 0;
}

.solution-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.solution-details {
    flex: 1;
}

.solution-details p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.solution-details ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.solution-details li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.solution-details li::before {
    content: "•";
    color: var(--secondary-color);
    position: absolute;
    left: 0;
}

.try-button {
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.try-button:hover {
    background: lightgreen;
    transform: translateY(-2px);
}

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

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

.nutrient-categories,
.solutions,
.how-it-works {
    animation: fadeIn 0.8s ease-out;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .diagram-grid {
        grid-template-columns: repeat(2, 1fr); /* 1200px以下两列 */
    }
}

@media (max-width: 768px) {
    .nutrients-main {
        padding: 1rem;
    }

    .nutrients-hero {
        padding: 3rem 1rem;
    }

    .nutrients-hero h2 {
        font-size: 2rem;
    }

    .nutrients-hero p {
        font-size: 1.2rem;
    }

    .search-box {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box input,
    .search-button {
        border-radius: 25px;
    }

    .data-grid {
        grid-template-columns: 1fr;
    }

    .solution-grid {
        grid-template-columns: 1fr;
    }

    .solution-content {
        flex-direction: column;
        text-align: center;
    }

    .solution-icon {
        margin: 0 auto;
    }

    .solution-details li {
        text-align: left;
    }

    .data-card {
        padding: 2rem 1.5rem;
    }

    .data-card h3 {
        font-size: 1.5rem;
    }

    .data-card p {
        font-size: 1.1rem;
    }

    .data-card li {
        font-size: 1rem;
    }

    .concept-text {
        font-size: 1rem;
        padding: 2rem;
    }

    .methodology-content {
        padding: 2rem;
    }

    .diagram-grid {
        grid-template-columns: 1fr; /* 768px以下一列 */
        gap: 1.5rem;
    }

    .diagram-image {
        padding: 1.5rem;
    }

    .diagram-image img {
        height: clamp(260px, 52vw, 360px);
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .nutrients-hero {
        padding: 2rem 1rem;
        min-height: 70vh;
    }

    .nutrients-hero h2 {
        font-size: 1.8rem;
    }

    .nutrients-hero p {
        font-size: 1rem;
    }

    .qr-container {
        padding: 2rem;
        border-radius: 20px;
    }

    .qr-container::after {
        border-radius: 22px;
    }

    .qr-code {
        width: 150px;
        height: 150px;
        border-radius: 16px;
    }

    .qr-text {
        font-size: 1rem;
        margin-top: 1rem;
    }

    .data-support,
    .computational-nutrition,
    .solutions {
        padding: 2rem 1rem;
    }

    .data-card,
    .solution-card {
        padding: 1.5rem;
    }

    .concept-text {
        padding: 1.5rem;
    }

    .methodology-content {
        padding: 1.5rem;
    }

    .diagram-image {
        padding: 1.5rem;
    }

    .diagram-image img {
        height: 300px; /* 小屏幕保持较大尺寸 */
    }

    .diagram-image p {
        font-size: 1.1rem;
    }
} 