* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe66d;
    --dark-color: #2d3436;
    --light-color: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
    --header-height: 60px;
    --bottom-cart-height: 60px;
    
    /* 可配置的样式变量 */
    --max-width: 1200px;
    --border-radius: 12px;
    --box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    --font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --dynamic-top-offset: calc(20px + var(--header-height)); /* JS将更新此值 */
}

/* 通用按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    font-weight: bold;
    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: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

body {
    font-family: var(--font-family);
    color: var(--dark-color);
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden; /* 防止水平滚动条 */
}

/* 防止页面加载时的布局闪烁 */
body.loading {
    opacity: 0;
}

body.loaded {
    opacity: 1;
    transition: opacity 0.2s ease-in;
}

/* 头部固定栏 */
.header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: var(--max-width);
    height: var(--header-height);
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    border-radius: 16px 16px 0 0;
}

/* 节假日横幅 */
.holiday-banner {
    position: fixed;
    top: calc(20px + var(--header-height));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 999;
}

.holiday-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.holiday-icon {
    font-size: 1.5em;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.holiday-message {
    font-size: 1em;
    font-weight: 500;
}

.holiday-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.holiday-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 每日一言横幅 */
.daily-quote-banner {
    position: fixed;
    top: calc(20px + var(--header-height)); /* Reverted: Static positioning */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1200px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 998;
    transition: top 0.3s ease-out; /* 让位置变化更平滑 */
}

.daily-quote-banner.loaded {
    opacity: 1;
    visibility: visible;
}

.daily-quote-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.quote-icon {
    font-size: 1.3em;
}

.quote-text {
    font-size: 0.95em;
    font-style: italic;
    line-height: 1.5;
}

.quote-refresh {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.quote-refresh:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg);
}

.quote-refresh:active {
    transform: rotate(180deg) scale(0.95);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-content h1 {
    font-size: 1.5em;
    color: var(--primary-color);
}

/* 时间显示 */
.time-display {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    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;
}

.time-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.time-text {
    font-size: 0.9em;
    font-weight: 600;
    color: white;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-link {
    font-size: 1.5em;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s;
}

.admin-link:hover {
    transform: scale(1.1);
}

.cart-icon {
    font-size: 1.5em;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6em;
    font-weight: bold;
    padding: 0 5px;
}

/* 主容器 - 垂直布局 */
.main-container {
    position: fixed;
    top: calc(20px + var(--header-height)); /* Reverted: Static positioning */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1200px;
    bottom: calc(20px + var(--bottom-cart-height));
    display: flex;
    overflow: hidden;
    border-radius: 0;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.05), 2px 0 4px rgba(0, 0, 0, 0.05);
    background: white;
    transition: top 0.3s ease-out; /* 让位置变化更平滑 */
}

/* 左侧分类栏 */
.category-sidebar {
    width: 90px !important;
    background: white;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    flex-shrink: 0;
}

.category-list {
    padding: 10px 0;
}

.category-item {
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.3s;
    font-size: 0.85em;
    color: #666;
}

.category-item:hover {
    background: var(--light-color);
}

.category-item.active {
    background: var(--light-color);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

.category-emoji {
    font-size: 1.8em;
    display: block;
    margin-bottom: 5px;
}

/* 右侧内容区域 */
.content-area {
    flex: 1;
    overflow-y: auto;
    background: #f5f5f5;
}

.menu-sections {
    padding: 15px;
}

.menu-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--dark-color);
    padding: 10px 0;
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    background: #f5f5f5;
    z-index: 10;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 菜品卡片 - 横向布局 */
.menu-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    gap: 15px;
    box-shadow: var(--box-shadow);
    transition: all 0.3s;
}

.menu-item:active {
    transform: scale(0.98);
}

.menu-item-image {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
}

.menu-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.menu-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.menu-item-name {
    font-weight: bold;
}

.menu-item-desc {
    color: #ccc;
    line-height: 1.6;
}

/* ==================== 手机端响应式修复 - 菜单项布局 ==================== */
.menu-item-footer {
    display: flex;
    flex-direction: column;
    gap: 8px; /* 行间距 */
    margin-top: auto;
}

.menu-item-price-row {
    /* 价格行可以根据需要添加特定样式 */
}

.menu-item-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px; /* 评价和按钮之间的间距 */
}

.menu-item-price {
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: bold;
    flex-shrink: 0;
}

.menu-item-price .currency {
    font-size: 0.75em;
    margin-left: 2px;
}

