:root {
    --bg-black: #000000;
    --card-bg: #161618;
    --tesla-red: #e81f3d;
    --text-gray: #8e8e93;
    --input-bg: #212123;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg-black); color: white; margin: 0; font-family: -apple-system, sans-serif; overflow-x: hidden; }

/* 登入頁面 */
.login-container { position: fixed; inset: 0; background: #000; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.glass-login-card { 
    background: rgba(22, 22, 24, 0.9); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    width: 100%; max-width: 380px; padding: 45px; border-radius: 35px; border: 1px solid rgba(255,255,255,0.1); text-align: center;
}
.login-brand { color: var(--tesla-red); font-weight: 800; letter-spacing: 2px; font-size: 0.75rem; }
.login-field { text-align: left; margin: 25px 0; }
.login-field label { display: block; font-size: 0.85rem; color: var(--text-gray); margin-bottom: 10px; }
.login-field input { width: 100%; background: var(--input-bg); border: 1px solid #333; border-radius: 14px; padding: 16px; color: #fff; }
.login-btn { width: 100%; background: var(--tesla-red); color: #fff; border: none; padding: 18px; border-radius: 16px; font-weight: 700; font-size: 1.1rem; }

/* 仿圖 4 漸變淡出 Banner */
.app-banner { 
    height: 380px; position: relative;
    /* 漸變必須在 url 之前，頂部完全透明，底部完全黑 */
    background: linear-gradient(to bottom, 
                rgba(0,0,0,0) 0%,      
                rgba(0,0,0,0.4) 60%,   
                rgba(0,0,0,1) 100%     
                ), 
                url('banner.jpg') no-repeat center 30%;
    background-size: cover; display: flex; flex-direction: column; justify-content: flex-end; padding: 40px 30px;
}
.banner-content h1 { font-size: 2.8rem; margin: 0; font-weight: 800; letter-spacing: -1px; text-shadow: 0 4px 15px rgba(0,0,0,0.8); }
.banner-content p { color: rgba(255, 255, 255, 0.7); margin-top: 8px; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1px; }

/* 介面佈局 */
.tesla-card { background: var(--card-bg); margin: 15px; padding: 20px; border-radius: 24px; border: 1px solid #2c2c2e; }
.card-header { display: flex; align-items: center; gap: 8px; color: var(--text-gray); font-size: 0.75rem; margin-bottom: 15px; text-transform: uppercase; }
.node-input { width: 100%; background: var(--input-bg); border: none; border-radius: 14px; padding: 16px; color: white; margin-bottom: 10px; font-size: 1.05rem; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-btn { background: var(--input-bg); color: white; border: 1px solid #333; padding: 15px; border-radius: 15px; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; gap: 8px; }
.action-btn.active-mode { border-color: var(--tesla-red); color: var(--tesla-red); background: rgba(232,31,61,0.1); }

.settings-grid { display: flex; flex-direction: column; gap: 14px; }
.setting-item { display: flex; justify-content: space-between; align-items: center; }
.setting-label { color: var(--text-gray); font-size: 0.95rem; }
.setting-value { background: var(--input-bg); border: 1px solid #333; padding: 12px; border-radius: 12px; color: white; text-align: right; min-width: 170px; }

.tunnel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tunnel-btn { background: #1c1c1e; color: #666; border: 1px solid #2c2c2e; padding: 12px 2px; border-radius: 12px; font-size: 0.75rem; }
.tunnel-btn.active { background: rgba(232, 31, 61, 0.2); color: var(--tesla-red); border-color: var(--tesla-red); font-weight: 800; }

#map { height: 350px; margin: 15px; border-radius: 25px; background: #111; border: 1px solid #2c2c2e; }

.stats-grid-main { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-card { background: var(--input-bg); padding: 16px; border-radius: 18px; text-align: center; border: 1px solid #2c2c2e; }
.mini-card span { font-size: 0.75rem; color: var(--text-gray); display: block; margin-bottom: 6px; }

/* 底欄 */
.tesla-footer {
    position: fixed; bottom: 0; width: 100%;
    background: rgba(0,0,0,0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid #2c2c2e; padding: 20px 30px calc(20px + env(safe-area-inset-bottom)); z-index: 1000;
}
.version-tag { position: absolute; right: 30px; top: -25px; font-size: 0.7rem; color: rgba(255,255,255,0.1); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; max-width: 600px; margin: 0 auto; }
.total-price { font-size: 2.1rem; font-weight: 800; color: var(--tesla-red); }
.update-btn { background: var(--tesla-red); color: white; border: none; padding: 18px 40px; border-radius: 18px; font-weight: 800; font-size: 1.1rem; }