/* ==========================================
   AURORA TEA CO. | 臻選茶品線上訂購系統
   設計風格：現代極簡 (Modern Minimalist) | 畫廊暖白、曜石黑、深琥珀金
   設計思維：等比例緊湊優化、小圓角 (4px-6px)、極致流暢自適應 (徹底解決右側切掉問題)
   ========================================== */

/* 1. 全域變數與品牌配色 (精品美學配色) */
:root {
    /* 靜謐溫潤的畫廊暖白與絲絨灰背景 */
    --bg-gradient: linear-gradient(180deg, #f4f3ef 0%, #e8e6e0 100%);
    
    /* 現代極簡亮白半透明玻璃材質，搭配極細緻的微透明邊框 */
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(0, 0, 0, 0.05);
    --card-hover-bg: rgba(255, 255, 255, 0.95);
    --card-hover-border: rgba(156, 124, 93, 0.35); /* 輕微的琥珀金懸浮外框 */
    
    /* 沉穩奢華品牌色 */
    --primary: #9c7c5d;          /* 經典深琥珀金 */
    --primary-light: #bca188;
    --primary-gradient: linear-gradient(135deg, #8c6c4f 0%, #bca188 100%);
    
    --accent: #111111;           /* 曜石純黑 (極簡沉穩) */
    --accent-gradient: linear-gradient(135deg, #111111 0%, #2c2c2c 100%);
    --accent-hover: #000000;
    
    /* 極簡黑灰字體配色 */
    --text-main: #111111;        /* 曜石黑主文字 */
    --text-muted: #555555;       /* 絲絨深灰說明字 */
    --text-dark: #000000;
    
    /* 極致輕盈、完全不黏膩的空氣感微陰影 */
    --shadow: 0 10px 45px -10px rgba(0, 0, 0, 0.035), 0 1px 3px rgba(0, 0, 0, 0.01);
    
    /* 鐵律：將圓角徹底縮小為 4px 至 6px，呈現俐落幹練的幾何線條 */
    --radius-lg: 6px;
    --radius-md: 4px;
    --radius-sm: 2px;
    
    --transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 全域 box-sizing 設定，確保 padding 與 border 不會撐開容器總寬度 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    /* 引入精品最愛的英文襯線體與無襯線體，中文搭配高雅宋體或蘋方無襯線 */
    font-family: 'Inter', 'Noto Sans TC', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 10px; /* 緊湊型邊距 */
    overflow-x: hidden; /* 防止水平溢出 */
    letter-spacing: 0.02em;
}

/* 2. 應用程式外容器 (等比例緊湊化：最大寬度改為更精緻的 1060px，防範超出螢幕) */
.app-container {
    width: 100%;
    max-width: 1060px; /* 從 1200px 縮小至 1060px，更精緻且適配多數筆電 */
    margin: 0 auto; 
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    padding: 24px; /* 從 40px 等比例縮小至 24px，大大節省空間 */
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 20px; /* 緊湊型間距 */
}

/* 3. 頂部標題區 */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 16px; /* 縮小間距 */
    flex-wrap: wrap;
    gap: 16px;
}

.logo-area {
    flex: 1;
    min-width: 200px;
}

.logo-text h1 {
    font-family: 'Playfair Display', 'Noto Serif TC', serif;
    font-size: 1.8rem; /* 從 2.2rem 縮小，更為精緻 */
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 4px;
    line-height: 1;
    margin-bottom: 4px;
}

.logo-text p {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    font-weight: 500;
}

/* 連線狀態指示燈 */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #94a3b8;
}

.status-dot.connected {
    background-color: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

/* 4. 主要內容排版 */
.app-main {
    display: grid;
    grid-template-columns: 1.15fr 1fr; /* 微調比例，讓點餐與看板更平衡 */
    gap: 20px;
}

/* 防止 CSS Grid 的子元素被內容撐開導致右側切邊 */
.app-main > section {
    min-width: 0;
}

/* 5. 磨砂玻璃卡片 (等比例緊湊化：Padding 縮減為 20px) */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 20px; /* 從 30px 縮小至 20px，提供更緊湊高雅的呼吸感 */
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.glass-card.full-height {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.section-title {
    font-family: 'Playfair Display', 'Noto Serif TC', serif;
    font-size: 1.15rem; /* 從 1.25rem 縮小 */
    font-weight: 700;
    margin-bottom: 16px; /* 縮小間距 */
    letter-spacing: 2px;
    color: var(--text-main);
    border-bottom: 1px solid var(--primary);
    padding-bottom: 6px;
    display: inline-block;
}

/* 表單區塊分組與雙欄佈局 (等比例緊湊化與高辨識度) */
.form-group {
    margin-bottom: 18px; /* 從 24px 縮小至 18px */
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.01);
}

.options-row {
    display: flex;
    gap: 16px; /* 從 20px 縮小 */
}

.half-width {
    flex: 1;
}

.group-label {
    display: block;
    font-size: 0.68rem; /* 從 0.72rem 縮小 */
    color: var(--text-muted);
    margin-bottom: 8px; /* 縮小邊距 */
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* 類別分頁標籤容器 */
.category-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
}

/* 隱藏橫向滾動條 */
.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab-btn {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
    padding: 8px 14px; /* 緊湊型 */
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: var(--transition);
    white-space: nowrap;
    outline: none;
}

.category-tab-btn:hover {
    background: #ffffff;
    color: var(--text-main);
    border-color: rgba(0, 0, 0, 0.15);
}

.category-tab-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* 飲料滾動格線容器 */
.scrollable-grid {
    max-height: 250px; /* 從 290px 縮小，大幅減小縱向高度佔用 */
    overflow-y: auto;
    padding-right: 6px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.008);
    padding: 10px;
}

.scrollable-grid::-webkit-scrollbar {
    width: 4px;
}

.scrollable-grid::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* 6. 茶飲選擇卡片格線 */
.tea-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px; /* 緊湊型 */
}

