/* style.css - 智慧廚房管家 (多彩大字/佈局修正版) */

:root {
    --primary-orange: #FF8C00; 
    --accent-yellow: #FFD700;   
    --soft-green: #E8F5E9;      
    --soft-blue: #E3F2FD;       
    --danger-red: #FF5252;      
    
    --font-base: 18px;          
    --font-h1: 26px;
    --font-h2: 22px;
    
    --white: #FFFFFF;
    --text-dark: #2D3436;
}

/* 全域設定：關鍵修正，確保所有元素寬度計算包含內邊距 */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    font-size: var(--font-base);
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #FFF9C4 0%, #E1F5FE 50%, #E8F5E9 100%);
    background-attachment: fixed;
    color: var(--text-dark);
    line-height: 1.7;
    /* 增加底部空間，確保最後一個按鈕不被導航欄遮住 */
    padding-bottom: 100px; 
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

header {
    background: linear-gradient(to right, var(--primary-orange), var(--accent-yellow));
    color: var(--white);
    padding: 20px;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
}

/* --- 表單優化：解決欄位溢出與重疊 --- */
.form-group {
    margin-bottom: 20px; /* 增加間距，防止重疊 */
    width: 100%;
}

.form-group label {
    display: block;
    font-size: 19px;
    color: var(--primary-orange);
    margin-bottom: 10px;
    font-weight: bold;
}

/* 關鍵修正：確保寬度 100% 且不超出手機螢幕 */
.form-group input, 
.form-group select {
    width: 100% !important; /* 強制寬度 */
    max-width: 100%;       /* 限制最大寬度 */
    font-size: var(--font-base);
    padding: 14px;
    border: 2px solid #EEE;
    border-radius: 10px;
    background-color: #FAFAFA;
    display: block;        /* 確保單行排列 */
    height: 55px;          /* 統一度高 */
}

/* 修正到期日欄位 */
input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
}

.login-submit, .btn-primary {
    width: 100%;
    background: linear-gradient(to bottom, #FFB74D, #FF8C00);
    height: 60px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 0 #E67E22;
    margin-top: 10px;
    transition: all 0.2s;
}

.login-submit:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #E67E22;
}

/* --- 表格轉色設計 (手機版) --- */
@media screen and (max-width: 600px) {
    table, thead, tbody, th, td, tr { display: block; }
    
    thead tr { display: none; } /* 隱藏表頭 */

    table tr {
        border: 2px solid var(--soft-blue);
        background: var(--white);
        margin-bottom: 20px;
        border-left: 8px solid var(--accent-yellow);
        border-radius: 12px;
        padding: 10px;
    }
    
    table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 5px;
        text-align: right;
        border: none;
        border-bottom: 1px solid #f9f9f9;
    }

    table td::before {
        content: attr(data-label); /* 顯示標籤 */
        color: var(--primary-orange);
        font-weight: bold;
        font-size: 17px;
        text-align: left;
    }
}

/* --- 底部固定導航 --- */
.bottom-nav {
    display: flex;
    position: fixed; 
    bottom: 0;
    left: 0;
    width: 100%; 
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--accent-yellow);
    z-index: 2000;
    height: 80px;
}

.bottom-nav .btn {
    flex: 1; 
    text-align: center;
    text-decoration: none; 
    color: #555; 
    font-size: 12px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
