/* P15 操作预演：所有样式限定在模块根节点内，避免影响教材原有控件。 */
.p15-operation-root {
  --p15-operation-ink: #173b46;
  --p15-operation-muted: #5a737a;
  --p15-operation-blue: #2167a4;
  --p15-operation-teal: #167c78;
  --p15-operation-pale-blue: #eef7ff;
  --p15-operation-pale-teal: #effaf7;
  --p15-operation-border: #c7dfe2;
  --p15-operation-focus: #0f6f88;
  box-sizing: border-box;
  max-width: 100%;
  margin: 20px 0 0;
  color: var(--p15-operation-ink);
  font-size: 14px;
  line-height: 1.55;
}

.p15-operation-root *,
.p15-operation-root *::before,
.p15-operation-root *::after {
  box-sizing: border-box;
}

.p15-operation-panel {
  border: 1px solid var(--p15-operation-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(37, 91, 102, 0.08);
  overflow: hidden;
}

.p15-operation-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 10px 16px;
  color: var(--p15-operation-ink);
  background: linear-gradient(90deg, #f3fbff, #f2fbf8);
  cursor: pointer;
  list-style: none;
}

.p15-operation-summary::-webkit-details-marker {
  display: none;
}

.p15-operation-summary::after {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-right: 2px solid var(--p15-operation-teal);
  border-bottom: 2px solid var(--p15-operation-teal);
  transform: rotate(45deg) translateY(-3px);
  content: "";
}

.p15-operation-panel[open] .p15-operation-summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.p15-operation-summary:focus-visible,
.p15-operation-button:focus-visible,
.p15-operation-choice:focus-visible,
.p15-operation-target-hint:focus-visible {
  outline: 3px solid rgba(15, 111, 136, 0.34);
  outline-offset: 2px;
}

.p15-operation-summary-leading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}

.p15-operation-summary-title {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.p15-operation-summary-subtitle {
  color: var(--p15-operation-muted);
  font-size: 14px;
}

.p15-operation-progress {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid #bddad9;
  border-radius: 999px;
  color: #126765;
  background: #f5fffc;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.p15-operation-body {
  padding: 14px 16px 18px;
}

.p15-operation-tracker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.p15-operation-tracker li {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #dce9eb;
  border-radius: 10px;
  color: #6b8186;
  background: #fbfdfd;
  font-size: 13px;
}

.p15-operation-tracker li span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  color: #547077;
  background: #eaf1f3;
  font-size: 12px;
  font-weight: 800;
}

.p15-operation-tracker li b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p15-operation-tracker li.is-current {
  border-color: #8dcaca;
  color: #135b60;
  background: var(--p15-operation-pale-teal);
}

.p15-operation-tracker li.is-current span {
  color: #fff;
  background: var(--p15-operation-teal);
}

.p15-operation-tracker li.is-done {
  border-color: #b4d6ea;
  color: #315f78;
  background: var(--p15-operation-pale-blue);
}

.p15-operation-tracker li.is-done span {
  color: #fff;
  background: var(--p15-operation-blue);
}

.p15-operation-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.p15-operation-figure {
  min-width: 0;
  margin: 0;
}

.p15-operation-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 210px;
  border: 1px solid #c8e1e5;
  border-radius: 13px;
  background: #f8fcfe;
}

