* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
    --dark-color: #2d3436;
    --light-color: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    color: var(--dark-color);
}

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

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 100%;
    animation: slideIn 0.5s;
}

.login-box h1 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.login-box h2 {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 30px;
    color: var(--dark-color);
}

.btn-block {
    width: 100%;
    margin-top: 10px;
}

.login-hint {
    margin-top: 20px;
    padding: 15px;
    background: var(--light-color);
    border-radius: 10px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

.login-hint p {
    margin: 5px 0;
}

.login-hint code {
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--primary-color);
    font-weight: bold;
}

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

/* 头部 */
.admin-header {
    background: white;
    padding: 20px 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    border-radius: 16px 16px 0 0;
}

.admin-header h1 {
    font-size: 1.8em;
    color: var(--primary-color);
}

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

.back-btn {
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    line-height: 1.5;
    font-weight: 500;
}

.back-btn:hover {
    background: #3db8af;
    transform: translateY(-2px);
}

/* 主要内容 */
.admin-content {
    background: white;
    border-radius: 0 0 16px 16px;
    padding: 0;
    box-shadow: var(--shadow);
    min-height: 500px;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0;
    padding: 20px 30px 0 30px;
    background: white;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    position: relative;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: bold;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* 区块头部 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.5em;
    color: var(--dark-color);
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #3db8af;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
}

/* 菜品列表 */
.menu-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.menu-category-group {
    /* Container for a title + grid */
}

