.popup-form {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.popup-form label {
  display: grid;
  gap: 4px;
}

.popup-form label span {
  color: #405469;
  font-size: 12px;
}

.popup-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.popup-form-grid label:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.drop-zone {
  position: relative;
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 12px;
  border: 1px dashed #9fb1c0;
  border-radius: 8px;
  background: #f6f9fb;
  text-align: center;
  cursor: pointer;
}

.drop-zone.is-dragover {
  border-color: #1f6f8b;
  background: #eaf4f7;
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone strong {
  color: #1f6f8b;
  font-size: 14px;
}

.drop-zone em {
  color: #667789;
  font-style: normal;
}

.drop-zone small {
  color: #405469;
}

.selected-file-summary {
  display: block;
  color: #1f6f8b;
  font-weight: 600;
}

.selected-file-list {
  display: block;
  max-height: 58px;
  overflow: auto;
  color: #405469;
  line-height: 1.45;
  word-break: break-all;
}

.upload-status {
  padding: 8px 10px;
  border: 1px solid #b9d7c1;
  border-radius: 6px;
  background: #eef8f1;
  color: #27613a;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}

.upload-popup-form.is-uploading .drop-zone {
  cursor: progress;
  opacity: 0.72;
}

.upload-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
}

.upload-progress-overlay[hidden] {
  display: none;
}

.upload-progress-panel {
  width: min(460px, 100%);
  display: grid;
  gap: 12px;
  padding: 22px 24px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
}

.upload-progress-title {
  color: #1c2733;
  font-size: 18px;
  font-weight: 700;
}

.upload-progress-message {
  color: #405469;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-all;
}

.upload-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef3;
}

.upload-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #1f6f8b;
  transition: width 180ms ease;
}

.upload-progress-meta {
  color: #27613a;
  font-size: 13px;
  font-weight: 700;
}

.upload-progress-file {
  max-height: 48px;
  overflow: auto;
  color: #647586;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.upload-target-path {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #dbe3ea;
  border-radius: 6px;
  background: #f8fafb;
}

.upload-target-path span {
  color: #647586;
  font-size: 12px;
}

.upload-target-path strong {
  min-width: 0;
  overflow: hidden;
  color: #243447;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-popup-form textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid #c9d3dd;
  border-radius: 4px;
  padding: 7px 8px;
  background: #ffffff;
  color: #1c2733;
  font: 12px/1.5 Consolas, "Microsoft YaHei", monospace;
}

.preview-shell {
  height: 100%;
  max-height: 100%;
  padding: 0;
  background: #f4f7f9;
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 0;
  overflow: hidden;
}

.preview-process-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border-right: 1px solid #d8e0e8;
  background: #ffffff;
  overflow: hidden;
}

.preview-process-section {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.preview-process-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid #d8e0e8;
}

.preview-process-header span {
  color: #7a8997;
  font-size: 12px;
}

.preview-process-tree {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  list-style: none;
  margin: 0;
  padding: 5px 0;
}

.preview-model-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #e3e9ee;
  background: #f8fafb;
}

.preview-model-meta span {
  color: #647586;
  font-size: 12px;
}

.preview-model-meta strong {
  color: #405469;
  font-size: 12px;
  font-weight: 600;
}

.preview-process-tree li {
  margin: 0 0 4px;
}

.preview-process-empty {
  padding: 28px 8px;
  color: #7a8997;
  text-align: center;
}

.preview-process-tree button {
  width: 100%;
  min-height: 30px;
  display: block;
  text-align: left;
  border-color: transparent;
  background: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-process-tree li.is-active button {
  border-color: #b8d4df;
  background: #eaf4f7;
  color: #1f6f8b;
}

.preview-process-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid #d8e0e8;
}

.preview-process-status {
  display: none;
  min-height: 44px;
  max-height: 78px;
  overflow: auto;
  padding: 6px 8px 8px;
  border-top: 1px solid #eef2f5;
  color: #647586;
  font-size: 12px;
  line-height: 1.4;
}

.preview-scene-section {
  min-height: 0;
  max-height: 236px;
  overflow: auto;
  overscroll-behavior: contain;
  border-top: 1px solid #d8e0e8;
}

.preview-scene-body {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.preview-scene-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-scene-actions > button {
  flex: 1;
}

.preview-scene-body > button {
  width: 100%;
}

.preview-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #405469;
}

.preview-switch input {
  width: auto;
  min-height: auto;
}

.preview-basepoint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.preview-basepoint-grid label {
  display: grid;
  gap: 3px;
}

.preview-basepoint-grid span {
  color: #647586;
  font-size: 11px;
}

.preview-basepoint-grid input {
  min-height: 26px;
  padding: 4px 6px;
}

.preview-canvas-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.preview-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.preview-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.preview-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  color: #647586;
  background: rgba(244, 247, 249, 0.86);
}

.preview-loading-box {
  width: min(280px, calc(100% - 40px));
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #d8e0e8;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(28, 39, 51, 0.12);
}

.preview-loading-box strong {
  color: #243447;
  font-size: 14px;
}

.preview-loading-box span {
  min-height: 18px;
  color: #647586;
}

.preview-loading-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf2;
}

.preview-loading-track i {
  display: block;
  height: 100%;
  min-width: 10px;
  border-radius: inherit;
  background: #1f6f8b;
  transition: width 0.16s ease;
}

.preview-loading-box.is-error {
  border-color: #f0c0b8;
}

.preview-loading-box.is-error strong {
  color: #b42318;
}

.dictionary-manager {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  background: #f3f6f8;
}

.dictionary-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  background: #ffffff;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(28, 39, 51, 0.04);
}

.dictionary-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid #e6edf2;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafb 100%);
}

