/* v2.0 Execution & Step Reader System (现代化药房工作台全屏二级页面) */
#execution-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f4f6f4;
}
.execution-reader {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* 顶部水平步骤滑轨 */
.execution-steps {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  flex-shrink: 0;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #edf2ee;
  scrollbar-width: none;
  touch-action: pan-x;
}
.execution-steps::-webkit-scrollbar { display: none; }

.execution-steps button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 140px;
  max-width: 190px;
  min-height: 52px;
  padding: 8px 12px;
  text-align: left;
  background: #f5f8f6;
  border: 1.5px solid transparent;
  border-radius: 14px;
  color: #4a5f53;
  cursor: pointer;
  transition: all 0.15s ease;
}
.execution-steps button:has(.execution-duration-badge) {
  padding-top: 14px;
}
.execution-steps button.done {
  background: #eef6f1;
  color: #285d45;
  border-color: #d4e8dc;
}
.execution-steps button.is-doing:not(.done) {
  border-color: #285d45;
  background: #f0f7f3;
}
.execution-steps button[aria-current="step"] {
  background: #285d45 !important;
  color: #fff !important;
  border-color: #285d45 !important;
  box-shadow: 0 4px 12px rgba(40, 93, 69, 0.28);
}

.execution-duration-badge {
  position: absolute;
  top: 3px;
  right: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: #5c6f65;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}
.execution-steps button[aria-current="step"] .execution-duration-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.execution-step-number {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  color: #4a5f53;
  font-size: 11px;
  font-weight: 700;
}
.execution-step-number .ui-icon {
  width: 14px;
  height: 14px;
}
.execution-steps button.done .execution-step-number {
  background: #285d45;
  color: #fff;
}
.execution-steps button[aria-current="step"] .execution-step-number {
  background: #fff;
  color: #285d45;
}

.execution-step-label {
  min-width: 0;
  flex: 1;
}
.execution-step-label strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.execution-step-label small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #718477;
}
.execution-steps button[aria-current="step"] .execution-step-label small {
  color: rgba(255, 255, 255, 0.85);
}

.form-page .execution-page-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.execution-progress-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* 内容滑动区 */
.execution-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
}
.execution-card {
  padding: 20px 18px 24px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 1px 4px rgba(15, 56, 46, 0.04);
  border: 1px solid #edf2ee;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.execution-card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.execution-step-tag {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 6px;
  background: #eef6f1;
  color: #285d45;
  font-size: 11px;
  font-weight: 600;
}
.execution-card h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  color: #17382e;
}

.execution-image {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  background: #f8faf8;
}

.execution-guide-box {
  background: #f8fbf9;
  border: 1px solid #e3ede6;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.execution-guide-box .guide-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #285d45;
  font-size: 13px;
  font-weight: 600;
}
.execution-guide-box .guide-title .ui-icon {
  width: 16px;
  height: 16px;
}
.execution-guide {
  font-size: 14px;
  line-height: 1.75;
  color: #203b30;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 底部操作区 */
.execution-action {
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #edf2ee;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 -4px 16px rgba(15, 56, 46, 0.05);
}
.execution-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.execution-state {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
  margin: 0;
}
.execution-state.done { color: #285d45; }
.execution-state.preview { color: #2563eb; }
.execution-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.execution-action button.primary {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  background: #285d45;
  color: #fff;
  border: 0;
  box-shadow: 0 3px 12px rgba(40, 93, 69, 0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
  transition: transform 0.1s ease, background 0.15s ease;
}
.execution-action button.primary:active {
  transform: scale(0.99);
  background: #214e3a;
}
.execution-action button.action-jump {
  background: #1e40af;
  box-shadow: 0 3px 12px rgba(30, 64, 175, 0.28);
}
.execution-action button.action-jump:active {
  background: #172554;
}
.execution-action button.primary .ui-icon {
  width: 18px;
  height: 18px;
}

.execution-action .error:not(:empty) {
  padding: 8px 12px;
  border-radius: 10px;
  background: #fdf2f0;
  color: #a4423d;
  font-size: 12px;
  margin: 0;
}

/* 计时面板 */
.execution-timer-panel {
  border: 1px solid #c7dff3;
  border-radius: 16px;
  background: #edf5fc;
  color: #1b5a8c;
  padding: 12px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.execution-timer-panel p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.execution-timer-panel p .ui-icon {
  width: 16px;
  height: 16px;
}
.execution-timer-panel .step-countdown {
  display: block;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.execution-timer-panel[hidden] { display: none; }

.timer-lock-hint {
  font-size: 12px;
  color: #718477;
  margin: 0;
  text-align: center;
}
.execution-action .execution-force {
  display: block;
  margin: 0 auto;
  padding: 6px 14px;
  border: 0;
  background: transparent;
  color: #c24136;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}
.execution-force[hidden], .timer-lock-hint[hidden] { display: none !important; }

.execution-completion {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: rgba(244, 246, 244, 0.96);
  backdrop-filter: blur(4px);
  color: #285d45;
  text-align: center;
  padding: 24px;
}
.execution-completion-check {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #285d45;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}
.execution-completion strong {
  font-size: 18px;
  font-weight: 700;
}
.execution-completion > span:last-child {
  font-size: 13px;
  color: #5c6f65;
}
