body {
  margin: 0;
  color: black;
  font-family: Arial, sans-serif;
  background: #f4f7fb;
}

#sceneWrapper {
  position: relative;
  width: 100%;
  height: 650px;
  overflow: hidden;
  background: #dff1ff;
}

#container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#titleOverlay {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  text-align: center;
  background: rgba(30, 70, 115, 0.92);
  color: white;
  padding: 10px 28px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

#titleOverlay h1 {
  font-size: 30px;
  margin: 0;
  color: white;
}

#titleOverlay div {
  font-size: 15px;
  margin-top: 5px;
}

#leftPanel,
#rightPanel {
  position: absolute;
  top: 90px;
  z-index: 999999;
  width: 340px;
  max-height: 530px;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: rgba(238, 238, 238, 0.96);
  border: 2px solid #333;
  border-radius: 10px;
  padding: 14px;
  font-family: Arial, sans-serif;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

#leftPanel {
  left: 20px;
}

#rightPanel {
  right: 20px;
}

#leftPanel h2,
#rightPanel h2 {
  font-size: 20px;
  margin-top: 0;
  color: #222;
}

.controlGroup {
  margin-bottom: 13px;
  text-align: left;
}

.controlGroup label {
  font-weight: bold;
}

#leftPanel input[type="range"] {
  width: 100%;
  accent-color: blue;
}

.valueBox {
  margin-top: 5px;
  padding: 8px;
  border-radius: 8px;
  background: white;
  font-size: 14px;
  text-align: left;
  border: 1px solid #d9d9d9;
}

.button-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 6px;
  margin: 10px 0;
}

.button-row .btn {
  flex: 0 0 auto;
  min-width: 54px;
  padding: 6px 9px;
  font-size: 13px;
}

#leftPanel::-webkit-scrollbar,
#rightPanel::-webkit-scrollbar,
.button-row::-webkit-scrollbar {
  width: 8px;
  height: 6px;
}

#leftPanel::-webkit-scrollbar-thumb,
#rightPanel::-webkit-scrollbar-thumb,
.button-row::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 8px;
}

#leftPanel::-webkit-scrollbar-track,
#rightPanel::-webkit-scrollbar-track,
.button-row::-webkit-scrollbar-track {
  background: #ddd;
}

.resultBox {
  background: white;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  text-align: left;
  border: 1px solid #ccc;
}

.resultBox h3 {
  font-size: 16px;
  margin: 0 0 8px 0;
  color: #1d3557;
  text-align: center;
}

.torqueBars {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-top: 10px;
  height: 140px;
}

.torqueCol {
  flex: 1;
  text-align: center;
}

.barFrame {
  width: 100%;
  height: 105px;
  border-radius: 10px;
  background: linear-gradient(to top, #e8edf3, #ffffff);
  border: 1px solid #bbb;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.torqueFill {
  width: 100%;
  height: 0%;
  border-radius: 8px 8px 0 0;
  transition: height 0.1s linear;
}

.leftFill {
  background: linear-gradient(to top, #d62828, #ff9f9f);
}

.middleFill {
  background: linear-gradient(to top, #2a9d8f, #99f0dc);
}

.rightFill {
  background: linear-gradient(to top, #1d4ed8, #93c5fd);
}

.netFill {
  background: linear-gradient(to top, #6d28d9, #c4b5fd);
}

.barLabel {
  font-size: 12px;
  margin-top: 6px;
  font-weight: bold;
  color: #333;
}

.graphBox {
  background: white;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
}

.graphBox canvas {
  width: 100%;
  height: 160px;
  background: #fafafa;
  border: 1px solid #ccc;
}

.statusBalanced {
  color: #16803a;
  font-weight: bold;
}

.statusLeft {
  color: #b91c1c;
  font-weight: bold;
}

.statusRight {
  color: #1d4ed8;
  font-weight: bold;
}

#seoContent {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 18px;
  background: white;
}

#seoContent h1 {
  text-align: center;
  font-size: 34px;
  margin-bottom: 15px;
  color: #1d3557;
}

#seoContent h2 {
  font-size: 24px;
  margin-top: 28px;
  color: #003366;
}

#seoContent p,
#seoContent li {
  font-size: 17px;
  line-height: 1.6;
}

.formula-box {
  text-align: center;
  font-size: 23px;
  font-weight: bold;
  background: #eef5ff;
  border-left: 6px solid #1d70b8;
  padding: 14px;
  margin: 18px 0;
}

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  background: #1d3557;
  color: white;
  text-align: center;
}

footer a {
  color: #ffd166;
}

@media (max-width: 980px) {
  #sceneWrapper {
    height: 930px;
  }

  #leftPanel,
  #rightPanel {
    width: 310px;
    max-height: 350px;
  }

  #leftPanel {
    top: 100px;
    left: 10px;
  }

  #rightPanel {
    top: 465px;
    left: 10px;
    right: auto;
  }

  #titleOverlay h1 {
    font-size: 24px;
  }
}