.p15-operation-svg text {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.p15-operation-canvas {
  fill: #f8fcfe;
  stroke: #c5e1e5;
  stroke-width: 2;
}

.p15-operation-svg-title {
  fill: #174a58;
  font-size: 14px;
  font-weight: 800;
}

.p15-operation-svg-label,
.p15-operation-svg-target-label,
.p15-operation-center-label,
.p15-operation-nose-label,
.p15-operation-wire-heading,
.p15-operation-terminal-label,
.p15-operation-terminal-symbol {
  pointer-events: none;
}

.p15-operation-svg-target-label {
  fill: #174a58;
  font-size: 12px;
  font-weight: 750;
}

.p15-operation-center-label {
  fill: #22616a;
  font-size: 13px;
  font-weight: 750;
}

.p15-operation-nose-label {
  fill: #1d5e69;
  font-size: 12px;
  font-weight: 750;
}

.p15-operation-svg-note {
  fill: #426970;
  font-size: 11px;
  font-weight: 650;
}

.p15-operation-svg-note-box {
  fill: #eef8f6;
  stroke: #c4e2dd;
  stroke-width: 1;
}

.p15-operation-arm {
  stroke: #74a9b9;
  stroke-width: 13;
  stroke-linecap: round;
}

.p15-operation-center {
  fill: #e8f2f4;
  stroke: #4a8b9b;
  stroke-width: 2;
}

.p15-operation-nose-line,
.p15-operation-nose-arrow {
  stroke: #167c78;
  fill: #167c78;
  stroke-width: 2;
}

.p15-operation-position-ring,
.p15-operation-nose-hit {
  fill: #eef7ff;
  stroke: #3d88b5;
  stroke-width: 3;
}

.p15-operation-position-dot {
  fill: #8bc8d7;
  stroke: #236e8c;
  stroke-width: 2;
}

.p15-operation-assembly-target[data-operation-target],
.p15-operation-wire-target[data-operation-target] {
  cursor: pointer;
}

.p15-operation-assembly-target[data-operation-target]:focus,
.p15-operation-wire-target[data-operation-target]:focus {
  outline: none;
}

.p15-operation-assembly-target[data-operation-target]:focus-visible .p15-operation-position-ring,
.p15-operation-assembly-target[data-operation-target]:focus-visible .p15-operation-nose-hit,
.p15-operation-wire-target[data-operation-target]:focus-visible .p15-operation-terminal {
  stroke: var(--p15-operation-focus);
  stroke-width: 5;
}

.p15-operation-assembly-target.is-expected .p15-operation-position-ring,
.p15-operation-assembly-target.is-expected .p15-operation-nose-hit,
.p15-operation-wire-target.is-expected .p15-operation-terminal {
  fill: #dff5f0;
  stroke: #0d8177;
  stroke-width: 4;
}

.p15-operation-assembly-target.is-correct .p15-operation-position-ring,
.p15-operation-assembly-target.is-correct .p15-operation-nose-hit,
.p15-operation-wire-target.is-correct .p15-operation-terminal {
  fill: #d9f4e7;
  stroke: #178358;
  stroke-width: 4;
}

.p15-operation-assembly-target.is-wrong .p15-operation-position-ring,
.p15-operation-assembly-target.is-wrong .p15-operation-nose-hit,
.p15-operation-wire-target.is-wrong .p15-operation-terminal {
  fill: #fff0ed;
  stroke: #be5b4d;
  stroke-width: 4;
}

.p15-operation-assembly-target.is-recorded .p15-operation-position-ring,
.p15-operation-assembly-target.is-recorded .p15-operation-nose-hit,
.p15-operation-wire-target.is-recorded .p15-operation-terminal {
  fill: #e8f3ff;
  stroke: #3979ae;
  stroke-width: 4;
}

.p15-operation-wire-heading {
  fill: #22616a;
  font-size: 13px;
  font-weight: 800;
}

.p15-operation-wire-line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

.p15-operation-wire-line-a {
  stroke: #2d9e9b;
}

.p15-operation-wire-line-b {
  stroke: #8aa9cf;
}

.p15-operation-terminal {
  fill: #f5fbff;
  stroke: #528eaa;
  stroke-width: 2;
}

.p15-operation-terminal-symbol {
  fill: #19546d;
  font-size: 14px;
  font-weight: 850;
}

.p15-operation-terminal-label {
  fill: #4b6d76;
  font-size: 10px;
}

.p15-operation-figure figcaption {
  margin-top: 7px;
  color: var(--p15-operation-muted);
  font-size: 13px;
}

.p15-operation-stage-copy {
  min-width: 0;
  padding: 2px 0;
}

.p15-operation-kicker {
  margin: 0 0 3px;
  color: var(--p15-operation-teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.p15-operation-stage-copy h3 {
  margin: 0 0 8px;
  color: var(--p15-operation-ink);
  font-size: 18px;
  line-height: 1.35;
}

.p15-operation-stage-copy p {
  margin: 0 0 10px;
}

.p15-operation-target-hint {
  margin-top: 12px !important;
  padding: 10px 12px;
  border-left: 4px solid #74aec5;
  border-radius: 4px 10px 10px 4px;
  color: #315e6b;
  background: #f0f8fc;
}

.p15-operation-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.p15-operation-choice-grid-two {
  grid-template-columns: 1fr;
}

.p15-operation-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid #bddbe4;
  border-radius: 11px;
  color: #1c5668;
  background: #f5fbfe;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.p15-operation-choice:hover,
.p15-operation-choice.is-selected {
  border-color: #25879a;
  background: #eaf8f6;
}

.p15-operation-choice strong {
  font-size: 14px;
  line-height: 1.4;
}

.p15-operation-choice span {
  margin-top: 2px;
  color: var(--p15-operation-muted);
  font-size: 13px;
}

.p15-operation-feedback,
.p15-operation-saved {
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid #c7dee2;
  border-left-width: 4px;
  border-radius: 10px;
  background: #f8fcfc;
}

.p15-operation-feedback.is-correct,
.p15-operation-saved {
  border-color: #a8d9c1;
  border-left-color: #278b60;
  background: #f1fbf5;
}

.p15-operation-feedback.is-wrong {
  border-color: #ebc7bf;
  border-left-color: #bd5c4f;
  background: #fff8f6;
}

.p15-operation-feedback strong,
.p15-operation-saved strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.p15-operation-feedback p,
.p15-operation-saved p {
  margin: 4px 0;
}

.p15-operation-feedback-evidence {
  color: #557079;
  font-size: 13px;
}

.p15-operation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.p15-operation-button {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid #9bcbd0;
  border-radius: 9px;
  color: #145761;
  background: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.p15-operation-button:hover {
  background: #f0fbfa;
}

.p15-operation-button.p15-operation-primary {
  border-color: #167c78;
  color: #fff;
  background: #167c78;
}

.p15-operation-button.p15-operation-primary:hover {
  background: #116863;
}

.p15-operation-record-fieldset {
  margin: 14px 0 0;
  padding: 10px 11px 9px;
  border: 1px solid #c7dfe2;
  border-radius: 10px;
}

.p15-operation-record-fieldset legend {
  padding: 0 5px;
  color: #27616a;
  font-size: 13px;
  font-weight: 750;
}

.p15-operation-check-row,
.p15-operation-radio-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 8px 4px;
  color: #264f5a;
  cursor: pointer;
}

.p15-operation-check-row input,
.p15-operation-radio-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 3px 0 0;
  accent-color: var(--p15-operation-teal);
}

.p15-operation-note-label {
  display: block;
  margin-top: 13px;
  color: #2c626b;
  font-size: 13px;
  font-weight: 750;
}

.p15-operation-note {
  display: block;
  width: 100%;
  min-height: 60px;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid #bdd7dc;
  border-radius: 9px;
  color: var(--p15-operation-ink);
  background: #fff;
  font: inherit;
  resize: vertical;
}

.p15-operation-note:focus,
.p15-operation-check-row input:focus-visible,
.p15-operation-radio-row input:focus-visible {
  outline: 3px solid rgba(15, 111, 136, 0.27);
  outline-offset: 2px;
}

.p15-operation-form-error {
  margin: 9px 0 0 !important;
  padding: 8px 10px;
  border-radius: 8px;
  color: #8a3d35;
  background: #fff0ed;
  font-size: 13px;
}

@media (max-width: 760px) {
  .p15-operation-visual-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .p15-operation-svg {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .p15-operation-root {
    margin-top: 14px;
    font-size: 14px;
  }

  .p15-operation-summary {
    align-items: flex-start;
    gap: 8px;
    min-height: 58px;
    padding: 10px 12px;
  }

  .p15-operation-summary-leading {
    display: block;
  }

  .p15-operation-summary-title,
  .p15-operation-summary-subtitle {
    display: block;
  }

  .p15-operation-summary-subtitle {
    margin-top: 2px;
    line-height: 1.4;
  }

  .p15-operation-progress {
    margin-top: 2px;
    padding: 4px 7px;
    font-size: 12px;
  }

  .p15-operation-body {
    padding: 11px 11px 15px;
  }

  .p15-operation-tracker {
    gap: 5px;
    margin-bottom: 12px;
  }

  .p15-operation-tracker li {
    justify-content: center;
    padding: 6px 3px;
  }

  .p15-operation-tracker li b {
    display: none;
  }

  .p15-operation-tracker li span {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  .p15-operation-choice-grid {
    grid-template-columns: 1fr;
  }

  .p15-operation-svg-title {
    font-size: 13px;
  }

  .p15-operation-svg-note {
    font-size: 10px;
  }

  .p15-operation-stage-copy h3 {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .p15-operation-root * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .p15-operation-root {
    margin: 10px 0 0;
    color: #111;
    font-size: 12pt;
  }

  .p15-operation-panel {
    border: 1px solid #777;
    box-shadow: none;
  }

  .p15-operation-panel:not([open]) > .p15-operation-body {
    display: block;
  }

  .p15-operation-summary {
    color: #111;
    background: #fff;
  }

  .p15-operation-summary::after,
  .p15-operation-actions {
    display: none;
  }

  .p15-operation-svg {
    border-color: #777;
  }

  .p15-operation-visual-grid {
    grid-template-columns: 1fr 1fr;
  }
}
