* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.history-button {
    background-color: #2196F3;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

h1, h2, h3 {
    color: #333;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* 必选原料区域 */
.required-ingredients {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.input-group label {
    width: 150px;
    font-weight: bold;
}

.input-group input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* 可选原料区域 */
.optional-ingredients {
    margin-bottom: 30px;
}

.ingredient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.ingredient-item {
    background-color: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ingredient-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    cursor: pointer;
}

.ingredient-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.ingredient-item input[type="number"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100px;
}

.ingredient-item input[type="number"]:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.water-content {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

/* 按钮样式 */
button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

button.secondary {
    background-color: #2196F3;
}

button.secondary:hover {
    background-color: #1976D2;
}

/* 结果显示区域 */
.results {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.recipe-table {
    background-color: white;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.result-item {
    margin: 10px 0;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.section-title {
    font-weight: bold;
    color: #2c3e50;
    margin-top: 15px;
    border-bottom: 2px solid #eee;
}

/* 底部按钮区域 */
.bottom-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    z-index: 1000;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #000;
}

/* 配方卡片样式 */
.recipe-card {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.recipe-card h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.recipe-card .date {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.recipe-card .actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.recipe-card .actions button {
    flex: 1;
    padding: 8px;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .ingredient-grid {
        grid-template-columns: 1fr;
    }

    .input-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-group label {
        width: 100%;
        margin-bottom: 5px;
    }

    .recipe-card {
        padding: 15px;
    }

    .recipe-card .actions {
        flex-direction: column;
    }

    .recipe-card .actions button {
        width: 100%;
    }
}

/* 在已有样式基础上添加 */
.liquid-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.liquid-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100px;
}

#liquid-unit {
    min-width: 20px;
}

/* 按钮组样式 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.action-buttons button {
    margin: 0;
}

/* 配方列表样式 */
.recipes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.recipe-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.recipe-card h4 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.2em;
}

.recipe-card .date {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.recipe-card .actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.recipe-card .actions button {
    flex: 1;
    padding: 8px;
    font-size: 14px;
    margin: 0;
    max-width: none;
}

.recipe-card .actions button:first-child {
    background-color: #4CAF50;
}

.recipe-card .actions button:last-child {
    background-color: #f44336;
}

.recipe-card .actions button:first-child:hover {
    background-color: #45a049;
}

.recipe-card .actions button:last-child:hover {
    background-color: #d32f2f;
}

/* 评论区样式 */
.comments-section {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.comment {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.comment .author {
    font-weight: bold;
    color: #2c3e50;
}

.comment .date {
    font-size: 0.8em;
    color: #666;
}

.ingredients-section {
    margin: 10px 0;
    padding: 5px 0;
}

.ingredients-section strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

.ingredients-section div {
    padding-left: 15px;
    color: #555;
    margin: 3px 0;
}
