/* ========================================
   公共样式文件 - 正直美好菜谱系统
   ======================================== */

/* CSS变量 */
:root {
    --breakfast-color: #d4a017;
    --lunch-color: #4682b4;
    --dinner-color: #2e8b57;
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --gray-color: #95a5a6;
    --border-radius: 10px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* 基础样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Heiti SC", sans-serif;
    background: #fdfdfd;
    color: #333;
    line-height: 1.6;
}

/* ========================================
   日期选择器样式
   ======================================== */
.date-tag {
    cursor: pointer;
    padding: 8px 15px;
    background: #f8f8f8;
    border: 2px solid #e67e22;
    border-radius: 8px;
    color: #e67e22;
    font-weight: bold;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}
.date-tag:hover { background: #fff3e0; }
.calendar-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    padding: 20px;
    z-index: 1000;
    margin-top: 10px;
    width: 320px;
    max-width: calc(100vw - 40px);
}
.calendar-popup.show { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.calendar-header button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    color: #666;
}
.calendar-header button:hover { color: #e67e22; }
.calendar-title { font-weight: bold; font-size: 16px; }
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}
.calendar-weekday {
    font-size: 12px;
    color: #999;
    padding: 5px 0;
}
.calendar-day {
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.calendar-day:hover { background: #f0f0f0; }
.calendar-day.other-month { color: #ccc; }
.calendar-day.empty-cell { visibility: hidden; pointer-events: none; }
.calendar-day.selected { background: #e67e22; color: white; border-radius: 6px; }
.calendar-day.today { border: 2px solid #e67e22; font-weight: bold; }
.calendar-day.today.selected {
    background: #e67e22;
    color: white;
    border-color: #e67e22;
    border-radius: 6px;
}
.quick-today {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.quick-today-btn {
    background: #e67e22;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}
.quick-today-btn:hover {
    background: #d35400;
    transform: scale(1.05);
}
.quick-today-btn.nav-btn {
    background: #3498db;
    padding: 10px 15px;
    font-size: 12px;
}
.quick-today-btn.nav-btn:hover {
    background: #2980b9;
}

/* ========================================
   菜谱三栏布局样式
   ======================================== */
.menu-grid { display: flex; gap: 20px; }
.column {
    flex: 1;
    border: 2px solid #ddd;
    border-radius: 15px;
    padding: 20px;
    min-height: 500px;
}
.col-breakfast { border-color: var(--breakfast-color); }
.col-lunch { border-color: var(--lunch-color); }
.col-dinner { border-color: var(--dinner-color); }

/* 南区北门晚餐布局调整 */
.dinner-section .menu-grid .column:nth-child(1) { flex: 2; } /* 晚餐占2/3 */
.dinner-section .menu-grid .column:nth-child(2) { flex: 1; } /* 面食占1/3 */

/* 南区北门晚餐两列布局 */
.dinner-section-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.column h2 {
    text-align: center;
    font-size: 28px;
    margin-top: 0;
}
.col-breakfast h2 { color: var(--breakfast-color); }
.col-lunch h2 { color: var(--lunch-color); }
.col-dinner h2 { color: var(--dinner-color); }
.meal-subtitle {
    text-align: center;
    color: #ccc;
    margin: 0;
    font-size: 12px;
}

/* 分类标题 */
.section-title {
    font-weight: bold;
    margin: 15px 0 10px;
    display: flex;
    align-items: center;
}
.section-title::before { content: "●"; margin-right: 8px; }

/* 菜品项 */
.item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    align-items: flex-end;
}
.item-name { flex-shrink: 0; }
.item-dots {
    flex-grow: 1;
    border-bottom: 2px dotted #ccc;
    margin: 0 5px;
    height: 1.2em;
}
.item-price { flex-shrink: 0; }

/* 空状态 */
.empty-menu {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 16px;
}
.empty-menu i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
    color: #ddd;
}

/* ========================================
   头部样式
   ======================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}
.site-logo {
    max-width: 260px;
    height: auto;
    display: block;
}
.brand { font-size: 24px; font-weight: bold; color: var(--breakfast-color); }
.title { font-size: 48px; text-align: center; flex-grow: 1; letter-spacing: 10px; }
.times { font-size: 14px; text-align: right; min-width: 150px; position: relative; }

/* ========================================
   管理入口按钮
   ======================================== */
.admin-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.6);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s;
    z-index: 100;
}
.admin-link:hover {
    background: #e67e22;
    transform: scale(1.1);
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 992px) {
    .menu-grid { flex-direction: column; }
    .column { min-height: auto; }
}
@media (max-width: 768px) {
    body { padding: 10px; }
    .container { padding: 15px; }
    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .brand { font-size: 18px; order: 1; }
    .site-logo { max-width: 200px; order: 1; }
    .title {
        font-size: 28px;
        letter-spacing: 5px;
        order: 2;
        margin: 10px 0;
    }
    .times {
        font-size: 12px;
        text-align: center;
        order: 3;
        min-width: auto;
    }
    .date-tag { display: block; margin-top: 5px; font-size: 16px; padding: 6px 12px; }
    .column { min-height: auto; padding: 15px; }
    .column h2 { font-size: 22px; }
    .item { font-size: 14px; }
    .calendar-popup { width: calc(100vw - 40px); max-width: 300px; }
    .calendar-popup.show { transform: translateX(-50%); }
}
@media (max-width: 480px) {
    .title { font-size: 24px; letter-spacing: 3px; }
    .brand { font-size: 16px; }
    .site-logo { max-width: 160px; }
    .times { font-size: 11px; }
    .date-tag { font-size: 14px; padding: 6px 10px; }
}
