.area-page {
  width: min(1280px, calc(100% - 32px));
}

.area-page .tool-heading { padding: 14px 0 11px; }
.area-page .tool-heading h1 { font-size: clamp(30px, 3.25vw, 43px); }
.area-page .lead { max-width: 850px; }

.area-lab .lab-toolbar { min-height: 52px; padding: 10px 18px; }
.area-lab .lab-grid { grid-template-columns: minmax(0, 3fr) minmax(292px, 1fr); }
.area-lab .visual-stage { min-width: 0; padding: 12px 14px 13px; }
.area-lab .control-deck { padding: 16px; }

.scene-status {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  border: 1px solid #e8dcc9;
  border-radius: 13px;
  color: #6a6258;
  background: rgba(255, 255, 255, .86);
}
.scene-status span { font-size: 11px; font-weight: 850; }
.scene-status strong { color: #253149; font-size: 17px; }

.geometry-scene {
  min-height: 300px;
  display: grid;
  place-items: center;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(58, 137, 127, .24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 16% 18%, rgba(243, 197, 88, .15), transparent 18rem),
    linear-gradient(145deg, rgba(255, 255, 255, .91), rgba(237, 249, 246, .78));
}
.geometry-scene svg {
  width: 100%;
  height: 300px;
  display: block;
  overflow: visible;
}
.measurement-grid line {
  stroke: rgba(76, 130, 124, .12);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.geometry-piece,
.final-outline {
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.geometry-piece { stroke-width: 2.4; }
.retained-piece {
  fill: #72cbbb;
  stroke: #227e75;
}
.cut-piece {
  fill: #f5a25d;
  stroke: #a84f22;
  stroke-dasharray: 8 5;
}
.final-outline {
  stroke: #1c645f;
  stroke-width: 3.2;
}
.height-line {
  stroke: #355a86;
  stroke-width: 2;
  stroke-dasharray: 6 5;
  vector-effect: non-scaling-stroke;
}
.right-angle-marker {
  stroke: #355a86;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}
.base-measure line {
  stroke: #7b4d28;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}
.geometry-dimension-label,
.piece-label,
.side-label {
  paint-order: stroke;
  stroke: rgba(255, 255, 255, .94);
  stroke-width: 5px;
  stroke-linejoin: round;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-weight: 900;
}
.geometry-dimension-label { fill: #35516f; font-size: 15px; }
.piece-label { fill: #7c371a; font-size: 14px; }
.side-label { fill: #725d4b; font-size: 12px; }

.evidence-row {
  min-height: 55px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}
.evidence-item {
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 6px 8px;
  border: 1px solid rgba(43, 152, 139, .27);
  border-radius: 12px;
  color: #65736f;
  background: #eaf7f3;
  font-size: 9px;
  font-weight: 850;
  text-align: center;
}
.evidence-item strong { color: #226d65; font-size: 13px; line-height: 1.2; }

.area-case strong { font-size: 13px; }
.area-case span { font-size: 8px; }
.area-lab .action-row { grid-template-columns: minmax(0, 1fr) 68px; }

.formula-zone {
  min-height: 136px;
  margin-top: 11px;
  padding: 10px;
  border: 1px solid rgba(85, 116, 202, .2);
  border-radius: 14px;
  background: linear-gradient(145deg, #f5f7ff, #fbfcff);
}
.formula-placeholder {
  min-height: 114px;
  display: grid;
  place-items: center;
  margin: 0;
  color: #748095;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.formula-placeholder[hidden] { display: none; }
.formula-proof { display: grid; gap: 5px; }
.formula-proof[hidden] { display: none; }
.proof-step {
  min-height: 23px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #5c687c;
  font-size: 10px;
  font-weight: 850;
}
.proof-step::before {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #5574ca;
  content: attr(data-order);
  font-size: 9px;
}
.proof-step.formula-result {
  color: #94431c;
  font-size: 12px;
}
.proof-step.formula-result::before { background: #dc712e; }

.area-lab .truth-note {
  margin-top: 9px;
  padding: 8px 9px;
  font-size: 10px;
}

[data-tool-state="moving"] .moving-cut-piece { filter: drop-shadow(0 10px 8px rgba(160, 76, 30, .24)); }
[data-tool-state="settled"] .final-outline { animation: outline-arrive .42s ease both; }
[data-tool-state="settled"] .proof-step { animation: proof-arrive .32s ease both; }
[data-tool-state="settled"] .proof-step:nth-child(2) { animation-delay: .08s; }
[data-tool-state="settled"] .proof-step:nth-child(3) { animation-delay: .16s; }
[data-tool-state="settled"] .proof-step:nth-child(4) { animation-delay: .24s; }

@keyframes outline-arrive {
  from { opacity: .25; }
  to { opacity: 1; }
}
@keyframes proof-arrive {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .area-page { width: calc(100% - 28px); }
  .area-lab .lab-grid { grid-template-columns: 1fr; }
  .area-lab .visual-stage { border-right: 0; border-bottom: 1px solid #eadfce; }
  .area-lab .control-deck {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 9px 15px;
  }
  .area-lab .control-heading { grid-row: span 2; }
  .area-lab .action-row { margin-top: 0; }
  .formula-zone { grid-column: 1 / -1; min-height: 111px; margin-top: 0; }
  .formula-placeholder { min-height: 89px; }
  .area-lab .truth-note { grid-column: 1 / -1; margin-top: 0; }
}

@media (max-width: 720px) {
  .area-page .tool-heading { padding-top: 16px; }
  .area-lab .lab-toolbar { align-items: flex-start; flex-direction: column; gap: 3px; }
  .area-lab .phase-copy { text-align: left; }
  .geometry-scene,
  .geometry-scene svg { min-height: 276px; height: 276px; }
  .area-lab .control-deck { display: block; }
  .area-lab .action-row,
  .formula-zone,
  .area-lab .truth-note { margin-top: 10px; }
}

@media (max-width: 430px) {
  .area-page { width: calc(100% - 20px); }
  .area-page .tool-heading { padding: 14px 0 10px; }
  .area-page .tool-heading h1 { font-size: 26px; }
  .area-page .lead { font-size: 13px; }
  .area-lab { border-radius: 21px; }
  .area-lab .visual-stage { padding: 9px; }
  .scene-status { align-items: flex-start; flex-direction: column; gap: 2px; }
  .geometry-scene,
  .geometry-scene svg { min-height: 232px; height: 232px; }
  .evidence-row { grid-template-columns: 1fr; }
  .evidence-item { min-height: 42px; grid-template-columns: 1fr 1.4fr; }
  .area-case strong { font-size: 10px; }
  .area-case span { font-size: 7px; }
  .area-lab .control-deck { padding: 13px; }
  .formula-zone { min-height: 130px; }
  .formula-placeholder { min-height: 108px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-tool-state="settled"] .final-outline,
  [data-tool-state="settled"] .proof-step {
    animation: none !important;
  }
}