.dictionary-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.dictionary-title i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1f6f8b;
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.12);
}

.dictionary-title strong {
  color: #243447;
  font-size: 14px;
  font-weight: 700;
}

.dictionary-count {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid #d9e4ea;
  border-radius: 999px;
  background: #ffffff;
  color: #5f7182;
  font-size: 12px;
  line-height: 18px;
}

.dictionary-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #e6edf2;
  background: #fbfcfd;
}

.dictionary-editor input {
  min-width: 0;
}

.dictionary-save-btn,
.dictionary-cancel-btn {
  min-width: 48px;
  padding-left: 9px;
  padding-right: 9px;
}

.dictionary-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 8px;
  padding: 6px 12px;
  color: #647586;
  font-size: 12px;
  font-weight: 600;
  background: #f5f8fa;
  border-bottom: 1px solid #e6edf2;
}

.dictionary-list-head span:last-child {
  text-align: right;
}

.dictionary-list {
  min-height: 0;
  overflow: auto;
  padding: 3px 0 6px;
}

.dictionary-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 12px;
  border-bottom: 1px solid #eef2f5;
  transition: background 0.14s ease;
}

.dictionary-item:nth-child(even) {
  background: #fbfcfd;
}

.dictionary-item:hover {
  background: #edf6f8;
}

.dictionary-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #263746;
  font-weight: 500;
}

.dictionary-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.dictionary-edit-btn,
.dictionary-delete-btn {
  min-height: 24px;
  padding: 2px 8px;
  border-color: transparent;
  background: transparent;
  color: #1f6f8b;
}

.dictionary-edit-btn:hover {
  border-color: #b8d4df;
  background: #eaf4f7;
}

.danger-text-btn {
  color: #b42318;
}

.danger-text-btn:hover {
  border-color: #f0b8b2;
  background: #fff1f0;
}

.dictionary-empty {
  margin: 8px;
  padding: 42px 8px;
  border: 1px dashed #cdd8e1;
  border-radius: 6px;
  background: #fbfcfd;
  color: #7a8997;
  text-align: center;
}

@media (max-width: 720px) {
  .dictionary-manager {
    grid-template-columns: 1fr;
  }
}

.user-manager {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding: 12px;
  background: #f3f6f8;
}

.user-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(28, 39, 51, 0.04);
}

.user-manager-head div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.user-manager-head strong {
  color: #243447;
  font-size: 14px;
}

.user-manager-head span {
  color: #647586;
  font-size: 12px;
}

.user-manager-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 10px;
}

.user-table {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(28, 39, 51, 0.04);
}

.user-table-head,
.user-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 78px 68px 88px 88px 98px;
  align-items: center;
  gap: 8px;
}

.user-table-head {
  padding: 7px 12px;
  color: #647586;
  font-size: 12px;
  font-weight: 600;
  background: #f5f8fa;
  border-bottom: 1px solid #e6edf2;
}

.user-table-head span:last-child {
  text-align: right;
}

.user-table-body {
  min-height: 0;
  overflow: auto;
  padding: 3px 0 6px;
}

.user-row {
  min-height: 38px;
  padding: 5px 12px;
  border-bottom: 1px solid #eef2f5;
}

.user-row:nth-child(even) {
  background: #fbfcfd;
}

.user-row:hover {
  background: #edf6f8;
}

.user-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-name {
  display: flex;
  align-items: center;
  gap: 7px;
}

.user-name strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #263746;
}

.user-name em {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef3f6;
  color: #647586;
  font-size: 11px;
  font-style: normal;
}

.role-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  line-height: 18px;
}

.role-badge {
  border: 1px solid #d9e4ea;
  background: #f8fafb;
  color: #4d5f70;
}

.role-badge.is-admin {
  border-color: #b8d4df;
  background: #eaf4f7;
  color: #1f6f8b;
}

.status-badge.is-enabled {
  border: 1px solid #b9dec6;
  background: #edf8f0;
  color: #246b38;
}

.status-badge.is-disabled {
  border: 1px solid #d8dde3;
  background: #f0f2f4;
  color: #6a7682;
}

.status-badge.is-expired {
  border: 1px solid #f0c0b8;
  background: #fff1f0;
  color: #b42318;
}

.user-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.user-row-actions button {
  min-height: 24px;
  padding: 2px 8px;
  border-color: transparent;
  background: transparent;
  color: #1f6f8b;
}

.user-row-actions button:hover {
  border-color: #b8d4df;
  background: #eaf4f7;
}

.user-row-actions .danger-text-btn {
  color: #b42318;
}

.user-empty {
  margin: 8px;
  padding: 48px 8px;
  border: 1px dashed #cdd8e1;
  border-radius: 6px;
  background: #fbfcfd;
  color: #7a8997;
  text-align: center;
}

.user-editor-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(28, 39, 51, 0.04);
}

.user-editor-title {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-bottom: 1px solid #e6edf2;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafb 100%);
}

.user-editor-title strong {
  color: #243447;
  font-size: 14px;
}

.user-editor-title span {
  color: #647586;
  font-size: 12px;
}

.user-editor-empty {
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 24px;
  color: #7a8997;
  text-align: center;
}

.user-editor-empty strong {
  color: #405469;
}

.user-editor-form {
  align-content: start;
  padding: 12px;
}

.user-editor-form select {
  min-width: 0;
}

.user-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
}

@media (max-width: 760px) {
  .user-manager-head {
    align-items: stretch;
    flex-direction: column;
  }

  .user-manager-body {
    grid-template-columns: 1fr;
  }

  .user-table {
    overflow: auto;
  }

  .user-table-head,
  .user-row {
    min-width: 720px;
  }
}
