/* 全域預設 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft JhengHei", "Apple LiGothic Medium", "儷黑 Pro", Arial, sans-serif;
  }
  
  html, body {
    height: 100%;
    background-color: #f0f2f5;
  }
  
  /* 頂部Header：改為較明顯的半透明藍 */
  header {
    background-color: rgba(52, 152, 219, 0.85); /* 半透明藍色 */
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  
    /* 若想加毛玻璃效果，可用 backdrop-filter (需瀏覽器支援):
       backdrop-filter: blur(3px);
       注意需搭配 background-clip: padding-box; (某些瀏覽器)
    */
  }
  
  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  h1 {
    font-size: 1.5rem;
    margin: 0;
  }
  
  /* 搜尋框區域 */
  .search-container {
    position: relative;
    width: 50%;
    max-width: 600px;
  }
  
  #search-bar {
    width: 100%;
    padding: 10px 15px 10px 35px;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    outline: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }
  
  .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
  }
  
  /* 中間：左側影像 + 右側地圖 */
  .main-container {
    display: flex;
    flex-direction: row;
    height: calc(100% - 70px); /* 扣掉 header 的高度 */
    transition: all 0.3s ease;
  }
  
  /* 左側 Info Panel：半透明灰 + 可收合 */
  #info-panel {
    width: 25%;
    background-color: rgba(221, 221, 221, 0.8); /* 半透明灰色 */
    padding: 15px;
    overflow-y: auto;
    position: relative; /* 為了放收合按鈕 */
    transition: width 0.3s ease, padding 0.3s ease;
    /* 可選 backdrop-filter:
       backdrop-filter: blur(5px);
    */
  }
  
  #info-panel h2 {
    margin-bottom: 10px;
  }
  
  /* 收合後：width變 40px, 只留按鈕把手 */
  #info-panel.collapsed {
    width: 40px;
    padding: 15px 0 15px 0;
    overflow: hidden;
  }
  
  #toggle-panel-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background-color: rgba(0,0,0,0.4);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
  }
  
  #toggle-panel-btn:hover {
    background-color: rgba(0,0,0,0.6);
  }
  
  #selected-cctv-info img {
    max-width: 100%;
    border: 2px solid #333;
    display: block;
    margin-top: 10px;
  }
  
  /* 地圖（右側） */
  #map {
    width: 75%;
    transition: width 0.3s ease;
  }
  
  /* 收合狀態：給 main-container 加個 class, 或直接用 info-panel.collapsed 來判斷 */
  .main-container.panel-collapsed #map {
    width: 100%;
  }
  
  /* 下方CCTV列表 */
  #table-container {
    background: #fff;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  /* 讓標題與表格不會貼邊 */
  #table-container h2 {
    margin: 10px 0;
  }
  
  /* 表格 */
  table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
  }
  
  th, td {
    padding: 8px;
    border-bottom: 1px solid #ccc;
    text-align: left;
  }
  
  th {
    background-color: #eaeaea;
  }
  
  tr:hover {
    background-color: #f5f5f5;
    cursor: pointer;
  }
  
  /* Material Symbols 樣式 */
  .material-symbols-outlined.cctv-icon {
    font-size: 45px;
    color: #e23703;
  }
  
  /* RWD：手機或小螢幕時，調整排版 */
  @media (max-width: 768px) {
    .header-content {
      flex-direction: column;
      align-items: flex-start;
    }
    .search-container {
      width: 100%;
      margin-top: 10px;
    }
  
    .main-container {
      flex-direction: column;
      height: auto; /* 高度自適應 */
    }
    #info-panel,
    #map {
      width: 100%;
      height: 300px;
    }
    #info-panel {
      order: 1;
    }
    #map {
      order: 2;
      margin-bottom: 10px;
    }
    #table-container {
      order: 3;
      margin: 0;
      border-radius: 0;
      width: 100%;
    }
  
    table, thead, tbody, th, td, tr {
      display: block;
      width: 100%;
    }
    thead {
      display: none;
    }
    tr {
      margin-bottom: 10px;
      border-bottom: 2px solid #3498db;
    }
    td {
      border-bottom: none;
      position: relative;
      padding-left: 50%;
      white-space: pre-wrap;
    }
    td:before {
      content: attr(data-label);
      position: absolute;
      left: 15px;
      width: 45%;
      font-weight: bold;
    }
  }
  