.add-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 24px; /* 与.quantity-btn保持一致 */
    height: 24px; /* 与.quantity-btn保持一致 */
    border-radius: 50%; /* 与.quantity-btn保持一致 */
    cursor: pointer;
    font-size: 1em; /* 与.quantity-btn保持一致 */
    transition: all 0.3s;
    display: flex; /* 居中加号 */
    align-items: center; /* 居中加号 */
    justify-content: center; /* 居中加号 */
    flex-shrink: 0; /* 防止按钮被压缩 */
}

.add-btn:hover {
    background: #ff5252;
    transform: scale(1.05);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0; /* 防止组件被压缩 */
}

.quantity-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.quantity-btn:hover {
    background: #ff5252;
}

.quantity-display {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* 底部购物车栏 */
.bottom-cart {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1200px;
    height: var(--bottom-cart-height);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 999;
    cursor: pointer;
    border-radius: 0 0 16px 16px;
}

.bottom-cart-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-icon-bottom {
    font-size: 2em;
    position: relative;
}

.cart-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-count {
    font-size: 0.85em;
    color: #666;
}

.cart-price {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--primary-color);
}

.bottom-checkout-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s;
}

.bottom-checkout-btn:hover {
    background: #ff5252;
}

/* 购物车抽屉 */
.cart-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.cart-drawer.active {
    display: block;
}

.cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.cart-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    background: white;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-size: 1.3em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-cart p:first-child {
    font-size: 3em;
    margin-bottom: 10px;
}

.cart-item {
    background: var(--light-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 0.95em;
}

.cart-item-price {
    color: var(--primary-color);
    font-size: 0.9em;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background: white;
}

.cart-actions {
    display: flex;
    gap: 10px;
}

.checkout-btn, .clear-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s;
}

.checkout-btn {
    background: var(--primary-color);
    color: white;
}

.checkout-btn:hover {
    background: #ff5252;
}

.clear-btn {
    background: var(--light-color);
    color: var(--dark-color);
}

.clear-btn:hover {
    background: #e0e0e0;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 3000;
    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;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    text-align: left;
    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);
}

.modal-content h2 {
    color: var(--dark-color);
    margin-bottom: 12px;
    font-size: 1.6em;
    font-weight: 700;
}

.modal-content p {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.order-summary {
    background: var(--light-color);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.order-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9em;
}

.order-summary-total {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--primary-color);
    margin-top: 8px;
    border-bottom: none;
}

.modal-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s;
    margin-top: 10px;
}

.modal-btn:hover {
    background: #ff5252;
}

/* 滚动条样式 */
.content-area::-webkit-scrollbar,
.cart-items::-webkit-scrollbar,
.category-sidebar::-webkit-scrollbar {
    width: 6px;
}

