/* =============================================================================
   LuLuEat - 可爱点餐系统样式表
   移动端优先设计，可爱风格，流畅动画
============================================================================= */

/* 基础重置和变量 */
:root {
    /* 可爱色彩方案 */
    --primary-color: #ff6b9d;
    --primary-light: #ffb5d1;
    --primary-dark: #e55a8a;
    --secondary-color: #4ecdc4;
    --secondary-light: #a8e6e3;
    --accent-color: #ffd93d;
    --accent-light: #ffe8a3;
    
    /* 中性色彩 */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #e9ecef;
    --dark-gray: #6c757d;
    --text-color: #343a40;
    --text-light: #6c757d;
    
    /* 状态色彩 */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --info-color: #17a2b8;
    
    /* 尺寸变量 */
    --border-radius: 12px;
    --border-radius-small: 8px;
    --border-radius-large: 16px;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 16px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 24px rgba(0,0,0,0.2);
    
    /* 动画变量 */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
    --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================================================
   加载动画
============================================================================= */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.cute-loader {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.cute-loader .bowl {
    font-size: 3rem;
    animation: bounce 1.5s infinite;
    margin-bottom: 1rem;
}

.loading-text {
    color: var(--text-light);
    font-size: 0.9rem;
    animation: pulse 2s infinite;
}

/* =============================================================================
   头部导航
============================================================================= */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow-medium);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.logo-icon:hover {
    transform: scale(1.1);
}

.cart-button {
    position: relative;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-medium);
    backdrop-filter: blur(10px);
}

.cart-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.cart-button.has-items {
    background: var(--accent-color);
    color: var(--text-color);
}

.cart-icon {
    font-size: 1.5rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--error-color);
    color: var(--white);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    animation: bounceIn 0.5s var(--bounce);
}

.cart-button.bounce {
    animation: cartBounce 0.6s var(--bounce);
}

/* =============================================================================
   分类导航
============================================================================= */
.category-nav {
    background: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 80px;
    z-index: 90;
}

.category-list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-list::-webkit-scrollbar {
    display: none;
}

.category-btn {
    background: var(--gray);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-medium);
    color: var(--text-color);
}

.category-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.category-btn.active {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-medium);
}

/* =============================================================================
   主要内容区域
============================================================================= */
.main-content {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 160px);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

/* 菜品网格 */
.dishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    animation: fadeInUp 0.5s ease;
}

/* 菜品卡片 */
.dish-card {
    background: var(--white);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-medium);
    cursor: pointer;
    animation: slideInUp 0.5s ease;
}

.dish-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.dish-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 创建1:1的正方形容器 */
    overflow: hidden;
    background: var(--light-gray);
}

.dish-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.dish-card:hover .dish-image img {
    transform: scale(1.05);
}

.placeholder-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray) 0%, var(--light-gray) 100%);
}

.placeholder-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.dish-info {
    padding: 1rem;
}

.dish-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.dish-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.dish-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dish-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.add-btn {
    background: var(--secondary-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    color: var(--white);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.add-btn:hover:not(:disabled) {
    background: var(--secondary-light);
    transform: translateY(-2px);
}

.add-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =============================================================================
   购物车侧边栏
============================================================================= */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    animation: fadeIn 0.3s ease;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--white);
    display: flex;
    flex-direction: column;
    transition: right var(--transition-medium);
    z-index: 201;
    box-shadow: var(--shadow-heavy);
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--light-gray);
    border-bottom: 1px solid var(--gray);
}

.cart-header h2 {
    font-size: 1.2rem;
    color: var(--text-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.25rem;
    border-radius: var(--border-radius-small);
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: var(--gray);
    color: var(--text-color);
}

.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.empty-cart {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-light);
}

.empty-cart-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-cart-hint {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray);
}

.item-image {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--light-gray);
    flex-shrink: 0;
}

.item-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-image .placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0.5;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.item-price {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--gray);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

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

.quantity {
    font-weight: bold;
    min-width: 24px;
    text-align: center;
}

.cart-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray);
    background: var(--light-gray);
}

.total-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.total-amount {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.checkout-btn {
    width: 100%;
    background: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem;
    color: var(--white);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.checkout-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.checkout-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =============================================================================
   弹窗样式
============================================================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    padding: 1rem;
}

.dish-detail-modal,
.checkout-modal {
    background: var(--white);
    border-radius: var(--border-radius-large);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideInUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(0,0,0,0.2);
}

/* 菜品详情弹窗 */
.detail-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 创建1:1的正方形容器 */
    background: var(--light-gray);
    overflow: hidden;
}

.detail-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    opacity: 0.3;
}

.detail-content {
    padding: 1.5rem;
}

