/* 已在 index.html 中引入 */
body {
  margin: 0;
  background-color: #000022;
  color: white;
  font-family: Arial, sans-serif;
}

#app {
  padding: 20px;
}

.period-container {
  border: 1px solid #ffffff33;
  margin-bottom: 40px;
  padding: 15px;
  background: #000033;
}

.chart-grid {
  display: flex;
  flex-wrap: nowrap; /* 禁止换行 */
  overflow-x: auto;/* 允许横向滚动 */
  gap: 20px; /* 可选：保留间距 */
  padding: 10px;
}

.period-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 10px;
  background: #000044;
  border-bottom: 1px solid #ffffff33;
}

.chart-category-container {
  display: flex;
  overflow-x: auto;
  gap: 20px;
  padding-top: 15px;
  white-space: nowrap;
}

.star-category {
  min-width: 300px;
  flex-shrink: 0;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}


/*
.star-chart-wrapper {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: black; 
}
.star-chart-canvas {
  width: 100%;
  height: 100%;
}*/


.star-chart-wrapper {
  position: relative;
  min-width: 300px;
  max-width: 600px;
  background-color: #000033;
  border: 1px solid #ffffff1a;
  border-radius: 8px;
  overflow: hidden;
}

.star-chart-canvas {
  height: 400px;
  position: relative;
  background-color: #000022;
}


.chart-title {
  padding: 10px 15px;
  background-color: #000033cc;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  border-bottom: 1px solid #ffffff1a;
}




.language-switcher button {
  padding: 8px 12px;
  margin-left: 5px;
  background-color: #2c2c6c;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.language-switcher button:hover {
  background-color: #3d3d99;
}

.config-panel {
  position: fixed;
  top: 10px;
  left: 10px;
  background: #000000cc;
  padding: 15px;
  border-radius: 8px;
  width: 250px;
  box-shadow: 0 0 10px #00000080;
  z-index: 9999;
  display: block;
  pointer-events: auto;
  max-height: 80vh;
  overflow-y: auto;
}

.featured {
  border: 2px solid yellow;
}

.main-window {
  display: flex;
  flex-direction: column;
  gap: 20px; /* 确保子元素间有间距 */
  margin-bottom: 20px;
  z-index: 1; 
}

.category-windows {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.toggle-category-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: auto;
  padding: 8px 12px;
  background-color: #000000b3;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  z-index: 1000;
}

.main-window .chart-title {
  pointer-events: auto; /* 避免干扰原交互 */
}

.main-window .star-chart-canvas {
  pointer-events: auto;
}

.main-window .star-chart-wrapper {
  flex-direction: column;
  gap: 10px;
}

.main-window .main-window-category-label {
  margin: 0;
  font-size: 18px;
  border-left: 4px solid #00ffff;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  line-height: 20px;
}

.main-window-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px; /* 增加顶部间距 */
  width: auto;
}



.star-category .star-category-header {
  display: sticky;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background-color: #000044;
  border-radius: 8px;
  margin-bottom: 10px;
}


.main-window .main-window-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 1000px; /* 根据实际内容调整 */
  overflow: hidden;
  transition: max-height 0.3s ease-in;
}

.main-window-header {
   display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  background-color: #000044;
  border-radius: 8px;
}

/* Fix main window header content alignment */
.main-window-header > * {
  align-self: center;
  margin: 0;
}

.category-title {
  margin: 0;
  font-size: 18px;
  border-left: 4px solid #00ffff;
  padding: 10px;
  box-sizing: border-box;
  height: 40px;
  line-height: 20px;
}

.inline-toggle-btn {
  margin-left: auto;
  margin-right: 10px;
  align-self: center;
  background-color: #000000b3;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  pointer-events: auto;
}

/* 增加这一行以确保主窗口内的 wrapper 和 chart 展示方式一致 */
.main-window-wrapper,
.star-category .chart-grid > .star-chart-wrapper {
  width: auto;
  margin-top: 20px; /* 统一顶部间距 */
}

:root {
  --header-height: 50px; /* You can adjust this value as needed */
}

.main-window-header, 
.star-category-header {
  height: var(--header-height);
  min-height: var(--header-height);
  line-height: var(--header-height); /* Vertical centering */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background-color: #000044;
  border-radius: 8px;
  margin-bottom: 10px;
}

.main-window-header .main-window-category-label,
.star-category-header .category-title {
  margin: 0;
  font-size: 18px;
  border-left: 4px solid #00ffff;
  padding-left: 10px;
  line-height: var(--header-height); 

}

.main-window-header .inline-toggle-btn,
.star-category-header .inline-toggle-btn {
  height: calc(var(--header-height) - 20px); /* Slightly smaller than header */
  margin: 0;
  padding: 0 10px;
}

.category-title, .main-window-category-label {
  margin: 0;
  font-size: 18px;
  border-left: 4px solid #00ffff;
  padding: 10px;
  box-sizing: border-box;
  height: 40px;
  line-height: 20px;
  background-color: #000044; /* 添加背景色 */
  border-radius: 8px; /* 添加圆角 */
}

.config-toggle-btn {
  background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.config-toggle-btn:hover {
  background: #000000e6;
}


.main-window.collapsed {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.main-window-wrapper {
  display: block; /* Default state */
}

.main-window-wrapper.collapsed {
  display: none; /* Hidden state */
}


.star-category, .main-window {
  background-color: #000033; /* 统一背景颜色 */
  border: 1px solid #ffffff33; /* 统一边框 */
  border-radius: 8px; /* 统一圆角 */
  display: flex;
  flex-direction: column;
  gap: 20px; /* 统一内部元素间距 */
}

#starCanvas {
  position: relative;
  z-index: 1; /* 确保canvas在顶层 */
}

.connection-layer {
  mix-blend-mode: screen; /* 改善透明度显示效果 */
}

.star-info {
  margin-top: 10px;
  color: #ffffff;
  font-size: 14px;
  max-width: 90%;
  margin: 10px auto;
}

.star-path,
.star-attributes,
.star-effect {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}