* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; color: #263b3a; font: 16px/1.5 "Microsoft YaHei", "Noto Sans SC", "PingFang SC", Arial, sans-serif; }
:root { --ink: #263b3a; --accent: #0079ba; --accent-strong: #0b2c5c; }
.cauchy-tetrahedron-demo {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  margin: 18px auto;
  border: 1px solid #d8dfd9;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  max-width: 760px;
}

.cauchy-face-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 10px;
  background: #f4fbfb;
  border-right: 1px solid #d4e7e7;
}

.cauchy-face-btn {
  display: block;
  width: 100%;
  padding: 12px 8px;
  border: 1px solid #cfe4e4;
  border-radius: 6px;
  background: #fff;
  color: #173f46;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.cauchy-face-btn:hover,
.cauchy-face-btn:focus-visible {
  border-color: #22a6b3;
  background: #eefafa;
  outline: none;
}

.cauchy-face-btn.is-active {
  border-color: #14848f;
  background: #168f9b;
  color: #fff;
  box-shadow: 0 6px 16px rgba(22, 143, 155, 0.2);
}

.cauchy-svg-panel {
  overflow-x: auto;
  background: linear-gradient(180deg, #ffffff 0%, #f6fcfb 100%);
}

.cauchy-tetrahedron-svg {
  display: block;
  width: 100%;
  max-width: 640px;
  min-width: 460px;
  height: auto;
  margin: 0 auto;
}

.cauchy-axis,
.cauchy-edges line {
  fill: none;
  stroke: #1d2621;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.cauchy-axis {
  stroke-width: 2.2;
}

.cauchy-face-base {
  stroke: #557a83;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.cauchy-base-oab {
  fill: rgba(125, 211, 252, 0.24);
}

.cauchy-base-oac {
  fill: rgba(254, 240, 138, 0.26);
}

.cauchy-base-obc {
  fill: rgba(254, 215, 170, 0.28);
}

.cauchy-base-abc {
  fill: rgba(153, 246, 228, 0.22);
}

.cauchy-face-highlight {
  opacity: 0;
  stroke: #18aab4;
  stroke-width: 3.2;
  fill: rgba(103, 232, 249, 0.32);
  transition: opacity 160ms ease;
  vector-effect: non-scaling-stroke;
}

.cauchy-tetrahedron-demo[data-active-face="obc"] .cauchy-highlight-obc,
.cauchy-tetrahedron-demo[data-active-face="oac"] .cauchy-highlight-oac,
.cauchy-tetrahedron-demo[data-active-face="oab"] .cauchy-highlight-oab,
.cauchy-tetrahedron-demo[data-active-face="abc"] .cauchy-highlight-abc {
  opacity: 1;
}

.cauchy-face-layer {
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.cauchy-tetrahedron-demo[data-active-face="obc"] .cauchy-layer-obc,
.cauchy-tetrahedron-demo[data-active-face="oac"] .cauchy-layer-oac,
.cauchy-tetrahedron-demo[data-active-face="oab"] .cauchy-layer-oab,
.cauchy-tetrahedron-demo[data-active-face="abc"] .cauchy-layer-abc {
  opacity: 1;
}

.cauchy-stress-vector,
.cauchy-normal-vector,
.cauchy-resultant-vector {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.cauchy-stress-vector {
  stroke: #1d4ed8;
  stroke-width: 2.55;
}

.cauchy-normal-vector {
  stroke: #7c3aed;
  stroke-width: 2.45;
}

.cauchy-resultant-vector {
  stroke: #059669;
  stroke-width: 2.75;
}

.cauchy-component-dash {
  stroke-dasharray: 5 4;
}

.cauchy-point-labels circle {
  fill: #1d2621;
}

.cauchy-axis-label,
.cauchy-point-label,
.cauchy-component-label,
.cauchy-normal-label,
.cauchy-resultant-label {
  pointer-events: none;
  overflow: visible;
}

.cauchy-axis-label > div,
.cauchy-point-label > div,
.cauchy-component-label > div,
.cauchy-normal-label > div,
.cauchy-resultant-label > div {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 26px;
  min-height: 28px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: #1d2621;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.cauchy-component-label > div,
.cauchy-component-label mjx-container {
  color: #1d4ed8 !important;
}

.cauchy-normal-label > div,
.cauchy-normal-label mjx-container {
  color: #7c3aed !important;
}

.cauchy-resultant-label > div,
.cauchy-resultant-label mjx-container {
  color: #059669 !important;
}

.cauchy-face-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 18px;
  background: #f5fcfb;
  border-top: 1px solid #d4e7e7;
  color: #31565b;
  font-size: 15px;
  line-height: 1.65;
  text-align: center;
}

.cauchy-face-note mjx-container {
  font-size: inherit;
}

.cauchy-tetrahedron-demo figcaption {
  grid-column: 1 / -1;
  padding: 10px 14px;
  border-top: 1px solid #d4e7e7;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}


body > :first-child { margin: 0 auto; max-width: 100%; padding: 22px; border: 1px solid #d9e2eb; border-radius: 6px; }
.equilibrium-controls, .cauchy-face-controls { background: #f5f8fa; }
button { font-family: inherit; }
button.is-active { background: #0079ba; border-color: #0079ba; color: #fff; }
.equilibrium-svg, .cauchy-tetrahedron-svg { min-width: 0; }
.equilibrium-canvas, .cauchy-svg-panel { min-width: 0; background: #fff; border: 0; }
mjx-container > svg { overflow: visible; }
@media (max-width: 680px) {
 body > :first-child { padding: 14px; grid-template-columns: 1fr; }
 .equilibrium-controls, .cauchy-face-controls { flex-direction: row; padding: 8px; gap: 8px; border-right: 0; }
 .equilibrium-dir-btn + .equilibrium-dir-btn { margin-top: 0; }
 .equilibrium-dir-btn, .cauchy-face-btn { flex: 1; padding: 10px 4px; }
}
