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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
}

/* 头部样式 */
header {
    background-color: #333;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.data-source {
    font-size: 0.8rem;
    color: #ccc;
    margin-left: 1rem;
    font-weight: normal;
}

.tab-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}

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

/* 分栏容器 */
.split-container {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 1rem;
    display: flex;
    gap: 1rem;
    width: 100%;
}

/* 左侧面板 */
.left-panel {
    width: 75%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
}

/* 右侧面板 */
.right-panel {
    width: 25%;
    padding: 1rem;
    background-color: #f8f9fa;
    overflow-y: auto;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 面板标题样式 */
.panel-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* 选中菜品信息样式 */
.selected-dish-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.selected-dish-info h3 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 16px;
}

.selected-dish-info p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

/* 日历样式 */
.calendar-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 月份标签BLOCK样式 */
.month-tabs-block {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    margin-bottom: 15px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* 月份标签样式 */
.month-tab {
    padding: 5px 8px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 月份标签悬停效果 */
.month-tab:hover {
    background-color: #f0f0f0;
    border-color: #999;
    color: #333;
}

/* 月份标签活跃状态 */
.month-tab.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
    font-weight: 600;
}

/* 有出品的月份标签 - 红色勾边框样式 */
.month-tab.has-dish-month {
    position: relative;
    border: 2px solid #ff4444;
    border-radius: 4px;
}

.month-tab.has-dish-month::after {
    content: '✓';
    position: absolute;
    right: 2px;
    top: -8px;
    color: #ff4444;
    font-size: 14px;
    font-weight: bold;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.calendar-nav-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.calendar-nav-btn:hover {
    background-color: #45a049;
}

.month-year-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #ddd;
    margin-bottom: 1px;
}

.calendar-weekday {
    background-color: #f5f5f5;
    padding: 0.5rem;
    text-align: center;
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    width: 100%;
}

.calendar-day {
    background-color: white;
    padding: 0.2rem;
    text-align: center;
    min-height: 0;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.calendar-day:hover {
    background-color: #f0f0f0;
}

.calendar-day.empty {
    background-color: #f5f5f5;
    cursor: default;
}

.calendar-day.today {
    background-color: #e3f2fd;
    font-weight: bold;
    border: 2px solid #2196F3;
}

.calendar-day.selected {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    border: 2px solid #007bff;
}

/* 有菜品的日期 */
.calendar-day.has-dish {
    position: relative;
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

/* 当天且有菜品的样式 */
.calendar-day.today.has-dish {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    border: 2px solid #0056b3;
}

/* 列表头部 */
.list-header {
    margin-bottom: 1rem;
}

.list-header h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #333;
}

/* 标签栏 */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.tab.active {
    background: #4CAF50;
    color: white;
}

/* 搜索栏 */
.search-bar {
    margin-bottom: 1rem;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
}

.search-input-group input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-input-group button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.search-input-group button:hover {
    background-color: #45a049;
}

/* 表格样式 */
.menu-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.menu-table th,
.menu-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.menu-table th {
    background-color: #f9f9f9;
    font-weight: 600;
    color: #333;
}

.menu-table tr:hover {
    background-color: #f5f5f5;
}

.menu-table tr.selected {
    background-color: #e8f5e9;
    outline: 2px solid #4CAF50;
    outline-offset: -2px;
}

/* 分页样式 */
.pagination {
    margin-top: 1rem;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pagination button {
    padding: 6px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button:hover {
    background: #e0e0e0;
}

.pagination button:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.pagination button.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.pagination span {
    color: #666;
}

.pagination select {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.pagination select:hover {
    border-color: #999;
}

/* 状态提示 */
#status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem;
    border-radius: 4px;
    z-index: 1000;
    display: none;
}

#status.error {
    background-color: #f44336;
    color: white;
}

#status.success {
    background-color: #4CAF50;
    color: white;
}

#status.info {
    background-color: #2196F3;
    color: white;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .split-container {
        flex-direction: column;
    }
    
    .left-panel,
    .right-panel {
        width: 100%;
    }
}

/* 按钮样式 */
.btn-primary {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

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