/* 情景模拟闯关 — 实训中心深色规范 */

.root[data-name="实训中心-情景模拟"] {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.root[data-name="实训中心-情景模拟"] .main.psim-main {
  overflow: auto;
  position: relative;
  isolation: isolate;
}

.psim-main {
  flex: 1 1 auto;
  min-height: 0;
  padding: 32px var(--page-pad) 40px;
}

.psim {
  position: relative;
  width: 100%;
  max-width: var(--content-max, 75rem);
  margin-left: auto;
  margin-right: auto;
  min-height: min(720px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* —— 面包屑 —— */
.psim-crumb {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.psim-crumb__back {
  width: var(--practice-crumb-back-size);
  height: var(--practice-crumb-back-size);
  border-radius: var(--practice-crumb-back-radius);
  border: 1px solid rgba(21, 247, 255, 0.22);
  background: linear-gradient(145deg, rgba(21, 247, 255, 0.16) 0%, rgba(21, 247, 255, 0.06) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.16);
  transition:
    background 200ms ease,
    border-color 200ms ease,
    transform 200ms ease;
}

.psim-crumb__back:hover {
  transform: translateX(-1px);
  border-color: rgba(21, 247, 255, 0.4);
}

.psim-crumb__back-icon {
  width: var(--practice-crumb-back-icon-box);
  height: var(--practice-crumb-back-icon-box);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.psim-crumb__back-icon svg {
  width: var(--practice-crumb-back-arrow-w);
  height: var(--practice-crumb-back-arrow-h);
  display: block;
}

.psim-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 14px;
  line-height: 22px;
  min-width: 0;
}

.psim-breadcrumb__link {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
}

.psim-breadcrumb__link:hover {
  color: #15f7ff;
}

.psim-breadcrumb__sep {
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.35);
}

.psim-breadcrumb__current {
  color: #15f7ff;
  font-weight: 600;
}

.psim-breadcrumb__text {
  color: #ffffff;
  white-space: nowrap;
}

.psim-hero {
  text-align: center;
  padding: 12px 12px 8px;
}

.psim-hero__title {
  margin: 0;
  font-size: clamp(1.375rem, 2.8vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #15f7ff 0%, #7cf7ff 45%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(21, 247, 255, 0.25);
  filter: drop-shadow(0 2px 12px rgba(21, 247, 255, 0.2));
}

.psim-hero__sub {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.62);
}

/* —— 顶栏信息卡 —— */
.psim-panel {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, transparent 40%),
    rgba(12, 22, 48, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.psim-panel--profile {
  width: 500px;
  max-width: min(500px, calc(100vw - var(--page-pad) * 2 - 8rem));
  margin: 0;
  padding: 22px 20px 22px 24px;
}

.psim-profile-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.psim-profile__avatar {
  flex: 0 0 104px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(21, 247, 255, 0.4);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  user-select: none;
}

.psim-profile__name {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.5;
}

.psim-profile__bio,
.psim-profile__tools {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.psim-profile__tools {
  margin-bottom: 0;
}

/* —— 关卡流程（点线） —— */
.psim-levels {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.psim-flow {
  position: relative;
  padding: 4px 0 2px;
}

.psim-flow__line {
  position: absolute;
  top: 15px;
  left: calc(12.5% + 6px);
  right: calc(12.5% + 6px);
  height: 0;
  border-top: 2px dashed rgba(21, 247, 255, 0.38);
  pointer-events: none;
}

.psim-flow__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.psim-flow__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.psim-flow__dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(21, 247, 255, 0.45);
  background: rgba(8, 16, 36, 0.95);
  box-shadow:
    0 0 0 3px rgba(21, 247, 255, 0.08),
    0 0 14px rgba(21, 247, 255, 0.15);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.psim-flow__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  transition: color 180ms ease;
}

.psim-flow__step.is-current .psim-flow__dot {
  border-color: #ffffff;
  background: linear-gradient(145deg, #15f7ff 0%, #0ea5e9 100%);
  box-shadow:
    0 0 0 3px rgba(21, 247, 255, 0.25),
    0 0 20px rgba(21, 247, 255, 0.45);
}

.psim-flow__step.is-current .psim-flow__label {
  color: #15f7ff;
}

.psim-flow__step.is-done .psim-flow__dot {
  border-color: rgba(34, 197, 94, 0.7);
  background: rgba(34, 197, 94, 0.35);
}

.psim-flow__step.is-done .psim-flow__label {
  color: rgba(134, 239, 172, 0.85);
}

/* —— 关卡卡片 —— */
.psim-levels__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.psim-level {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 36%),
    rgba(10, 20, 44, 0.82);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.psim-level:hover {
  transform: translateY(-2px);
  border-color: rgba(21, 247, 255, 0.35);
}

.psim-level.is-selected {
  border-color: rgba(21, 247, 255, 0.65);
  box-shadow:
    0 0 0 1px rgba(21, 247, 255, 0.25),
    0 14px 32px rgba(0, 0, 0, 0.35);
}

.psim-level:focus-visible {
  outline: 2px solid #15f7ff;
  outline-offset: 2px;
}

.psim-level__cover {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.psim-level__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 220ms ease;
}

.psim-level:hover .psim-level__cover img {
  transform: scale(1.04);
}

.psim-levels__grid li:nth-child(1) .psim-level__cover img {
  object-position: 30% center;
}

.psim-levels__grid li:nth-child(2) .psim-level__cover img {
  object-position: 55% center;
}

.psim-levels__grid li:nth-child(3) .psim-level__cover img {
  object-position: 70% center;
}

.psim-levels__grid li:nth-child(4) .psim-level__cover img {
  object-position: 40% 60%;
}

.psim-level__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
}

.psim-level__body {
  padding: 10px 12px 12px;
}

.psim-level__title {
  margin: 0 0 4px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
}

.psim-level__role {
  margin: 0 0 10px;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.55);
}

.psim-level__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.72);
}

.psim-level__score {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #15f7ff;
  background: rgba(21, 247, 255, 0.12);
  border: 1px solid rgba(21, 247, 255, 0.28);
}

/* —— 开始 —— */
.psim-start-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 0 8px;
}

.psim-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: min(100%, 320px);
  padding: 14px 28px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #062028;
  background: linear-gradient(90deg, #15f7ff 0%, #34d399 55%, #22c55e 100%);
  box-shadow:
    0 10px 28px rgba(21, 247, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition:
    transform 160ms ease,
    filter 160ms ease,
    box-shadow 160ms ease;
}

.psim-start:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.psim-start:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.psim-start__arrow {
  font-size: 1.125rem;
  line-height: 1;
}

@media (max-width: 56em) {
  .psim-flow__line {
    left: calc(25% + 4px);
    right: calc(25% + 4px);
  }

  .psim-flow__steps,
  .psim-levels__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 40em) {
  .psim-profile-wrap {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .psim-panel--profile {
    width: 100%;
    max-width: 500px;
  }

  .psim-flow__line {
    display: none;
  }

  .psim-flow__steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .psim-flow__label {
    font-size: 0.625rem;
  }

  .psim-levels__grid {
    grid-template-columns: 1fr;
  }

  .psim-start__text {
    font-size: 0.8125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .psim-level,
  .psim-start,
  .psim-crumb__back {
    transition: none;
  }

  .psim-level:hover .psim-level__cover img {
    transform: none;
  }
}
