/* === Base Styles === */
body {
    font-family: 'Noto Sans SC', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.5;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === Container === */
.op-container {
    width: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === Header === */
.op-header {
    background-color: #34495e;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2c3e50;
}

.op-header h1 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.header-title-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.data-source-note {
    margin: 0;
    font-size: 0.85em;
    color: rgba(255,255,255,0.75);
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-btn {
    text-decoration: none;
    background-color: #5bc0de;
    color: white;
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-right: 10px;
}

.nav-btn:hover {
    background-color: #46b8da;
    transform: translateY(-2px);
}

/* === Main Content === */
.op-main-content {
    padding: 20px;
    flex-grow: 1;
    background-color: #f8f9fa;
}

/* === 套餐定义容器 === */
.mealcat-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    padding: 20px;
}

/* === 页面标题 === */
.page-title {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
}

.page-title h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.8em;
    font-weight: 600;
}

.page-title p {
    margin: 10px 0 0 0;
    color: #7f8c8d;
    font-size: 1em;
}

/* === Three Column Layout === */
.three-column-layout {
    display: flex;
    height: calc(100vh - 80px);
    gap: 0;
    background: #fff;
}

/* 最左侧功能栏 */
.function-sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 24px 16px;
    overflow-y: auto;
    flex-shrink: 0;
}

/* 中间分类栏（宽度缩小一半） */
.category-sidebar {
    width: 120px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
    flex-shrink: 0;
}

/* 最右侧新增栏（与菜品列表等宽） */
.right-sidebar {
    flex: 1;
    background: #f8f9fa;
    border-left: 1px solid #e9ecef;
    padding: 24px 16px;
    overflow-y: auto;
    flex-shrink: 0;
}

.right-sidebar .function-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.right-sidebar .function-card h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #202124;
}

.right-sidebar .function-card p {
    margin: 0 0 12px 0;
    font-size: 12px;
    color: #5f6368;
    line-height: 1.4;
}

.right-sidebar #combo-details,
.right-sidebar #operation-log {
    font-size: 12px;
    color: #5f6368;
    line-height: 1.4;
}

/* 套餐详情样式 */
.combo-details-content {
    padding: 16px;
}

.combo-details-image {
    width: 100%;
    max-width: 200px;
    margin: 0 auto 16px;
    border-radius: 8px;
    overflow: hidden;
}

.combo-details-image img {
    width: 100%;
    height: auto;
    display: block;
}

.combo-details-info h4 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
}

.combo-details-meta {
    margin-bottom: 16px;
}