.content-area::-webkit-scrollbar-track,
.cart-items::-webkit-scrollbar-track,
.category-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb,
.cart-items::-webkit-scrollbar-thumb,
.category-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    :root {
        --header-height: 50px;
        --bottom-cart-height: 55px;
    }
    
    .header {
        top: 10px;
        width: calc(100% - 20px);
        height: var(--header-height);
        padding: 0 15px;
        border-radius: 12px 12px 0 0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    }
    
    .holiday-banner {
        top: calc(10px + var(--header-height));
        width: calc(100% - 20px);
    }
    
    .daily-quote-banner {
        top: calc(10px + var(--header-height));
        width: calc(100% - 20px);
    }
    
    body.has-holiday-banner .daily-quote-banner {
        top: calc(10px + var(--header-height) + 52px);
    }
    
    .main-container {
        top: calc(10px + var(--header-height));
        bottom: calc(10px + var(--bottom-cart-height));
        width: calc(100% - 20px);
        border-radius: 0;
        box-shadow: -2px 0 4px rgba(0, 0, 0, 0.05), 2px 0 4px rgba(0, 0, 0, 0.05);
    }
    
    .bottom-cart {
        bottom: 10px;
        width: calc(100% - 20px);
        border-radius: 0 0 12px 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }

        .header-content {

            gap: 8px;

            /* flex-wrap: wrap; */ /* 移除换行，防止标题和时间换行 */

            overflow: hidden; /* 防止内容溢出 */

        }

    

        .header-content h1 {

            font-size: 1.2em;

            white-space: nowrap; /* 防止标题自身换行 */

            overflow: hidden;

            text-overflow: ellipsis; /* 超出部分显示省略号 */

            flex-shrink: 1; /* 允许标题收缩 */

        }

    

        .time-display {

            flex-shrink: 0; /* 不允许时间显示收缩 */

        }
    
    .time-text {
        font-size: 0.75em;
        letter-spacing: 0.5px;
    }

    .admin-link, .cart-icon {
        font-size: 1.3em;
    }

    .category-sidebar {
        width: 70px !important;
    }

    .category-item {
        font-size: 0.75em;
        padding: 12px 5px;
    }

    .category-emoji {
        font-size: 1.6em;
    }
    
    .menu-sections {
        padding: 10px;
    }
    
    .menu-item {
        padding: 12px;
        gap: 12px;
    }
    
    .menu-item-image {
        width: 70px;
        height: 70px;
        font-size: 2.5em;
    }
    
    .menu-item-name {
        font-weight: bold;
        font-size: 1em;
    }
    
    .menu-item-desc {
        font-size: 0.9em;
        color: #ccc;
        line-height: 1.6;
    }
    
    .add-btn {
        padding: 0; /* 确保在移动端也是圆形 */
        font-size: 1em; /* 确保在移动端字体大小一致 */
    }

    .content-area {
        padding-bottom: 10px;
    }

    .menu-sections {
        padding: 10px;
    }

    .section-title {
        font-size: 1.1em;
        padding: 8px 0;
    }

    .menu-item {
        padding: 10px;
        gap: 10px;
    }

    .menu-item-image {
        width: 70px;
        height: 70px;
        font-size: 2.5em;
    }

    .menu-item-desc {
        font-size: 0.8em;
        -webkit-line-clamp: 1;
    }

    .menu-item-price {
        font-size: 1.1em;
    }



    .quantity-btn {
        width: 22px;
        height: 22px;
        font-size: 0.9em;
    }

    .bottom-cart {
        height: var(--bottom-cart-height);
        padding: 0 15px;
    }

    .cart-icon-bottom {
        font-size: 1.8em;
    }

    .cart-count {
        font-size: 0.8em;
    }

    .cart-price {
        font-size: 1em;
    }

    .bottom-checkout-btn {
        padding: 8px 20px;
        font-size: 0.9em;
    }

    .cart-content {
        max-height: 80vh;
    }

    .cart-item {
        padding: 10px;
    }

    .cart-item-image {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .modal-content h2 {
        font-size: 1.3em;
    }

    .order-summary {
        padding: 12px;
    }

    .order-summary-item {
        font-size: 0.85em;
    }
}

/* ==================== 评价功能样式 ==================== */

/* 菜品卡片上的评分显示 */
.menu-item-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8em;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

/* 使用高优先级选择器确保星星颜色 */
.menu-item .rating-stars {
    color: #ffd700 !important; /* 使用 !important 强制覆盖 */
    font-size: 0.9em;
    letter-spacing: 1px;
}

.rating-score {
    color: #ff6b6b;
    font-weight: bold;
}

.rating-count {
    color: #999;
    font-size: 0.9em;
}

.no-rating {
    color: #ccc;
    font-size: 0.9em;
    font-style: italic;
}

/* 菜品操作区域调整 */
.menu-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: none;
    color: white;
    font-size: 1.1em;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.rating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.4);
}

/* 评价模态框 */
.rating-modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.rating-modal-body {
    overflow-y: auto;
    padding: 0 25px 25px 25px;
}

.rating-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.rating-modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: var(--dark-color);
}

