/* =========================================================
 * info.css —— 画布信息块 / 摘要 / 下载按钮 / quick chips / 全局响应式
 * =========================================================
 * ========================================================= */
.stage-overlay {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 5;
  pointer-events: none;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(3px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 1px 4px rgba(30, 40, 60, .06);
}

.stage-overlay .ov-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

.stage-overlay .ov-legend .ln {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top-width: 2.5px;
  vertical-align: middle;
  margin-right: 5px;
}

.stage-overlay .ov-legend i.ln { margin-bottom: 3px; }

.ov-dims div { margin-bottom: 6px; }
.ov-dims div:last-child { margin-bottom: 0; }

.ov-dims span {
  display: block;
  font-size: 11px;
  color: #8a93a3;
  line-height: 1.3;
}

.ov-dims b {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: #1f2430;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: #5b6473;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  flex-wrap: wrap;
}

.legend i.ln {
  display: inline-block;
  width: 26px;
  height: 0;
  border-top-width: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.legend .cut, .stage-overlay .ov-legend .cut { border-top: 2.5px solid var(--red); }
.legend .crease, .stage-overlay .ov-legend .crease { border-top: 2.5px dashed var(--blue); }
.legend .bleed, .stage-overlay .ov-legend .bleed { border-top: 2.5px dashed #0e9f6e; }

.legend .sep { flex: 1 1 auto; }

.muted { color: var(--muted); }

/* ---------- 摘要 ---------- */
.sum {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.sumrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}

.sumrow:last-child { border-bottom: 0; }

.sumrow .k { font-size: 12px; color: var(--muted); }

.sumrow .v { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

.sumrow.primary { background: var(--accent-soft); }

.sumrow.primary .v { color: #b34a00; font-size: 14.5px; }

.sumrow.primary .k { color: #a1611f; }

/* ---------- 下载 ---------- */
.dloads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 4px;
}

.dloads .btn { width: 100%; }

.dloads .btn span { font-size: 10.5px; color: var(--muted); }

/* ---------- quick chips ---------- */
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.chip {
  border: 1px dashed #ccd2dc;
  background: #fafbfc;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11.5px;
  color: #5b6473;
  cursor: pointer;
  font-family: inherit;
}

.chip:hover { border-color: var(--accent); color: #b34a00; }

/* ---------- 说明浮层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(22, 28, 40, .45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal.on { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 14px;
  max-width: 560px;
  width: 100%;
  max-height: 82vh;
  overflow: auto;
  padding: 22px 24px;
  position: relative;
}

.modal-box h2 { font-size: 15px; margin: 18px 0 8px; }

.modal-box h2:first-of-type { margin-top: 0; }

.modal-box p { font-size: 13px; color: #4b5462; line-height: 1.75; }

.modal-box ul { font-size: 13px; color: #4b5462; line-height: 1.8; padding-left: 20px; }

.modal-box .x {
  position: absolute;
  right: 14px;
  top: 12px;
  border: 0;
  background: #f2f4f7;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  color: #5b6473;
}

.tbl { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 12.5px; }

.tbl th, .tbl td { border: 1px solid var(--line); padding: 6px 9px; text-align: center; }

.tbl th { background: #fafbfc; color: #4b5462; }

@media (max-width: 1220px) {
  .wrap {
    grid-template-columns: 280px minmax(0, 1fr);
    overflow: auto;
  }

  .side.right { grid-column: 1 / -1; }

  .wrap { overflow: hidden; }
}

@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; }

  body { height: auto; }

  /* 单列布局下 .wrap 高度由内容决定，flex:1 拿不到确定高度，
     画布会塌成一条线（手机上「3D 成型」点下去完全看不见，就是这么来的）。
     这里改成按视口高度给一个确定值。 */
  .stage-holder { flex: 0 0 auto; height: 56vh; min-height: 320px; }
  .stage3d { flex: 0 0 auto; height: 56vh; min-height: 320px; }

  /* 控件栏放不下就换行，滑块独占一行 */
  .bar3d { flex-wrap: wrap; row-gap: 6px; padding: 6px 12px; }
  .foldrow { width: 100%; }
  .foldrow input[type="range"] { flex: 1 1 auto; width: auto; min-width: 120px; }

  .info3d { flex-wrap: wrap; max-width: calc(100% - 24px); }
  .legend { flex-wrap: wrap; }

  /* 右上角提示会压到左上角的信息条，窄屏上直接隐藏（触屏本来也没有滚轮） */
  .tip3d { display: none; }
}

/* 极窄屏：尺寸信息与工序标签各占一行，别挤在一起 */
@media (max-width: 420px) {
  .info3d > span { font-size: 11px; padding: 2px 7px; }
}
