html,
body {
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #e6f0f6;
  font-family: "Noto Sans SC", system-ui, sans-serif;
}

#app {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #070b14;
}

.export-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #070b14;
}

.export-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  flex: 0 0 var(--export-width, 2560px);
  width: var(--export-width, 2560px);
  height: var(--export-height, 1440px);
  margin-left: calc(var(--export-width, 2560px) / -2);
  margin-top: calc(var(--export-height, 1440px) / -2);
  background: #070b14;
  overflow: visible;
  transform: scale(var(--export-scale, 1));
  transform-origin: center center;
}

.export-frame > [data-pencil-id] {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  overflow: hidden !important;
}

.export-frame [data-pencil-name="HUD Top Wing Header"] {
  box-sizing: border-box !important;
  width: 100% !important;
}

.export-frame [data-pencil-name="HUD Top Wing Header"].runtime-shared-header {
  flex: 0 0 75.5px !important;
}

.runtime-header-active {
  background: #0284c7 !important;
  outline: 1px solid #00f0ff !important;
}

.runtime-header-active [data-pencil-name="Cat Label"] { color: #ffffff !important; }
.runtime-header-idle { background: #10192a !important; outline: 1px solid #1e3050 !important; }
.runtime-header-idle [data-pencil-name="Cat Label"] { color: #8ea3bf !important; }

.export-frame [data-pencil-name="Center Sector - Digital Twin Dynamic Workshop Map"],
.export-frame [data-pencil-name="Center Interactive Twin Frame"],
.export-frame [data-pencil-name="Tri-Sector Main Cockpit Grid"],
.export-frame [data-pencil-name="Topology Spatial Map Viewport"],
.export-frame [data-pencil-name="Workshops Grid Row 1"],
.export-frame [data-pencil-name="Workshops Grid Row 2"],
.export-frame [data-pencil-name^="ShopCard-"] {
  min-width: 0 !important;
}

.export-frame [data-pencil-name="Center Interactive Twin Frame"],
.export-frame [data-pencil-name="Topology Spatial Map Viewport"],
.export-frame [data-pencil-name="Workshops Grid Row 1"],
.export-frame [data-pencil-name="Workshops Grid Row 2"] {
  width: 100% !important;
}

.export-frame [data-pencil-name="Btn Submit Login"] {
  cursor: pointer;
  user-select: none;
}

.export-frame [data-pencil-name="Btn Submit Login"]:hover {
  filter: brightness(1.12);
}

.export-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin-left: 14px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font: 700 16px/1.2 "Noto Sans SC", system-ui, sans-serif;
}

.export-input.password {
  font-size: 20px;
  letter-spacing: 0.08em;
}

.runtime-input-group {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
}

.runtime-input-group .export-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  margin-left: 14px;
}

.export-input::placeholder { color: #4a6180; }

.export-error {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 100;
  width: 560px;
  padding: 22px 28px;
  border: 1px solid #ef4444;
  color: #ffd8d4;
  background: #251725;
  box-shadow: 0 18px 60px #0009;
  font-size: 18px;
  transform: translate(-50%, -50%);
}

.export-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 32px;
  background: #02060dcc;
}

.export-modal {
  width: 920px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 38px 42px 34px;
  border: 1px solid #00f0ff;
  border-radius: 10px;
  background: #10192a;
  box-shadow: 0 24px 80px #000b;
  transform: scale(var(--modal-scale, 1));
  transform-origin: center center;
}

.export-modal-kicker { margin-bottom: 8px; color: #00f0ff; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
.export-modal h2 { margin: 0 0 16px; color: #fff; font-size: 25px; }
.export-modal p { margin: 0; color: #b7c8d5; font-size: 16px; line-height: 1.8; }
.export-modal button { min-height: 40px; margin-top: 24px; padding: 9px 24px; border: 1px solid #00f0ff; border-radius: 6px; color: #06121b; background: #00f0ff; font: 700 15px/1.2 "Noto Sans SC", system-ui, sans-serif; cursor: pointer; }
.export-modal button:hover { filter: brightness(1.15); }

.export-action { cursor: pointer; }
.export-action:focus-visible { outline: 2px solid #00f0ff; outline-offset: 3px; }

.runtime-selected { filter: brightness(1.18); outline: 1px solid #00f0ff !important; outline-offset: -1px; }

.export-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.export-modal-actions button[data-modal-close] { color: #b7c8d5; background: #16283c; }
.export-modal-actions .button-secondary { color: #cbe6ef; background: #13263b; }
.modal-detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 10px 18px; margin: 18px 0 0; color: #8ea3bf; font-size: 15px; }
.modal-detail-grid b { color: #e8f5f8; font-weight: 600; }
.modal-choice-list { display: grid; gap: 7px; margin-top: 18px; }
.modal-choice-list button { width: 100%; color: #cbe6ef; background: #13263b; text-align: left; }

.runtime-nav-menu { position: absolute; z-index: 80; width: 390px; padding: 14px; border: 1px solid #00f0ff; border-radius: 10px; background: #0b111e; box-shadow: 0 18px 48px #000b; }
.runtime-nav-menu-head { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 6px 12px; border-bottom: 1px solid #1e3050; color: #fff; font-size: 17px; font-weight: 700; }
.runtime-nav-menu-head small { color: #6f8ba4; font-size: 14px; font-weight: 400; }
.runtime-nav-menu-list { display: grid; gap: 6px; padding-top: 10px; }
.runtime-nav-menu-list button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #1e3050; border-radius: 6px; color: #cbe6ef; background: #10192a; font: 15px/1.2 "Noto Sans SC", system-ui, sans-serif; cursor: pointer; }
.runtime-nav-menu-list button:hover { border-color: #00f0ff; color: #fff; background: #162238; }
.runtime-nav-menu-list svg { width: 16px; height: 16px; fill: none; stroke: #00f0ff; stroke-width: 1.8; }
.runtime-logout-action { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 0 0 8px; padding: 0; border: 1px solid #2a4365; color: #f59e0b; background: #10192a; cursor: pointer; }
.runtime-logout-action:hover { border-color: #f59e0b; background: #162238; }
.runtime-logout-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.runtime-closed { opacity: .46; filter: grayscale(.8); }

.notification-list,
.inspection-list,
.history-list { display: grid; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.notification-item { display: grid; grid-template-columns: 62px 1fr; gap: 12px; align-items: start; padding: 12px; border: 1px solid #1e3050; border-radius: 6px; background: #0b111e; }
.notification-item.is-unread { border-color: #2a7892; background: #102236; }
.notification-type { color: #00f0ff; font-size: 14px; font-weight: 700; }
.notification-item b { display: block; color: #e8f5f8; font-size: 15px; font-weight: 600; }
.notification-item small { display: block; margin-top: 5px; color: #6f8ba4; font-size: 14px; }
.inspection-list li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid #1e3050; border-radius: 6px; color: #d7e8ee; background: #0b111e; }
.inspection-list svg, .history-list svg { width: 16px; height: 16px; fill: none; stroke: #10b981; stroke-width: 2; }
.inspection-list em { color: #10b981; font-size: 14px; font-style: normal; }
.history-list li { display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; border: 1px solid #1e3050; border-radius: 6px; color: #b7c8d5; background: #0b111e; font-size: 14px; line-height: 1.6; }
.modal-section-title { margin-top: 22px; padding-bottom: 8px; border-bottom: 1px solid #1e3050; color: #00f0ff; font-size: 14px; font-weight: 700; }
.modal-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.modal-form-grid label { display: grid; gap: 7px; color: #8ea3bf; font-size: 14px; }
.modal-form-grid .modal-form-wide { grid-column: 1 / -1; }
.modal-form-grid input, .modal-form-grid select, .modal-form-grid textarea, .settings-list select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #2a4365; border-radius: 6px; outline: 0; color: #e8f5f8; background: #0b111e; font: 14px/1.4 "Noto Sans SC", system-ui, sans-serif; }
.modal-form-grid textarea { min-height: 94px; resize: vertical; }
.modal-form-grid input:focus, .modal-form-grid select:focus, .modal-form-grid textarea:focus, .settings-list select:focus { border-color: #00f0ff; }
.settings-list { display: grid; gap: 8px; margin-top: 20px; }
.setting-row { display: grid; grid-template-columns: 1fr auto 28px; gap: 14px; align-items: center; min-height: 58px; padding: 10px 12px; border: 1px solid #1e3050; border-radius: 6px; background: #0b111e; cursor: pointer; }
.setting-row span { display: grid; gap: 4px; }
.setting-row b { color: #e8f5f8; font-size: 15px; font-weight: 600; }
.setting-row small { color: #6f8ba4; font-size: 14px; }
.setting-row input { position: absolute; opacity: 0; pointer-events: none; }
.setting-row i { position: relative; width: 28px; height: 16px; border: 1px solid #4a6180; border-radius: 10px; background: #162238; }
.setting-row i::after { position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; background: #8ea3bf; content: ""; transition: transform .16s ease, background .16s ease; }
.setting-row input:checked + i { border-color: #00f0ff; background: #00f0ff33; }
.setting-row input:checked + i::after { background: #00f0ff; transform: translateX(12px); }
.setting-row select { width: 120px; min-height: 34px; }

@media (max-width: 720px) {
  .export-modal-backdrop { padding: 14px; }
  .export-modal { max-width: calc(100vw - 28px); padding: 24px; }
  .modal-form-grid { grid-template-columns: 1fr; }
  .modal-form-grid .modal-form-wide { grid-column: auto; }
  .runtime-nav-menu { width: 320px; }
}

.puzzle-modal { width: min(560px, 100%); }
.puzzle-modal p { font-size: 15px; }
.puzzle-scene { position: relative; width: 100%; height: 220px; margin-top: 20px; overflow: hidden; border: 1px solid #2a5872; border-radius: 8px; background-color: #183247; background-image: linear-gradient(rgba(255,255,255,.1), rgba(255,255,255,.1)), var(--puzzle-image); background-blend-mode: screen, normal; background-position: 0 0; background-size: var(--puzzle-width, 100%) var(--puzzle-height, 100%); }
.puzzle-scene::after { position: absolute; inset: 0; background: linear-gradient(115deg, #0713232e, transparent 58%); content: ""; pointer-events: none; }
.puzzle-hole, .puzzle-piece { position: absolute; z-index: 2; top: var(--puzzle-y); width: 48px; height: 48px; clip-path: polygon(0 0,35% 0,40% 10%,40% 20%,53% 25%,64% 20%,64% 10%,70% 0,100% 0,100% 34%,89% 41%,82% 52%,89% 64%,100% 68%,100% 100%,69% 100%,62% 89%,51% 84%,40% 90%,35% 100%,0 100%,0 69%,11% 62%,17% 51%,11% 40%,0 34%); }
.puzzle-hole { left: var(--puzzle-target); border: 1px dashed #b8ecf1; background: #102b3b80; box-shadow: inset 0 0 0 2px #07121d88, 0 0 0 1px #00f0ff66; }
.puzzle-piece { left: 0; border: 1px solid #fff; background-color: #a6d9e3; background-image: var(--puzzle-image); background-position: var(--piece-x) var(--piece-y); background-size: var(--puzzle-width, 100%) var(--puzzle-height, 100%); box-shadow: 0 3px 9px #00121eaa; transition: transform .03s linear; }
.puzzle-piece::after { position: absolute; inset: 4px; border: 1px solid #fff8; content: ""; }
.puzzle-status { min-height: 25px; margin: 14px 0 9px !important; color: #8ea3bf !important; font-size: 14px !important; }
.puzzle-status.retry { color: #ff9a8f !important; }
.puzzle-status.success { color: #10b981 !important; }
.puzzle-track { position: relative; height: 50px; overflow: hidden; border: 1px solid #2a5872; border-radius: 8px; background: #0b1828; }
.puzzle-track > i { position: absolute; inset: 0 auto 0 0; width: 0; background: #00f0ff24; transition: width .03s linear; }
.puzzle-track::after { position: absolute; inset: 0; display: grid; place-items: center; color: #7690a8; content: "拖动滑块完成拼图验证"; font-size: 14px; pointer-events: none; }
.puzzle-thumb { position: relative; z-index: 3; display: grid; place-items: center; width: 50px; height: 100%; margin-top: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 6px; color: #06121b !important; background: #00f0ff !important; touch-action: none; cursor: grab !important; transition: transform .03s linear; }
.puzzle-thumb:active { cursor: grabbing !important; }
.puzzle-thumb svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.puzzle-refresh { display: inline-flex; align-items: center; gap: 8px; min-height: 40px !important; margin-top: 0 !important; padding: 0 14px !important; border-color: #2a5872 !important; border-radius: 8px !important; color: #bfeef4 !important; background: #102238 !important; }
.puzzle-refresh:hover { border-color: #00f0ff !important; background: #14324a !important; }
.puzzle-refresh svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.puzzle-output { display: block; min-height: 22px; margin-top: 10px; color: #8ea3bf; font-size: 14px; }
