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

:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-bg: #EFF6FF;
    --gray-900: #0F0F1A;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50:  #F9FAFB;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f4f5f9;
    min-height: 100vh;
    padding: 20px;
    color: var(--gray-700);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

/* 语言切换器 */
.language-switcher {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    gap: 5px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

.lang-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    color: #666;
    font-weight: 500;
}

.lang-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.lang-btn.active {
    background: var(--primary);
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(91,71,214,0.28);
}

h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.btn-back {
    position: absolute;
    left: 0;
    top: 0;
    padding: 10px 20px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #e0e0e0;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    font-weight: 500;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(91,71,214,0.38);
}

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

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

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

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

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1em;
}

.btn-add {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
}

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

/* 主页网格 */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.feature-card {
    background: white;
    padding: 32px;
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    border-color: rgba(91,71,214,0.25);
}

.feature-card .icon {
    font-size: 2.8em;
    margin-bottom: 16px;
    display: block;
    background: var(--primary-bg);
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

.feature-card h2 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--gray-900);
    font-weight: 700;
}

.feature-card p {
    color: var(--gray-500);
    margin-bottom: 20px;
    line-height: 1.65;
    font-size: 0.9em;
}

/* 使用说明 */
.usage-guide {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-top: 40px;
}

.usage-guide h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    text-align: center;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.step {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.step strong {
    display: block;
    font-size: 1.05em;
    margin-bottom: 8px;
    color: var(--primary);
    font-weight: 700;
}

.step p {
    color: #666;
    line-height: 1.6;
}

/* 二维码页面 */
.info-banner {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.qrcode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.qrcode-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.qrcode-card:hover {
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(91,71,214,0.18);
    transform: scale(1.02);
}

.qrcode-card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.qrcode {
    margin: 15px auto;
    display: inline-block;
}

.qr-url {
    font-size: 0.75em;
    color: #666;
    word-break: break-all;
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.print-hint {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 10px;
}

/* 点餐页面 */
.table-info {
    margin-top: 20px;
}

.table-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: bold;
}

.cart-summary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header {
    font-size: 1.2em;
    font-weight: bold;
}

.cart-total {
    font-size: 1.5em;
    font-weight: bold;
}

.menu-section h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #333;
}

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

.menu-item {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.menu-item:hover {
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(91,71,214,0.15);
    transform: translateY(-5px);
}

.menu-image {
    font-size: 4em;
    text-align: center;
    padding: 20px;
    background: white;
}

.menu-info {
    padding: 20px;
}

.menu-info h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #333;
}

.menu-desc {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

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

.menu-price {
    font-size: 1.5em;
    color: #f5576c;
    font-weight: bold;
}

.cart-detail {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 100px;
}

.cart-detail h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.cart-item-emoji {
    font-size: 2em;
    margin-right: 15px;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cart-item-price {
    color: #f5576c;
    font-weight: bold;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 15px;
}

.quantity-controls button {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
}

.quantity-controls button:hover {
    background: var(--primary-dark);
}

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

.btn-remove {
    width: 30px;
    height: 30px;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5em;
    line-height: 1;
}

.btn-remove:hover {
    background: #c82333;
}

.empty-cart {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 1.2em;
}

.checkout-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.checkout-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 1.2em;
}

.checkout-info span:first-child {
    font-weight: bold;
    font-size: 1.3em;
}

/* 厨房管理页面 */
.kitchen-container {
    max-width: 1400px;
}

.kitchen-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

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

.kitchen-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.kanban-column {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
}

.column-header {
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pending-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.cooking-header {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.completed-header {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.column-header h2 {
    font-size: 1.3em;
    margin: 0;
}

.badge {
    background: rgba(255,255,255,0.3);
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
}

.order-list {
    padding: 20px;
    min-height: 400px;
}

.order-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.order-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateY(-3px);
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.table-number {
    background: var(--primary);
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: bold;
    margin-right: 10px;
}

.order-id {
    color: #999;
    font-size: 0.9em;
}

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

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

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

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

.item-price {
    color: #f5576c;
    font-weight: bold;
}

.order-total {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: right;
    font-size: 1.2em;
    margin-bottom: 15px;
}

.order-total strong {
    color: #f5576c;
}

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

.order-actions button {
    flex: 1;
    min-width: 100px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 1.1em;
}

/* 反馈提示 */
.feedback-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s;
    z-index: 9999;
}

.feedback-toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    .home-grid {
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .qrcode-grid {
        grid-template-columns: 1fr;
    }

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

    .kanban-board {
        grid-template-columns: 1fr;
    }

    .kitchen-stats {
        gap: 20px;
    }

    .stat-value {
        font-size: 1.5em;
    }

    .btn-back {
        position: static;
        margin-bottom: 15px;
        display: block;
        width: 100%;
    }

    .checkout-bar {
        flex-direction: column;
        gap: 15px;
    }

    .checkout-bar button {
        width: 100%;
    }
}

@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        padding: 20px;
    }

    .qrcode-card {
        page-break-inside: avoid;
    }
}
