html.if-condition-page {
  --pass: var(--success);
  --fail: var(--danger);
  --current: var(--warning);
  --dim: var(--text-muted);
  --muted: var(--text-faint);
  --neutral: var(--info);
  --pass-dim: var(--success-muted);
  --fail-dim: var(--danger-muted);
  --cur-dim: var(--warning-muted);
  --neut-dim: var(--info-muted);
  --s2: var(--bg-elevated);
  --s3: var(--surface-solid);
  --border2: var(--border-strong);
}

html.if-condition-page body {
  font-family: var(--font-sans);
  overflow-x: hidden;
}

html.if-condition-page .if-app {
  position: relative;
  z-index: 1;
}

html.if-condition-page .header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

html.if-condition-page .hdr-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  background: var(--warning-muted);
  border: 1px solid var(--warning);
  color: var(--warning);
}

html.if-condition-page .hdr-text h1 {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
}

html.if-condition-page .hdr-text p {
  color: var(--dim);
  font-size: 13px;
  margin-top: 4px;
}

html.if-condition-page .hdr-pill {
  margin-right: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

html.if-condition-page .pill {
  padding: 5px 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
}

html.if-condition-page .pill-green {
  border-color: var(--success);
  background: var(--success-muted);
  color: var(--success);
}

html.if-condition-page .pill-blue {
  border-color: var(--info);
  background: var(--info-muted);
  color: var(--info);
}

html.if-condition-page .pill-red {
  border-color: var(--danger);
  background: var(--danger-muted);
  color: var(--danger);
}

html.if-condition-page .main {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
}

@media (max-width: 1000px) {
  html.if-condition-page .main {
    grid-template-columns: 1fr;
  }
}

html.if-condition-page .left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

html.if-condition-page .scenario-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 200px;
  overflow-y: auto;
}

html.if-condition-page .scenario-btn {
  padding: 9px 12px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  text-align: right;
  transition: all 0.18s;
  line-height: 1.5;
}

html.if-condition-page .scenario-btn:hover {
  background: var(--s3);
  color: var(--text);
  border-color: var(--border2);
}

html.if-condition-page .scenario-btn.active {
  background: var(--warning-muted);
  border-color: var(--warning);
  color: var(--warning);
}

html.if-condition-page .scenario-config {
  margin-bottom: 10px;
}

html.if-condition-page .config-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

html.if-condition-page .config-row label {
  font-size: 11px;
  color: var(--dim);
  font-family: var(--font-mono);
  min-width: 60px;
}

html.if-condition-page .config-row .inp {
  flex: 1;
}

html.if-condition-page .config-row select {
  background: var(--s3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
}

html.if-condition-page .config-row select:focus {
  border-color: var(--warning);
}

html.if-condition-page .config-row select option {
  background: var(--surface-solid);
}

html.if-condition-page .speed-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
  cursor: pointer;
}

html.if-condition-page .speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--warning);
  cursor: pointer;
  border: 2px solid var(--surface-solid);
}

html.if-condition-page .speed-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--warning);
  min-width: 40px;
}

html.if-condition-page .btn-run {
  background: var(--warning);
  color: #0a0e14;
}

html.if-condition-page .btn-run:hover:not(:disabled) {
  background: var(--warning);
  filter: brightness(1.1);
}

html.if-condition-page .btn-step {
  color: var(--warning);
}

html.if-condition-page .btn-step:hover:not(:disabled) {
  background: var(--warning-muted);
  border-color: var(--warning);
}

html.if-condition-page .viz-panel .phead .dot {
  background: var(--warning);
}

html.if-condition-page .viz-stage {
  padding: 24px 18px;
  min-height: 260px;
  position: relative;
}

html.if-condition-page .flow-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
}

html.if-condition-page .flow-idle {
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-mono);
  text-align: center;
  padding: 20px 0;
}

html.if-condition-page .flow-node {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  position: relative;
  transition: all 0.4s ease;
  max-width: 90%;
  animation: if-node-in 0.4s ease;
}

@keyframes if-node-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html.if-condition-page .flow-node.diamond {
  background: var(--cur-dim);
  border: 2px solid var(--current);
  color: var(--current);
  transform: rotate(0deg);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  width: 160px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

html.if-condition-page .flow-node.diamond .diamond-inner {
  transform: rotate(0deg);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

html.if-condition-page .flow-node.condition-testing {
  background: var(--cur-dim);
  border: 2px solid var(--current);
  color: var(--current);
  box-shadow: 0 0 20px rgba(235, 194, 117, 0.2);
}

html.if-condition-page .flow-node.condition-true {
  background: var(--pass-dim);
  border: 2px solid var(--pass);
  color: var(--pass);
}

html.if-condition-page .flow-node.condition-false {
  background: var(--fail-dim);
  border: 2px solid var(--fail);
  color: var(--fail);
  opacity: 0.6;
}

html.if-condition-page .flow-node.executed {
  background: var(--pass-dim);
  border: 2px solid var(--pass);
  color: var(--pass);
}

html.if-condition-page .flow-node.skipped {
  background: var(--fail-dim);
  border: 2px dashed var(--fail);
  color: var(--fail);
  opacity: 0.4;
}

html.if-condition-page .flow-node.result-node {
  background: var(--neut-dim);
  border: 2px solid var(--neutral);
  color: var(--neutral);
  font-size: 14px;
}

html.if-condition-page .flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 18px;
  animation: if-arrow-in 0.3s ease;
}

@keyframes if-arrow-in {
  from {
    opacity: 0;
    transform: scaleY(0);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

html.if-condition-page .flow-arrow.arrow-true {
  color: var(--pass);
}

html.if-condition-page .flow-arrow.arrow-false {
  color: var(--fail);
}

html.if-condition-page .flow-branch-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--dim);
  text-align: center;
  margin-bottom: 2px;
}

html.if-condition-page .flow-branch-label.label-true {
  color: var(--pass);
}

html.if-condition-page .flow-branch-label.label-false {
  color: var(--fail);
}

html.if-condition-page .eval-box {
  padding: 14px 18px;
  background: var(--s2);
  border-top: 1px solid var(--border);
  min-height: 70px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

html.if-condition-page .eval-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
}

html.if-condition-page .eval-step .es-label {
  color: var(--dim);
  font-size: 11px;
  min-width: 80px;
}

html.if-condition-page .eval-step .es-expr {
  color: var(--text);
  flex: 1;
}

html.if-condition-page .eval-verdict {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  align-self: flex-start;
  display: none;
}

html.if-condition-page .eval-verdict.pass {
  background: var(--pass-dim);
  color: var(--pass);
  border: 1px solid rgba(61, 214, 140, 0.35);
  display: block;
}

html.if-condition-page .eval-verdict.fail {
  background: var(--fail-dim);
  color: var(--fail);
  border: 1px solid rgba(240, 113, 120, 0.35);
  display: block;
}

html.if-condition-page .eval-idle {
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-mono);
  text-align: center;
  padding: 8px 0;
}

