/* 探孔侧边栏 - GIS 深色科技风格 */
.tk-sidebar {
  position: fixed;
  top: 60px;
  right: 0;
  width: 320px;
  height: calc(100vh - 60px);
  background: rgba(10, 25, 41, 0.95); /* GIS_COLORS.bgPrimary */
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(0, 184, 217, 0.3); /* GIS_COLORS.border */
  box-shadow: -2px 0 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 184, 217, 0.1);
  z-index: 900;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.tk-sidebar-hidden {
  display: none;
}

/* 标题栏 */
.tk-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 2px solid rgba(0, 184, 217, 0.3); /* GIS_COLORS.border */
  background: linear-gradient(90deg, rgba(19, 47, 76, 0.98) 0%, transparent 100%);
}

.tk-sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #66d9ef; /* GIS_COLORS.primaryLight */
}

.title-icon {
  font-size: 18px;
}

.title-text {
  color: #e3f2fd; /* GIS_COLORS.textPrimary */
}

.title-count {
  font-size: 14px;
  color: rgba(227, 242, 253, 0.5); /* GIS_COLORS.textDim */
  font-weight: normal;
}

/* 内容区 */
.tk-sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 搜索框 */
.tk-search {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 184, 217, 0.15);
}

/* 列表 */
.tk-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Naive UI NInput 暗色覆盖 */
.tk-sidebar .n-input {
  --n-color: rgba(19, 47, 76, 0.6);
  --n-color-focus: rgba(19, 47, 76, 0.8);
  --n-text-color: #e3f2fd;
  --n-placeholder-color: rgba(227, 242, 253, 0.4);
  --n-border: 1px solid rgba(0, 184, 217, 0.3);
  --n-border-focus: 1px solid #00b8d9;
  --n-border-hover: 1px solid rgba(0, 184, 217, 0.5);
  --n-box-shadow-focus: 0 0 8px rgba(0, 184, 217, 0.3);
  --n-clear-color: rgba(227, 242, 253, 0.5);
  --n-clear-color-hover: #66d9ef;
}

/* Naive UI NEmpty 暗色覆盖 */
.tk-sidebar .n-empty__description {
  color: rgba(227, 242, 253, 0.5); /* GIS_COLORS.textDim */
}

/* Naive UI NScrollbar 暗色覆盖 */
.tk-sidebar .n-scrollbar-rail {
  --n-scrollbar-color: rgba(0, 184, 217, 0.3);
  --n-scrollbar-color-hover: rgba(0, 184, 217, 0.5);
}
/* 弹窗卡片内容区无边距 */
.tk-layer-modal .n-card__content {
  padding: 0 !important;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
}

#cesiumContainer {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

#cesiumContainer.map-visible {
  opacity: 1;
}

/* 隐藏面板的通用类 */
.panel-hidden {
  display: none !important;
}

/* 顶部标题栏 */
.header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(135deg, rgba(26, 35, 126, 0.95), rgba(21, 101, 192, 0.95));
  color: white;
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header h1 {
  font-size: 24px;
  font-weight: 600;
}

.header .subtitle {
  margin-left: 20px;
  font-size: 14px;
  opacity: 0.9;
}

/* 侧边栏切换按钮 */
.header-sidebar-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.header-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

/* 左侧控制面板 */
.control-panel {
  position: absolute;
  top: 80px;
  left: 20px;
  width: 280px;
  max-height: calc(100vh - 100px);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  z-index: 999;
  overflow-y: auto;
}

.panel-section {
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.panel-section:last-child {
  border-bottom: none;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  color: #1976d2;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.panel-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: #1976d2;
  margin-right: 8px;
  border-radius: 2px;
}

/* 图层列表 */
.layer-item {
  padding: 8px 10px;
  margin: 5px 0;
  background: #f5f5f5;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.layer-item:hover {
  background: #e3f2fd;
  transform: translateX(2px);
}

.layer-item.active {
  background: #1976d2;
  color: white;
}

.layer-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.layer-name {
  font-weight: 500;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-type-tag {
  font-size: 11px;
  color: #666;
  background: rgba(25, 118, 210, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  width: fit-content;
}

.layer-item.active .layer-type-tag {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.15);
}

.layer-badge {
  background: #fff;
  color: #1976d2;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.layer-item.active .layer-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* 统计信息 */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.stats-grid .stat-card:nth-child(3) {
  grid-column: 1 / -1;
}

.stat-card {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
  color: #1976d2;
}

.stat-label {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

/* 按钮样式 */
.btn {
  padding: 8px 16px;
  background: #1976d2;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  margin-top: 10px;
  width: 100%;
}

.btn:hover {
  background: #1565c0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.4);
}

.btn:active {
  transform: translateY(0);
}

/* 加载指示器 */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 30px 50px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  text-align: center;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1976d2;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: #333;
  font-size: 14px;
}

/* 右下角信息面板 */
.info-panel {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  z-index: 999;
  font-size: 12px;
  max-width: 300px;
}

.info-item {
  margin: 5px 0;
  color: #666;
}

.info-label {
  font-weight: 600;
  color: #333;
}

/* 滚动条美化 */
.control-panel::-webkit-scrollbar {
  width: 6px;
}

.control-panel::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 注意：图片预览和实体选择器样式已迁移到组件内部（使用 Naive UI + 内联样式） */