.tea-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    padding: 12px; /* 從 16px 縮小 */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 4px;
    transition: var(--transition);
    color: var(--text-main);
    outline: none;
    height: 100%;
}

.tea-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.tea-card.active {
    background: #ffffff;
    border-color: var(--primary);
    border-width: 1.5px;
    box-shadow: 0 4px 15px rgba(156, 124, 93, 0.06);
}

.tea-name {
    font-size: 0.85rem; /* 緊湊 */
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tea-price {
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

.tea-desc {
    font-size: 0.65rem; /* 緊湊 */
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 2px;
}

/* 按鈕自適應響應式網格 (解決溢出與換行問題) */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); /* 在筆電上也能提早換行 */
    gap: 8px;
}

.option-grid.size-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.option-grid.addon-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.option-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.option-btn {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
    padding: 10px 8px; /* 從 12px 縮小，更精緻 */
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.72rem; /* 緊湊 */
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: var(--transition);
    text-align: center;
    outline: none;
    width: 100%; 
    white-space: normal; 
    word-break: break-all;
}

.option-btn:hover {
    background: #ffffff;
    color: var(--text-main);
    border-color: rgba(0, 0, 0, 0.15);
}

.option-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(156, 124, 93, 0.15);
}

/* 8. 賓客尊稱/客製附言輸入框 */
.name-input {
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-main);
    padding: 10px 14px; /* 從 12px 縮小 */
    border-radius: var(--radius-md);
    font-size: 0.78rem; /* 緊湊 */
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.name-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(156, 124, 93, 0.1);
}

.name-input::placeholder {
    color: #94a3b8;
}

/* 9. 數量與價格即時計算面板 (等比例緊湊化) */
.price-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 14px 20px; /* 從 18px 24px 縮小 */
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-top: 6px;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.005);
}

.qty-section {
    display: flex;
    flex-direction: column;
}

.qty-section .group-label {
    margin-bottom: 6px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 28px; /* 從 32px 縮小 */
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    outline: none;
}