.combo-details-item {
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.combo-details-item:last-child {
    border-bottom: none;
}

.combo-details-item strong {
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
}

.combo-details-item span {
    color: #1f2937;
    font-size: 14px;
}

.combo-price {
    color: #dc2626 !important;
    font-weight: 600;
    font-size: 18px !important;
}

.combo-details-description {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.combo-details-description strong {
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
}

.combo-details-description p {
    margin: 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* 套餐菜品列表样式 */
.combo-dishes-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.combo-dishes-section strong {
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    display: block;
    margin-bottom: 12px;
}

.combo-dishes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.combo-dish-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.combo-dish-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.combo-dish-image {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7eb;
}

.combo-dish-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.combo-dish-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.combo-dish-category {
    font-size: 12px;
    color: #6b7280;
}

.right-sidebar #combo-details p,
.right-sidebar #operation-log p {
    margin: 0;
    font-style: italic;
    color: #9aa0a6;
}

.category-sidebar .category-item {
    width: 100%;
}

.category-sidebar .h-16 {
    height: 48px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-sidebar .flex {
    display: flex;
}

.category-sidebar .items-center {
    align-items: center;
}

.category-sidebar .justify-center {
    justify-content: center;
}

.category-sidebar .px-1 {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.category-sidebar .border-b {
    border-bottom-width: 1px;
}

.category-sidebar .border-gray-100 {
    border-color: #f7fafc;
}

.category-sidebar .transition-all {
    transition: all 0.3s ease;
}

.category-sidebar .cursor-pointer {
    cursor: pointer;
}

.category-sidebar .text-gray-600 {
    color: #718096;
}

.category-sidebar .text-orange-500 {
    color: #ed8936;
}

.category-sidebar .border-l-4 {
    border-left-width: 4px;
}

.category-sidebar .border-orange-500 {
    border-color: #ed8936;
}

.category-sidebar .bg-white {
    background-color: #fff;
}

.category-sidebar .font-medium {
    font-weight: 500;
}

.category-sidebar .category-item:hover .h-16 {
    background: #f1f3f4;
    color: #202124;
}

.category-sidebar .category-item.active .h-16 {
    background: #fff;
    color: #ed8936;
    border-left-color: #ed8936;
    font-weight: 600;
}

/* 右侧菜品展示栏 */
.content-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #fff;
}

.function-sidebar .function-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.function-sidebar .function-card h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #202124;
}

.function-sidebar .function-card p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #5f6368;
    line-height: 1.4;
}

.function-sidebar .function-btn {
    width: 100%;
    padding: 10px 16px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.function-sidebar .function-btn:hover {
    background: #e55a2b;
}

/* 团餐社餐标签容器样式 */
.group-meal-tabs {
    margin-bottom: 15px;
    background: #ffffff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

/* 餐次标签容器样式 */
.meal-time-tabs {
    margin-bottom: 20px;
    background: #ffffff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.tab-container {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background: #f8f9fa;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    outline: none;
}

.tab-btn:hover {
    border-color: #3b82f6;
    background: #f0f7ff;
    color: #3b82f6;
    transform: translateY(-1px);
}

.tab-btn.active {
    border-color: #10b981;
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.tab-btn.active:hover {
    border-color: #059669;
    background: #059669;
    color: #ffffff;
    transform: translateY(-1px);
}

/* 早餐标签特殊样式 */
.breakfast-tab {
    border-color: #f59e0b;
}

.breakfast-tab:hover {
    border-color: #d97706;
    background: #fffbeb;
    color: #d97706;
}

.breakfast-tab.active {
    border-color: #f59e0b;
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.breakfast-tab.active:hover {
    border-color: #d97706;
    background: #d97706;
}

/* 午餐标签特殊样式 */
.lunch-tab {
    border-color: #10b981;
}

.lunch-tab:hover {
    border-color: #059669;
    background: #ecfdf5;
    color: #059669;
}

.lunch-tab.active {
    border-color: #10b981;
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.lunch-tab.active:hover {
    border-color: #059669;
    background: #059669;
}

/* 晚餐标签特殊样式 */
.dinner-tab {
    border-color: #ef4444;
}

.dinner-tab:hover {
    border-color: #dc2626;
    background: #fef2f2;
    color: #dc2626;
}

.dinner-tab.active {
    border-color: #ef4444;
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.dinner-tab.active:hover {
    border-color: #dc2626;
    background: #dc2626;
}

/* 团餐标签样式 */
.group-meal-tab {
    border: 2px solid #3b82f6;
    background: #ffffff;
    color: #3b82f6;
}

.group-meal-tab:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

.group-meal-tab.active {
    border-color: #3b82f6;
    background: #3b82f6;
    color: #ffffff;
}

.group-meal-tab.active:hover {
    border-color: #2563eb;
    background: #2563eb;
}

/* 社餐标签样式 */
.social-meal-tab {
    border: 2px solid #8b5cf6;
    background: #ffffff;
    color: #8b5cf6;
}

.social-meal-tab:hover {
    border-color: #7c3aed;
    background: #f5f3ff;
    color: #7c3aed;
}

.social-meal-tab.active {
    border-color: #8b5cf6;
    background: #8b5cf6;
    color: #ffffff;
}

.social-meal-tab.active:hover {
    border-color: #7c3aed;
    background: #7c3aed;
}

/* 餐次类型信息样式 */
.meal-type-info {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    border: 1px solid #e1e5e9;
}

/* === 菜品卡片布局 === */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.item-card {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: #d0d7de;
}

/* 套餐卡片选中状态 */
.item-card.combo-card.selected {
    border: 3px solid #3498db !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3) !important;
    transform: translateY(-2px);
}

.item-card.combo-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.item-card.combo-card:hover {
    border-color: #3498db;
}

.item-card-content {
    display: flex;
    height: 96px;
}

.item-card-image {
    flex: 0 0 96px;
    height: 96px;
    overflow: hidden;
    position: relative;
}

.item-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-card:hover .item-card-image img {
    transform: scale(1.05);
}

.item-card-info {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.item-card-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    flex: 1;
    padding-right: 8px;
}

.item-card-header .price {
    font-size: 18px;
    font-weight: 700;
    color: #dc2626;
    white-space: nowrap;
}

.item-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.item-card-body .item-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.item-card-body .category {
    font-size: 14px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    align-self: flex-start;
}

.item-card-body .item-id {
    font-size: 12px;
    color: #9ca3af;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    align-self: flex-start;
}

.item-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.item-card-actions .action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.item-card-actions .edit-btn {
    background: #3b82f6;
    color: white;
}

.item-card-actions .edit-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.item-card-actions .delete-btn {
    background: #ef4444;
    color: white;
}

.item-card-actions .delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.item-card-description {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.5;
    margin-top: 4px;
    font-style: italic;
}

/* === 按钮样式 === */
.btn-primary {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-success:hover {
    background-color: #219a52;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-warning:hover {
    background-color: #e67e22;
}

/* === 响应式设计 === */
@media (max-width: 768px) {
    .function-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .meal-grid {
        grid-template-columns: 1fr;
    }
    
    .op-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
}

/* === 加载状态 === */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.loading::after {
    content: "...";
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 33% { content: "."; }
    34%, 66% { content: ".."; }
    67%, 100% { content: "..."; }
}