.detail-content h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.detail-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.detail-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.detail-add-btn {
    width: 100%;
    background: var(--secondary-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem;
    color: var(--white);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.detail-add-btn:hover {
    background: var(--secondary-light);
    transform: translateY(-2px);
}

/* 结账弹窗 */
.checkout-modal {
    padding: 1.5rem;
}

.checkout-modal h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    text-align: center;
}

.checkout-form .form-group {
    margin-bottom: 1rem;
}

.checkout-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.checkout-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

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

.order-summary {
    background: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1.5rem 0;
}

.order-summary h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.summary-total {
    border-top: 1px solid var(--gray);
    padding-top: 0.5rem;
    margin-top: 1rem;
    font-size: 1.1rem;
}

.submit-order-btn {
    width: 100%;
    background: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem;
    color: var(--white);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.submit-order-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.submit-order-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 成功弹窗 */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    animation: fadeIn 0.3s ease;
    padding: 1rem;
}

.success-content {
    background: var(--white);
    border-radius: var(--border-radius-large);
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: bounceIn 0.5s var(--bounce);
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: celebration 1s ease;
}

.success-content h2 {
    color: var(--success-color);
    margin-bottom: 1rem;
}

.success-content p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.order-id {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1.5rem !important;
}

.success-btn {
    background: var(--success-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    color: var(--white);
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-medium);
}

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

/* =============================================================================
   提示消息
============================================================================= */
.toast {
    position: fixed;
    top: 100px;
    right: 1rem;
    background: var(--text-color);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform var(--transition-medium);
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    transform: translateX(0);
}

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

.toast-warning {
    background: var(--warning-color);
    color: var(--text-color);
}

.toast-error {
    background: var(--error-color);
}

.toast-info {
    background: var(--info-color);
}

/* =============================================================================
   动画定义
============================================================================= */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes cartBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes celebration {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(-5deg);
    }
    50% {
        transform: scale(1.2) rotate(0deg);
    }
    75% {
        transform: scale(1.1) rotate(5deg);
    }
}

/* =============================================================================
   响应式设计
============================================================================= */

