@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700;900&display=swap");

body.theme-zhaozhou[data-scene="sandbox"] {
  background: #162429;
}

.app-shell:has(.zhaozhou-lab),
.app-main:has(.zhaozhou-lab),
.bridge-layout:has(.zhaozhou-lab) {
  min-height: 100vh;
}

.zhaozhou-lab {
  --zzx-ink: rgba(246, 239, 220, 0.94);
  --zzx-ink-soft: rgba(246, 239, 220, 0.68);
  --zzx-muted: rgba(246, 239, 220, 0.46);
  --zzx-panel: rgba(18, 25, 22, 0.64);
  --zzx-panel-soft: rgba(238, 228, 205, 0.055);
  --zzx-line: rgba(238, 228, 205, 0.16);
  --zzx-line-strong: rgba(212, 175, 55, 0.42);
  --zzx-gold: #d4af37;
  --zzx-cyan: #91d9d0;
  --zzx-red: #a83a32;
  --zzx-shadow: 0 20px 54px rgba(0, 0, 0, 0.28);

  position: relative;
  max-width: 1180px;
  margin-top: 0.95rem;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--bridge-accent, #aab199) 44%, var(--line));
  background:
    radial-gradient(90% 70% at 18% 4%, rgba(212, 175, 55, 0.13), transparent 58%),
    radial-gradient(76% 86% at 88% 88%, rgba(145, 217, 208, 0.11), transparent 62%),
    rgba(16, 25, 24, 0.64);
  color: var(--zzx-ink);
  font-family: "Noto Serif SC", "LXGW WenKai", "Songti SC", "STSong", serif;
}

.zhaozhou-lab *,
.zhaozhou-lab *::before,
.zhaozhou-lab *::after {
  box-sizing: border-box;
}

.zzx-shell-head {
  margin-bottom: 0.95rem;
}

.zzx-loading {
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  padding: 0.48rem 0.92rem;
  border: 1px solid var(--zzx-line-strong);
  border-radius: 999px;
  background: rgba(10, 13, 12, 0.72);
  color: var(--zzx-ink);
  backdrop-filter: blur(14px);
  box-shadow: var(--zzx-shadow);
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.zzx-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 0.9rem;
  min-height: 650px;
  opacity: 0;
  transition: opacity 320ms ease;
}

.zzx-layout.is-ready {
  opacity: 1;
}

.zzx-dock {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 0.62rem;
}

.zzx-paper,
.zzx-panel,
.zzx-toolbar,
.zzx-hotspot,
.zzx-stage-hud {
  border: 1px solid var(--zzx-line);
  border-radius: 8px;
  background: var(--zzx-panel);
  box-shadow: var(--zzx-shadow);
  backdrop-filter: blur(18px) saturate(1.1);
}

.zzx-paper,
.zzx-panel,
.zzx-toolbar {
  padding: 0.78rem;
}

.zzx-paper__title {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.zzx-paper h3 {
  margin: 0;
  color: #f4ead1;
  font-size: clamp(1.9rem, 2.5vw, 2.7rem);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.42);
}

.zzx-paper-sub {
  margin: 0.26rem 0 0;
  color: var(--zzx-ink-soft);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
}

.zzx-paper ul {
  margin: 0.62rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.16rem 0.6rem;
  color: var(--zzx-ink-soft);
  font-size: 0.68rem;
  line-height: 1.35;
}

.zzx-mode-detail h4,
.zzx-params h4 {
  margin: 0;
  color: var(--zzx-ink);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.zzx-mode-detail {
  height: 8.2rem;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.45) transparent;
}

