﻿:root {
    /* --- New Liquid Glass Palette (Light Mode) --- */
    --glass-bg: rgba(255, 255, 255, 0.65); /* 卡片本體：高通透白 */
    --glass-border: rgba(255, 255, 255, 0.8); /* 邊框高光 */
    --glass-shadow: 0 8px 8px 0 rgba(31, 38, 135, 0.15); /* 柔和深藍陰影 */
    
    --primary-gradient: linear-gradient(135deg, #6dd5ed 0%, #2193b0 100%); /* 清新藍漸層 */
    --primary-color: #2193b0;
    
    --success-bg: rgba(46, 204, 113, 0.15);
    --success-text: #27ae60;
    
    --warning-bg: rgba(243, 156, 18, 0.15);
    --warning-text: #ffd208;
    
    --danger-bg: rgba(231, 76, 60, 0.15);
    --danger-text: #c0392b;
    
    --text-dark: #2d3436;
    --text-gray: #35393a;
    
    --radius-lg: 24px; /* 液態大圓角 */
    --radius-md: 18px; /* 卡片圓角 */
    --radius-sm: 12px; /* 按鈕圓角 */
    --screen-radius: 36px; /* 螢幕圓角 */
}

body {
    margin: 0;
    overflow: hidden;
    font-family: "SF Pro Rounded", "Microsoft JhengHei", "Noto Sans TC", sans-serif; /* 圓體字更搭 */
    background-color: #000; /* 機身維持全黑 */
}

/* --- 全螢幕遮罩 --- */
#init-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; 
    background: rgba(0,0,0,0.85); 
    backdrop-filter: blur(10px); /* 遮罩也要毛玻璃 */
    z-index: 10000; 
    display: flex; flex-direction: column; justify-content: center; align-items: center; 
    cursor: pointer; color: white;
}

/* --- 容器 --- */
#app-container {
    width: 992px; height: 620px;
    position: absolute; transform-origin: 0 0;
    display: flex; flex-direction: column;
    background-color: #000;
    box-shadow: none;
}

