/* Apple 標準淺色液態玻璃風格核心變數 */
:root {
    /* 淺色半透明 (0.4) 營造清透感 */
    --glass-white: rgba(255, 255, 255, 0.4);
    /* 強化白色邊框 (0.6) 營造玻璃切割亮邊 */
    --glass-border: rgba(255, 255, 255, 0.6);
    --apple-blue: #007aff;
    --apple-green: #34c759;
    --apple-red: #ff3b30;
    --apple-gray: #8e8e93;
    /* 淺色模式回歸深色文字 */
    --text-dark: #1d1d1f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    /* 淺色模式改用鮮豔活潑的淺藍漸層，玻璃感最明顯 */
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
}

/* 玻璃容器 */
.container {
    width: 90%;
    max-width: 480px;
    padding: 30px;
    background: var(--glass-white);
    /* 高清晰模糊與飽和度提升 */
    backdrop-filter: blur(25px) saturate(160%);
    -webkit-backdrop-filter: blur(25px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    /* 淺色模式使用較柔和的深色陰影 */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    text-align: center;
    /* 模擬表面陽光反射高光 */
    background-image: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 50%);
}

h1 { font-weight: 700; font-size: 28px; margin-bottom: 25px; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* 玻璃卡片階段 */
.stage { margin-bottom: 20px; }
.hidden { display: none !important; }

/* 輸入框 - 淺色半透明 */
input[type="password"], input[type="text"] {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    font-size: 16px;
    color: var(--text-dark);
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* 修正日期框過寬問題 */
input[type="date"] {
    width: auto;
    min-width: 220px;
    max-width: 100%;
    padding: 12px;
    margin: 10px auto;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    font-size: 16px;
    color: var(--text-dark);
    display: block;
    cursor: pointer;
}

input:focus { background: rgba(255, 255, 255, 0.8); border-color: var(--apple-blue); outline: none; }

/* 按鈕美化 - 統一透明反射風格 */
button {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    /* 基礎透明效果 */
    background: rgba(255, 255, 255, 0.3);
    color: var(--text-dark);
    backdrop-filter: blur(5px);
    /* 增加表面光澤感 */
    background-image: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
}

button:active { transform: scale(0.97); opacity: 0.8; }
button:disabled { background: rgba(0,0,0,0.05) !important; color: #999; }

/* 針對功能按鈕賦予「透明彩色玻璃」效果 */
.primary-btn { 
    background: rgba(0, 122, 255, 0.7); 
    color: #fff; 
    border-color: rgba(0, 122, 255, 0.2); 
}
.secondary-btn { 
    background: rgba(255, 255, 255, 0.4); 
    border-color: var(--glass-border); 
}
.danger-btn { 
    background: rgba(255, 59, 48, 0.15); 
    color: var(--apple-red); 
    border-color: rgba(255, 59, 48, 0.2);
}
.purple-btn { 
    background: rgba(88, 86, 214, 0.7); 
    color: #fff; 
}
.info-btn { 
    background: rgba(90, 200, 250, 0.7); 
    color: #fff; 
}
.warning-btn { 
    background: rgba(255, 149, 0, 0.7); 
    color: #fff; 
}
.dark-btn { 
    background: rgba(0, 0, 0, 0.6); 
    color: #fff; 
}

.button-group { display: flex; gap: 10px; }
.button-group button { flex: 1; }

/* 玻璃盒與網格 */
.glass-box {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 15px;
    text-align: left;
    margin: 15px 0;
}
.success-accent { border-left: 6px solid var(--apple-green); }

.section-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 18px;
    margin: 15px 0;
}
.section-grid label { font-size: 14px; display: flex; align-items: center; cursor: pointer; }
.section-grid input { margin-right: 8px; width: auto; }

/* 標籤 */
.date-tag {
    display: inline-flex;
    align-items: center;
    background: var(--apple-blue);
    color: white;
    padding: 6px 12px;
    border-radius: 10px;
    margin: 4px;
    font-size: 13px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Loading 效果 */
#loading-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.spinner {
    width: 30px; height: 30px;
    border: 3px solid rgba(0, 122, 255, 0.1);
    border-top-color: var(--apple-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer-copyright { position: fixed; bottom: 15px; color: #fff; opacity: 0.8; font-size: 12px; }
