:root { --panel-w: 380px; --blue: #1a73e8; --shadow: 0 4px 20px rgba(0,0,0,0.15); }
body, html { margin: 0; padding: 0; height: 100%; font-family: -apple-system, sans-serif; overflow: hidden; background: #f0f2f5; }
#map { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }

/* --- 控制面板佈局 --- */
#control-panel { 
    position: absolute; background: white; z-index: 10; 
    display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.panel-header { flex-shrink: 0; padding: 15px 15px 5px; border-bottom: 1px solid #eee; z-index: 11; }
#incident-list { flex: 1; overflow-y: auto; background: white; }

/* --- 廣告容器 --- */
.ad-container { display: flex; align-items: center; justify-content: center; background: #f8f9fa; font-size: 12px; color: #aaa; }
.ad-container:empty { display: none !important; }

/* --- 電腦與手機響應式 --- */
@media (min-width: 769px) {
    #control-panel { top: 20px; left: 20px; width: var(--panel-w); max-height: calc(100vh - 40px); border-radius: 16px; }
    
    /* 🔴 電腦版廣告：獨立懸浮於下方中心，完全脫離 UI 面板 */
    .ad-container.desktop-only { 
        position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); 
        z-index: 10; border-radius: 8px; box-shadow: var(--shadow); 
        min-width: 320px; min-height: 90px; background: white;
    }
    .mobile-only { display: none !important; }
}
@media (max-width: 768px) {
    #control-panel { bottom: 0; left: 0; width: 100%; max-height: 60vh; border-radius: 20px 20px 0 0; }
    
    /* 🟢 手機版廣告：置頂，地圖下移 */
    .ad-container.mobile-only { position: fixed; top: 0; left: 0; width: 100%; min-height: 50px; z-index: 5; }
    #map { top: 50px; }
    .desktop-only { display: none !important; }
}

/* --- UI 元件細節 --- */
.search-row { display: flex; gap: 10px; align-items: center; margin-bottom: 15px; }
.search-row input { flex: 1; padding: 10px 15px; border: 1px solid #ddd; border-radius: 20px; background: #f8f9fa; outline: none; font-size: 14px; }
#lang-toggle { color: var(--blue); font-weight: bold; cursor: pointer; padding: 5px 10px; }

.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 15px; text-align: center; }
.cat-btn { padding: 8px 0; border: 1px solid transparent; border-radius: 10px; cursor: pointer; color: #5f6368; font-size: 11px; transition: 0.2s; }
.cat-btn.active { background: #e8f0fe; color: var(--blue); font-weight: bold; }
.cat-icon { font-size: 22px; display: block; margin-bottom: 4px; }

.scroll-row { display: flex; overflow-x: auto; gap: 8px; margin-bottom: 10px; padding-bottom: 5px; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.scroll-row::-webkit-scrollbar { display: none; }
.pill { padding: 6px 14px; background: #f1f3f4; color: #3c4043; border-radius: 18px; font-size: 13px; cursor: pointer; transition: 0.2s; border: 1px solid transparent; }
.pill.active { background: var(--blue); color: white; }

.list-item { padding: 14px 16px; border-bottom: 1px solid #f1f3f4; cursor: pointer; display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.4; transition: 0.2s; }
.list-item:hover { background: #f8f9fa; }
.locate-btn { position: fixed; right: 20px; bottom: 30px; width: 56px; height: 56px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); z-index: 20; cursor: pointer; font-size: 24px; }
