/* 后台管理通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #2c3e50;
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

header h1 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

header h1 a:hover {
    color: #3498db;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-links a {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.nav-links a:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.toolbar {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-group select, .filter-group input {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    background: white;
    transition: border-color 0.3s;
    min-width: 0;
    box-sizing: border-box;
}

.filter-group select:focus, .filter-group input:focus {
    outline: none;
    border-color: #3498db;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #27ae60;
    color: white;
}

.btn-primary:hover {
    background: #229954;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-toggle {
    background: #f39c12;
    color: white;
}

.btn-toggle:hover {
    background: #e67e22;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.dishes-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.dishes-header {
    background: #34495e;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dishes-list {
    max-height: 70vh;
    overflow-y: auto;
}

.dish-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    transition: background 0.3s;
}

.dish-item:hover {
    background: #f8f9fa;
}

.dish-item:last-child {
    border-bottom: none;
}

.dish-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    overflow: hidden;
}

.dish-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dish-icon {
    font-size: 2rem;
}

.dish-info {
    flex: 1;
    margin-right: 20px;
}

.dish-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.dish-description {
    color: #7f8c8d;
    margin-bottom: 8px;
    line-height: 1.4;
}

.dish-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 0.9rem;
}

.dish-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #e74c3c;
    margin-right: 20px;
}

.dish-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 15px;
}

.status-available {
    background: #27ae60;
    color: white;
}

.status-unavailable {
    background: #95a5a6;
    color: white;
}

.dish-actions {
    display: flex;
    gap: 8px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    background: #34495e;
    color: white;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 图片上传相关样式 */
.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-upload-buttons {
    display: flex;
    gap: 10px;
}

.image-preview {
    margin-top: 15px;
    padding: 15px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    text-align: center;
    background: #f8f9fa;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-preview.has-image {
    border-color: #27ae60;
    background: #f0f8f0;
}

.image-preview img {
    max-width: 100%;
    max-height: 100px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-preview-placeholder {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.image-preview-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.image-preview-actions .btn {
    padding: 4px 8px;
    font-size: 0.7rem;
}

.upload-progress {
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.upload-progress-bar {
    height: 100%;
    background: #27ae60;
    transition: width 0.3s ease;
    width: 0%;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px;
    }

    .filter-group {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .filter-group select, .filter-group input {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 14px;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 14px;
    }

    .nav-links {
        flex-direction: column;
        gap: 10px;
    }

    .nav-links a {
        text-align: center;
        padding: 12px 20px;
    }

    .dishes-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .dishes-header .btn {
        width: auto;
        min-width: 120px;
    }

    .dish-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 15px;
    }

    .dish-image {
        margin: 0;
        width: 60px;
        height: 60px;
    }

    .dish-info {
        margin: 0;
    }

    .dish-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .dish-actions .btn {
        width: auto;
        min-width: 80px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .modal-body {
        padding: 20px;
    }

    .image-upload-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .image-upload-buttons .btn {
        width: 100%;
    }
}