html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
}

.app {
  display: flex;
  width: 100%;
  height: 100%;
  background: #e8ecf1;
  --left: 66.66%;
}

/* 左侧地图区域(可拖拽调宽) */
#mapPane {
  position: relative;
  flex: 0 0 var(--left);
  height: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-right: 1px solid #c9d0d8;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.03);
}

/* 中间拖拽分隔条 */
#divider {
  flex: 0 0 10px;
  width: 10px;
  cursor: col-resize;
  background: #f2f4f7;
  border-left: 1px solid #c9d0d8;
  border-right: 1px solid #c9d0d8;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  touch-action: none;
  user-select: none;
}
#divider::after {
  content: "";
  width: 3px;
  height: 48px;
  border-radius: 2px;
  background: #b7c1cc;
}

/* 右侧查看区域 */
#rightPane {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-left: 1px solid #c9d0d8;
  background: #fff;
}

#map {
  position: absolute;
  inset: 0;
}

/* 左上角切换 tab(右移避开地图 zoom 控件) */
.type-tab {
  position: absolute;
  top: 10px;
  left: 64px;
  z-index: 1000;
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.type-tab button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 13px;
  color: #555;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.type-tab button.active {
  background: #3d5a80;
  color: #fff;
  font-weight: 600;
}

/* 全景查看器占满右侧 */
#viewer {
  width: 100%;
  height: 100%;
}

/* 普通影像 + 属性表面板 */
#imgPanel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: #fff;
}
#imgPanel[hidden] {
  display: none;
}
#imgHint {
  padding: 24px 16px;
  font-size: 13px;
  color: #888;
  text-align: center;
}
#imgContent {
  padding: 12px;
}
#imgContent[hidden] {
  display: none;
}
#imgPanelTitle {
  font-size: 14px;
  font-weight: 600;
  color: #3d5a80;
  margin-bottom: 8px;
  word-break: break-all;
}
#imgView {
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 8px;
  background: #f2f4f7;
  border: 1px solid #e5e9ee;
  margin-bottom: 10px;
  display: block;
}
#attrList {
  margin: 0;
  border: 1px solid #e5e9ee;
  border-radius: 8px;
  overflow: hidden;
}
#attrList .row {
  display: flex;
  font-size: 12px;
  line-height: 1.6;
}
#attrList .row:nth-child(even) {
  background: #fafbfc;
}
#attrList dt {
  flex: 0 0 110px;
  padding: 3px 8px;
  color: #777;
  background: #f4f6f8;
  border-right: 1px solid #e5e9ee;
  text-align: right;
}
#attrList dd {
  flex: 1;
  margin: 0;
  padding: 3px 8px;
  color: #333;
  word-break: break-all;
}

/* 地图点位 marker: 圆形序号 */
/* .num-marker {
  background: #1a73e8;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  cursor: pointer;
} */

/* 选中的普通影像点位高亮 */
/* .leaflet-marker-icon.selected .num-marker {
  background: #f6a609;
  border-color: #b96e00;
  width: 28px;
  height: 28px;
  font-size: 12px;
  box-shadow: 0 0 0 3px rgba(246, 166, 9, 0.35);
} */
 /* ================= 普通影像点位: 航向角箭头图标 ================= */
.dir-marker-wrapper {
  background: transparent !important;
  border: none !important;
}

.dir-marker {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 箭头 SVG：绕中心点旋转对应航向角 */
.dir-marker .dir-arrow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: #1a73e8; /* 默认蓝色 */
  stroke: #ffffff;
  stroke-width: 1.5;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  transform: rotate(var(--heading, 0deg));
  transform-origin: center center;
  transition: transform 0.25s ease, fill 0.2s ease;
}

/* 内部序号：始终保持正向水平，不随箭头颠倒 */
.dir-marker .dir-num {
  position: relative;
  z-index: 2;
  font-size: 10px;
  font-weight: bold;
  color: #ffffff;
  line-height: 1;
  pointer-events: none;
  transform: translateY(2px); /* 居中微调至箭头腹部 */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* 选中的普通影像点位高亮 (高亮为橙黄色并微放大) */
.leaflet-marker-icon.selected .dir-marker {
  transform: scale(1.25);
  z-index: 1000 !important;
}

.leaflet-marker-icon.selected .dir-marker .dir-arrow {
  fill: #f6a609 !important;
  stroke: #ffffff !important;
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(246, 166, 9, 0.8)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* 移除 Leaflet 預設外框 */
.pin-marker-wrapper {
  background: transparent !important;
  border: none !important;
}

.pin-marker {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 16px 16px; /* 嚴格以中心圓點為旋轉中心 */
  cursor: pointer;
  transition: transform 0.2s ease;
}

.pin-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  /* 八方疊加 1.5px~2px 實心白邊，最外層加深色暗影拉開對比 */
  filter: 
    drop-shadow( 1px  0px 0 #ffffff)
    drop-shadow(-1px  0px 0 #ffffff)
    drop-shadow( 0px  1px 0 #ffffff)
    drop-shadow( 0px -1px 0 #ffffff)
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

/* 選中點位高亮 (線條、箭頭與圓圈統一變為橙黃色) */
.leaflet-marker-icon.selected .pin-svg line {
  stroke: #ff9800 !important;
  stroke-width: 2.4px !important;
}

.leaflet-marker-icon.selected .pin-svg path,
.leaflet-marker-icon.selected .pin-svg circle {
  fill: #ff9800 !important;
}

.leaflet-marker-icon.selected .pin-marker {
  transform-origin: 16px 16px;
  filter: drop-shadow(0 0 5px rgba(255, 152, 0, 0.9));
}

/* 普通影像前后切换导航 */
.img-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.img-nav button {
  flex: 0 0 auto;
  border: 1px solid #d5dbe2;
  background: #fff;
  color: #3d5a80;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
}
.img-nav button:hover {
  background: #eef2f7;
}
#imgCount {
  font-size: 13px;
  color: #666;
}

/* 全景标题 */
.psv-navbar .psv-caption {
  font-size: 15px;
}

@media (max-width: 900px) {
  .app {
    flex-direction: column;
    --left: 55%;
  }
  #divider {
    display: none;
  }
  #mapPane {
    height: auto;
  }
  #rightPane {
    height: auto;
  }
}