.rating-modal-header .close-btn {
    background: #f5f5f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.rating-modal-header .close-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

/* 评价菜品信息 */
.rating-dish-info {
    display: flex;
    gap: 15px;
    padding: 20px 25px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.rating-dish-image {
    width: 80px;
    height: 80px;
    font-size: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    flex-shrink: 0;
}

.rating-dish-name {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.rating-dish-desc {
    color: #666;
    font-size: 0.9em;
}

/* 评价表单 */
.rating-form {
    padding: 25px;
}

.rating-form .form-group {
    margin-bottom: 20px;
}

.rating-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--dark-color);
}

/* 星星评分 */
.star-rating {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.star {
    font-size: 2.5em;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.star:hover {
    transform: scale(1.15);
    color: #ffd700;
}

.star.active {
    color: #ffd700;
    animation: starPop 0.3s ease-out;
}

@keyframes starPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.rating-text {
    color: var(--primary-color);
    font-size: 1.1em;
    font-weight: bold;
    min-height: 30px;
}

/* 评价输入框 */
.rating-textarea,
.rating-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
    transition: border-color 0.3s;
}

.rating-textarea:focus,
.rating-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.rating-textarea {
    resize: vertical;
    min-height: 100px;
}

/* 评价操作按钮 */
.rating-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.rating-actions .btn-primary,
.rating-actions .btn-secondary {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.rating-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff8787 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.rating-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 107, 107, 0.4);
}

.rating-actions .btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.rating-actions .btn-secondary:hover {
    background: #e0e0e0;
}

/* 历史评价列表 */
.ratings-list-container {
    padding: 25px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}

.ratings-list-container h3 {
    margin: 0 0 20px 0;
    font-size: 1.2em;
    color: var(--dark-color);
}

.ratings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.empty-ratings {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

.rating-item {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.rating-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.rating-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.rating-item-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rating-item-nickname {
    font-weight: bold;
    color: var(--dark-color);
}

.rating-item-stars {
    color: #ffd700;
    font-size: 1em;
    letter-spacing: 1px;
}

.rating-item-score {
    color: var(--primary-color);
    font-weight: bold;
}

.rating-item-date {
    color: #999;
    font-size: 0.85em;
    white-space: nowrap;
}

.rating-item-comment {
    color: #666;
    line-height: 1.6;
    padding-left: 28px;
}

/* ==================== 响应式设计 ==================== */



/* 平板优化 */

@media (min-width: 769px) and (max-width: 1024px) {

    .category-sidebar {

        width: 100px;

    }

    

    .menu-sections {

        padding: 15px;

        max-width: 700px;

    }

    

    .menu-item {

        padding: 15px;

    }

}



/* 大屏幕优化 */

@media (min-width: 1025px) {

    .category-sidebar {

        width: 110px;

    }

    

    .menu-sections {

        padding: 18px;

    }

    

    .menu-item {

        padding: 16px;

    }

    

    .menu-item-image {

        width: 95px;

        height: 95px;

    }

}



/* 手机端优化 (小于 768px) */

@media (max-width: 768px) {

    :root {

        --header-height: 50px;

        --bottom-cart-height: 55px;

    }

    

    .sticky-header-container {
        width: calc(100% - 20px);
        top: 10px;
        border-radius: 12px 12px 0 0;
    }

    .header {
        height: var(--header-height);
        padding: 0 15px;
        /* 移除独立的圆角，由父容器处理 */
    }

    .holiday-banner, .daily-quote-banner {
        /* 移除独立的top值 */
    }







    .main-container {

        top: calc(10px + var(--header-height));

        bottom: calc(10px + var(--bottom-cart-height));

        border-radius: 0;

    }







    .bottom-cart {

        bottom: 10px;

        height: var(--bottom-cart-height);

        padding: 0 15px;

        border-radius: 0 0 12px 12px;

    }



    .header-content {

        gap: 8px;

    }

    

    .header-content h1 {

        font-size: 1.2em;

    }



    .time-display {

        display: none; /* 在手机端隐藏时间以节省空间 */

    }



    .admin-link, .cart-icon {

        font-size: 1.3em;

    }



    .category-sidebar {

        width: 80px;

    }



    .category-item {

        font-size: 0.75em;

        padding: 12px 5px;

    }



    .category-emoji {

        font-size: 1.6em;

    }

    

    .menu-sections {

        padding: 10px;

    }



    .section-title {

        font-size: 1.1em;

        padding: 8px 0;

    }



        /* --- 核心修改：菜品项布局 --- */



        .menu-item {



            flex-direction: column; /* 垂直布局 */



            padding: 12px;



            gap: 10px;



        }



        .menu-item-image {



            width: 100%; /* 图片容器宽度占满 */



            height: 150px; /* 给一个合适的高度 */



            font-size: 4em;



        }



        .menu-item-info {



            width: 100%;



        }



        .menu-item-desc {



            -webkit-line-clamp: 2; /* 描述最多显示两行 */



        }



        .menu-item-footer {



            margin-top: 10px;



        }



            .menu-item-bottom-row {



                display: flex;



                justify-content: space-between;



                align-items: center;



                gap: 4px; /* 减小元素之间的间距 */



            }



        



            .menu-item-bottom-row .menu-item-price {



                font-size: 1.05em; /* 再次减小价格字体 */



                flex-shrink: 0; /* 防止价格被压缩 */



            }



        



            .menu-item-bottom-row .menu-item-rating {



                font-size: 0.8em; /* 减小评价字体 */



                flex-shrink: 1; /* 允许评价部分收缩 */



                min-width: 0; /* 允许收缩到0 */



                display: flex;



                align-items: center;



            }



        



            .menu-item-bottom-row .rating-count {



                display: none; /* 在最拥挤的情况下隐藏评价数 */



            }



        



            .add-btn, .quantity-control {



                margin-left: auto; /* 确保按钮在最右侧 */



                flex-shrink: 0; /* 防止按钮被压缩 */



            }



    .quantity-btn {

        width: 24px;

        height: 24px;

        font-size: 1em;

    }



    /* --- 购物车和模态框调整 --- */

    .bottom-cart-info {

        gap: 10px;

    }



    .cart-icon-bottom {

        font-size: 1.8em;

    }



    .cart-price {

        font-size: 1.1em;

    }



    .bottom-checkout-btn {

        padding: 8px 20px;

        font-size: 0.9em;

    }



    .cart-content {

        max-height: 80vh;

    }



    .modal-content {

        width: 95%;

        padding: 20px;

    }



    /* --- 评价模态框调整 --- */

    .rating-modal-content {

        width: 95%;

        max-height: 90vh;

    }

    

        .star {

    

            font-size: 2em;

    

        }

    

    

    

    }

    

    

    

    /* ==================== 图片放大模态框样式 ==================== */

    

    .image-modal {

    

        display: none;

    

        position: fixed;

    

        z-index: 4000; /* 比其他模态框更高 */

    

        left: 0;

    

        top: 0;

    

        width: 100%;

    

        height: 100%;

    

        overflow: auto;

    

        background-color: rgba(0,0,0,0.85);

    

        justify-content: center;

    

        align-items: center;

    

    }



/* ==================== 评价模态框图片样式修正 ==================== */

.rating-dish-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保证图片填满容器而不变形 */
    border-radius: 12px; /* 与容器圆角保持一致 */
    display: block;
}


    

    

    

    .image-modal.active {

    

        display: flex;

    

    }

    

    

    

    .image-modal-content {

    

    

    

        margin: auto;

    

    

    

        display: block;

    

    

    

        max-width: 90%;

    

    

    

        max-height: 90%;

    

    

    

        animation-name: zoom;

    

    

    

        animation-duration: 0.3s;

    

    

    

        border-radius: 8px;

    

    

    

    }

    

    

    

    @keyframes zoom {

    

        from {transform:scale(0)} 

    

        to {transform:scale(1)}

    

    }

    

    

    

    .image-modal-close {

    

        position: absolute;

    

        top: 25px;

    

        right: 45px;

    

        color: #fff;

    

        font-size: 40px;

    

        font-weight: bold;

    

        transition: 0.3s;

    

        cursor: pointer;

    

    }

    

    

    

    .image-modal-close:hover,

    

    .image-modal-close:focus {

    

        color: #bbb;

    

        text-decoration: none;

    

    }

    

    

    

    /* 在小屏幕上，关闭按钮更易于点击 */

    

    @media (max-width: 768px) {

    

        .image-modal-close {

    

            top: 15px;

    

            right: 25px;

    

            font-size: 35px;

    

        }

    

    }

    

    



/* ==================== 自定义 Alert/Confirm 模态框 (可爱风格) ==================== */
#customModal .modal-content {
    width: 85%;
    max-width: 320px !important;
    border-radius: 24px; /* 更圆润的边角 */
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: none;
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* 弹性弹出动画 */
    gap: 15px;
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#customModal .modal-header {
    padding: 0;
    border-bottom: none !important;
    justify-content: center;
    background: transparent;
}

#customModal .modal-header h3 {
    font-size: 1.4em !important;
    margin: 0;
    text-align: center;
    font-weight: bold;
    color: var(--dark-color);
}

#customModal .modal-body {
    padding: 0;
    text-align: center;
    color: #666;
    font-size: 1.05em;
    line-height: 1.6;
}

#customModal .modal-footer {
    padding: 0;
    border-top: none;
    display: flex;
    flex-direction: row;
    gap: 12px; /* 按钮之间的间距 */
    background: transparent;
    margin-top: 10px;
}

#customModal .modal-footer button {
    flex: 1;
    margin: 0;
    border: none;
    font-size: 1em;
    padding: 12px 0;
    border-radius: 12px; /* 按钮也是圆角 */
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    height: auto;
    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-secondary {
    background: #f0f2f5;
    color: #666;
}

/* 确定按钮 */
#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 {
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4);
}
