/* 外层居中 */
.chart-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 10vh;
  padding: 20px;
  box-sizing: border-box;
}

/* 三栏布局：文字 | 饼图 | 图例 */
.container {
  display: flex;
  flex-direction: row;
  gap: 30px;               /* 三列之间的间距 */
  align-items: center;     /* 垂直居中对齐 */
  background: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 1000px;
  width: 100%;
  box-sizing: border-box;
}

/* 左侧文字 */
.text-box {
  flex: 1;
  max-width: 300px;
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  text-align: left;
  margin-right: 80px; 
}

.text-box p{
    padding-bottom: 10px;
}

.text-box p {
  margin: 0;
}

/* 中间：饼图 */
.pie-chart {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: conic-gradient(
    #FF6384 0% 32%,
    #36A2EB 32% 57%,
    #FFCE56 57% 75%,
    #4BC0C0 75% 90%,
    #9966FF 90% 100%
  );
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border: 3px solid #f0f0f0;
}

/* 右侧：图例 */
.legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  font-size: 15px;
}

.legend-item {
  display: flex;
  align-items: center;
}

.color-box {
  width: 14px;
  height: 14px;
  margin-right: 10px;
  border-radius: 2px;
}

/* 响应式：小屏幕下垂直堆叠 */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  .text-box {
    max-width: none;
    text-align: center;
  }
  .legend {
    align-items: center;
  }
}