.qty-btn:hover {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.qty-val {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.price-display-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.price-item {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.price-total {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.highlight-price {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem; /* 從 1.6rem 縮小，無比精緻 */
    font-weight: 700;
    color: var(--primary);
}

/* 10. 送出訂購按鈕 (極簡純黑設計) */
.submit-btn {
    width: 100%;
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    padding: 14px; /* 從 18px 縮小 */
    border-radius: var(--radius-md);
    font-size: 0.8rem; /* 緊湊 */
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    margin-top: 8px;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: #000000;
}

.submit-btn:active {
    transform: translateY(1px);
}

.arrow-icon {
    transition: var(--transition);
}

.submit-btn:hover .arrow-icon {
    transform: translateX(4px);
}

/* 11. 訂單看板 */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px; /* 縮小 */
}

.board-header .section-title {
    margin-bottom: 0;
}

.badge {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-main);
    padding: 3px 10px; /* 緊湊 */
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.order-list-container {
    flex: 1;
    overflow-y: auto;
    max-height: 480px; /* 縮小以符合整體緊湊佈局 */
    padding-right: 6px;
}

.order-list-container::-webkit-scrollbar {
    width: 4px;
}

.order-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.order-list-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 10px; /* 緊湊 */
}

/* 訂單卡片項目 */
.order-item {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-md);
    padding: 14px; /* 從 18px 縮小 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.005);
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.order-item:hover {
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.015);
}

.order-item.completed {
    background: rgba(16, 185, 129, 0.01);
    border-color: rgba(16, 185, 129, 0.25);
}

.order-item-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.order-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.order-item-name {
    font-size: 0.88rem; /* 緊湊 */
    font-weight: 700;
    color: var(--text-main);
}

.order-item-qty {
    font-size: 0.65rem;
    background: rgba(0, 0, 0, 0.03);
    padding: 1px 4px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.order-item-specs {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.spec-tag {
    background: #ffffff;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.spec-tag.addons-tag {
    border-color: rgba(156, 124, 93, 0.2);
    color: var(--primary);
    background: rgba(156, 124, 93, 0.02);
}

.order-item-notes {
    font-size: 0.65rem;
    color: #c2410c;
    background: rgba(251, 146, 60, 0.05);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(251, 146, 60, 0.15);
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.order-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    margin-left: 12px;
}

.order-item-time {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.order-status-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.order-status-badge.pending {
    background: rgba(156, 124, 93, 0.08);
    border: 1px solid rgba(156, 124, 93, 0.18);
    color: #8c6c4f;
}

.order-status-badge.completed {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.18);
    color: #047857;
}

.complete-order-btn {
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    padding: 4px 10px; /* 緊湊 */
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.complete-order-btn:hover {
    background: #000000;
    transform: translateY(-1px);
}

/* 12. 讀取中與無資料狀態 */
.loading-state, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.empty-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
    opacity: 0.3;
}

/* 13. 超唯美精品收據彈窗 (Modal) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.receipt-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: var(--text-main);
}

.modal-overlay:not(.hidden) .receipt-card {
    transform: scale(1);
}

.success-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

.checkmark {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s;
}

.modal-overlay:not(.hidden) .checkmark {
    transform: scale(1);
}

.receipt-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    letter-spacing: 2px;
}

.receipt-subtitle {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.receipt-divider {
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 10px 0;
}

.receipt-divider.dotted {
    background: transparent;
    border-top: 1px dotted rgba(0, 0, 0, 0.15);
}

.receipt-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.receipt-label {
    color: var(--text-muted);
}

.receipt-value {
    color: var(--text-main);
    font-weight: 700;
    max-width: 65%;
    text-align: right;
    word-break: break-all;
}

.receipt-value.highlight {
    color: var(--primary);
}

.receipt-row.total {
    margin-top: 6px;
    font-size: 0.9rem;
    align-items: center;
}

.receipt-row.total .receipt-label {
    color: var(--text-main);
    font-weight: 800;
}

.receipt-value.price {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.close-receipt-btn {
    width: 100%;
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 24px;
    outline: none;
}

.close-receipt-btn:hover {
    background: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   全新響應式網格與螢幕自適應斷點 Media Queries
   ========================================== */

/* 鐵律修正一：中小型螢幕 (提早至 1100px) 自動切換為單欄上下排列，徹底消滅右側被切掉問題 */
@media (max-width: 1100px) {
    .app-container {
        padding: 20px;
        gap: 16px;
        max-width: 100%;
    }
    
    .app-main {
        grid-template-columns: 1fr; /* 右邊看板自動變為下方看板，絕不切邊 */
        gap: 20px;
    }
    
    .glass-card.full-height {
        min-height: auto;
    }
}

/* 小型螢幕 (智慧型手機、窄版手持裝置) */
@media (max-width: 768px) {
    body {
        padding: 10px 6px; /* 減小 Body 襯距，為手機爭取最大顯示寬度 */
    }
    
    .app-container {
        padding: 16px 12px; 
        gap: 16px;
    }
    
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .status-indicator {
        align-self: flex-start;
    }
    
    /* 雙欄在手機端變為單欄垂直排列，防範擠壓 */
    .options-row {
        flex-direction: column;
        gap: 14px;
    }
    
    .half-width {
        width: 100%;
    }
}

/* 極小螢幕 (iPhone SE 等極窄手機) */
@media (max-width: 500px) {
    .tea-grid {
        grid-template-columns: 1fr; /* 飲料卡片在手機上改為單欄，更清晰好點擊 */
    }
    
    .price-calc-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }
    
    .price-display-section {
        align-items: flex-start; /* 價格靠左對齊，符合閱讀直覺 */
    }
    
    .highlight-price {
        font-size: 1.3rem;
    }
    
    .glass-card {
        padding: 16px 12px; 
    }
    
    .option-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); 
    }
}

/* 14. 動畫定義 */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 15. 頁尾 */
.app-footer {
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 16px;
    margin-top: 8px;
    letter-spacing: 1px;
}