.menu-category-title {
    font-size: 1.4em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-list-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.menu-card {
    background: var(--light-color);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.menu-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.menu-card-header {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.menu-card-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    flex-shrink: 0;
}

.menu-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.menu-card-info {
    flex: 1;
}

.menu-card-name {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
}

.menu-card-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

.menu-card-price {
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: bold;
    margin: 10px 0;
}

.menu-card-desc {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
    line-height: 1.4;
}

.menu-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 分类列表 */
.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.category-card {
    background: var(--light-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.category-card:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow);
}

.category-emoji {
    font-size: 3em;
    margin-bottom: 10px;
}

.category-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
}

.category-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

/* 设置区块 */
.settings-section {
    background: var(--light-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.settings-section h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.help-text {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    line-height: 1.5;
}

.help-text a {
    color: var(--secondary-color);
}

.data-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.required {
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

.image-input-group {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.image-input-group .form-control {
    flex: 1;
}

.image-preview {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-size: 2.5em;
    flex-shrink: 0;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.preview-placeholder {
    color: #ccc;
    font-size: 0.4em;
}

.color-picker-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.color-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bg-options {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* 节假日管理 */
.holidays-list {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.holiday-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.holiday-card:hover {
    box-shadow: var(--shadow-lg);
}

.holiday-card.disabled {
    opacity: 0.6;
}

.holiday-info {
    flex: 1;
}

.holiday-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.holiday-icon-large {
    font-size: 1.8em;
}

.holiday-name {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.recurring-badge, .manual-badge {
    color: white;
    font-size: 0.7em;
    padding: 3px 8px;
    border-radius: 10px;
    vertical-align: middle;
    font-weight: 600;
}

.recurring-badge {
    background-color: #007bff;
}

.manual-badge {
    background-color: #28a745; /* Green color for manual items */
}

@media (max-width: 768px) {
    .upstash-help-content strong {
        white-space: normal !important;
    }
}
@media (max-width: 768px) {
    .upstash-help-content strong {
        white-space: normal !important;
    }
}

.holiday-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

.holiday-status.active {
    background: #d4edda;
    color: #155724;
}

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

.holiday-message-preview {
    color: #666;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.holiday-dates {
    color: #999;
    font-size: 0.9em;
}

.holiday-actions {
    display: flex;
    gap: 10px;
}

.color-picker {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}

.color-text {
    flex: 1;
    font-family: 'Courier New', monospace;
}

.icon-preview {
    margin-top: 15px;
    padding: 15px;
    background: var(--light-color);
    border-radius: 8px;
}

.icon-preview label {
    margin-bottom: 8px;
}

.preview-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    min-height: 60px;
    padding: 10px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 2em;
}

.preview-box img {
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
}

/* 订单历史 */
.orders-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--light-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid var(--border-color);
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-card {
    background: var(--light-color);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.order-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.order-id {
    font-weight: bold;
    color: var(--primary-color);
}

.order-time {
    color: #666;
    font-size: 0.9em;
}

.order-items {
    margin-bottom: 15px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #e0e0e0;
}

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

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.order-total {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
}

.order-actions {
    display: flex;
    gap: 10px;
}

.empty-orders {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-orders p:first-child {
    font-size: 4em;
    margin-bottom: 20px;
}

/* 热门菜品统计 */
.popular-dishes {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dish-stat {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.dish-stat:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateX(5px);
}

.dish-rank {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.dish-rank.top1 {
    color: #FFD700;
}

.dish-rank.top2 {
    color: #C0C0C0;
}

.dish-rank.top3 {
    color: #CD7F32;
}

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

.dish-name {
    font-weight: bold;
    font-size: 1.1em;
}

.dish-bar-container {
    position: relative;
    width: 100%;
    height: 30px;
    background: var(--light-color);
    border-radius: 15px;
    overflow: hidden;
}

.dish-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    transition: width 0.5s ease;
}

.dish-count {
    color: #666;
    font-size: 0.9em;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1);
    border: 1px solid #ccc;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* 针对自定义 Alert/Confirm 模态框的特定样式 - 可爱风格 */
#customModal .modal-content {
    max-width: 320px;
    width: 85%;
    text-align: center;
    padding: 24px;
    overflow-y: visible;
    border-radius: 24px; /* 更圆润的角 */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#customModal .modal-header {
    padding: 0;
    border-bottom: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

#customModal h2, #customModal h3 {
    color: var(--dark-color);
    margin: 0;
    font-size: 1.4em;
    font-weight: bold;
}

#customModal .modal-body {
    padding: 0;
    color: #666;
    font-size: 1.05em;
    line-height: 1.6;
    white-space: pre-wrap;
}

#customModal p {
    margin: 0;
}

#customModal .modal-footer {
    padding: 0;
    border-top: none;
    display: flex;
    justify-content: center;
    gap: 12px; /* 按钮间距 */
    margin-top: 10px;
}

#customModal .modal-footer button {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 12px 0;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

#customModal .modal-footer button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

#customModal .modal-footer button:active {
    transform: scale(0.95);
}

#customModal .modal-footer button.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

#customModal .modal-footer button.btn-primary:hover {
    background: #ff5252;
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4);
}

#customModal .modal-footer button.btn-secondary {
    background: #f0f2f5;
    color: #666;
}

#customModal .modal-footer button.btn-secondary:hover {
    background: #e4e6eb;
}

/* 通用模态框样式 (用于其他非Alert弹窗) */
.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.3em;
    color: var(--dark-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 响应式 */
@media (max-width: 768px) {
    .admin-container {
        margin: 10px auto;
        padding: 0 10px;
    }

    .admin-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
        border-radius: 12px 12px 0 0;
    }

    .admin-content {
        padding: 0;
        border-radius: 0 0 12px 12px;
    }
    
    .tabs {
        padding: 15px 15px 0 15px;
    }
    
    .tab-content {
        padding: 20px 15px;
    }

    .menu-list {
        grid-template-columns: 1fr;
    }

    .category-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .tabs {
        overflow-x: auto;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .data-actions {
        flex-direction: column;
    }

    .data-actions .btn {
        width: 100%;
    }

    .image-input-group {
        flex-direction: column;
    }
}

/* ==================== 评价管理样式 ==================== */

/* 评价统计卡片 */
.ratings-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* 菜品评价列表 */
.dish-ratings-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
}

.dish-rating-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.dish-rating-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.dish-rating-info {
    display: flex;
    gap: 12px;
    flex: 1;
}

.dish-rating-image {
    font-size: 2.5em;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 10px;
    flex-shrink: 0;
}

.dish-rating-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dish-rating-name {
    font-weight: bold;
    color: #2d3436;
    margin-bottom: 8px;
    font-size: 1.05em;
}

.dish-rating-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
}

.dish-rating-stars {
    color: #ffd700;
}

.dish-rating-score {
    color: #ff6b6b;
    font-weight: bold;
}

.dish-rating-count {
    color: #999;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* 后台评价列表 */
.admin-ratings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-rating-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s;
}

.admin-rating-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.admin-rating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.admin-rating-dish {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-rating-dish-image {
    font-size: 1.8em;
}

.admin-rating-dish-name {
    font-weight: bold;
    color: #2d3436;
    font-size: 1.05em;
}

.btn-delete-small {
    background: #ff6b6b;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.btn-delete-small:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.admin-rating-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-rating-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-rating-nickname {
    font-weight: 600;
    color: #2d3436;
}

.admin-rating-stars {
    color: #ffd700;
    font-size: 1em;
}

.admin-rating-score {
    color: #ff6b6b;
    font-weight: bold;
}

.admin-rating-date {
    color: #999;
    font-size: 0.9em;
    margin-left: auto;
}

.admin-rating-comment {
    color: #666;
    line-height: 1.6;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #ff6b6b;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .ratings-stats {
        grid-template-columns: 1fr;
    }
    
    .dish-ratings-list {
        grid-template-columns: 1fr;
    }
    
    .dish-rating-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-bar select {
        max-width: 100% !important;
    }
    
    .admin-rating-date {
        margin-left: 0;
        width: 100%;
    }
}

/* ==================== 数据存储管理样式 ==================== */

.storage-info-box {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #666;
}

.info-value {
    font-weight: bold;
    color: #2d3436;
}

.storage-mode-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 15px 0;
}