/* --- 擬真螢幕顯示區 (Main Area) --- */
.main-area { 
    flex: 1; 
    overflow: hidden; 
    padding: 16px; 
    gap: 16px; 
    position: relative;
    
    /* 液態流體背景 */
    background: linear-gradient(120deg, #ffeaea 0%, #d1d6eb 100%);
    border-radius: var(--screen-radius); 
    margin: 0; 
}

/* 在背景加入一點光暈裝飾 (偽元素) */
.main-area::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(74, 144, 226, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* --- 隱形 Footer --- */
.footer-area { 
    height: 60px; 
    background: #000; 
    color: #888; 
    display: flex; align-items: center; 
    padding: 0 30px; 
    justify-content: space-between;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

button { cursor: pointer; border: none; outline: none; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); font-family: inherit; }
button:active { transform: scale(0.95); }

/* --- Glassmorphism 卡片通用樣式 --- */
.modern-card, .kitchen-card-lg {
    position: relative;
    z-index: 1; /* 浮在光暈上 */
    background: var(--glass-bg);
    backdrop-filter: blur(12px); /* 核心毛玻璃效果 */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
    
    padding: 5px 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    height: 90px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    
    /* 左側色條改為內發光 */
    border-left: 6px solid var(--primary-color);
}

.kitchen-card-lg {
    margin-bottom: 0px;
    height: 100%;
}

/* Hover 浮起效果 */
.modern-card:hover, .kitchen-card-lg:hover {
    /*transform: translateY(-2px);*/
    /*box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.2);*/
    background: rgba(255, 255, 255, 0.85); /* 變亮 */
}

.modern-card:active, .kitchen-card-lg:active { transform: scale(0.98); }

/* 優先級與超時樣式 */
.modern-card.priority, .kitchen-card-lg.priority {
    border-left-color: var(--warning-text);
    background: rgb(255 234 189 / 80%) !important;
}

@keyframes pulseGlassRed { 
    0% { box-shadow: inset 0 0 0 0 rgba(231, 76, 60, 0.2),0 8px 8px 0 rgba(31, 38, 135, 0.15); border-left-color: var(--danger-text); } 
    50% { box-shadow: inset 0 0 30px 0 rgba(231, 76, 60, 0.4),0 8px 8px 0 rgba(31, 38, 135, 0.15); border-left-color: #ff0000; } 
    100% { box-shadow: inset 0 0 0 0 rgba(231, 76, 60, 0.2),0 8px 8px 0 rgba(31, 38, 135, 0.15); border-left-color: var(--danger-text); } 
}
.modern-card.timeout, .kitchen-card-lg.timeout {
    animation: pulseGlassRed 2s infinite;
}

@keyframes flashError { 0%, 100% { background-color: inherit; } 50% { background-color: rgba(231, 76, 60, 0.3); } }
.flash-error { animation: flashError 0.4s ease-in-out; }

/* --- 內部元件樣式 --- */
.qty-group, .k-qty-group-lg {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex-shrink: 0;
    cursor: pointer; 
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
    /* 移除所有實線邊框，改用 Neomorphism 凹槽感或留白 */
    /*border-right: 1px solid rgba(0,0,0,0.05); */
}
.qty-group:hover, .k-qty-group-lg:hover { background-color: var(--success-bg); }

.card-qty { 
    font-size: 3rem; font-weight: 800; 
    background: var(--primary-gradient); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; /* 文字漸層 */
    line-height: 1; text-align: center; 
}
.card-timer { font-size: 0.95rem; color: #b2bec3; font-weight: 700; font-family: monospace; margin-top: 4px; }
.card-timer.timeout { color: var(--danger-text); }

.card-info { flex: 1; display: flex; flex-direction: column; justify-content: center; overflow: hidden; height: 100%; padding-left: 10px; }
.info-main { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); line-height: 1.2; text-shadow: 0 1px 1px rgba(255,255,255,0.8); }
.info-sub { display: block; font-size: 1.1rem; color: var(--text-gray); margin-top: 2px; font-weight: 500; }
.info-opts { font-size: 1.05rem; color: var(--success-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 按鈕區 */
.btn-grid-area { width: 70px; height: 100%; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; margin-left: 8px; flex-shrink: 0; }
.grid-btn { 
    border-radius: 8px; font-size: 0.9rem; 
    background: rgba(255,255,255,0.5); 
    box-shadow: 2px 2px 5px rgba(0,0,0,0.05), -2px -2px 5px rgba(255,255,255,0.8);
    color: var(--text-gray);
    display: flex; align-items: center; justify-content: center; padding: 0; 
}
.grid-btn:active { box-shadow: inset 2px 2px 5px rgba(0,0,0,0.05); }

/* --- 喊單頁面元件 --- */
.col-selector { 
    border-radius: var(--radius-md); 
    overflow-y: auto; 
    display: flex; flex-direction: column; gap: 8px; 
    padding: 8px; 
    /* 選擇器容器本身透明，讓背景透出來 */
    background: rgba(255,255,255,0.4); 
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02); 
    border: 1px solid rgba(255,255,255,0.3);
}

.sel-btn { 
    min-height: 60px; 
    border-radius: var(--radius-sm); 
    font-size: 1.8rem; 
    background: rgba(255,255,255,0.7); 
    backdrop-filter: blur(5px);
    color: var(--text-dark); 
    border: 1px solid rgba(255,255,255,0.9);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    font-weight: 600; 
    position: relative;
    overflow: hidden;
}
.sel-btn:active { transform: scale(0.97); }

/* 選擇狀態：液態漸層背景 */
.sel-btn.active { 
    background: var(--primary-gradient); 
    color: white; 
    border: none; 
    box-shadow: 0 4px 15px rgba(33, 147, 176, 0.3);
}
.sel-btn-opt.active { 
    background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%); /* 綠色漸層 */
    color: white; 
    border: none; 
    box-shadow: 0 4px 15px rgba(86, 171, 47, 0.3);
}

/* --- 廚房佈局 --- */
.kitchen-col-active { flex: 2; display: grid; grid-template-rows: repeat(4, 1fr); gap: 12px; height: 100%; }
.kitchen-col-upcoming { 
    flex: 1; overflow-y: auto; 
    /*background: rgba(255,255,255,0.3);*/ /* 半透明背景 */
    /*border: 1px solid rgba(255,255,255,0.4);*/
    /*border-radius: var(--radius-md); */
    padding: 8px;
}

/* 廚房左側大卡片 */
.kitchen-card-lg {
    padding: 0 24px 0 10px;
    border-left-width: 8px;
}
.k-qty-group-lg { 
    width: 95px; margin-right: 0px; padding: 10px 0; 
    /*border-right: 1px solid rgba(0,0,0,0.06); */
}
.k-qty-lg { 
    font-size: 4.8rem; font-weight: 800; 
    background: var(--primary-gradient); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    line-height: 0.9; 
    filter: drop-shadow(0 4px 6px rgba(33, 147, 176, 0.2));
}
.k-timer-lg { font-size: 1.8rem; color: #b2bec3; font-weight: 700; font-family: monospace; /*margin-top: 8px;*/ }
.k-timer-lg.timeout { color: var(--danger-text); }

.k-info-lg { flex: 1; padding: 10px 0; }
.k-main-lg { font-size: 2.4rem; font-weight: 800; color: var(--text-dark); letter-spacing: -1px; }
.k-sub-lg { font-size: 2rem; color: var(--text-gray); margin-left: 15px; font-weight: 500; }
.k-opts-lg { font-size: 1.5rem; color: var(--success-text); font-weight: 700; /*margin-top: 8px;*/ line-height: 1.3; }

.k-actions-lg { display: none !important; }

/* --- 狀態列與文字 --- */
.status-group { display: flex; align-items: center; gap: 12px; }
.status-indicator { width: 10px; height: 10px; border-radius: 50%; background-color: #444; box-shadow: 0 0 8px rgba(255,255,255,0.1); transition: all 0.5s; }
.status-indicator.online { background-color: var(--success-text); box-shadow: 0 0 10px var(--success-text); }
.status-indicator.offline { background-color: var(--danger-text); box-shadow: 0 0 10px var(--danger-text); }
.datetime-display { font-size: 1.2rem; font-weight: 600; letter-spacing: 1px; color: #666; }

/* 廚房模式 - 移除深色背景，改為統一的 Light Glass 風格 */
body.kitchen-theme { background-color: #000; }
body.kitchen-theme #app-container { background-color: #000; color: #333; }
body.kitchen-theme .modern-card, body.kitchen-theme .kitchen-card-lg { background: var(--glass-bg); color: #333; }
body.kitchen-theme .info-main, body.kitchen-theme .k-main-lg { color: var(--text-dark); }
body.kitchen-theme .info-sub, body.kitchen-theme .k-sub-lg { color: var(--text-gray); }

/* 修正分隔線 */
/*body.kitchen-theme .qty-group { border-right: 1px solid rgba(0,0,0,0.08); }
body.kitchen-theme .k-qty-group-lg { border-right: 1px solid rgba(0,0,0,0.08); }*/