/* 家庭菜单管理系统 - 主样式文件 */

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

body {
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h1 {
    color: #333;
    margin-bottom: 8px;
    font-size: 28px;
    font-weight: 600;
}

.login-card .subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    min-width: auto;
}

.btn-block {
    width: 100%;
    display: block;
}

/* 头部导航 */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar .brand {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

.navbar .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar .user-name {
    color: #555;
    font-weight: 500;
}

/* 网格布局 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    padding: 0 10px;
    flex: 1;
}

/* 基础网格类 */
.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 10px;
}

.col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 10px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 10px;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 10px;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 10px;
}

.col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 10px;
}

.col-md-2 {
    flex: 0 0 calc(100% / 6);
    max-width: calc(100% / 6);
    padding: 0 10px;
}

.col-sm-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 10px;
}

.col-md-1 {
    flex: 0 0 calc(100% / 12);
    max-width: calc(100% / 12);
    padding: 0 10px;
}

/* 菜品卡片 */
.dish-card {
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.dish-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.dish-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.dish-card .dish-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.dish-card .dish-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.dish-card .dish-category {
    display: inline-block;
    background: #f0f0f0;
    color: #555;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 12px;
}

.dish-card .dish-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-confirmed {
    background: #d1edff;
    color: #004085;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* 筛选器 */
.filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filters .row {
    align-items: end;
}

.filters .form-group {
    margin-bottom: 0;
}

/* 订单表单 */
.order-form {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.order-form h3 {
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: #666;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover {
    background: #f0f0f0;
    color: #666;
}

/* 响应式设计 */
/* 大屏幕到平板的过渡 (≤ 991px) */
@media (max-width: 991px) {
    .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* 平板及手机 (≤ 768px) */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .navbar {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .col-md-6,
    .col-md-4,
    .col-md-3,
    .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .row {
        margin: 0;
    }
    
    .col {
        padding: 0;
        margin-bottom: 16px;
    }
    
    .login-card {
        padding: 30px 24px;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
    
    .dish-card {
        padding: 16px;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .filters .row {
        flex-direction: column;
        gap: 16px;
    }
    
    .filters .col {
        margin-bottom: 0;
    }
}

/* 极小屏幕 (≤ 576px) - 数据概览每行显示1个 */
@media (max-width: 576px) {
    .col-6,
    .col-sm-6,
    .col-md-6,
    .col-md-4,
    .col-md-3,
    .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .dish-card .dish-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    .navbar .user-info {
        flex-direction: column;
        gap: 8px;
    }
}

/* 加载动画 */
.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
}

.loading.show {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-2 { gap: 16px; }

/* 竖向排版样式 */
.vertical-date, .vertical-meal {
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    text-align: center;
    vertical-align: middle;
}

.vertical-date div, .vertical-meal div {
    min-height: 40px;
}

/* 订单操作按钮组 */
.order-action-buttons {
    display: flex;
    gap: 5px; /* 按钮之间的间距 */
    flex-wrap: nowrap; /* 默认不换行 */
}

@media (max-width: 480px) {
    .order-action-buttons {
        flex-direction: column; /* 窄屏幕下堆叠 */
    }
    .order-action-buttons .btn {
        width: 100%;
        margin-bottom: 5px; /* 堆叠时的间距 */
    }
    .order-action-buttons .btn:last-child {
        margin-bottom: 0;
    }
}

.order-actions-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.order-actions-cell .btn {
    flex-shrink: 0;
    padding: 6px;
    line-height: 1;
}

.order-actions-cell .status-select {
    width: auto;
    flex-grow: 1;
    min-width: 80px;
}

/* 批量上传相关样式 */
.upload-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 20px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #dee2e6;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background-color: #007bff;
    color: white;
}

.step.completed .step-number {
    background-color: #28a745;
    color: white;
}

.step-text {
    font-size: 14px;
    text-align: left;
}

.step.active .step-text {
    color: #007bff;
    font-weight: 500;
}

.step.completed .step-text {
    color: #28a745;
    font-weight: 500;
}

.upload-step {
    min-height: 300px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .upload-steps {
        flex-direction: column;
        gap: 15px;
    }
    
    .step {
        flex-direction: row;
        margin: 0;
        gap: 10px;
    }
    
    .step-number {
        width: 30px;
        height: 30px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .step-text {
        font-size: 14px;
        text-align: left;
    }
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 12px;
    margin-right: 8px;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

/* 加载动画 */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
    border-width: 1px;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* 详情展开样式 */
details {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px;
    margin: 8px 0;
}

details[open] {
    padding-bottom: 12px;
}

details summary {
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    outline: none;
    user-select: none;
}

details summary:hover {
    color: #007bff;
}

/* ===== 移动端响应式优化 (新增) ===== */

/* 数据概览和订单统计模块在窄屏幕的优化 */
@media (max-width: 576px) {
    /* 缩小数据概览模块的字体，让窄屏一行显示2个指标 */
    #statsContainer .col-6 h2,
    #statsContainer .col-md-3 h2 {
        font-size: 1.5rem !important;
        margin-bottom: 4px !important;
    }
    
    #statsContainer .col-6 p,
    #statsContainer .col-md-3 p {
        font-size: 12px !important;
        margin-bottom: 0 !important;
    }
    
    /* 确保每行显示2个指标 */
    #statsContainer .col-md-3 {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding: 8px !important;
    }
}

/* 订单页面筛选控件在窄屏幕的换行优化 */
@media (max-width: 768px) {
    .filter-controls-mobile {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }
    
    .filter-controls-mobile > div {
        flex-direction: column !important;
        gap: 8px !important;
        align-items: stretch !important;
    }
    
    .filter-controls-mobile .form-control {
        width: 100% !important;
        max-width: none !important;
    }
    
    .filter-controls-mobile label {
        margin-bottom: 4px !important;
        font-size: 14px !important;
    }
}

/* 菜品管理表格在窄屏幕的优化 */
@media (max-width: 768px) {
    .dish-description-mobile {
        display: none !important;
    }
    
    .dish-description-detail-btn {
        color: #007bff !important;
        text-decoration: underline !important;
        cursor: pointer !important;
        font-size: 14px !important;
        background: none !important;
        border: none !important;
        padding: 0 !important;
    }
    
    .dish-description-detail-btn:hover {
        color: #0056b3 !important;
    }
}

/* 描述详情弹窗样式 */
.description-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 2000 !important;
}

.description-modal-content {
    background: white !important;
    border-radius: 12px !important;
    padding: 20px !important;
    max-width: 90% !important;
    max-height: 80% !important;
    overflow-y: auto !important;
    position: relative !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

.description-modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 16px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid #eee !important;
}

.description-modal-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.description-modal-close {
    background: none !important;
    border: none !important;
    font-size: 24px !important;
    cursor: pointer !important;
    color: #666 !important;
    padding: 0 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: background-color 0.3s ease !important;
}

.description-modal-close:hover {
    background-color: #f0f0f0 !important;
    color: #333 !important;
}

.description-modal-body {
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #333 !important;
} 