/* 全局字体和基础样式 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Geologica:wght@300;400;500;600;700&display=swap');

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  height: 100%;
  width: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  transition: color 0.2s ease;
}

ul {
  list-style-type: none;
}

#cesiumContainer {
  position: absolute;
  width: 100%;
  height: 100vh;
  z-index: 10000;
}

/* 顶部导航栏 - 白色背景 */
nav {
  width: 100%;
  height: 64px;
  background: #ffffff;
  color: #333;
  display: flex;
  align-items: center;
  padding: 0 40px;
  font-weight: 600;
  border-bottom: 1px solid #e5e5e5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  position: relative;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

nav .logo {
  width: 120px;
  height: 32px;
}

.logo-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

nav .logoText {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.logoSubtitle {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  line-height: 1.4;
}

.subtitle-line {
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
  line-height: 1.4;
  display: block;
}

.subtitle-line:first-child {
  font-weight: 600;
  color: #1f2937;
}

.nav-search {
  display: flex;
  justify-content: flex-start;
  margin-left: 16px;
  margin-right: 0;
  flex-shrink: 0;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 500px;
  min-width: 300px;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: #9ca3af;
  pointer-events: none;
}

.clear-icon {
  position: absolute;
  right: 12px;
  color: #9ca3af;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.search-input:not(:placeholder-shown) ~ .clear-icon {
  opacity: 1;
  pointer-events: auto;
}

.search-input {
  width: 100%;
  padding: 10px 40px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #333;
  transition: all 0.2s ease;
  outline: none;
}

/* 隐藏浏览器默认的搜索框清除按钮 */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}

input[type="search"]::-ms-clear {
  display: none;
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.nav-button {
  background: #10b981;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  height: 36px;
  line-height: 36px;
  padding: 0 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.2);
}

.nav-button:hover {
  background: #059669;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

.nav-button a {
  color: #fff;
  font-weight: 500;
}

/* 左侧导航栏 - 白色背景 */
#aside {
  width: 280px;
  padding: 16px 0;
  height: calc(100vh - 64px);
  background: #ffffff;
  color: #333;
  overflow-y: auto;
  overflow-x: hidden;
  float: left;
  position: relative;
  z-index: 1000;
  border-right: 1px solid #e5e5e5;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

#aside::-webkit-scrollbar {
  width: 6px;
}

#aside::-webkit-scrollbar-track {
  background: transparent;
}

#aside::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

#aside::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.treeview {
  padding: 12px 20px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  cursor: pointer;
  user-select: none;
  color: #10b981;
  text-transform: none;
  border-bottom: none;
  display: block;
  position: relative;
  z-index: 1001;
}

/* 数量显示样式 */
.treeview-title {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
}

/* 主类别数量徽章 - 绿色圆形，白色数字 */
.category-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background-color: #10b981;
  color: #ffffff;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}

/* 子类别数量徽章 - 白色圆形，灰色边框，深灰色数字 */
.sub-category-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background-color: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
}

.treeview-title::before {
  content: '';
  width: 16px;
  height: 16px;
  display: inline-block;
  margin-right: 4px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="8" cy="8" r="7" fill="%2310b981" opacity="0.1"/><path d="M8 4L8 12M4 8L12 8" stroke="%2310b981" stroke-width="1.5" stroke-linecap="round"/></svg>') no-repeat center;
  background-size: contain;
  flex-shrink: 0;
}

.treeview.collapsed .treeview-title::before {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="8" cy="8" r="7" fill="%2310b981" opacity="0.1"/><path d="M4 8L12 8" stroke="%2310b981" stroke-width="1.5" stroke-linecap="round"/></svg>') no-repeat center;
  background-size: contain;
}

.treeview > span {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  /* width: 100%; */
}

.treeview > span::after {
  content: '^';
  font-size: 16px;
  color: #10b981;
  transition: transform 0.3s ease;
  font-weight: bold;
  display: inline-block;
  margin-left: 8px;
  flex-shrink: 0;
  line-height: 1;
}

.treeview.collapsed > span::after {
  transform: rotate(180deg);
}


.treeview.collapsed .second-menu {
  display: none !important;
}

.treeview:hover {
  background: transparent;
}

.menuTitle {
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  margin: 4px 12px;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1001;
  overflow: visible;
}

.menuTitle a {
  display: flex;
  align-items: center;
  padding: 8px 16px 8px 32px;
  color: #1f2937;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 400;
  position: relative;
  gap: 8px;
  min-width: 0; /* 允许flex子项收缩 */
  overflow: hidden; /* 防止内容溢出 */
}

/* 文本部分：允许截断，但徽章始终可见 */
.menu-title-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 数量显示样式 - 数量会自动显示在括号中 */

/* Tooltip - 只在文本被截断时显示 */
.menuTitle a[title]:hover .menu-title-text {
  position: relative;
}

.menuTitle a[title]:hover::before {
  content: attr(title);
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #1f2937;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 400;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  line-height: 1.4;
}

.menuTitle a[title] {
  position: relative;
}

/* Tooltip箭头 - 边框层 */
.menuTitle a[title]:hover {
  position: relative;
}

.menuTitle a[title]:hover::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #ffffff;
  z-index: 1001;
  margin-bottom: 2px;
  pointer-events: none;
}


.menuTitle:hover a {
  color: #1f2937;
  background: transparent;
}

.active {
  background: #10b981;
  margin-left: 22px;
}

.active a {
  color: #ffffff !important;
  font-weight: 500;
  padding-left: 24px;
  animation: none;
}

/* active状态下的子类别徽章样式 */
.active .sub-category-badge {
  background-color: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
}