.zzx-structure-tags {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.zzx-structure-tags span {
  display: inline-flex;
  border: 1px solid rgba(212, 175, 55, 0.28);
  color: rgba(248, 232, 185, 0.84);
  padding: 0.18rem 0.42rem;
  font-size: 0.7rem;
}

.zzx-three-views,
.zzx-materials {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.42rem;
}

.zzx-three-views {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.zzx-materials {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.zzx-three-views figure,
.zzx-materials article {
  margin: 0;
  display: grid;
  gap: 0.22rem;
}

.zzx-three-views img,
.zzx-materials img,
.zzx-wire-preview img {
  display: block;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  object-fit: cover;
}

.zzx-three-views img,
.zzx-materials img {
  height: 3.9rem;
}

.zzx-materials span,
.zzx-three-views figcaption {
  color: var(--zzx-ink-soft);
  font-size: 0.7rem;
}

.zzx-wire-preview {
  margin-top: 0.6rem;
}

.zzx-wire-preview img {
  aspect-ratio: 16 / 9;
  max-height: 6.4rem;
}

.zzx-flood-game {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.56rem;
}

.zzx-flood-game label,
.zzx-slider {
  display: grid;
  gap: 0.18rem;
  color: var(--zzx-ink-soft);
  font-size: 0.74rem;
}

.zzx-switch {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.44rem;
}

.zzx-switch input {
  accent-color: var(--zzx-gold);
}

.zzx-pressure {
  display: grid;
  gap: 0.28rem;
}

.zzx-score header,
.zzx-slider__line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
}

.zzx-score header span {
  color: var(--zzx-ink-soft);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.zzx-score header b,
.zzx-slider__line b,
.zzx-pressure b {
  color: var(--zzx-gold);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.zzx-score-total {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin: 0.12rem 0 0.4rem;
}

.zzx-score-total strong {
  color: #f4e6bd;
  font-size: 1.8rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.zzx-score-total small,
.zzx-metric span,
.zzx-metric b,
.zzx-pressure span,
.zzx-slider small {
  color: var(--zzx-ink-soft);
  font-size: 0.7rem;
}

.zzx-metrics,
.zzx-params {
  display: grid;
  gap: 0.32rem;
}

.zzx-metric {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr) 1.8rem;
  align-items: center;
  gap: 0.42rem;
}

.zzx-metric i,
.zzx-pressure i {
  position: relative;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.zzx-metric em,
.zzx-pressure em {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--zzx-gold), var(--zzx-cyan));
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.34);
}

.zzx-slider__line {
  color: var(--zzx-ink);
  font-size: 0.76rem;
}

.zzx-slider__input,
.zzx-flood-game input[type="range"] {
  appearance: none;
  width: 100%;
  height: 0.92rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.zzx-slider__input::-webkit-slider-runnable-track,
.zzx-flood-game input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.92), rgba(255, 255, 255, 0.18));
}

.zzx-slider__input::-webkit-slider-thumb,
.zzx-flood-game input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 0.86rem;
  height: 0.86rem;
  margin-top: -0.34rem;
  border: 1px solid rgba(255, 244, 211, 0.9);
  border-radius: 50%;
  background: var(--zzx-gold);
  box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.13), 0 0 16px rgba(212, 175, 55, 0.38);
}

.zzx-slider__input::-moz-range-track,
.zzx-flood-game input[type="range"]::-moz-range-track {
  height: 3px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.92), rgba(255, 255, 255, 0.18));
}

.zzx-slider__input::-moz-range-thumb,
.zzx-flood-game input[type="range"]::-moz-range-thumb {
  width: 0.86rem;
  height: 0.86rem;
  border: 1px solid rgba(255, 244, 211, 0.9);
  border-radius: 50%;
  background: var(--zzx-gold);
}

.zzx-toolbar {
  display: grid;
  gap: 0.45rem;
}

.zzx-mode-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.34rem;
}

.zzx-mode-btn,
.zzx-reset {
  min-height: 2.1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--zzx-ink-soft);
  padding: 0 0.5rem;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
}

.zzx-mode-btn:hover,
.zzx-reset:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 175, 55, 0.48);
  color: var(--zzx-ink);
}

.zzx-mode-btn.is-active {
  color: #11110d;
  background: var(--zzx-gold);
  border-color: rgba(255, 244, 211, 0.76);
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.18);
}

.zzx-center {
  position: relative;
  min-height: 650px;
  border: 1px solid var(--zzx-line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 12, 14, 0.86), rgba(8, 20, 18, 0.92)),
    rgba(0, 0, 0, 0.24);
}

.zzx-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0e1412;
}

.zzx-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.zzx-canvas canvas:active {
  cursor: grabbing;
}

.zzx-stage-hud {
  position: absolute;
  z-index: 8;
  left: 0.82rem;
  right: 0.82rem;
  top: 0.82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.62rem 0.72rem;
}

