#map_top td{
  padding:2px;
}
.tree-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  color: #ddd;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s;
}

.tree-toggle:hover {
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

.arrow {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-right: 2px solid #aaa;
  border-bottom: 2px solid #aaa;
  transform: rotate(-45deg); /* ▶ */
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  margin-left: 2px;
}

.tree-toggle[aria-expanded="true"] .arrow {
  transform: rotate(45deg); /* ▼ */
  border-color: #00b4ff;
  box-shadow: 0 0 6px rgba(0,180,255,0.8);
}

.tree-child {
  margin-left: 16px;
  padding-left: 10px;
  border-left: 2px solid rgba(0,180,255,0.3);
}

.tree-child.in {
  border-left-color: rgba(0,180,255,0.7);
  background: rgba(0,180,255,0.05);
}

.cursorpointer{
  cursor:pointer;
}
.width24px{
  width:24px;
}

.width32px{
  width:32px;
}

.width64px{
  width:64px;
}

.lineheight24px{
  line-height:24px;
}

.lineheight32px{
  line-height:32px;
}

.btn-tool {
    width: 64px;
    height: 64px;
    background: #1c1c1c;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0px;
}

.btn-tool:hover {
    background: #333;
    border-color: #777;
}

.btn-tool span {
    font-size: 24px;   /* icon 大小 */
    line-height: 1;
    margin-bottom: 4px;
}

.btn-tool div {
    font-size: 18px;   /* 文字小一點 */
    text-align: center;
    line-height: 1.0;
}


/* 圖層管理 */
.layer-window {
    position: absolute;
    top: 160px;
    left: 0px;
    width: 550px;
    max-height: 80%;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    overflow-y: auto;
    z-index: 1002;
    padding: 8px;
    border-radius: 4px;
}

.layer-window.hidden { display: none; }

.layer-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    padding-bottom: 4px;
    border-bottom: 1px solid #555;
    margin-bottom: 8px;
}

.layer-titlebar .close-layer {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

/* Tabs 樣式 */
.layer-tabs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    border-bottom: 1px solid #555;
}

.layer-tabs li {
    padding: 6px 12px;
    cursor: pointer;
    margin-right: 4px;
    background: #333;
    border-radius: 4px 4px 0 0;
    font-size: 13px;
}

.layer-tabs li.active {
    background: #1c1c1c;
    font-weight: bold;
    border: 1px solid #555;
    border-bottom: none;
}

/* tab 內容 */
.layer-body .layer-group {
    display: none;
    padding-top: 6px;
}

.layer-body .layer-group.active {
    display: block;
}

.layer-list {
    list-style: none;
    padding-left: 12px;
    margin: 0;
}

.layer-list li {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}


.layer-list li {
    margin-bottom: 6px;
    display: block; /* 改成 block，換行 */
    position: relative;
}

.layer-list input[type="checkbox"] {
    margin-right: 6px;
    vertical-align: top;
}



.layer-dir {
    font-weight: bold;
    cursor: pointer;
}

.dir-title{
    cursor: pointer;
}

.toggle-dir {
    display: inline-block;
    width: 16px;
    text-align: center;
    margin-right: 4px;
}

.sub-layer {
    list-style: none;
    /*padding-left: 20px;*/
    display: none; /* 初始收起 */
}

.sub-layer li {
    padding-left: 20px; /* 子圖層縮排 */
    display: block;      /* 換行排列 */
    font-size: 14px;
}
/* RWD */
@media (max-width: 768px) {
    .layer-window {
        top: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0;
        padding: 12px;
    }
}




/* 底圖選單 */
.basemap-container { position:fixed; top:100px; right:10px; z-index:9999; }
.basemap-menu { background:#222; border:1px solid #444; padding:6px; border-radius:4px; display:flex; flex-direction:column; }
.basemap-menu.hidden { display:none; }
.basemap-btn { display:flex; flex-direction:column; align-items:center; margin-bottom:6px; cursor:pointer; padding:4px; text-align:center; transition:0.2s; }
.basemap-btn:hover { background:#333; border-radius:4px; }
.basemap-btn img { width:48px; height:48px; margin-bottom:4px; }
.basemap-btn div { font-size:12px; color:#fff; }
.basemap-btn.active {
    border: 2px solid #00b4ff;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(0,180,255,0.8);
}
/* 手機 RWD */
@media (max-width: 768px) {
    .basemap-menu {
        position: fixed;
        bottom: 0px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        padding: 4px;
        overflow-x: auto;       /* 可以左右滑動 */
        max-width: 90vw;        /* 最多占畫面寬度 */
        background: rgba(34,34,34,0.95);
        border-radius: 6px;
        z-index: 9999;
    }
    .basemap-btn {
        margin: 0 4px;
        flex: 0 0 auto;          /* 固定寬度，不被壓縮 */
        text-align: center;
        cursor: pointer;
        transition: transform 0.2s;
    }
}

.displayinline{
    display: inline !important;
}

.width100px{
  width:100px !important;
}

.width180px{
  width:180px !important;
}
