/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2c3e50;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #f5f5f5;
    --dark-color: #333;
    --gray-color: #7f8c8d;
    --border-color: #eee;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

header h1 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 2rem;
}

header p {
    color: var(--gray-color);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: var(--primary-dark);
}

.btn.secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn.secondary:hover {
    background-color: #1a252f;
}

.btn.success {
    background-color: var(--success-color);
    color: white;
}

.btn.success:hover {
    background-color: #27ae60;
}

/* 区块样式 */
.section {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.section h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 食材列表样式 */
.ingredients-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.category {
    flex: 1;
    min-width: 200px;
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 18px;
}

.category ul {
    list-style-type: none;
}

.category li {
    padding: 5px 0;
    border-bottom: 1px dashed var(--border-color);
}

/* 生产量设置样式 */
.production-inputs {
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
}

.production-inputs h3 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.production-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.production-item {
    display: flex;
    align-items: center;
}

.production-item label {
    width: 60px;
    font-weight: 500;
}

.production-item input {
    width: 70px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 10px;
}

/* 采购计划样式 */
.purchase-plan {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.plan-category {
    flex: 1;
    min-width: 250px;
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.plan-category h4 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 18px;
}

.plan-category table {
    width: 100%;
    border-collapse: collapse;
}

.plan-category th, .plan-category td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.plan-category input[type="number"] {
    width: 70px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 菜谱样式 */
.recipes-container {
    margin-bottom: 20px;
}

.day-recipe {
    margin-bottom: 20px;
}

.day-recipe h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 20px;
}

.recipe-card {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.recipe-header {
    margin-bottom: 15px;
}

.recipe-header h4 {
    color: var(--secondary-color);
    font-size: 18px;
}

.recipe-nutrition {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #ecf0f1;
    border-radius: 6px;
}

.nutrition-item {
    flex: 1;
    min-width: 100px;
    text-align: center;
}

.nutrition-item .label {
    display: block;
    font-weight: 500;
    color: var(--gray-color);
    font-size: 14px;
}

.nutrition-item .value {
    display: block;
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 16px;
}

.recipe-ingredients {
    margin-bottom: 20px;
}

.recipe-ingredients h5, .recipe-layout h5, .recipe-workflow h5 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 16px;
}

.recipe-ingredients ul {
    list-style-type: none;
}

.recipe-ingredients li {
    padding: 5px 0;
    border-bottom: 1px dashed var(--border-color);
}

/* 盒装图示样式 */
.box-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
    margin-bottom: 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    background-color: #fff;
}

.box-section {
    padding: 10px;
    border-radius: 4px;
}

.box-section h4 {
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.box-section.rice {
    background-color: #f9e7bb;
    grid-column: 1;
    grid-row: 1;
}

.box-section.protein {
    background-color: #f5cba7;
    grid-column: 2;
    grid-row: 1;
}

.box-section.vegetables {
    background-color: #abebc6;
    grid-column: 1 / span 2;
    grid-row: 2;
}

.box-section.dressing {
    background-color: #d5f5e3;
    grid-column: 1 / span 2;
    grid-row: 3;
}

.ingredient {
    display: inline-block;
    margin: 2px;
    padding: 3px 6px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 3px;
    font-size: 12px;
}

.ingredient.base {
    background-color: #d4efdf;
}

.ingredient.garnish {
    background-color: #ebdef0;
}

/* 摆盒提示样式 */
.box-layout {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.plating-tips {
    margin-bottom: 20px;
}

.tip-header {
    font-size: 18px;
    color: #e74c3c;
    text-align: center;
    margin-bottom: 15px;
    font-weight: bold;
}

.tips-list {
    padding-left: 20px;
}

.tips-list li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.tip-highlight {
    color: #e74c3c;
    font-weight: bold;
}

.section-header {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.section-tip {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fff;
    border-radius: 5px;
    border-left: 3px solid #3498db;
}

.section-tip h4 {
    color: #3498db;
    margin-top: 0;
    margin-bottom: 5px;
}

.section-tip p {
    margin: 0;
    color: #555;
}

.final-tip {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background-color: #f1c40f;
    color: #333;
    border-radius: 5px;
}

.final-tip p {
    margin: 0;
}

/* 工作流程样式 */
.workflow-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.workflow-stage {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
}

.workflow-stage h6 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 16px;
}

.tasks {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.task-card {
    flex: 1;
    min-width: 200px;
    background-color: #fff;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.task-card h6 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 14px;
}

.task-details p {
    font-size: 13px;
    margin-bottom: 3px;
}

/* 标签页样式 */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.tab-btn {
    padding: 8px 15px;
    background-color: #f1f1f1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    background-color: #e1e1e1;
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--gray-color);
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 20px;
    color: var(--gray-color);
    font-size: 14px;
}

/* 成功消息提示 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 计划操作区域 */
.plan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

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

.form-group input[type="text"],
.form-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
}

/* 菜谱网格布局 */
.recipes-grid {
    display: grid;
    gap: 15px;
}

/* 移动端一行显示2个 */
@media (max-width: 768px) {
    .recipes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tab-content {
        grid-column: span 2;
    }
    
    .tab-content.active {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .day-recipe {
        margin-bottom: 15px;
    }
}

/* PC端一行显示7个 */
@media (min-width: 769px) {
    .recipes-grid {
        grid-template-columns: repeat(7, 1fr);
    }
    
    .tab-content {
        grid-column: span 7;
    }
    
    .tab-content.active {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 15px;
    }
}

/* 可折叠内容样式 */
.collapsible-header {
    cursor: pointer;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
    margin-bottom: 0;
    position: relative;
    transition: background-color 0.3s;
}

.collapsible-header:hover {
    background-color: #e9e9e9;
}

.toggle-icon {
    position: absolute;
    right: 15px;
    transition: transform 0.3s;
}

.collapsible-header.active .toggle-icon {
    transform: rotate(45deg);
}

.collapsible-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.collapsible-content.active {
    padding: 15px;
    max-height: 1000px;
}

/* 更紧凑的卡片样式 */
.recipe-card {
    padding: 10px;
    margin-bottom: 0;
}

.recipe-header h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.recipe-nutrition {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.nutrition-item {
    font-size: 0.9em;
}

.recipe-ingredients ul {
    margin: 5px 0;
    padding-left: 20px;
}

.recipe-ingredients li {
    margin-bottom: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .production-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .plan-category {
        min-width: 100%;
    }
    
    .nutrition-item {
        min-width: 80px;
    }
    
    .box-layout {
        grid-template-columns: 1fr;
    }
    
    .box-section.rice,
    .box-section.protein,
    .box-section.vegetables,
    .box-section.dressing {
        grid-column: 1;
    }
    
    .box-section.rice {
        grid-row: 1;
    }
    
    .box-section.protein {
        grid-row: 2;
    }
    
    .box-section.vegetables {
        grid-row: 3;
    }
    
    .box-section.dressing {
        grid-row: 4;
    }
    
    .plan-actions {
        flex-direction: column;
    }
    
    .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group input[type="text"],
    .form-group select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        text-align: center;
    }
    
    .production-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .production-item input {
        width: 100%;
        margin: 5px 0;
    }
}