.storage-mode-option {
    position: relative;
}

.storage-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.storage-mode-option label {
    display: block;
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
}

.storage-mode-option input[type="radio"]:checked + label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.storage-mode-option label strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
}

.storage-mode-option label p {
    font-size: 13px;
    margin: 0;
    opacity: 0.9;
}

.storage-mode-option:hover label {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#upstashOptions {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

#upstashStatus {
    margin-top: 15px;
    font-weight: 500;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .storage-mode-selector {
        grid-template-columns: 1fr;
    }
    
    .storage-mode-option label {
        min-height: auto;
    }
}

/* ============================================
   Upstash 云存储样式
   ============================================ */

.alert {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.alert a {
    color: inherit;
    text-decoration: underline;
    font-weight: bold;
}

.alert a:hover {
    opacity: 0.8;
}

.alert-info {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #0d47a1;
}

.alert-success {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #1b5e20;
}

.alert-warning {
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
}

.alert-error {
    background: #ffebee;
    border-color: #f44336;
    color: #b71c1c;
}

.storage-mode-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 15px 0;
}

.storage-mode-option {
    position: relative;
}

.storage-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.storage-mode-option label {
    display: block;
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
}

.storage-mode-option input[type="radio"]:checked + label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.storage-mode-option label strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
}

.storage-mode-option label p {
    font-size: 13px;
    margin: 0;
    opacity: 0.9;
}

.storage-mode-option:hover label {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#upstashOptions {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

#upstashStatus {
    margin-top: 15px;
    font-weight: 500;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .storage-mode-selector {
        grid-template-columns: 1fr;
    }
    
    .storage-mode-option label {
        min-height: auto;
    }
}

/* ============================================
   折叠面板样式
   ============================================ */

details.alert-info {
    padding: 0 !important;
    margin: 6px 0 !important;
    margin-left: 0 !important;
    border-left-width: 4px !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    text-align: left;
    width: 100%;
}

details.alert-info[open] {
    padding: 0 !important;
}

details.alert-info summary {
    font-weight: bold;
    padding: 3px 4px !important;
    margin: 0 !important;
    list-style: none;
    user-select: none;
    outline: none;
    cursor: pointer;
    display: block;
    text-align: left;
    font-size: 15px !important;
    line-height: 1.2 !important;
}

details.alert-info summary::-webkit-details-marker {
    display: none;
}

details.alert-info summary span {
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.3s ease;
    font-size: 1em;
    min-width: 10px;
    text-align: left;
    vertical-align: middle;
}

details.alert-info[open] summary span {
    transform: rotate(90deg);
}

details.alert-info summary:hover {
    opacity: 0.8;
}

.upstash-help-content {
    margin: 0 !important;
    padding: 0 !important;
    text-align: left;
    line-height: 1.2 !important;
    font-size: 15px !important;
    display: block !important;
}

.upstash-help-content p {
    margin: 0 !important;
    padding: 0 0 4px 4px !important;
    text-align: left;
    line-height: 1.3 !important;
    font-size: 15px !important;
    display: block !important;
}

.upstash-help-content p:last-child {
    padding-bottom: 0 !important;
}

.upstash-help-content strong,
.upstash-help-content code {
    white-space: nowrap;
    display: inline;
}

/* ============================================
   时间显示配置样式
   ============================================ */

.time-preview-box {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

.time-preview-box label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #495057;
}

.time-preview {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    margin-top: 5px;
}

.time-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#timePreviewText {
    font-size: 0.9em;
    font-weight: 600;
    color: white;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.color-picker-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.color-picker-group input {
    flex: 1;
    min-width: 200px;
}

.color-picker-group .btn-sm {
    flex-shrink: 0;
}