html.if-condition-page .stats-bar {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

html.if-condition-page .stat-card {
  flex: 1;
  min-width: 100px;
  padding: 10px 14px;
  border-radius: 10px;
  text-align: center;
}

html.if-condition-page .stat-card.total {
  background: var(--neut-dim);
  border: 1px solid rgba(108, 181, 248, 0.25);
}

html.if-condition-page .stat-card.passed {
  background: var(--pass-dim);
  border: 1px solid rgba(61, 214, 140, 0.25);
}

html.if-condition-page .stat-card.failed {
  background: var(--fail-dim);
  border: 1px solid rgba(240, 113, 120, 0.22);
}

html.if-condition-page .stat-card.remain {
  background: var(--cur-dim);
  border: 1px solid rgba(235, 194, 117, 0.25);
}

html.if-condition-page .stat-num {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

html.if-condition-page .stat-num.blue {
  color: var(--neutral);
}

html.if-condition-page .stat-num.green {
  color: var(--pass);
}

html.if-condition-page .stat-num.red {
  color: var(--fail);
}

html.if-condition-page .stat-num.yellow {
  color: var(--current);
}

html.if-condition-page .stat-lbl {
  font-size: 11px;
  color: var(--dim);
  margin-top: 4px;
}

html.if-condition-page .right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

html.if-condition-page .code-line-hl {
  background: var(--warning-muted);
  border-right: 3px solid var(--warning);
  margin: 0 -16px;
  padding: 0 16px;
  display: block;
  animation: if-hl-pulse 0.5s ease;
}

@keyframes if-hl-pulse {
  0% {
    background: rgba(235, 194, 117, 0.28);
  }
  100% {
    background: var(--warning-muted);
  }
}

html.if-condition-page .trace-panel {
  flex: 1;
}

html.if-condition-page .trace-list {
  max-height: 300px;
  overflow-y: auto;
}

html.if-condition-page .trace-item {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  animation: if-trace-in 0.3s ease;
}

@keyframes if-trace-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

html.if-condition-page .trace-item:last-child {
  border-bottom: none;
}

html.if-condition-page .ti-i {
  color: var(--dim);
  min-width: 28px;
  font-size: 10px;
}

html.if-condition-page .ti-val {
  font-weight: 600;
  min-width: 50px;
}

html.if-condition-page .ti-expr {
  color: var(--dim);
  flex: 1;
  font-size: 10px;
}

html.if-condition-page .ti-res {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

html.if-condition-page .ti-pass {
  background: var(--pass-dim);
  color: var(--pass);
  border: 1px solid rgba(61, 214, 140, 0.35);
}

html.if-condition-page .ti-fail {
  background: var(--fail-dim);
  color: var(--fail);
  border: 1px solid rgba(240, 113, 120, 0.35);
}

html.if-condition-page .ti-cur {
  background: var(--cur-dim);
  color: var(--current);
  border: 1px solid rgba(235, 194, 117, 0.35);
}

html.if-condition-page .tip-panel .phead .dot {
  background: var(--info);
}

html.if-condition-page .tip-content {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

html.if-condition-page .tip-content strong {
  color: var(--accent);
}

html.if-condition-page .tip-content code {
  font-family: var(--font-mono);
  background: var(--accent-muted);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

html.if-condition-page .progress-fill {
  background: var(--warning);
  box-shadow: none;
}

html.if-condition-page .c-kw {
  color: var(--violet);
}

html.if-condition-page .c-fat {
  color: var(--warning);
}

html.if-condition-page .c-str {
  color: var(--success);
}

html.if-condition-page .c-num {
  color: var(--info);
}

html.if-condition-page .c-op {
  color: var(--warning);
}

html.if-condition-page .c-bool {
  color: var(--violet);
}

html.if-condition-page .done-banner {
  display: none;
  padding: 16px 18px;
  background: var(--pass-dim);
  border: 1px solid rgba(61, 214, 140, 0.35);
  border-radius: var(--radius-md);
  margin: 12px 18px;
  text-align: center;
}

html.if-condition-page .done-banner.show {
  display: block;
}

html.if-condition-page .done-banner h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--success);
  margin-bottom: 6px;
}

html.if-condition-page .done-banner .done-result {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
  background: var(--s2);
  padding: 8px 14px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 4px;
}

html.if-condition-page .trace-clear {
  margin-right: auto;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-sans);
}

html.if-condition-page .trace-clear:hover {
  color: var(--danger);
}
