body, html { margin: 0; padding: 0; height: 100%; width: 100%; overflow: hidden; font-family: -apple-system, sans-serif; background: #f4f7f6; }

/* 螢幕切換控制 */
.screen { height: calc(100% - 60px); top: 0; width: 100%; position: absolute; overflow-y: auto; background: #f4f7f6; }
.hidden { display: none !important; }
.header { background: #2c3e50; color: white; padding: 15px; text-align: center; font-weight: bold; font-size: 18px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

/* --- 內建系統跳窗 (Modal) --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 99999; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(3px); }
.modal-box { background: white; padding: 25px; border-radius: 15px; width: 80%; max-width: 320px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.3); animation: popIn 0.3s ease-out; }
.modal-box h3 { margin: 0 0 15px 0; color: #333; font-size: 18px; }
.modal-box p { color: #555; font-size: 15px; margin-bottom: 20px; line-height: 1.5; }
.modal-btn { background: #4CAF50; color: white; border: none; padding: 12px 30px; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer; width: 100%; }
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* --- 聊天輕量提示 (Toast) --- */
#toast-banner { position: fixed; top: 20px; left: 5%; width: 90%; background: rgba(44, 62, 80, 0.95); color: #FFF; padding: 12px 0; border-radius: 10px; z-index: 10000; text-align: center; font-weight: bold; font-size: 14px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); transition: transform 0.4s ease-in-out, opacity 0.4s; display: flex; justify-content: center; align-items: center; gap: 8px; }
.toast-hidden { transform: translateY(-100px); opacity: 0; pointer-events: none; }

/* --- 📍跑馬燈 (獨立在底部導航上方) --- */
#marquee-bar { position: fixed; bottom: 60px; width: 100%; height: 28px; background: rgba(0, 0, 0, 0.85); color: #00ff00; z-index: 9998; line-height: 28px; font-size: 14px; font-weight: bold; letter-spacing: 1px; }

/* 地圖專屬 */
#map { height: 100%; width: 100%; z-index: 1; }
#ctrl-panel { position: absolute; bottom: 80px; width: 100%; z-index: 999; display: flex; justify-content: center; pointer-events: none; }
.btn-main { pointer-events: auto; padding: 15px 35px; border-radius: 50px; border: none; background: #28a745; color: white; font-size: 18px; font-weight: bold; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.btn-off { background: #dc3545; }
#recenter-btn { position: absolute; right: 20px; bottom: 160px; z-index: 999; width: 50px; height: 50px; border-radius: 50%; background: white; border: none; box-shadow: 0 2px 10px rgba(0,0,0,0.3); color: #4CAF50; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }

/* 地圖標記 */
.driver-marker { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.speed-tag { background: rgba(0,0,0,0.85); color: #00ff00; padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: bold; white-space: nowrap; margin-bottom: 2px; }
.avatar-img { width: 46px; height: 46px; border-radius: 50%; border: 3px solid white; box-shadow: 0 2px 5px rgba(0,0,0,0.4); object-fit: cover; background: white; }
.name-tag { font-size: 13px; font-weight: bold; background: rgba(255, 255, 255, 0.95); border-radius: 4px; padding: 2px 8px; color: #333; box-shadow: 0 1px 4px rgba(0,0,0,0.3); white-space: nowrap; margin-top: 4px; }

/* 列表樣式與隱身按鈕 */
.user-card { background: white; margin: 10px; padding: 12px; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.user-info { display: flex; align-items: flex-start; gap: 10px; width: 72%; }
.user-avatar-small { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-meta { display: flex; flex-direction: column; }
.user-meta b { font-size: 15px; margin-bottom: 2px; }
.user-meta .user-speed { color: #28a745; font-weight: bold; font-size: 12px; }
.user-meta .user-address { display: block; font-size: 12px; color: #e67e22; margin-top: 2px; line-height: 1.3; }

.action-btns { display: flex; gap: 6px; flex-direction: column; width: 28%; align-items: stretch; }
.nav-link-btn { background: #FFF9C4; color: #333 !important; padding: 8px 10px; border-radius: 6px; text-decoration: none; font-weight: bold; font-size: 13px; text-align: center; border: 1px solid #FBC02D; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.chat-btn { background: #ff9800; color: white !important; cursor: pointer; border: none; }
.btn-stealth-off { background: #7f8c8d; color: white; border: none; padding: 6px; border-radius: 5px; font-weight: bold; cursor: pointer; font-size: 12px; }
.btn-stealth-on { background: #dc3545; color: white; border: none; padding: 6px; border-radius: 5px; font-weight: bold; cursor: pointer; font-size: 12px; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; } }

/* 聊天室樣式 */
.chat-container { padding: 15px; height: calc(100% - 110px); overflow-y: auto; background: #e5ddd5; }
.chat-input-area { position: absolute; bottom: 0; width: 100%; display: flex; padding: 10px; background: #f0f0f0; box-sizing: border-box; }
.chat-input-area input { flex: 1; padding: 12px; border: none; border-radius: 20px; outline: none; font-size: 15px; }
.chat-input-area button { margin-left: 10px; width: 45px; height: 45px; border: none; background: #4CAF50; color: white; border-radius: 50%; font-size: 18px; cursor: pointer; }
.chat-msg { display: flex; margin-bottom: 15px; }
.msg-me { flex-direction: row-reverse; }
.chat-avatar { width: 35px; height: 35px; border-radius: 50%; margin: 0 10px; object-fit: cover; }
.msg-content { max-width: 70%; }
.msg-name { font-size: 11px; color: #555; margin-bottom: 3px; }
.msg-me .msg-name { text-align: right; }
.msg-bubble { padding: 10px 15px; border-radius: 15px; background: white; box-shadow: 0 1px 2px rgba(0,0,0,0.1); word-break: break-word; font-size: 14px; line-height: 1.4; }
.msg-me .msg-bubble { background: #dcf8c6; }

/* --- 設定頁面優化 (恢復美美的卡片) --- */
.settings-content { padding: 20px; max-width: 400px; margin: 0 auto; }
.settings-card { background: white; border-radius: 15px; padding: 25px 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-align: center; margin-bottom: 20px; }
.large-avatar { width: 110px; height: 110px; border-radius: 50%; border: 4px solid #4CAF50; margin-bottom: 10px; object-fit: cover; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.account-text { margin: 5px 0 20px 0; color: #555; font-size: 15px; }
.input-group { text-align: left; margin-bottom: 15px; }
.input-group label { display: block; font-size: 13px; color: #777; margin-bottom: 6px; font-weight: bold; }
.text-input, .file-input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; box-sizing: border-box; font-size: 15px; background: #f9f9f9; transition: 0.3s; }
.text-input:focus { border-color: #4CAF50; background: #fff; outline: none; }
.btn-save { width: 100%; padding: 14px; background: #4CAF50; color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer; margin-top: 10px; box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3); }
.btn-logout { width: 100%; padding: 14px; background: #fff; color: #dc3545; border: 2px solid #dc3545; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer; }

/* 底部導航與未讀紅點 */
.bottom-nav { position: fixed; bottom: 0; width: 100%; height: 60px; background: #fff; border-top: 1px solid #ddd; display: flex; justify-content: space-around; align-items: center; z-index: 9999; }
.nav-item { position: relative; display: flex; flex-direction: column; align-items: center; color: #7f8c8d; font-size: 12px; cursor: pointer; transition: 0.2s; width: 25%; }
.nav-item i { font-size: 20px; margin-bottom: 2px; }
.nav-item.active { color: #4CAF50; }
.badge { position: absolute; top: -5px; right: 20px; background: red; color: white; font-size: 10px; font-weight: bold; padding: 2px 6px; border-radius: 10px; border: 2px solid white; }