#timeIconGroup {
    transition: opacity 0.3s ease;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .color-picker-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .color-picker-group input,
    .color-picker-group .btn-sm {
        width: 100%;
    }
}
/* ==================== 通用模态框样式 ==================== */

/* 节假日表单现在也使用这个通用模态框样式 */
#holidayModal {
    display: none; /* 默认隐藏 */
    position: fixed; /* 固定定位，覆盖整个屏幕 */
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* 如果内容过多则允许滚动 */
    background-color: rgba(0,0,0,0.5); /* 半透明黑色背景遮罩 */
    -webkit-animation: fadeIn 0.3s;
    animation: fadeIn 0.3s;
}

#holidayModal.active {
    display: flex; /* 使用flex布局来垂直和水平居中 */
    align-items: center;
    justify-content: center;
}

/* 继承自 .modal-content 的样式，确保节假日表单也像其他弹窗一样 */
#holidayModal .modal-content {
    position: relative;
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px; /* 限制最大宽度 */
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    border-radius: var(--border-radius, 12px);
    -webkit-animation: slideIn 0.4s;
    animation: slideIn 0.4s;
    display: flex;
    flex-direction: column;
}

.modal-body {
    padding: 20px 25px;
    overflow-y: auto; /* 当内容过多时，仅body区域滚动 */
    max-height: 70vh; /* 限制最大高度 */
}

/* 动画效果 */
@-webkit-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@-webkit-keyframes slideIn {
    from { top: -100px; opacity: 0 }
    to { top: 0; opacity: 1 }
}

@keyframes slideIn {
    from { top: -100px; opacity: 0 }
    to { top: 0; opacity: 1 }
}

/* ==================== 节假日UI优化 ==================== */
.custom-year-group {
    display: flex;
    align-items: center;
    gap: 5px; /* 减小元素之间的间距 */
}

.custom-year-group .btn input.form-control-inline {
    width: 50px; /* 稍微减小宽度 */
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.1);
    color: white;
    text-align: center;
    font-weight: bold;
    border-radius: 4px;
    padding: 2px; /* 移除特定的右侧内边距 */
    font-size: inherit;
}

.custom-year-group input[type=number]::-webkit-outer-spin-button,
.custom-year-group input[type=number]::-webkit-inner-spin-button {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.custom-year-group input[type=number]:hover::-webkit-outer-spin-button,
.custom-year-group input[type=number]:hover::-webkit-inner-spin-button,
.custom-year-group input[type=number]:focus::-webkit-outer-spin-button,
.custom-year-group input[type=number]:focus::-webkit-inner-spin-button {
    opacity: 1;
}

/* ==================== 数据统计响应式布局 ==================== */
.data-stats {
    display: grid; /* 使用Grid布局 */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* 响应式网格 */
    gap: 15px;
}

/* ==================== 后台主题颜色响应式修复 ==================== */      
@media (max-width: 767px) {
    .color-input-wrapper {
        display: flex;
        gap: 10px;
        width: 100%;
    }
    .color-input-wrapper .color-picker,
    .color-input-wrapper .color-text {
        flex: 1; /* 让两个元素平分宽度 */
        width: auto; /* 覆盖可能存在的固定宽度 */
        min-width: 0; /* 允许元素收缩 */
    }
}

.recurring-badge {
    background-color: #007bff;
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 8px;
    vertical-align: middle;
    font-weight: 600;
}

/* Image Overlay */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1001; /* Higher than modal */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: fadeIn 0.3s;
}

.image-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    cursor: default;
}

/* Drag and Drop Sorting */
.menu-card, .category-card {
    display: flex;
    align-items: center;
}

.drag-handle:hover {
    color: #333;
}

.drag-handle {
    cursor: grab;
    font-size: 24px;
    color: #aaa;
    padding: 20px 15px;
    user-select: none;
    touch-action: none; /* Improve mobile dragging */
}

.menu-card-main {
    flex-grow: 1;
}

.category-card-main {
    flex-grow: 1;
    text-align: center;
}

.menu-card.dragging, .category-card.dragging {
    opacity: 0.5;
    background: #e9ecef;
}

/* Visual enhancements for SortableJS */

/* 1. The item being dragged (ghost) */
.sortable-ghost {
    opacity: 0.8;
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* 2. The spot the item was dragged from */
.sortable-drag {
    opacity: 0.2 !important;
}

/* 3. The drop indicator line on the next element */
.sortable-ghost + .category-card,
.sortable-ghost + .menu-card {
    border-left: 3px solid var(--primary-color);
    margin-left: -3px;
}

.placeholder {
    background: #e9ecef;
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    margin: 10px 0;
}