:root { 
    --bg-color: #121212; --card-bg: #1e1e1e; --text-main: #ffffff; 
    --text-sub: #aaaaaa; --danger: #ff5252; --success: #4caf50; 
    --warning: #ffb300; --info: #2196F3; 
}

html, body { overflow: hidden; height: 100%; width: 100%; margin: 0; padding: 0; background-color: var(--bg-color); overscroll-behavior: none; }
body { font-family: 'Segoe UI', Roboto, sans-serif; color: var(--text-main); display: flex; justify-content: center; align-items: center; }

.container { 
    text-align: center; width: 90%; max-width: 400px; height: 92vh; 
    max-height: 720px; 
    background-color: var(--card-bg); border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.8); 
    display: flex; flex-direction: column; justify-content: center; padding: 0 20px; box-sizing: border-box; gap: 8px; position: relative; 
}

.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.header-row h1 { font-size: 22px; color: var(--danger); margin: 0; font-weight: bold; }
.mode-toggle-btn { background: #333; color: white; border: none; border-radius: 50%; width: 35px; height: 35px; cursor: pointer; display: flex; justify-content: center; align-items: center; }

#input-zone { display: flex; flex-direction: column; gap: 8px; width: 100%; }
#result-zone { display: flex; flex-direction: column; width: 100%; margin-top: 25px; }

.location-block { display: flex; flex-direction: column; width: 100%; text-align: left; }
.location-block label { font-size: 11px; color: var(--text-sub); margin-bottom: 4px; font-weight: bold; }
.select-group { display: flex; gap: 8px; position: relative; width: 100%; margin-bottom: 4px; align-items: stretch; }

/* 🌟 1. 將選單與輸入框的基礎設定分開，拔除下拉選單無效的 35px 右邊距 */
select, .station-input { 
    background-color: #2c2c2c; color: white; border: 1px solid #444; 
    padding: 12px; 
    border-radius: 10px; font-size: 15px; outline: none; box-sizing: border-box; width: 100%; 
}

/* 🌟 2. 專屬輸入框設定：保留右側 35px 空間給「清除 (×)」按鈕 */
.station-input {
    padding-right: 35px;
}

/* 🌟 3. 左側選單設定：微調撐開至 35%，並徹底釋放被擠壓的文字空間 */
.type-select, .type-select-label { 
    width: 35% !important; /* 原本 30%，微調放大 */
    flex-shrink: 0; box-sizing: border-box; height: 46px; 
}

.type-select {
    padding-left: 10px;  /* 縮減左側留白 */
    padding-right: 20px; /* 縮減右側留白 (20px 足夠容納原生的下拉箭頭) */
    font-size: 14px;     /* 在小螢幕上稍微縮小字體，確保四個字穩如泰山 */
}

.type-select-label {
    background: #2a2a2a; border: 1px solid #333; border-radius: 10px;
    font-size: 12px; color: #888; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    white-space: nowrap;
}

/* 🌟 4. 右側容器退讓：配合左側放大，這裡縮減至 65% */
.autocomplete-wrapper { position: relative; width: 65%; flex-grow: 1; }
.clear-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; background: rgba(255, 255, 255, 0.15); color: #fff; border-radius: 50%; display: none; justify-content: center; align-items: center; cursor: pointer; font-size: 14px; z-index: 5; }
.clear-btn:active { background: rgba(255, 255, 255, 0.4); }

.autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background-color: #2c2c2c; border: 1px solid #444; z-index: 1000; max-height: 200px; overflow-y: auto; display: none; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.dropdown-item { padding: 12px; border-bottom: 1px solid #333; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.star-btn { padding: 0 10px; font-size: 18px; }

.time-area { margin: 5px 0 15px 0; display: flex; flex-direction: column; align-items: center; min-height: 110px; justify-content: center; }
.time-display { font-size: 55px; font-weight: bold; color: #e0e0e0; letter-spacing: 2px; }
.main-action-btn { background-color: var(--success); color: white; border: none; padding: 16px; font-size: 17px; border-radius: 12px; font-weight: bold; width: 100%; cursor: pointer; }
.btn-reset { background: transparent; color: var(--text-sub); border: 1px dashed #555; width: 100%; padding: 12px; border-radius: 10px; cursor: pointer; margin-top: 5px; display: none; justify-content: center; align-items: center; }
.plan-b-container { display: none; flex-direction: column; width: 100%; gap: 10px; margin-top: 5px; }
.plan-b-option { border-radius: 12px; padding: 15px; display: flex; justify-content: space-between; align-items: center; background: #2a2a2a; border: 1px solid #333; color: white; text-decoration: none; width: 100%; box-sizing: border-box; }
.footer { margin-top: 15px; font-size: 11px; color: #666; display: flex; flex-direction: column; align-items: center; }
.footer-links-container { display: flex; gap: 20px; margin-top: 10px; }
.footer-toggle { color: var(--success); font-weight: bold; cursor: pointer; }
.contact-links { display: none; gap: 10px; margin-top: 10px; width: 100%; justify-content: center; }
.contact-btn { text-decoration: none; color: white; font-size: 11px; padding: 8px 15px; border-radius: 20px; font-weight: bold; }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 900; }
.overlay.active { opacity: 1; pointer-events: all; }

.bottom-sheet { position: fixed; bottom: 0; left: 50%; width: 100%; max-width: 400px; height: 92vh; background-color: var(--card-bg); border-radius: 20px 20px 0 0; transform: translate(-50%, 100%); transition: transform 0.3s cubic-bezier(0.1, 0.8, 0.2, 1); z-index: 2000; padding: 20px; box-sizing: border-box; display: flex; flex-direction: column; }
.bottom-sheet.active { transform: translate(-50%, 0); }

/* 🌟 核心修正：設定面板的頭部對齊與內容間距 */
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.sheet-content { flex: 1; display: flex; flex-direction: column; align-items: stretch; gap: 15px; overflow-y: auto; }

/* 🌟 彩蛋專屬避震彈簧 (點擊回饋感) */
.egg-trigger {
    transition: transform 0.1s ease, opacity 0.1s ease !important;
    cursor: pointer;
}
.egg-trigger:active {
    transform: scale(0.92) !important;
    opacity: 0.7 !important;
}
/* ==========================================
   🌟 去白條魔法 (客製化暗黑捲軸)
   ========================================== */
/* 針對 Firefox 的設定 */
.autocomplete-list {
    max-height: 250px; /* 限制高度讓它出現捲軸 */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #555 #222;
}

/* 針對 Chrome, Edge, Safari 的暗黑捲軸 */
.autocomplete-list::-webkit-scrollbar {
    width: 6px;
}
.autocomplete-list::-webkit-scrollbar-track {
    background: #1e1e1e; /* 軌道顏色融入背景 */
    border-radius: 4px;
}
.autocomplete-list::-webkit-scrollbar-thumb {
    background: #555; /* 捲軸本體顏色 */
    border-radius: 4px;
}
.autocomplete-list::-webkit-scrollbar-thumb:hover {
    background: #777; /* 滑鼠移過去亮一點 */
}
