body {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* background-color: #2b2b2b; */
  position: relative;
}

canvas {
  overflow: hidden;
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
}

#canvas-border {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: transparent;
  z-index: 0;
  width: calc(100% + 5px);
  height: calc(100% + 5px);
  pointer-events: none;
  transition: border 0.6s;
}

@keyframes toBlack {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}


@keyframes toWhite {
  from {
    filter: brightness(0%);
  }
  to {
    filter: brightness(100%);
  }
}

.buffer-image {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  display: block;
  margin: auto;
  animation: toBlack 0.5s forwards;
}

.project-image {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  display: block;
  margin: auto;
  animation: toWhite 1.0s forwards;
}


#infoPanel {
  display: none;
  position: absolute;
  z-index: 9999;
  background: rgba(0,0,0,0.8) !important;
  border-radius: 16px;
  padding: 0; /* 內距移到內層 */
  max-width: 80vw;
  max-height: 70vh;
  overflow: hidden; /* 關鍵：裁切圓角 */
  font-family: 'Consolas', 'Menlo', 'Monaco', 'monospace';
  color: #fff;
  border: 1.3px solid rgb(49, 49, 49);
  pointer-events: auto;
  box-sizing: border-box;
}

.infoPanel-inner {
  width: 100%;
  max-height: 70vh; /* 關鍵：讓內容可捲動 */
  overflow: auto;   /* 捲動條出現在這層 */
  box-sizing: border-box;
  padding: 32px 40px;
  border-radius: 16px;
  /* 不能設 height: 100%，否則內容高度不足時不會出現 scrollbar */
}

.infoPanel-inner::-webkit-scrollbar {
  width: 3px;
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
}
.infoPanel-inner::-webkit-scrollbar-thumb {
  background: linear-gradient(120deg, rgb(255, 255, 255) 10%, #c4c4c488 90%);
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(71, 71, 71, 0.533), 0 0 2px rgb(102, 102, 122);
  border: 1px solid rgba(0,0,0,0.5);
}
.infoPanel-inner::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(120deg, rgb(111, 111, 111) 0%, #a4a4a4cc 100%);
  box-shadow: 0 0 16px rgb(83, 83, 83), 0 0 4px rgb(92, 92, 122);
}
.infoPanel-inner::-webkit-scrollbar-corner {
  background: rgba(0,0,0,0.3);
}

/* Firefox */
.infoPanel-inner {
  scrollbar-width: thin;
  scrollbar-color: rgb(213, 213, 213) rgba(0,0,0,0.3);
}

#infoPanel table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1em;
  background: transparent;
}

#infoPanel th, #infoPanel td {
  border: 1px solid rgba(97, 97, 97, 0.533);
  padding: 5px 12px;
  text-align: left;
  color: #fff;
  font-size: 0.5em;
  letter-spacing: 0.02em;
}

#infoPanel th {
  background: rgba(196, 196, 196, 0.08);
  font-weight: bold;
  color: rgb(255, 255, 255);
  text-shadow: 0 0 4px rgba(97, 97, 97, 0.533);
}

#infoPanel h3 {
  color: rgb(255, 255, 255);
  margin-top: 0.5em;
  margin-bottom: 0.2em;
  font-size: 1.0em;
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px rgba(104, 104, 104, 0.533);
  border-bottom: 1px solid rgba(40, 40, 40, 0.267);
  padding-bottom: 0.2em;
}

#infoPanel::-webkit-scrollbar {
  width: 10px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
}

#infoPanel::-webkit-scrollbar-thumb {
  background: linear-gradient(120deg, rgb(255, 255, 255) 10%, #00f0ff88 90%);
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(129, 129, 129, 0.533), 0 0 2px #00f;
  border: 2px solid rgba(0,0,0,0.5);
}

#infoPanel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(120deg, rgb(141, 141, 141) 0%, #00f0ffcc 100%);
  box-shadow: 0 0 16px rgb(242, 242, 242), 0 0 4px #00f;
}

#infoPanel::-webkit-scrollbar-corner {
  background: rgba(0,0,0,0.3);
}

/* Firefox */
#infoPanel {
  scrollbar-width: thin;
  scrollbar-color: rgb(255, 255, 255) rgba(0,0,0,0.3);
}

.info-flex {
  display: flex;
  flex-direction: row;
  gap: 50px; /* 兩表格間距 */
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap; /* 小螢幕自動換行 */
}

.info-block {
  min-width: 220px;
  max-width: 600px;
  flex: 1 1 0;
}
