/* 自选配方页面样式 */
.custom-formulation-page {
    padding-top: 80px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #333;
    /* background: #e9f3df; */
}

/* 页面标题区 */
.page-hero {
    background: transparent;
    color: white;
    padding: 40px 0;
    text-align: center;
}

.page-hero__title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #a8e6cf;
}

.page-hero__subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* 功效选择区 */
.effects-selector {
    padding: 40px 0;
    background: transparent;
}

.effects-selector__header {
    text-align: left;
    margin-bottom: 30px;
}

.effects-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.effects-subtitle {
    font-size: 1rem;
    color: #a8e6cf;
    margin: 0;
}

/* 功效选择网格 */
.effects-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 40px;
}

.effect-option {
    position: relative;
    cursor: pointer;
}

.effect-option input[type="radio"] {
    display: none;
}

.effect-label {
    display: block;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #e8e9e9;
    border-radius: 25px;
    padding: 12px 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #fff;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.effect-option:hover .effect-label {
    background: rgba(168, 230, 207, 0.2);
    border-color: #a8e6cf;
    transform: translateY(-2px);
}

.effect-option input[type="radio"]:checked + .effect-label {
    background: #a8e6cf;
    color: #1a1a2e;
    border-color: #a8e6cf;
    font-weight: 600;
}

/* 成分选择区域 */
.ingredients-selection {
    padding: 40px 0;
    background: transparent;
}

.current-effect-display {
    text-align: center;
    margin-bottom: 40px;
}

.effect-display-title {
    font-size: 2rem;
    font-weight: 700;
    color: #a8e6cf;
    margin: 0;
    text-shadow: 0 0 20px rgba(168, 230, 207, 0.3);
}

/* 成分容器 */
.ingredients-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 成分分类 - 横排布局 */
.ingredients-categories {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.category-section {
    background: rgba(168, 230, 207, 0.1);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(168, 230, 207, 0.3);
}

.category-section .category-title {
    background: #a8e6cf;
    color: #1a1a2e;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 20px;
    display: inline-block;
    min-width: 120px;
    text-align: center;
}

/* 成分网格 - 6列布局 */
.category-ingredients {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.ingredient-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ingredient-option:hover {
    background: rgba(168, 230, 207, 0.1);
    border-color: rgba(168, 230, 207, 0.3);
    transform: translateY(-1px);
}

.ingredient-option input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: #a8e6cf;
    flex-shrink: 0;
}

.ingredient-option label {
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    line-height: 1.3;
    flex: 1;
}

.ingredient-option input[type="checkbox"]:checked + label {
    color: #a8e6cf;
    font-weight: 500;
}

/* 表单样式 */
.form-fields {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px 30px 60px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
    margin-top: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-group.full-width {
    grid-column: 1 / -1;
    align-items: flex-start;
}

.form-group label {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 80px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.form-group label.required::after {
    content: ' *';
    color: #ff6b6b;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 0.9rem;
    color: #333;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #a8e6cf;
    box-shadow: 0 0 0 2px rgba(168, 230, 207, 0.2);
}



.checkbox-group {
    margin: 20px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: white;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    accent-color: #a8e6cf;
}

.privacy-link {
    color: #a8e6cf;
    text-decoration: underline;
}

.form-submit {
    text-align: center;
    margin-top: 30px;
}

.submit-btn {
    background: #a8e6cf;
    color: #1a1a2e;
    border: none;
    border-radius: 25px;
    padding: 15px 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-btn:hover {
    background: #8fd9b8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(168, 230, 207, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .effects-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .category-ingredients {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .custom-formulation-page {
        padding-top: 60px;
    }

    .page-hero__title {
        font-size: 2rem;
    }

    .effects-title {
        font-size: 2rem;
    }

    .effect-display-title {
        font-size: 2rem;
    }

    .effects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .category-ingredients {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .form-group label {
        min-width: auto;
    }

    .ingredients-container,
    .form-fields {
        padding: 20px;
    }

    .category-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .effects-grid {
        grid-template-columns: 1fr;
    }

    .category-ingredients {
        grid-template-columns: 1fr;
    }

    .effect-label {
        padding: 10px 15px;
        font-size: 0.8rem;
    }

    .ingredients-container,
    .form-fields {
        padding: 15px;
    }

    .category-section {
        padding: 15px;
    }
}

/* 已选择成分显示区域 */
.selected-ingredients-section {
    background: rgba(168, 230, 207, 0.1);
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    border: 1px solid rgba(168, 230, 207, 0.3);
}

.selected-title {
    color: #a8e6cf;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    margin-top: 0;
}

.selected-ingredients-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.selected-ingredient-tag {
    background: #a8e6cf;
    color: #1a1a2e;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeInScale 0.3s ease;
}

.selected-ingredient-tag .remove-btn {
    background: rgba(26, 26, 46, 0.2);
    color: #1a1a2e;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: all 0.2s ease;
}

.selected-ingredient-tag .remove-btn:hover {
    background: rgba(26, 26, 46, 0.4);
    transform: scale(1.1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