.zzx-stage-hud span {
  display: block;
  color: var(--zzx-muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.zzx-stage-hud strong {
  color: var(--zzx-ink);
  font-size: 1rem;
}

.zzx-reset--stage {
  min-height: 1.9rem;
  white-space: nowrap;
}

.zzx-hotspot {
  position: absolute;
  z-index: 8;
  left: 0.82rem;
  bottom: 0.82rem;
  width: min(23rem, calc(100% - 1.64rem));
  padding: 0.66rem 0.78rem;
}

.zzx-hotspot h4 {
  margin: 0;
  color: var(--zzx-gold);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.zzx-hotspot p {
  margin: 0.24rem 0 0;
  color: var(--zzx-ink-soft);
  font-size: 0.74rem;
  line-height: 1.52;
}

.zzx-label-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.zzx-structure-label {
  position: absolute;
  left: 0;
  top: 0;
  width: 10rem;
  opacity: 0;
  transform: translate3d(-999px, -999px, 0);
  transition: opacity 240ms ease;
}

.zzx-structure-label.is-visible {
  opacity: 1;
}

.zzx-structure-label > i {
  position: absolute;
  left: var(--line-x, 0);
  top: var(--line-y, 0);
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 50%;
  background: var(--zzx-gold);
  box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.16), 0 0 18px rgba(212, 175, 55, 0.45);
}

.zzx-structure-label::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--line-length, 4rem);
  height: 1px;
  transform-origin: left center;
  transform: rotate(var(--line-angle, 0rad));
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.82), rgba(212, 175, 55, 0));
}

.zzx-structure-label span {
  display: grid;
  gap: 0.12rem;
  padding: 0.45rem 0.55rem;
  border-left: 2px solid var(--zzx-gold);
  background: rgba(10, 10, 10, 0.48);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.zzx-structure-label b {
  color: #f6e8bd;
  font-size: 0.78rem;
}

.zzx-structure-label small {
  color: var(--zzx-ink-soft);
  font-size: 0.64rem;
  line-height: 1.35;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .zzx-layout {
    grid-template-columns: 1fr;
  }

  .zzx-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zzx-paper,
  .zzx-toolbar {
    grid-column: 1 / -1;
  }

  .zzx-center {
    min-height: 560px;
  }
}

@media (max-width: 760px) {
  .zzx-layout {
    min-height: 0;
  }

  .zzx-dock {
    grid-template-columns: 1fr;
  }

  .zzx-paper ul {
    grid-template-columns: 1fr;
  }

  .zzx-mode-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zzx-center {
    min-height: 470px;
  }

  .zzx-stage-hud {
    align-items: flex-start;
  }
}

@media (max-width: 900px), (pointer: coarse) {
  .app-shell:has(.zhaozhou-lab),
  .app-main:has(.zhaozhou-lab),
  .bridge-layout:has(.zhaozhou-lab) {
    min-height: auto;
  }

  .zhaozhou-lab {
    width: min(94vw, 680px);
    max-width: 100%;
    margin: 0.75rem auto 0;
    overflow: visible;
  }

  .zzx-layout {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    min-height: 0;
  }

  .zzx-dock {
    grid-template-columns: 1fr;
    order: 2;
  }

  .zzx-center {
    order: 1;
    min-height: clamp(360px, 74vw, 520px);
  }

  .zzx-canvas {
    min-height: clamp(360px, 74vw, 520px);
  }

  .zzx-paper ul,
  .zzx-three-views,
  .zzx-materials,
  .zzx-mode-group {
    grid-template-columns: 1fr;
  }

  .zzx-mode-detail {
    height: auto;
    max-height: 18rem;
  }

  .zzx-toolbar {
    position: static;
  }

  .zzx-stage-hud,
  .zzx-hotspot {
    left: 0.6rem;
    right: 0.6rem;
    width: auto;
    max-width: calc(100% - 1.2rem);
  }

  .zzx-stage-hud {
    align-items: flex-start;
    flex-direction: column;
  }

  .zzx-hotspot {
    bottom: 0.6rem;
  }

  .zzx-structure-label {
    width: min(9rem, 42vw);
  }
}

@media (max-width: 560px) {
  .zhaozhou-lab {
    width: 92vw;
    border-radius: 8px;
  }

  .zzx-shell-head h3 {
    font-size: clamp(1.3rem, 7vw, 1.9rem);
  }

  .zzx-center,
  .zzx-canvas {
    min-height: 360px;
  }

  .zzx-stage-hud {
    padding: 0.52rem 0.58rem;
  }

  .zzx-hotspot {
    padding: 0.56rem 0.62rem;
  }
}
