.ingredient-detail {
    padding-top: .85rem;
    padding-left: 20px;
    padding-right: 20px;
    margin: 0 auto;
    max-width: 100%;
    animation: fadeIn 0.5s ease-in-out;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 20px;
    border-radius: 10px;
    background-color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.image-section img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.image-section img:hover {
    transform: scale(1.1);
}

.score-section {
    text-align: center;
}

.comprehensive-score h2 {
    font-size: 48px;
    margin: 0;
    font-weight: bold;
    animation: zoomIn 0.3s ease-in-out;
}

.score-description {
    font-size: 28px;
    font-weight: bold;
}

.ingredient-overview {
    margin-bottom: 20px;
}

.ingredient-overview h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.ingredient-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #e6e6e6;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.ingredient-item:hover {
    background-color: #f9f9f9;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.ingredient-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ingredient-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.ingredient-categories {
    font-size: 14px;
    color: #888;
    margin-top: 5px;
    padding: 5px;
    display: inline-block;
    border-radius: 5px;
    background-color: #f5f5f5;
}

.advice-text {
    font-size: 14px;
    margin-left: auto;
}

.advice-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.right-arrow {
    width: 12px;
    height: 12px;
    background: url("../../icons/more2.01d277654efd.png") no-repeat right center;
    background-size: contain;
}

.ingredient-detail-section {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%) translateY(100%); /* 修复初始位置偏移 */
    background-color: #fff;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
    padding: 0 40px;
    max-height: 80%;
    overflow-y: hidden;
    transition: bottom 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    z-index: 20;
    width: 90%;
    max-width: 767px;
}

.ingredient-detail-section.open {
    bottom: 0;
    transform: translateX(-50%) translateY(0); /* 确保动画终点位置正确 */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    animation: slideUp 0.5s ease-in-out;
}

.detail-content {
    padding: 10px;
}

.data-source {
    font-size: 14px;
    color: #007bff;
    margin-bottom: 10px;
}

.detail-content h3 {
    font-size: 20px;
    margin: 10px 0;
}

.detail-content p {
    font-size: 16px;
    margin: 5px 0;
    line-height: 1.6;
}

.carcinogenic {
    display: flex;
    align-items: center;
    font-size: 16px;
    margin-top: 10px;
}

.carcinogenic span:first-child {
    font-weight: bold;
    margin-right: 5px;
}

.overlay.show, .popup-overlay.show {
    display: block;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 10;
    animation: fadeIn 0.3s ease-in-out;
}

hr {
    border: none;
    height: 1px;
    background-color: #ccc;
    opacity: 0.5;
    margin: 10px 0;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

/* 弹窗主体 */
.popup-window {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
    padding: 0; /* 去掉内边距 */
    max-height: 80%;
    overflow-y: auto;
    display: none;
    z-index: 1001;
    width: 100%; /* 改为全宽 */
    max-width: 767px; /* 限制最大宽度 */
}

/* 弹窗头部固定 */
.popup-header {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    padding: 15px 20px; /* 添加左右内边距 */
    border-bottom: 1px solid #ccc;
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    width: 100%; /* 确保宽度与弹窗一致 */
}

/* 弹窗内容 */
.popup-body {
    padding: 40px; /* 添加适当的内边距 */
    max-height: 60%;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-in-out;
    width: 100%; /* 确保宽度与弹窗一致 */
}


/* 弹窗底部固定 */
.popup-footer {
    text-align: center;
    border-top: 1px solid #ccc;
    position: sticky;
    bottom: 0;
    background-color: #fff;
    padding: 15px 20px; /* 添加左右内边距 */
    z-index: 10;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
    width: 100%; /* 确保宽度与弹窗一致 */
}

#close-popup {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%; /* 确保按钮填满宽度 */
}

#close-popup:hover {
    background-color: #0056b3;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.additive-search-page {
    padding: 50px 0;
    background-color: #f9f9f9; /* 背景色为浅灰色，提升页面层次感 */
}

.additive-search-page .container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 20px;
    background: #ffffff; /* 白色背景容器 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* 添加轻微阴影效果 */
    border-radius: 10px; /* 圆角 */
}

.additive-search-page .page-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    animation: fadeIn 0.5s ease-in-out; /* 添加淡入动画 */
}

.additive-search-page .page-description {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease-in-out 0.2s; /* 延迟淡入动画 */
}

.search-form {
    display: flex;
    justify-content: center;
    gap: 10px; /* 输入框与按钮之间的间距 */
    animation: fadeIn 0.5s ease-in-out 0.4s; /* 延迟淡入动画 */
}

.search-form input[type="text"] {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加轻微阴影 */
}

.search-form input[type="text"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* 聚焦效果 */
}

.search-form button {
    padding: 15px 30px;
    font-size: 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加按钮阴影 */
}

.search-form button:hover {
    background-color: #0056b3;
    transform: translateY(-2px); /* 鼠标悬停时轻微上移 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 增强阴影效果 */
}

.search-form button:active {
    transform: translateY(0); /* 点击时移回原位 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 恢复默认阴影 */
}
/* 更新 slideUp 动画关键帧 */
@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%); /* 修复起始偏移 */
    }
    to {
        transform: translateX(-50%) translateY(0); /* 保持终点一致 */
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
    }
    to {
        transform: scale(1);
    }
}

@media (min-width: 767px) {
    .ingredient-detail {
        width: 767px;
    }
}


/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式布局 */
@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
    }

    .search-form input[type="text"] {
        margin-bottom: 10px; /* 输入框与按钮之间增加间距 */
    }

    .additive-search-page .container {
        padding: 15px; /* 调整小屏幕的内边距 */
    }
}