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

/* 调整备餐中区域样式 */
.preparing-section {
    border-left: 2px solid #666;
    border-right: 1px solid #666;
    width: 90%;
    min-width: 0;
}

/* 备餐中区域网格样式 - 强制每行显示三个卡片 */
.preparing-section .pickup-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* 调整待取餐区域样式 */
.ready-section {
    border-left: 1px solid #666;
    border-right: 2px solid #666;
    width: 10%;
    min-width: 0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .pickup-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .preparing-section {
        width: 75%;
    }
    
    .ready-section {
        width: 25%;
    }
}

@media (max-width: 900px) {
    .pickup-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .preparing-section {
        width: 70%;
    }
    
    .ready-section {
        width: 30%;
    }
}

@media (max-width: 600px) {
    .pickup-sections {
        flex-direction: column;
    }
    
    .preparing-section,
    .ready-section {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .ready-section .pickup-code {
        font-size: 24px;
    }
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: #000; /* 黑色背景 */
    color: #fff;
    overflow: auto;
}

/* 大屏容器 */
.pickup-screen {
    display: flex;
    flex-direction: column;
    background: #000;
}

/* 取餐区域容器 */
.pickup-sections {
    display: flex;
    flex: 1;
    gap: 20px;
    padding: 20px;
}

/* 顶部操作栏 */
.top-actions {
    background: #333;
    padding: 15px 20px;
    border-bottom: 1px solid #444;
    display: flex;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.action-btn.manual-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* 取餐区域 */
.pickup-section {
    background: #333;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    border: 2px solid #444;
    position: relative;
    padding-top: var(--section-header-height, 0px);
}

.section-header {
    font-size: 42px;
    font-weight: 900;
    background: #f0f0f0;
    color: #333;
    padding: 20px 5px;
    display: flex;
    justify-content: center; /* 居中显示标题 */
    align-items: center;
    border-bottom: 2px solid #444;
    position: relative;
    overflow: hidden;
}

.section-header-fixed {
    position: fixed;
    top: 0;
    z-index: 1000;
}

/* 取餐码滚动容器样式 */
.pickup-codes-scroll {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch; /* 平滑滚动 */
    scrollbar-width: none; /* 隐藏滚动条 Firefox */
}

/* 隐藏滚动条 Chrome, Safari, Edge */
.pickup-codes-scroll::-webkit-scrollbar {
    display: none;
}

/* 区域标题样式 */
.section-title {
    font-size: 42px;
    font-weight: 900;
    color: #333;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 全屏按钮样式 */
#fullscreen-btn {
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#fullscreen-btn:hover {
    background-color: #764ba2;
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#fullscreen-btn:active {
    transform: translateX(-50%) translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* 全屏状态下的页面样式优化 */
:fullscreen .pickup-screen {
    width: 100vw;
    height: 100vh;
}

:-webkit-full-screen .pickup-screen {
    width: 100vw;
    height: 100vh;
}

:-moz-full-screen .pickup-screen {
    width: 100vw;
    height: 100vh;
}

:-ms-fullscreen .pickup-screen {
    width: 100vw;
    height: 100vh;
}

/* 取餐码列表样式 - 单行显示，超出内容可滚动 */
.pickup-codes-list {
    display: flex;
    gap: 15px;
    font-size: 42px;
    font-weight: 900;
    color: #333;
    line-height: 1.2;
    padding: 5px 0;
    width: auto;
    white-space: nowrap;
}

/* 调整section-header高度以容纳单行取餐码 */
.preparing-section .section-header {
    height: 100px;
    min-height: 100px;
    padding: 15px 25px;
}

.pickup-code {
    background-color: #000;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 42px;
    font-weight: 900;
    min-width: 120px;
    text-align: center;
    display: inline-block;
    margin: 5px 5px;
}

.section-header h2 {
     font-size: 42px;
    font-weight: 700;
    color: #333;
}

.pickup-grid {
    flex: 1;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(1, 1fr); /* 每行显示一个卡片 */
    gap: 20px;
    overflow-y: auto;
    background: #333;
    align-content: start;
}

/* 待取餐区域网格样式 - 每行显示两个卡片 */
.ready-section .pickup-grid {
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
    padding: 15px;
}

.pickup-card {
    background: linear-gradient(135deg, #444 0%, #555 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid #666;
    position: relative;
    height: auto;
    gap: 15px;
    cursor: pointer;
    overflow: hidden;
}

.pickup-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: #555; /* 悬停时背景色变化 */
}

.pickup-card:active {
    transform: translateY(0);
    background: #666; /* 点击时背景色变化 */
}

.pickup-code {
    font-size: 30px;
    font-weight: 700;
    color: #fff;
    background: #000;
    padding: 6px 10px;
    border-radius: 4px;
    text-align: center;
    min-width: 60px;
    letter-spacing: 0.5px;
    align-self: flex-start; /* 放在左上角 */
    /* position: absolute;
    top: 10px; 
    left: 10px;  */
}

.order-items {
    font-size: 16px;
    color: #ccc;
    line-height: 1.5;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* 从顶部开始排列 */
    gap: 8px;
}

/* 左右分栏布局样式 */
.card-left {
    /* flex: 1; */
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    padding: 10px;
    min-width: 0;
}

.card-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    min-width: 0;
}

/* 套餐名称样式 */
.combo-name {
    padding: 8px 12px;
    background: transparent; /* 去除背景色 */
    border-radius: 0; /* 去除圆角 */
    border: none; /* 去除边框 */
    font-size: 18px;
    color: #fff; /* 保持文字颜色 */
    transition: all 0.3s ease;
    text-align: center;
    font-weight: bold;
}

/* 套餐组样式 */
.combo-group {
    margin-bottom: 15px;
}

.combo-group-title {
    font-weight: bold;
    color: orange; /* 绿色标题 */
    margin-bottom: 8px;
    font-size: 38px;
    text-align: left;
    padding-left: 5px;
}

.item-detail {
    padding: 8px 12px;
    background: transparent; /* 去除背景色 */
    border-radius: 0; /* 去除圆角 */
    border: none; /* 去除边框 */
    font-size: 18px;
    color: #fff; /* 保持文字颜色 */
    transition: all 0.3s ease;
}

.item-detail:hover {
    background: transparent; /* 悬停时保持透明背景 */
    border: none; /* 悬停时保持无边框 */
    transform: none; /* 去除悬停时的移动效果 */
}

/* 不同分类的商品颜色样式 */
.category-combo {
    color: #FF0000; /* 套餐类 - 红色 */
    font-size: 42px;
}

/* 套餐菜品展示样式 */
.combo-dishes {
    padding: 10px;
    font-size: 14px;
    width: 100%;
    overflow: visible;
}

.combo-dishes-title {
    font-weight: bold;
    color: #28a745; /* 绿色标题 */
    margin-bottom: 8px;
    font-size: 14px;
    text-align: left;
}

/* 套餐菜品列表样式 - 强制每行显示一个 */
.combo-dishes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 5px;
}

.combo-dish-item {
    padding: 6px 12px;
    background: #555;
    border-radius: 6px;
    font-size: 40px;
    text-align: center;
    width: 100%;
}

.combo-dish-item h4 {
    color: #FF0000; /* 套餐菜品h4标题 - 红色 */
}

.combo-dishes-loading,
.combo-dishes-error {
    color: #888;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    padding: 10px;
}

.category-meat {
    color: #FF6B6B; /* 荤菜类 - 红色 */
}

.category-vegetable {
    color: #51CF66; /* 素菜类 - 绿色 */
}

.category-soup {
    color: #FFE066; /* 汤粥类 - 黄色 */
}

.category-drink {
    color: #FFA8A8; /* 饮料类 - 粉色 */
}

.category-snack {
    color: #FFE066; /* 小食类 - 黄色 */
}

.category-staple {
    color: #C678DD; /* 主食类 - 紫色 */
}

.category-default {
    font-size: 40px; /* 默认分类 - 字体大小40px */
}

/* 空状态样式 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    font-size: 18px;
    gap: 15px;
}

.empty-state-icon {
    font-size: 48px;
}

/* 待取餐卡片样式 */
.ready-card {
    margin: auto;
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
}

.ready-card:hover {
    background: linear-gradient(135deg, #4a4a4a 0%, #5a5a5a 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

/* 待取餐区域只显示取餐码，隐藏商品信息 */
.ready-section .order-items {
    display: none;
}

/* 待取餐区域的取餐码样式 */
.ready-section .pickup-code {
    position: static;
    font-size: 30px;
    font-weight: 900;
    background: #28a745;
    color: white;
}

/* 手动输入区域样式 */
.manual-input-container {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    max-width: 400px;
}

.manual-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #444;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    background: #222;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

.manual-input:focus {
    border-color: #28a745;
    background: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
}

.manual-input::placeholder {
    color: #666;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .manual-input-container {
        flex-direction: column;
        width: 100%;
        max-width: none;
    }
    
    .manual-input {
        width: 100%;
    }
    
    .action-btn.manual-btn {
        width: 100%;
    }
}

.ready-indicator {
    position: static;
    margin-top: 5px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: inline-block;
}
.category-special {
    color: #4ECDC4; /* 精品菜/特色菜 - 青色 */
}

.category-staple {
    color: #A8E6CF; /* 面条卤/饺子 - 浅绿色 */
}

.category-health {
    color: #FF9FF3; /* 养元活力 - 紫色 */
}

.category-default {
    color: #E9ECEF; /* 默认分类 - 浅灰色 */
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .pickup-grid {
        grid-template-columns: repeat(3, 1fr); /* 中等屏幕每行显示三个卡片 */
    }

    .pickup-code {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }

    .pickup-grid {
        grid-template-columns: repeat(2, 1fr); /* 小屏幕每行显示两个卡片 */
        padding: 20px;
    }

    .pickup-code {
        font-size: 24px;
        padding: 12px 16px;
    }

    .section-header{
        font-size: 42px;
        font-weight: 900;
    }
}

/* 隐藏滚动条 */
.pickup-grid::-webkit-scrollbar {
    display: none;
}

.pickup-grid {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #ccc;
    font-size: 18px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 条形码扫描区域样式 */
.scan-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: 20px;
    text-align: center;
}

.scan-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 600;
}

.scan-area {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 20px;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.scanner-video {
    width: 100%;
    height: 360px;
    object-fit: cover;
    border-radius: 10px;
}

.scanner-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.scan-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 100px;
    border: 2px solid #00ff00;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.scan-line {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff00, transparent);
    animation: scan-animation 2s linear infinite;
}

@keyframes scan-animation {
    0% { transform: translate(-50%, -50%) translateY(-50px); }
    100% { transform: translate(-50%, -50%) translateY(50px); }
}

.scan-controls {
    margin-bottom: 20px;
}

.scan-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 0 10px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scan-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.scan-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.scan-btn.stop {
    background: #dc3545;
}

.scan-btn.stop:hover {
    background: #c82333;
}

.scan-btn.upload {
    background: #28a745;
}

.scan-btn.upload:hover {
    background: #218838;
}

.scan-btn.back {
    background: #6c757d;
}

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

.scan-result {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    border-left: 4px solid #667eea;
}

.scan-result p {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.scan-result span {
    font-weight: 600;
    color: #667eea;
}

.scan-result-success {
    border-left-color: #28a745;
}

.scan-result-success span {
    color: #28a745;
}

.scan-result-error {
    border-left-color: #dc3545;
}

.scan-result-error span {
    color: #dc3545;
}

.scan-result-processing {
    border-left-color: #ffc107;
}

.scan-result-processing span {
    color: #ffc107;
}

.scan-result-scanning {
    border-left-color: #17a2b8;
}

.scan-result-scanning span {
    color: #17a2b8;
}

.scan-result-stopped {
    border-left-color: #6c757d;
}

.scan-result-stopped span {
    color: #6c757d;
}

.scan-result-waiting {
    border-left-color: #667eea;
}

.scan-result-waiting span {
    color: #667eea;
}

.confirm-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    margin-top: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.confirm-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .scan-section {
        margin: 10px;
        padding: 20px;
    }
    
    .scan-area {
        max-width: 100%;
    }
    
    .scanner-video {
        height: 240px;
    }
    
    .scan-frame {
        width: 150px;
        height: 80px;
    }
    
    .scan-line {
        width: 150px;
    }
    
    .scan-btn {
        padding: 10px 20px;
        font-size: 14px;
        margin: 5px;
    }
}