/* 小屏幕手机 */
@media (max-width: 480px) {
    .header {
        padding: 0.75rem;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .dishes-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .cart-sidebar {
        width: 100%;
        max-width: none;
    }
    
    .modal-overlay {
        padding: 0.5rem;
    }
    
    .success-content {
        padding: 1.5rem;
    }
    
    .toast {
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
}

/* 中等屏幕 */
@media (min-width: 768px) {
    .dishes-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .cart-sidebar {
        width: 400px;
    }
}

/* 大屏幕 */
@media (min-width: 1024px) {
    .main-content {
        padding: 1.5rem;
    }
    
    .dishes-grid {
        gap: 1.5rem;
    }
    
    .dish-card:hover {
        transform: translateY(-6px);
    }
}

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

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* 无障碍优化 */
/* 管理员登录弹窗样式 */
.admin-login-modal {
    background: var(--white);
    border-radius: var(--border-radius-large);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    position: relative;
    animation: bounceIn 0.5s var(--bounce);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.admin-login-modal h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.admin-login-modal p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-password-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    text-align: center;
    letter-spacing: 0.2em;
    transition: all var(--transition-fast);
}

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

.admin-login-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.admin-login-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.admin-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid #ffcdd2;
    animation: shake 0.5s ease;
}

/* 快速下单样式 */
.quick-order-notice {
    background: linear-gradient(135deg, #4CAF50, #81C784);
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.quick-order-notice p {
    margin: 0;
    font-weight: 500;
    font-size: 1rem;
}

.checkout-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color var(--transition-fast);
}

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

/* 管理员界面样式 */
.admin-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-header h1 {
    margin: 0 0 1rem 0;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
}

.admin-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-nav button {
    background: rgba(255,255,255,0.2);
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-medium);
    backdrop-filter: blur(10px);
}

.admin-nav button:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

.admin-nav button.active {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.admin-main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-section h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 订单卡片美化 */
.orders-list {
    display: grid;
    gap: 1rem;
}

.order-card {
    background: var(--white);
    border-radius: var(--border-radius-large);
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid var(--light-gray);
    transition: all var(--transition-medium);
}

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

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.order-status.pending {
    background: #fff3e0;
    color: #f57c00;
}

.order-status.preparing {
    background: #e3f2fd;
    color: #1976d2;
}

.order-status.ready {
    background: #e8f5e8;
    color: #388e3c;
}

.order-status.completed {
    background: #f3e5f5;
    color: #7b1fa2;
}

.order-time {
    color: var(--text-light);
    font-size: 0.9rem;
}

.order-customer {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.order-customer strong {
    color: var(--text-color);
}

.order-items {
    background: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.order-item {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

.order-item:last-child {
    margin-bottom: 0;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.order-footer select {
    padding: 0.5rem;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    background: var(--white);
    color: var(--text-color);
    cursor: pointer;
}

/* 完成订单按钮样式 */
.complete-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-medium);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.complete-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.completed-text {
    color: #10b981;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--border-radius);
}

.order-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.delete-order-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-medium);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.delete-order-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.delete-confirm-modal {
    max-width: 400px;
}

.warning-text {
    color: var(--error-color);
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.cancel-btn {
    background: var(--gray);
    color: var(--text-color);
}

.cancel-btn:hover {
    background: #6b7280;
    color: var(--white);
}

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

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

/* 订单项摘要样式 */
.order-items-summary {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.order-items-summary h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1rem;
}

.order-item-summary {
    padding: 0.25rem 0;
    color: var(--text-light);
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

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

/* 管理员后台订单项样式 */
.order-items {
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

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

.item-name {
    font-weight: 600;
    color: var(--text-color);
    flex: 1;
}

.item-quantity {
    color: var(--text-light);
    margin: 0 0.75rem;
    font-weight: 500;
}

.item-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
}

.no-items {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 1rem;
}

.order-wait-text {
    color: var(--text-light);
    font-style: italic;
    margin: 1rem 0;
    text-align: center;
}

/* 菜品管理样式 */
.add-btn {
    background: var(--success-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 2rem;
    transition: all var(--transition-medium);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.add-btn:hover {
    background: #43a047;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.dishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.dish-admin-card {
    background: var(--white);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all var(--transition-medium);
    border: 1px solid var(--light-gray);
}

.dish-admin-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.dish-admin-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.dish-admin-card .dish-info {
    padding: 1.5rem;
}

.dish-admin-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.dish-admin-card p {
    color: var(--text-light);
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.dish-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.dish-meta .price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.dish-meta .category {
    background: var(--light-gray);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.dish-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dish-actions button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.edit-btn {
    background: #2196f3;
    color: var(--white);
}

.edit-btn:hover {
    background: #1976d2;
}

.generate-btn {
    background: #9c27b0;
    color: var(--white);
}

.generate-btn:hover {
    background: #7b1fa2;
}

.delete-btn {
    background: #f44336;
    color: var(--white);
}

.delete-btn:hover {
    background: #d32f2f;
}

/* 统计卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--white) 0%, #f8f9ff 100%);
    border-radius: var(--border-radius-large);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid var(--light-gray);
    transition: all var(--transition-medium);
}

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

.stat-card h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
}

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

/* 弹窗表单样式 */
.modal {
    background: var(--white);
    border-radius: var(--border-radius-large);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: bounceIn 0.5s var(--bounce);
}

.modal h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    text-align: center;
}

.modal form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal input,
.modal textarea {
    padding: 0.75rem;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

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

.modal textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.form-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.form-actions button[type="button"] {
    background: var(--gray);
    color: var(--text-color);
}

.form-actions button[type="button"]:hover {
    background: #bbb;
}

.form-actions button[type="submit"] {
    background: var(--primary-color);
    color: var(--white);
}

.form-actions button[type="submit"]:hover {
    background: var(--primary-dark);
}

/* 动画增强 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Logo点击提示 */
.logo {
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.logo:hover {
    transform: scale(1.05);
}

.logo:active {
    transform: scale(0.95);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .admin-main {
        padding: 1rem;
    }
    
    .admin-nav {
        flex-direction: column;
        align-items: center;
    }
    
    .admin-nav button {
        width: 100%;
        max-width: 200px;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .order-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dishes-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dish-actions {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* =============================================================================
   图片管理样式
============================================================================= */
.dish-image-container {
    position: relative;
    width: 100%;
    height: 150px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    overflow: hidden;
}

.dish-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-medium);
}

.dish-image-container:hover img {
    transform: scale(1.05);
}

.no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--gray) 0%, var(--light-gray) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.dish-image-container:hover .image-overlay {
    opacity: 1;
}

.delete-image-btn {
    background: var(--error-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius-small);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
    transform: scale(0.9);
}

.delete-image-btn:hover {
    background: #c82333;
    transform: scale(1);
}

/* 菜品表单样式增强 */
.dish-form-modal {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.image-upload-section {
    border: 2px dashed var(--gray);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    transition: border-color var(--transition-medium);
}

.image-upload-section:hover {
    border-color: var(--primary-color);
}

.file-input {
    display: none;
}

.file-input-label {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-medium);
    font-weight: 500;
}

.file-input-label:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.selected-file {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--success-color);
    color: var(--white);
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
}

.file-help {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.form-help {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
}

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

.save-btn:hover {
    background: #218838;
}

.generate-btn:disabled {
    background: var(--gray);
    color: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.generate-btn:disabled:hover {
    background: var(--gray);
    transform: none;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .dish-form-modal {
        margin: 1rem;
        max-height: 95vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =============================================================================
   管理员认证界面样式
============================================================================= */
.auth-overlay {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
}

.auth-modal {
    position: relative;
    background: linear-gradient(135deg, var(--white) 0%, var(--light-gray) 100%);
    border: 2px solid var(--primary-light);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 450px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    color: var(--primary-color);
    margin: 1rem 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.auth-header p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.95rem;
}

.login-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-direction: column;
}

.back-btn {
    background: var(--gray);
    color: var(--text-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-medium);
    font-size: 0.9rem;
    font-weight: 500;
}

.back-btn:hover {
    background: var(--dark-gray);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.logout-btn {
    background: var(--error-color) !important;
    color: var(--white) !important;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-medium);
    font-size: 0.85rem;
    font-weight: 500;
}

.logout-btn:hover {
    background: #c82333 !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.admin-container {
    min-height: 100vh;
    background: var(--light-gray);
}

@media (min-width: 768px) {
    .login-buttons {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .back-btn {
        flex: 1;
    }
    
    .admin-login-btn {
        flex: 2;
    }
} 