.second-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block;
  position: relative;
  z-index: 1001;
}

.second-menu::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #e5e7eb;
  z-index: 0;
}

.second-menu li {
  display: block;
  position: relative;
  z-index: 1;
}

/* 主内容区 */
#main {
  height: calc(100vh - 64px);
  width: calc(100% - 280px);
  float: left;
  position: relative;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

#main::-webkit-scrollbar {
  width: 8px;
}

#main::-webkit-scrollbar-track {
  background: #f9fafb;
}

#main::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

#main::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.charts-list {
  padding: 40px 48px 40px 20px;
  /* max-width: 1400px; */
  margin: 0;
  background-color: #f9fafb;
}

.charts-list>li {
  padding: 32px 24px 48px;
  margin-bottom: 32px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.charts-list h1 {
  font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 24px;
  font-weight: 500;
  font-style: normal;
  color: #1f2937;
  margin-bottom: 28px;
  margin-top: 0;
  padding-bottom: 0;
  padding-top: 0;
  letter-spacing: 0;
  border: none;
  line-height: 28px;
}

.charts-list h1::after {
  display: none;
}

h2 {
  font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: 20px;
  line-height: 28px;
  color: #1f2937;
  padding: 0;
  margin-top: 32px;
  margin-bottom: 24px;
  letter-spacing: 0px;
}

.category-content {
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* 示例卡片 - 白色背景，轻微阴影 */
.charts {
  display: inline-block;
  width: 265px;
  height: 251px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  padding: 0;
  background: #ffffff;
  transition: all 0.2s ease;
  position: relative;
}

.charts:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: #d1d5db;
}

.charts a {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  color: #333;
  text-align: left;
  padding: 0;
}

.charts:hover a {
  color: #333;
}

.charts img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px 8px 0 0;
  margin: 0;
  display: block;
  flex-shrink: 0;
}

.charts p {
  padding: 12px 16px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #000000;
  line-height: 1.4;
  text-align: left;
  height: 60px;
  display: flex;
  align-items: center;
}

/* 移除之前的渐变效果 */
.charts::before {
  display: none;
}

/* 搜索框清除按钮功能 */
.clear-icon:hover {
  color: #1f2937;
}

/* dat.GUI 控制面板样式 - 确保显示在地图之上 */
.dg {
  z-index: 10003 !important;
  position: fixed !important;
  left: 10px !important;
  top: 19px !important;
  /* left: auto !important; */
  margin-right: 10px !important;
}

.dg * {
  z-index: 10003 !important;
}

.property-name {
  z-index: 10003 !important;
  position: relative !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.dg .property-name {
  z-index: 10003 !important;
  position: relative !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.dg .controller {
  z-index: 10003 !important;
  position: relative !important;
}

.dg .name {
  z-index: 10003 !important;
  position: relative !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.dg .cr {
  z-index: 10003 !important;
  position: relative !important;
}

.dg .c {
  z-index: 10003 !important;
  position: relative !important;
}

/* 右键菜单（context menu）白色主题样式 */
.cesium-viewer-context-menu,
.cesium-context-menu,
.ge3d-context-menu,
[class*="context-menu"],
[class*="contextmenu"] {
  background-color: #ffffff !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  color: #333 !important;
  font-size: 14px !important;
}

.cesium-viewer-context-menu ul,
.cesium-context-menu ul,
.ge3d-context-menu ul,
[class*="context-menu"] ul,
[class*="contextmenu"] ul {
  background-color: #ffffff !important;
  color: #333 !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 4px 0 !important;
}

.cesium-viewer-context-menu li,
.cesium-context-menu li,
.ge3d-context-menu li,
[class*="context-menu"] li,
[class*="contextmenu"] li {
  background-color: #ffffff !important;
  color: #333 !important;
  padding: 8px 16px !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease !important;
}

.cesium-viewer-context-menu li:hover,
.cesium-context-menu li:hover,
.ge3d-context-menu li:hover,
[class*="context-menu"] li:hover,
[class*="contextmenu"] li:hover {
  background-color: #f0f0f0 !important;
  color: #333 !important;
}

.cesium-viewer-context-menu li:active,
.cesium-context-menu li:active,
.ge3d-context-menu li:active,
[class*="context-menu"] li:active,
[class*="contextmenu"] li:active {
  background-color: #e0e0e0 !important;
}

/* 覆盖可能的深色样式 */
.cesium-viewer-context-menu .cesium-context-menu-item,
.cesium-context-menu .cesium-context-menu-item,
.ge3d-context-menu .ge3d-context-menu-item {
  background-color: #ffffff !important;
  color: #333 !important;
  border-bottom: 1px solid #f0f0f0 !important;
}

.cesium-viewer-context-menu .cesium-context-menu-item:hover,
.cesium-context-menu .cesium-context-menu-item:hover,
.ge3d-context-menu .ge3d-context-menu-item:hover {
  background-color: #f0f0f0 !important;
}

/* 通用右键菜单样式覆盖 */
div[class*="menu"]:not(.nav-menu):not(.shortcutCode):not(.shortcutCodeList):not(.secondCodeList) {
  background-color: #ffffff !important;
  color: #333 !important;
  border: 1px solid #ddd !important;
}

div[class*="menu"]:not(.nav-menu):not(.shortcutCode):not(.shortcutCodeList):not(.secondCodeList) a,
div[class*="menu"]:not(.nav-menu):not(.shortcutCode):not(.shortcutCodeList):not(.secondCodeList) span,
div[class*="menu"]:not(.nav-menu):not(.shortcutCode):not(.shortcutCodeList):not(.secondCodeList) div {
  color: #333 !important;
}
