* {
  margin: 0;
  padding: 0;
}

body {
  background-color: #f1f2f3;
}

.container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1600px;
  min-width: 1240px;
  margin: 20px auto;
  color: #333;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.container * {
  box-sizing: border-box;
}

/* 头部样式 */
header {
  position: relative;
  margin-bottom: 20px;
  text-align: center;
}

h1 {
  font-size: 32px;
  margin-bottom: 5px;
}

.tool-description {
  font-size: 16px;
  line-height: 1.6;
}

.usage-section {
  background: #fff;
  border-radius: 8px;
  padding: 15px;
}

.usage-section h3 {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.usage-section ul {
  padding-left: 20px;
}

.usage-section li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* 主体布局 */
.main-content {
  display: flex;
  gap: 20px;
  flex-wrap: nowrap;
  /* 防止元素换行 */
}

/* 左侧控制面板 */
.control-panel {
  flex: 0 0 380px;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #555;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
  background: #f9f9f9;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-row .form-group {
  flex: 1;
}

/* 按钮区域 */
.action-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.btn {
  padding: 12px 15px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #3498db, #2c3e50);
  color: white;
}

.btn-secondary {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, #f39c12, #d35400);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(0);
}

/* 图表区域 */
.chart-area {
  flex: 1;
  /* 占据剩余空间 */
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
  /* 设置最大高度为视口高度减去其他元素高度 */
  overflow: hidden;
  /* 初始隐藏溢出内容 */
}

.chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 300px;
  /* 减小最小高度 */
  max-height: 930px;
  /* 限制最大高度 */
  overflow: auto;
  /* 当图表超出时显示滚动条 */
  position: relative;
}

#chart {
  width: 100%;
  height: 100%;
}

/* 数据表格区域 */
.data-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.data-section h2 {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #2c3e50;
}

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.table-buttons {
  display: flex;
  gap: 10px;
  color: #8a8a8a;
}

.hot-container {
  height: 397px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 800px;
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #7f8c8d;
}

.modal p{
  margin-bottom: 10px;
  color: #6a6a6a;
}

.modal .modal-btn{
  display: flex;
  gap: 30px;
  margin-top: 20px;
  text-align: right;
}

.json-editor {
  width: 100%;
  height: 400px;
  font-family: monospace;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container>* {
  animation: fadeIn 0.5s ease-out;
}

footer {
  text-align: center;
  padding: 20px 0;
  color: #7f8c8d;
  font-size: 1rem;
}
