/* 基础重置与网格背景 */
html, body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}

body {
  background: rgb(248, 248, 248);
  background-image: radial-gradient(rgb(98, 117, 101) 1px, transparent 0);
  background-size: 40px 40px;
  background-position: -19px -19px;
  
  /* 关键修复：让 body 变成弹性盒子，所有内容自动居中、垂直排列 */
  display: flex;
  flex-direction: column;
  align-items: center; 
}

/* --- 画布与容器区 --- */

/* 彻底移除 absolute，让元素自然往下排 */
#canvas {
  width: 400px;
  margin: 20px auto; /* 保证居中并与其他元素保持距离 */
  background-color: #E9EAE9;
  border: 1px dashed black;
  color: black;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#canvas2 {
  width: 100%; /* 撑满外层容器 */
  height: 350px;
  background-color: #FCFCFC;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* p5.js 生成的 canvas 标签 */
canvas {
  display: block;
  margin: auto;
}

/* --- 按钮区 --- */

/* 统一按钮的基础样式，移除绝对定位 */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 10px;
  cursor: pointer;
  border-radius: 5px;
  border: none;
  color: #FFFFFF;
}

#button {
  width: 110px;
  height: 40px;
  background-color: #4CAF50;
  font-size: 18px;
}

#share {
  width: 90px;
  height: 40px;
  background-color: #57AF4E;
  font-size: 18px;
}

#button:hover, #share:hover, #label:hover {
  background-color: #555555E2;
}

/* --- 标签与图例区 --- */

.label {
  padding: 5px;
  background-color: #BBBEBB54;
  border: 1px solid #A4A4A45B;
  border-radius: 5px;
  color: #000; /* 修改为黑色方便阅读，可根据需要改回白 */
}

/* 这个是你右下角的图例模块，用 fixed 固定在角落最稳妥 */
#label {
  /* position: fixed; */
  bottom: 20px;
  right: 20px;
  width: 110px;
  font-size: 15px;
  z-index: 10;
}

/* --- 链接与杂项 --- */

a:link { 
  text-decoration: none; 
} 

a:hover {
  background-color: #EEEF00;
  color: black;
}

/* 原来的底部占位符（如果还需要的话） */
#container-3407918bc7ada72e26013699abbdb309 {
  width: 100%;
  height: 50px;
  margin-top: auto;
}
