:root {
  --bg: #0a0f0e;
  --panel: #141c1b;
  --text: #e6f0ee;
  --muted: #8b9e9a;
  --accent: #3fd0c8;
  --border: #243836;
  accent-color: var(--accent);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  accent-color: var(--accent);
}

body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  accent-color: var(--accent);
}

/* 主工作台：顶栏 + 画布 + 底栏填满视口，不出现页面级滚动条 */
body:has(> .workspace) {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body:has(> .workspace) > .toolbar,
body:has(> .workspace) > .statusbar {
  flex-shrink: 0;
}

.toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  overflow: visible;
  flex-shrink: 0;
}

.brand-group {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}

.toolbar-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  margin-right: 14px;
  flex-shrink: 0;
  user-select: none;
  pointer-events: none;
}

.label {
  color: var(--muted);
  font-size: 13px;
}

.btn,
.file-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #1c2827;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.btn:hover,
.file-btn:hover {
  background: #263836;
}

.btn.accent {
  background: #2a9e96;
  border-color: #3fd0c8;
}

.btn.accent:hover {
  background: #3fd0c8;
}

.btn.ghost {
  background: transparent;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 导航：打开图片已移至首页空状态，顶栏不再展示 */
.toolbar .toolbar-open-btn {
  display: none !important;
}

/* 导航：描边按钮（青色主题） */
.toolbar .toolbar-outline-btn.btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: #9ee8e2;
}

.toolbar .toolbar-outline-btn.btn:hover {
  background: rgba(63, 208, 200, 0.12);
  border-color: #7de0d6;
  color: #d4f5f1;
}

.toolbar .toolbar-outline-btn.btn.accent {
  background: transparent;
  border-color: var(--accent);
  color: #9ee8e2;
}

.toolbar label {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.radio,
.check {
  color: var(--text) !important;
}

.group {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.brand-group {
  gap: 8px;
}

.toolbar-autobg-group,
.toolbar-menu-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.toolbar-icon-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -4px;
}

.toolbar-icon-btn:hover {
  background: rgba(63, 208, 200, 0.12);
  border-color: var(--accent);
  color: #9ee8e2;
}

.toolbar-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.toolbar-menu-trigger.is-active,
.toolbar-outline-btn.toolbar-menu-trigger.is-active,
.toolbar .toolbar-outline-btn.btn.is-active {
  background: rgba(63, 208, 200, 0.18);
  border-color: #7de0d6;
  color: #d4f5f1;
}

.toolbar-caret {
  font-size: 11px;
  opacity: 0.75;
  line-height: 1;
}

.toolbar-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 148px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #1a2423;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toolbar-menu--wide {
  min-width: 220px;
}

.toolbar-menu--opts {
  left: auto;
  right: 0;
  min-width: 180px;
}

#toolbarMoreGroup .toolbar-menu {
  right: 0;
  left: auto;
}

.toolbar-menu[hidden] {
  display: none;
}

.toolbar-menu-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.toolbar-menu-item[hidden] {
  display: none;
}

.toolbar-menu-item:hover {
  background: rgba(63, 208, 200, 0.16);
}

.toolbar-menu-item.is-active {
  background: rgba(63, 208, 200, 0.22);
  box-shadow: inset 0 0 0 1px rgba(110, 176, 255, 0.35);
}

.toolbar-menu-item-title {
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.toolbar-menu-item-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.toolbar-menu-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  user-select: none;
  white-space: nowrap;
}

.toolbar-menu-check:hover {
  background: rgba(63, 208, 200, 0.12);
}

.toolbar-menu-check input {
  accent-color: var(--accent);
}

.about-page .toolbar-menu--static {
  display: none;
}

.about-page .about-nav-hover:hover .toolbar-menu--static {
  display: flex;
}

.about-page .toolbar-menu-trigger.is-static {
  cursor: inherit;
}

.about-page .about-nav-hover {
  cursor: pointer;
}

.about-page a.toolbar-menu-item {
  text-decoration: none;
  color: inherit;
}

.auth-group {
  margin-left: auto;
  gap: 10px;
  flex-shrink: 0;
}

@media (max-width: 960px) {
  .toolbar-logo {
    max-width: 100px;
    margin-right: 6px;
  }

  .toolbar-menu-trigger {
    padding: 6px 8px;
    font-size: 12px;
  }

  .toolbar-menu--wide {
    min-width: 200px;
  }
}

input[type="range"] {
  width: 72px;
  vertical-align: middle;
  accent-color: var(--accent);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(63, 208, 200, 0.25);
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(63, 208, 200, 0.25);
  cursor: pointer;
}

.workspace {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #060a10;
}

/* 素材编辑：画布左上角常驻打开图片 */
.workspace-open-btn {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 14;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  margin: 0;
  border: 1px solid rgba(63, 208, 200, 0.55);
  border-radius: 8px;
  background: rgba(16, 28, 48, 0.92);
  color: #e8eef6;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
}

.workspace-open-btn:hover {
  border-color: #7de0d6;
  background: rgba(24, 42, 68, 0.96);
  color: #fff;
}

.workspace-open-btn[hidden] {
  display: none !important;
}

/* 左侧工具栏 */
.tool-rail {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 999px;
  background: rgba(12, 18, 28, 0.52);
  border: 1px solid rgba(90, 140, 200, 0.18);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: visible;
}

.tool-flyout {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 13;
  min-width: 188px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(12, 18, 28, 0.94);
  border: 1px solid rgba(90, 140, 200, 0.22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-flyout[hidden] {
  display: none !important;
}

.tool-flyout-title {
  font-size: 12px;
  font-weight: 600;
  color: #c9d6d3;
  letter-spacing: 0.02em;
}

.tool-opt-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.tool-flyout .tool-opt-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  color: var(--muted);
}

.tool-opt-row.check,
.tool-flyout .tool-opt-row.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.tool-opt-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.brush-style-row {
  display: flex;
  gap: 6px;
  margin: 2px 0 4px;
}

.brush-style-btn {
  flex: 1;
  appearance: none;
  border: 1px solid var(--border);
  background: #1c2827;
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}

.brush-style-btn:hover {
  color: var(--text);
  border-color: #2d524e;
}

.brush-style-btn.is-active {
  color: #fff;
  background: #2a9e96;
  border-color: #3fd0c8;
}

.brush-path-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.brush-path-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #1c2827;
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
}

.brush-path-btn:hover {
  border-color: #2d524e;
  background: #243836;
}

.brush-path-btn.danger {
  color: #ffb4b4;
  border-color: rgba(255, 77, 79, 0.45);
}

.brush-path-btn.danger:hover {
  background: rgba(255, 77, 79, 0.12);
  border-color: rgba(255, 77, 79, 0.7);
}

.asset-pack-tile-dialog {
  max-width: min(720px, 94vw);
}

.asset-pack-library-dialog {
  max-width: min(780px, 94vw);
}

.asset-pack-library-grid {
  max-height: min(58vh, 480px);
}

.asset-pack-library-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.asset-pack-card-actions {
  display: flex;
  gap: 6px;
}

.asset-pack-open {
  flex: 1;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text, #e8eef8);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  cursor: pointer;
}

.asset-pack-open:hover {
  border-color: rgba(63, 208, 200, 0.7);
  background: rgba(63, 208, 200, 0.12);
}

.asset-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  max-height: min(52vh, 420px);
  overflow: auto;
  padding: 4px 2px 8px;
  margin-top: 8px;
}

.asset-pack-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #161f1e;
  padding: 8px;
}

.asset-pack-card.is-selected {
  border-color: rgba(63, 208, 200, 0.85);
  box-shadow: 0 0 0 1px rgba(63, 208, 200, 0.35);
}

.asset-pack-card-main {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.asset-pack-card-main input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.asset-pack-order {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(63, 208, 200, 0.95);
  color: #0b1220;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  z-index: 1;
}

.asset-pack-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: repeating-conic-gradient(#1a2330 0% 25%, #243836 0% 50%) 50% / 12px 12px;
  border-radius: 6px;
}

.asset-pack-name {
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-pack-size {
  font-size: 10px;
  color: var(--muted);
}

.asset-pack-del {
  appearance: none;
  border: 1px solid rgba(255, 77, 79, 0.35);
  background: transparent;
  color: #ffb4b4;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11px;
  cursor: pointer;
}

.asset-pack-del:hover {
  background: rgba(255, 77, 79, 0.12);
}

.asset-pack-empty {
  margin: 12px 0 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.asset-pack-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.asset-pack-tile-footer .auth-modal-msg {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
}

.asset-pack-tile-size {
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.asset-pack-align-field select {
  height: 30px;
  min-width: 96px;
  border-radius: 8px;
  border: 1px solid #2e3a4c;
  background: #0e1520;
  color: #e8eef6;
  font-size: 12px;
  padding: 0 8px;
  outline: none;
  cursor: pointer;
}

.asset-pack-align-field select:focus {
  border-color: #3d6a66;
}

.tool-opt-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
}

.tool-btn {
  appearance: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #ececec;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.tool-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.tool-btn.is-active {
  background: #2a9e96;
  color: #fff;
}

.tool-btn:focus-visible {
  outline: 2px solid #5ed4cc;
  outline-offset: 2px;
}

.erase-size-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.erase-size-panel[hidden] {
  display: none !important;
}

.erase-size-btn {
  appearance: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: #dceae7;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.erase-size-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.erase-size-btn.is-active {
  border-color: #3fd0c8;
  background: rgba(42, 158, 150, 0.28);
}

.erase-size-dot {
  display: block;
  border-radius: 50%;
  background: #e8eef6;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.select-action-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  margin-bottom: 2px;
}

.select-action-panel[hidden] {
  display: none !important;
}

.tool-action-btn {
  appearance: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(63, 208, 200, 0.45);
  border-radius: 10px;
  background: rgba(42, 158, 150, 0.22);
  color: #e8eef6;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.tool-action-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.tool-action-btn:hover {
  background: rgba(42, 158, 150, 0.4);
  border-color: #5ed4cc;
}

.tool-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tool-action-btn.danger {
  border-color: rgba(239, 83, 80, 0.55);
  background: rgba(198, 40, 40, 0.22);
}

.tool-action-btn.danger:hover:not(:disabled) {
  background: rgba(198, 40, 40, 0.45);
  border-color: #ef5350;
}

.selection-export-bar {
  position: absolute;
  z-index: 13;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.selection-export-bar[hidden] {
  display: none !important;
}

.selection-export-btn {
  appearance: none;
  border: 1px solid rgba(63, 208, 200, 0.55);
  border-radius: 8px;
  background: rgba(16, 28, 48, 0.92);
  color: #e8eef6;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.selection-export-btn.accent {
  border-color: rgba(63, 208, 200, 0.75);
  background: rgba(42, 158, 150, 0.45);
}

.selection-export-btn:hover:not(:disabled) {
  background: rgba(42, 158, 150, 0.55);
  border-color: #5ed4cc;
}

.selection-export-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.compose-ctx-menu {
  position: fixed;
  z-index: 12000;
  min-width: 132px;
  padding: 4px 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(28, 32, 40, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

.compose-ctx-menu[hidden] {
  display: none !important;
}

.compose-ctx-menu-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: #e8ecf4;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.compose-ctx-menu-item:hover:not(:disabled) {
  background: rgba(88, 140, 255, 0.18);
  color: #fff;
}

.compose-ctx-menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.compose-ctx-menu-sep {
  height: 1px;
  margin: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
}

.compose-ctx-fill-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 12px;
}

.compose-ctx-fill-row[hidden] {
  display: none !important;
}

.compose-ctx-fill-color {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  overflow: hidden;
}

.compose-ctx-fill-color input[type="color"] {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 36px;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.compose-ctx-fill-btn {
  flex: 1;
  padding: 8px 6px 8px 0 !important;
}

.selection-export-btn.canvas-delete-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-color: rgba(180, 60, 60, 0.65);
  background: #8b2e2e;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.selection-export-btn.canvas-delete-btn:hover:not(:disabled) {
  background: #a43838;
  border-color: #c45a5a;
  color: #fff;
}

.image-dir-group {
  display: inline-flex;
  border-radius: 8px;
  border: 1px solid rgba(63, 208, 200, 0.55);
  overflow: hidden;
  background: rgba(16, 28, 48, 0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.image-dir-group .image-dir-btn {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  min-width: 44px;
  padding: 6px 10px;
}

.image-dir-group .image-dir-btn + .image-dir-btn {
  border-left: 1px solid rgba(63, 208, 200, 0.35);
}

.image-dir-group .image-dir-btn.is-active {
  background: rgba(42, 158, 150, 0.55);
  border-color: transparent;
}

.scene-export-group {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.scene-export-group .selection-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.scene-export-caret {
  font-size: 10px;
  opacity: 0.75;
  line-height: 1;
}

.scene-export-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 132px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #1a2423;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scene-export-menu[hidden] {
  display: none;
}

.scene-export-menu-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.scene-export-menu-item:hover {
  background: rgba(63, 208, 200, 0.16);
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.overlay-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--muted);
  font-size: 16px;
  z-index: 2;
  padding: 24px;
}

.overlay-hint.hidden {
  display: none;
}

.home-open-card {
  position: relative;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: min(86vw, 280px);
  padding: 36px 40px 32px;
  border-radius: 18px;
  border: 1px dashed rgba(63, 208, 200, 0.42);
  background:
    linear-gradient(165deg, rgba(63, 208, 200, 0.14) 0%, rgba(20, 28, 27, 0.92) 48%, rgba(14, 20, 19, 0.96) 100%);
  color: #d4f5f1;
  cursor: pointer;
  user-select: none;
  box-shadow:
    0 0 0 1px rgba(63, 208, 200, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
  overflow: hidden;
}

.home-open-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(ellipse at 50% 30%, rgba(63, 208, 200, 0.28), transparent 68%);
  pointer-events: none;
}

.home-open-card:hover,
.home-open-card.is-dragover {
  transform: translateY(-3px);
  border-color: rgba(125, 224, 214, 0.75);
  border-style: solid;
  box-shadow:
    0 0 0 1px rgba(63, 208, 200, 0.2),
    0 22px 48px rgba(0, 0, 0, 0.4),
    0 0 28px rgba(63, 208, 200, 0.18);
  background:
    linear-gradient(165deg, rgba(63, 208, 200, 0.22) 0%, rgba(24, 36, 34, 0.95) 48%, rgba(14, 20, 19, 0.98) 100%);
}

.home-open-card:focus-visible {
  outline: 2px solid rgba(63, 208, 200, 0.65);
  outline-offset: 3px;
}

.home-open-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 22px;
  color: #7de0d6;
  background: rgba(63, 208, 200, 0.12);
  border: 1px solid rgba(63, 208, 200, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.22s ease, color 0.22s ease, background 0.22s ease;
}

.home-open-card:hover .home-open-icon,
.home-open-card.is-dragover .home-open-icon {
  color: #b7f5ee;
  background: rgba(63, 208, 200, 0.2);
  transform: scale(1.04);
}

.home-open-title {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: #e8f8f6;
}

.home-open-desc {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: #9ee8e2;
  opacity: 0.9;
}

.home-open-hint {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  font-size: 12px;
  color: #8b9e9a;
}

.home-open-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 1px;
  border-radius: 4px;
  border: 1px solid rgba(63, 208, 200, 0.28);
  background: rgba(63, 208, 200, 0.1);
  color: #c8f2ee;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .home-open-card {
    min-width: min(92vw, 260px);
    padding: 28px 24px 26px;
  }

  .home-open-icon {
    width: 76px;
    height: 76px;
    border-radius: 18px;
  }

  .home-open-icon svg {
    width: 48px;
    height: 48px;
  }

  .home-open-title {
    font-size: 18px;
  }
}

/* 生成等待遮罩 */
.gen-wait-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(ellipse at 50% 42%, #0e1a1a 0%, #070b12 62%, #040608 100%);
  pointer-events: auto;
}

.gen-wait-overlay[hidden] {
  display: none !important;
}

.gen-wait-dog {
  width: 72px;
  height: 72px;
  margin-bottom: 4px;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(63, 208, 200, 0.25));
}

.gen-wait-title {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
}

.gen-wait-sub {
  color: #8a8a8a;
  font-size: 14px;
  text-align: center;
  max-width: min(90vw, 420px);
  padding: 0 16px;
  line-height: 1.45;
}

.gen-wait-progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(72vw, 320px);
  margin-top: 2px;
}

.gen-wait-progress-wrap[hidden] {
  display: none !important;
}

.gen-wait-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.gen-wait-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3fd0c8 0%, #6ed8d0 100%);
  transition: width 0.45s ease;
}

.gen-wait-pct {
  color: #b8d0cc;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.statusbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 12px 10px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  font-size: 13px;
  flex-shrink: 0;
}

.statusbar-body {
  min-width: 0;
  flex: 1;
}

.site-copy {
  flex-shrink: 0;
  margin-left: auto;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.site-copy-line {
  white-space: normal;
}

.site-beian {
  color: inherit;
  text-decoration: none;
}

.site-beian:hover {
  color: #c8f2ee;
  text-decoration: none;
}

.site-beian-gongan {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: baseline;
}

.site-beian-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-copy a {
  color: inherit;
  text-decoration: none;
}

.site-copy a:hover {
  color: #c8f2ee;
  text-decoration: none;
}

.toolbar a.btn {
  text-decoration: none;
}

.hint {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

#status.busy {
  color: #69d8d0;
}

/* 场景拆分底部面板 */
.scene-dock {
  position: fixed;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  z-index: 40;
  width: min(820px, calc(100vw - 24px));
  pointer-events: none;
}

.scene-dock[hidden] {
  display: none !important;
}

.scene-dock-inner {
  position: relative;
  pointer-events: auto;
  padding: 1px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(50, 130, 230, 0.55), rgba(30, 90, 180, 0.35), rgba(40, 55, 75, 0.45));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.scene-dock-body {
  border-radius: 21px;
  background: #101822;
  padding: 14px;
}

.scene-dock-collapse {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 18px;
  border: 1px solid #2a3548;
  border-radius: 999px;
  background: #141c28;
  color: #9ab0ac;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  padding: 0;
}

.scene-dock-collapse:hover {
  color: #fff;
  border-color: #5a5f70;
}

.scene-dock-row-top {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.scene-dock-upload {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  border: 1px solid #32353f;
  background: #22242c;
  color: #c5c8d2;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  box-sizing: border-box;
}

.scene-dock-upload:hover {
  border-color: #4d5160;
  background: #2a2d37;
}

.scene-dock-plus {
  font-size: 20px;
  line-height: 1;
  color: #fff;
  font-weight: 500;
}

.scene-dock-thumb-box {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.scene-dock-thumb-box[hidden] {
  display: none !important;
}

.scene-dock-thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #32353f;
  background: #0f1014;
  cursor: zoom-in;
  flex-shrink: 0;
  box-sizing: border-box;
  display: block;
}

.scene-dock-thumb:hover {
  border-color: #3fd0c8;
  box-shadow: 0 0 0 1px rgba(63, 208, 200, 0.35);
}

.scene-dock-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.scene-dock-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(28, 36, 52, 0.95);
  color: #e8eef6;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.scene-dock-thumb-remove:hover {
  background: #c62828;
  border-color: #ef5350;
  color: #fff;
}

.scene-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.scene-lightbox[hidden] {
  display: none !important;
}

.scene-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.scene-lightbox-dialog {
  position: relative;
  z-index: 1;
  max-width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  border-radius: 16px;
  overflow: hidden;
  background: #0e1520;
  border: 1px solid #2a3a50;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.scene-lightbox-dialog img {
  display: block;
  max-width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #070b12;
}

.scene-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  border: 1px solid #4a4e5c;
  border-radius: 999px;
  background: rgba(22, 23, 28, 0.9);
  color: #eceef4;
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
}

.scene-lightbox-close:hover {
  border-color: #7a8885;
  background: #22242c;
}

.seq-region-preview-dialog {
  width: min(520px, 92vw);
  max-height: min(88vh, 720px);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.seq-region-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.seq-region-preview-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: #e8eef6;
}

.seq-region-preview-head .scene-lightbox-close {
  position: static;
}

.seq-region-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  max-height: min(56vh, 480px);
  border-radius: 12px;
  background:
    linear-gradient(45deg, #2a3344 25%, transparent 25%),
    linear-gradient(-45deg, #2a3344 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a3344 75%),
    linear-gradient(-45deg, transparent 75%, #2a3344 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-color: #1a2230;
  overflow: hidden;
}

.seq-region-preview-stage canvas {
  max-width: 100%;
  max-height: min(56vh, 480px);
}

.seq-region-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #a8b8b5;
  font-size: 13px;
}

.seq-region-preview-actions {
  display: flex;
  gap: 8px;
}

.scene-dock-prompt-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  position: relative;
  border-radius: 14px;
  border: 1px solid #2a3a4e;
  background: #121a26;
  padding: 0;
  box-sizing: border-box;
  min-height: 64px;
}

.scene-dock-prompt-wrap:focus-within {
  border-color: #3fd0c8;
  background: #152030;
}

.scene-prompt-ai-btn {
  flex: 0 0 auto;
  align-self: stretch;
  width: 40px;
  margin: 0;
  border: none;
  border-right: 1px solid #2a3a4e;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(180deg, #1c3a42 0%, #152830 100%);
  color: #5eead4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.scene-prompt-ai-btn:hover {
  background: linear-gradient(180deg, #245058 0%, #1a3540 100%);
  color: #99f6e4;
}

.scene-prompt-ai-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.scene-prompt-single,
.scene-prompt-dual {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
}

/* display:flex 会盖掉 UA 的 [hidden]，必须强制隐藏 */
.scene-dock-prompt-wrap[hidden],
.scene-prompt-ai-btn[hidden],
.scene-prompt-single[hidden],
.scene-prompt-dual[hidden] {
  display: none !important;
}

.scene-prompt-single {
  position: relative;
}

.scene-prompt-dual {
  gap: 0;
}

.scene-prompt-dual-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #2a3a4e;
}

.scene-prompt-dual-col:first-child {
  border-left: none;
}

.scene-prompt-dual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px 0;
  font-size: 11px;
  color: #8aa0b0;
}

.scene-prompt-view-btn {
  border: none;
  background: transparent;
  color: #5eead4;
  font-size: 11px;
  padding: 2px 4px;
  cursor: pointer;
  opacity: 0.85;
}

.scene-prompt-view-btn:hover {
  opacity: 1;
  text-decoration: underline;
}

.scene-prompt-single .scene-prompt-view-btn {
  position: absolute;
  right: 6px;
  top: 4px;
  z-index: 1;
}

.scene-prompt-single .scene-dock-prompt {
  padding-right: 40px;
}

.scene-prompt-dual .scene-dock-prompt {
  min-height: 44px;
  max-height: 72px;
  padding-top: 2px;
}

.scene-dock-prompt {
  width: 100%;
  height: 100%;
  min-height: 64px;
  max-height: 88px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: #eceef4;
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 12px;
  font-family: inherit;
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a3f4d transparent;
}

.scene-prompt-modal-dialog {
  width: min(560px, 94vw);
}

.scene-prompt-modal-input {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid #2a3a4e;
  background: #121a26;
  color: #eceef4;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
}

.scene-dock-prompt::-webkit-scrollbar {
  width: 6px;
}

.scene-dock-prompt::-webkit-scrollbar-thumb {
  background: #3a3f4d;
  border-radius: 999px;
}

.scene-dock-prompt::placeholder {
  color: #6f7a78;
}

.scene-dock-run {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 88px;
  height: 64px;
  padding: 8px 10px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(160deg, #4fd9d0 0%, #2a9e96 45%, #1a7a74 100%);
  box-shadow: 0 8px 20px rgba(42, 158, 150, 0.35);
  flex-shrink: 0;
  box-sizing: border-box;
}

.scene-dock-run:hover {
  filter: brightness(1.08);
}

.scene-dock-run:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.scene-dock-run-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.scene-dock-row-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 12px;
}

.scene-tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #2e3a4c;
  background: #162030;
  color: #c5d4d2;
  font-size: 12px;
  cursor: default;
  box-sizing: border-box;
  flex: 0 0 auto;
}

.scene-tool.static {
  color: #9aa0ae;
  cursor: default;
}

.scene-tool.ghost {
  cursor: pointer;
  background: transparent;
  border-color: #3a3e4a;
  color: #a7b5b2;
}

.scene-tool.ghost:hover {
  color: #fff;
  border-color: #5a6070;
}

.scene-tool-engine {
  padding-right: 28px;
  max-width: none;
}

.scene-tool-label {
  color: #8b91a3;
  flex-shrink: 0;
}

.scene-engine-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 5;
}

.scene-engine-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 168px;
  max-width: 280px;
  height: 34px;
  padding: 0 10px 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(90, 140, 200, 0.22);
  background: rgba(20, 28, 40, 0.92);
  color: #e8eef6;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.scene-engine-trigger:hover {
  border-color: rgba(88, 166, 255, 0.45);
  background: rgba(28, 40, 58, 0.95);
}

.scene-engine-trigger.is-open {
  border-color: #3fd0c8;
  box-shadow: 0 0 0 1px rgba(63, 208, 200, 0.35);
}

.scene-engine-trigger-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(42, 158, 150, 0.28);
  color: #9ee8e2;
  flex-shrink: 0;
}

.scene-engine-trigger-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-weight: 600;
}

.scene-engine-trigger-caret {
  color: #8b9e9a;
  font-size: 10px;
  flex-shrink: 0;
}

.scene-engine-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(360px, calc(100vw - 48px));
  padding: 14px;
  border-radius: 16px;
  background: rgba(18, 24, 34, 0.98);
  border: 1px solid rgba(90, 140, 200, 0.22);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 40;
}

.scene-engine-menu[hidden] {
  display: none !important;
}

.scene-engine-menu-head {
  margin-bottom: 12px;
  padding: 0 2px;
}

.scene-engine-menu-title {
  font-size: 16px;
  font-weight: 700;
  color: #f2f6fb;
  letter-spacing: 0.01em;
}

.scene-engine-menu-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #8b9e9a;
  line-height: 1.4;
}

.scene-engine-menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scene-engine-option {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(28, 36, 50, 0.72);
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.scene-engine-option[hidden] {
  display: none;
}

.scene-engine-option:hover {
  background: rgba(36, 48, 68, 0.9);
  border-color: rgba(88, 166, 255, 0.28);
}

.scene-engine-option.is-selected {
  border-color: #3fd0c8;
  background: rgba(42, 158, 150, 0.16);
  box-shadow: inset 0 0 0 1px rgba(63, 208, 200, 0.25);
}

.scene-engine-option-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #e8eef6;
}

.scene-engine-option-icon.tone-a {
  background: linear-gradient(145deg, #2a9e96, #1a5c58);
}
.scene-engine-option-icon.tone-b {
  background: linear-gradient(145deg, #3fd0c8, #1f6e68);
}
.scene-engine-option-icon.tone-c {
  background: linear-gradient(145deg, #2ea043, #1a5c2e);
}
.scene-engine-option-icon.tone-d {
  background: linear-gradient(145deg, #d29922, #8a5b12);
  border-radius: 11px 4px 4px 11px;
}
.scene-engine-option-icon.tone-e {
  background: linear-gradient(145deg, #10b981, #047857);
}
.scene-engine-badge.green {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.14);
}

.scene-engine-option-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.scene-engine-option-name {
  font-size: 13px;
  font-weight: 700;
  color: #f2f6fb;
  line-height: 1.35;
}

.scene-engine-option-desc {
  font-size: 11px;
  color: #8b9e9a;
  line-height: 1.4;
}

.scene-engine-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
  color: #d4f5f1;
  background: rgba(42, 158, 150, 0.45);
  border: 1px solid rgba(88, 166, 255, 0.35);
}

.scene-engine-badge.outline {
  color: #8fd19e;
  background: transparent;
  border-color: rgba(46, 160, 67, 0.55);
}

.scene-engine-badge.purple {
  color: #efe6ff;
  background: rgba(124, 77, 255, 0.42);
  border: 1px solid rgba(167, 139, 250, 0.55);
}

.scene-tool-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  outline: none;
  background: transparent;
  color: #eceef4;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  width: auto;
  max-width: none;
  flex: 0 0 auto;
  field-sizing: content;
}

.scene-tool-select option {
  background: #1f2128;
  color: #eceef4;
}

.scene-tool-caret {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #8b91a3;
  font-size: 10px;
  pointer-events: none;
}

/* 序列帧面板 */
.seq-dock {
  position: fixed;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  z-index: 40;
  width: min(960px, calc(100vw - 24px));
  pointer-events: none;
}

.seq-dock[hidden] {
  display: none !important;
}

.seq-dock-inner {
  position: relative;
  pointer-events: auto;
  padding: 1px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(40, 160, 140, 0.5), rgba(30, 90, 160, 0.35), rgba(40, 55, 75, 0.45));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.seq-dock-body {
  border-radius: 21px;
  background: #101822;
  padding: 14px;
}

.seq-dock-row-top {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.seq-upload-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* 游戏序列帧：图片/视频各占固定格，缩略图叠在上传钮上 */
.seq-dock:not(.char-dock) .seq-source-slot {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.seq-dock:not(.char-dock) .seq-source-slot .scene-dock-upload {
  width: 64px;
  height: 64px;
}

.seq-dock:not(.char-dock) .seq-source-slot .scene-dock-thumb-box {
  position: absolute;
  inset: 0;
  width: 64px;
  height: 64px;
}

/* 角色动作帧：竖排多图，勿用 absolute 叠层 */
.char-dock .seq-source-slot.char-refs-slot {
  position: relative;
  width: 64px;
  height: auto;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
}

.char-dock .seq-dock-row-top {
  align-items: flex-start;
}

.char-thumb-list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: stretch;
  width: 64px;
}

.char-thumb-list:empty {
  display: none;
}

.char-dock .char-thumb-list .scene-dock-thumb-box,
.char-dock .char-refs-slot .scene-dock-thumb-box {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.char-dock .char-refs-slot .scene-dock-upload {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.char-dock .char-refs-slot .scene-dock-upload[hidden] {
  display: none !important;
}

.seq-source-slot[hidden] {
  display: none !important;
}

.seq-video-thumb {
  position: relative;
}

.seq-video-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  background: #0f1014;
}

.seq-video-thumb-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(10, 16, 26, 0.72);
  color: #e8eef8;
  font-size: 9px;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.seq-source-lightbox-dialog {
  max-width: min(920px, 94vw);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.seq-source-lightbox-dialog img,
.seq-source-lightbox-dialog video {
  max-width: min(880px, 90vw);
  max-height: min(78vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #0a0f0e;
}

.seq-dock-controls {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid #2a3a4e;
  background: #121a26;
}

.seq-mode-group {
  display: inline-flex;
  border-radius: 10px;
  border: 1px solid #2e3a4c;
  overflow: hidden;
  background: #0e1520;
}

.seq-mode-btn {
  border: none;
  background: transparent;
  color: #9ab0ac;
  font-size: 12px;
  padding: 7px 12px;
  cursor: pointer;
}

.seq-mode-btn:hover {
  color: #e8eef6;
  background: rgba(255, 255, 255, 0.04);
}

.seq-mode-btn.is-active {
  color: #fff;
  background: #2a9e96;
}

.seq-grid-fields {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.seq-grid-fields[hidden] {
  display: none !important;
}

.seq-video-panel {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(63, 208, 200, 0.22);
  background: linear-gradient(180deg, rgba(28, 40, 58, 0.75), rgba(14, 21, 32, 0.9));
}

.seq-video-panel[hidden] {
  display: none !important;
}

.seq-video-meta {
  display: inline-flex;
  align-items: center;
  align-self: center;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(63, 208, 200, 0.28);
  background: rgba(63, 208, 200, 0.1);
  color: #c8f2ee;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.seq-video-meta[hidden] {
  display: none !important;
}

.seq-video-range,
.seq-video-sample,
.seq-extract-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.seq-video-range {
  padding: 3px 6px;
  border-radius: 10px;
  background: rgba(8, 12, 20, 0.45);
  border: 1px solid rgba(46, 58, 76, 0.9);
}

.seq-chip-dash {
  color: #6f8582;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 0 2px;
  user-select: none;
}

.seq-chip-field {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  margin: 0;
  color: #9ab0ac;
  font-size: 11px;
}

.seq-chip-label {
  line-height: 1;
  padding-left: 2px;
  color: #8b9e9a;
  white-space: nowrap;
}

.seq-chip-field input {
  width: 64px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #2e3a4c;
  background: #0b121c;
  color: #e8eef6;
  font-size: 12px;
  padding: 0 8px;
  outline: none;
  box-sizing: border-box;
}

.seq-chip-field input:focus {
  border-color: #3fd0c8;
  box-shadow: 0 0 0 2px rgba(63, 208, 200, 0.18);
}

.seq-chip-field select {
  width: 88px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #2e3a4c;
  background: #0b121c;
  color: #e8eef6;
  font-size: 12px;
  padding: 0 6px;
  outline: none;
  box-sizing: border-box;
  cursor: pointer;
}

.seq-chip-field select:focus {
  border-color: #3fd0c8;
  box-shadow: 0 0 0 2px rgba(63, 208, 200, 0.18);
}

.char-bg-field select option {
  background: #0b121c;
  color: #e8eef6;
}

.seq-video-range .seq-chip-field input {
  width: 72px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.seq-extract-actions {
  margin-left: 2px;
  gap: 8px;
}

.seq-extract-btn.scene-dock-run {
  flex-direction: row;
  width: auto;
  min-width: 96px;
  height: 46px;
  padding: 0 14px;
  gap: 8px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 6px 16px rgba(42, 158, 150, 0.32);
}

.seq-grid-fields .seq-field input[type="number"] {
  width: 56px;
}

.seq-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9ab0ac;
  font-size: 12px;
}

.seq-field input {
  width: 52px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #2e3a4c;
  background: #0e1520;
  color: #e8eef6;
  font-size: 12px;
  padding: 0 8px;
  outline: none;
}

.seq-field input:focus {
  border-color: #3fd0c8;
}

.seq-preview-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 220px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid #2a3a4e;
  background:
    linear-gradient(45deg, #1a2230 25%, transparent 25%),
    linear-gradient(-45deg, #1a2230 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1a2230 75%),
    linear-gradient(-45deg, transparent 75%, #1a2230 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #0f1520;
}

.seq-preview-box canvas {
  width: 96px;
  height: 96px;
  object-fit: contain;
  image-rendering: auto;
  background: transparent;
  border-radius: 8px;
}

.seq-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 88px;
}

.seq-preview-meta #seqPreviewLabel {
  color: #c5d4d2;
  font-size: 12px;
}

.seq-preview-actions {
  display: inline-flex;
  gap: 6px;
}

.seq-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #2e3a4c;
  background: #162030;
  color: #e8eef6;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.seq-icon-btn:hover {
  border-color: #4a5a70;
  background: #1c2a3c;
}

.seq-icon-btn.accent {
  background: linear-gradient(160deg, #4fd9d0 0%, #2a9e96 100%);
  border-color: transparent;
}

.seq-frame-bar {
  display: flex;
  align-items: center;
  margin-top: 12px;
}

.seq-frame-bar[hidden] {
  display: none;
}

.seq-dir-group {
  display: inline-flex;
  border-radius: 10px;
  border: 1px solid #2e3a4c;
  overflow: hidden;
  background: #0e1520;
}

.seq-dir-group .seq-mode-btn {
  min-width: 56px;
  padding: 6px 12px;
}

.seq-dir-group .seq-mode-btn + .seq-mode-btn {
  border-left: 1px solid #2e3a4c;
}

.seq-frame-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 8px;
  padding: 4px 2px 8px;
  min-height: 78px;
  scrollbar-width: thin;
  scrollbar-color: #3a3f4d transparent;
}

.seq-frame-strip:empty::before {
  content: attr(data-empty-hint);
  color: #6f7a78;
  font-size: 12px;
  padding: 22px 8px;
}

.seq-frame-item {
  position: relative;
  flex: 0 0 auto;
  width: 68px;
  color: #9ab0ac;
  text-align: center;
  content-visibility: auto;
  contain-intrinsic-size: 68px 90px;
}

.seq-frame-item.char-strip-item {
  width: min(100%, 480px);
}

.seq-frame-item.char-strip-item .seq-frame-thumb {
  width: 100%;
  height: 72px;
}

.seq-frame-select {
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.seq-frame-item .seq-frame-thumb {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  border: 1px solid #2e3a4c;
  background:
    linear-gradient(45deg, #1a2230 25%, transparent 25%),
    linear-gradient(-45deg, #1a2230 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1a2230 75%),
    linear-gradient(-45deg, transparent 75%, #1a2230 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-color: #0f1520;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
  padding: 4px;
}

.seq-frame-item .seq-frame-thumb img,
.seq-frame-item .seq-frame-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  image-rendering: auto;
}

.seq-frame-item.is-active .seq-frame-thumb {
  border-color: #3fd0c8;
  box-shadow: 0 0 0 1px rgba(63, 208, 200, 0.45);
}

.seq-frame-item .seq-frame-idx {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}

.seq-frame-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(28, 36, 52, 0.95);
  color: #e8eef6;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.seq-frame-remove:hover {
  background: #c62828;
  border-color: #ef5350;
  color: #fff;
}

.seq-dock-row-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.seq-key-color-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.seq-nobg-combo {
  gap: 6px !important;
  padding: 0 10px 0 6px !important;
  cursor: default !important;
}

.seq-nobg-combo .seq-nobg-main {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 1;
}

.seq-nobg-combo .seq-nobg-main:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.seq-key-eyedrop {
  --key-swatch: #00ff00;
  appearance: none;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  margin: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: var(--key-swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  color: #fff;
  line-height: 1;
  cursor: pointer;
}

.seq-key-eyedrop:hover {
  border-color: rgba(255, 255, 255, 0.55);
  filter: brightness(1.06);
}

.seq-key-eyedrop-icon {
  display: block;
  filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, 0.85));
  pointer-events: none;
}

/* 角色动作帧面板 */
.char-dock-controls {
  align-items: stretch;
  gap: 8px;
}

.char-dock .seq-dock-body {
  padding: 10px;
}

.char-dock .char-action-chip {
  padding: 4px 8px;
  gap: 3px;
}

.char-dock .char-facing-pad {
  grid-template-columns: repeat(3, 24px);
  grid-template-rows: repeat(3, 24px);
  gap: 2px;
}

.char-dock .char-facing-cell {
  font-size: 12px;
  border-radius: 5px;
}

.char-dock .seq-preview-box {
  min-width: 180px;
  padding: 6px 8px;
  gap: 8px;
}

.char-dock .seq-preview-box canvas {
  width: 72px;
  height: 72px;
}

.char-dock .char-prompt-wrap .scene-dock-prompt {
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
  min-height: 52px;
}

.char-dock .seq-frame-strip {
  margin-top: 6px;
  padding: 2px 2px 4px;
  min-height: 60px;
  gap: 6px;
}

.char-dock .seq-frame-item {
  width: 52px;
  contain-intrinsic-size: 52px 70px;
}

.char-dock .seq-frame-item .seq-frame-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  padding: 3px;
}

.char-dock .seq-frame-item .seq-frame-idx {
  margin-top: 2px;
  font-size: 10px;
}

.char-dock .seq-frame-strip:empty::before {
  padding: 14px 8px;
}

.char-dock .seq-dock-row-tools {
  gap: 6px;
  margin-top: 2px;
}

.char-dock .seq-icon-btn {
  width: 28px;
  height: 28px;
}

/* 骨骼动画面板：矮横条，编辑在主画布 */
.skel-dock.seq-dock {
  width: min(1080px, calc(100vw - 24px));
}

.skel-dock .skel-hint,
.skel-dock .skel-status-line {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted, #9aa3b2);
  max-width: 36em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skel-dock .skel-options-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.skel-dock .skel-dock-controls {
  gap: 6px;
  min-width: 0;
  flex: 1 1 220px;
}

.skel-dock .skel-preview-box {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  flex: 1 1 420px;
  padding: 6px 8px;
}

.skel-dock .skel-preview-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.skel-dock.char-dock .skel-preview-box canvas.skel-preview-canvas,
.skel-dock .skel-preview-canvas {
  display: block;
  width: 112px;
  height: 112px;
  border-radius: 8px;
  touch-action: none;
  cursor: default;
  background:
    linear-gradient(45deg, #2a2e38 25%, transparent 25%),
    linear-gradient(-45deg, #2a2e38 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2e38 75%),
    linear-gradient(-45deg, transparent 75%, #2a2e38 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-color: #1a1d24;
}

.skel-dock .skel-edit-side {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 10px;
  min-width: 0;
  flex: 1;
}

.skel-dock .skel-pose-panel {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 168px;
  flex: 1 1 168px;
}

.skel-dock .skel-pose-title {
  display: none;
}

.skel-dock .skel-pose-keys {
  display: flex;
  gap: 4px;
}

.skel-dock .skel-pose-key {
  flex: 1;
  font-size: 11px;
  padding: 3px 2px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #e8eaef);
  cursor: pointer;
}

.skel-dock .skel-pose-key.is-active {
  border-color: #5ec8ff;
  background: rgba(94, 200, 255, 0.18);
}

.skel-dock .skel-mode-row .scene-tool.is-active {
  border-color: rgba(94, 200, 255, 0.55);
  background: rgba(94, 200, 255, 0.16);
  color: #dff4ff;
}

.skel-dock .skel-mode-row .scene-tool.is-dirty {
  box-shadow: inset 0 0 0 1px rgba(255, 180, 80, 0.65);
  color: #ffe6c2;
}

.skel-dock .skel-part-badge {
  display: inline-flex;
  align-items: center;
  max-width: 140px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(94, 200, 255, 0.45);
  background: rgba(20, 40, 64, 0.85);
  color: #dff4ff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skel-dock .skel-part-badge.is-locked {
  border-color: rgba(255, 180, 80, 0.7);
  color: #ffe6c2;
  background: rgba(64, 40, 12, 0.85);
}

.skel-dock .skel-mode-row .scene-tool.is-lock-on {
  border-color: rgba(255, 180, 80, 0.7);
  background: rgba(255, 180, 80, 0.16);
  color: #ffe6c2;
}

.skel-dock .skel-pose-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.skel-dock .skel-pose-info {
  flex: 1;
  font-size: 10px;
  color: var(--muted, #9aa3b2);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skel-dock .skel-pose-actions {
  display: flex;
  gap: 4px;
}

.skel-dock .skel-pose-actions .scene-tool {
  flex: 1;
  font-size: 11px;
  padding: 3px 6px;
}

.skel-dock #skelAnimSelect {
  max-width: 72px;
  font-size: 11px;
}

.skel-dock .skel-tune-panel {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 168px;
  flex: 1 1 180px;
}

.skel-dock .skel-tune-row {
  display: grid;
  grid-template-columns: 28px 1fr 32px;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted, #9aa3b2);
}

.skel-dock .skel-weapon-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  min-width: 0;
}

.skel-dock .skel-weapon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 0;
}

.skel-dock .skel-weapon-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.skel-dock .skel-weapon-row .scene-tool {
  padding: 2px 8px;
  font-size: 10px;
}

.skel-dock .skel-weapon-grip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 10px;
  color: var(--muted, #9aa3b2);
}

.skel-dock .skel-grip-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.skel-dock .skel-grip-item select,
.skel-dock .skel-grip-item input[type="number"] {
  width: 52px;
  min-width: 0;
  height: 22px;
  padding: 0 4px;
  font-size: 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text, #e8eaef);
}

.skel-dock .skel-grip-item input[type="number"] {
  width: 40px;
}

.skel-dock .skel-weapon-grip .scene-tool {
  padding: 2px 8px;
  font-size: 10px;
}

.skel-dock .skel-tune-row input[type="range"] {
  width: 100%;
  min-width: 0;
  height: 16px;
}

.skel-dock .skel-tune-val {
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text, #e8eaef);
  font-size: 10px;
}

.skel-dock .skel-tune-apply {
  margin-top: 2px;
  align-self: stretch;
  font-size: 11px;
  padding: 3px 6px;
}

.skel-dock .seq-preview-meta {
  gap: 4px;
  font-size: 11px;
}

.skel-dock .seq-dock-row-tools {
  margin-top: 6px;
}

/* 游戏特效处理面板 */
.fx-dock-controls {
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.fx-dock-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, #667);
  max-width: 42em;
}

.fx-opt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.fx-soft-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 160px;
}

.fx-soft-field input[type="range"] {
  width: 100px;
}

.fx-preview-checker {
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(45deg, #d0d0d0 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(-45deg, #d0d0d0 25%, transparent 25%) 0 6px / 12px 12px,
    linear-gradient(45deg, transparent 75%, #d0d0d0 75%) 6px -6px / 12px 12px,
    linear-gradient(-45deg, transparent 75%, #d0d0d0 75%) -6px 0 / 12px 12px,
    #fff;
}

.fx-preview-box canvas {
  display: block;
  vertical-align: top;
}

.char-compose-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.char-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.char-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #2e3a4c;
  background: #0e1520;
  color: #c5d4d2;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.char-action-chip:hover {
  border-color: #4a5a70;
  color: #e8eef6;
}

.char-action-chip:has(input:checked) {
  border-color: #2d6a66;
  background: #122033;
  color: #fff;
}

.char-action-chip input {
  margin: 0;
  accent-color: #3fd0c8;
}

.skel-anim-chip {
  padding-right: 6px;
  gap: 6px;
}

.skel-anim-chip-main {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  min-width: 0;
}

.skel-anim-chip-text {
  white-space: nowrap;
}

.skel-anim-chip-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
}

.skel-anim-chip-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #7a8fa3;
  font-size: 11px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
}

.skel-anim-chip-btn:hover {
  color: #e8eef6;
  background: rgba(63, 208, 200, 0.12);
}

.skel-anim-chip-btn-danger {
  color: #b07a7a;
}

.skel-anim-chip-btn-danger:hover {
  color: #ffc9c9;
  background: rgba(220, 80, 80, 0.14);
}

.char-facing-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  width: 100%;
  margin-top: 2px;
}

/* 人物朝向 | 朝向图+补充/生成 左右并排 */
.char-facing-compose {
  display: flex;
  align-items: stretch;
  gap: 10px 14px;
  width: 100%;
  min-width: 0;
  margin-top: 2px;
}

.char-facing-compose .char-facing-row {
  flex: 0 0 auto;
  width: auto;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 6px;
  margin-top: 0;
}

.char-facing-compose-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.char-facing-compose .char-facing-still-row {
  margin: 0;
  align-items: center;
  gap: 8px;
}

.char-facing-compose .char-compose-row {
  flex: 1 1 auto;
  min-height: 0;
}

.char-facing-row[hidden],
.char-bg-field[hidden] {
  display: none !important;
}

.char-facing-label {
  font-size: 12px;
  color: #9aaeaa;
  flex: 0 0 auto;
}

.char-facing-pad {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  grid-template-rows: repeat(3, 28px);
  gap: 3px;
  flex: 0 0 auto;
}

.char-facing-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 6px;
  border: 1px solid #2e3a4c;
  background: #0e1520;
  color: #c5d4d2;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  line-height: 1;
}
.char-facing-cell[hidden] {
  display: none !important;
}
.char-facing-cell.is-disabled,
.char-facing-cell:has(input:disabled) {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
  border-color: #243042;
  color: #6a7788;
}
.char-facing-cell.is-disabled:hover,
.char-facing-cell:has(input:disabled):hover {
  border-color: #243042;
  color: #6a7788;
}

.char-facing-cell:hover {
  border-color: #4a5a70;
  color: #e8eef6;
}

.char-facing-cell:has(input:checked) {
  border-color: #2d6a66;
  background: #122033;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(63, 208, 200, 0.35);
}

.char-facing-cell.is-none {
  font-size: 11px;
  color: #8a97a8;
}

.char-facing-cell.is-none:has(input:checked) {
  color: #9ef0e0;
}

.char-facing-cell input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.char-facing-hint {
  font-size: 12px;
  color: #8fa8a4;
  min-width: 4.5em;
}

.char-facing-still-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 8px;
  min-width: 0;
}

.char-facing-still {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  margin: 0;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid #2e3a4c;
  background: #0e1520;
  color: #c5d4d2;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.char-facing-still[hidden] {
  display: none !important;
}

.char-facing-still:hover {
  border-color: #3a4a5e;
}

.char-facing-still input {
  margin: 0;
  flex: 0 0 auto;
}

.char-facing-still:has(input:checked) {
  border-color: rgba(63, 208, 200, 0.45);
  background: rgba(63, 208, 200, 0.08);
}

.char-style-hint {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 3px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: #8fa8a4;
}

.char-facing-compose .char-style-hint {
  padding: 0;
  font-size: 10.5px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.char-facing-review-dialog {
  width: min(720px, 94vw);
  max-height: min(92vh, 820px);
  overflow-y: auto;
}

.char-facing-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}

.char-facing-review-grid--preview-only {
  grid-template-columns: 1fr;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.char-facing-review-ref[hidden] {
  display: none !important;
}

.char-facing-review-cell {
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f1520;
  text-align: center;
}

.char-facing-review-cell figcaption {
  margin: 0 0 8px;
  font-size: 12px;
  color: #9eb8b4;
}

.char-facing-review-cell img {
  display: block;
  width: 100%;
  max-height: min(42vh, 360px);
  object-fit: contain;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
}

.char-facing-review-error {
  margin: 0 0 10px;
  font-size: 12px;
  color: #ff9a9a;
}

.char-facing-extra-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.char-facing-extra-label {
  font-size: 12px;
  color: #9eb8b4;
}

.char-facing-extra-wrap .scene-dock-prompt {
  min-height: 56px;
  resize: vertical;
}

.char-facing-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .char-facing-review-grid {
    grid-template-columns: 1fr;
  }

  .char-facing-review-actions {
    flex-direction: column;
  }

  .char-facing-review-actions .btn {
    width: 100%;
  }
}

.char-prompt-wrap {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  min-height: 0;
  display: flex;
}

.char-prompt-wrap .scene-dock-prompt {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
  resize: none;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}

.char-action-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.char-action-tabs[hidden] {
  display: none !important;
}

.char-action-tab {
  border: 1px solid #2e3a4c;
  background: #0e1520;
  color: #9ab0ac;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.char-action-tab:hover {
  color: #e8eef6;
  background: rgba(255, 255, 255, 0.04);
}

.char-action-tab.is-active {
  color: #fff;
  background: #2a9e96;
  border-color: transparent;
}

.char-dock .seq-extract-btn.scene-dock-run {
  min-width: 0;
  width: 100%;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  height: auto;
  min-height: 36px;
  padding: 6px 10px;
  gap: 4px 6px;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(42, 158, 150, 0.28);
}

.char-dock .seq-extract-btn .scene-dock-run-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.char-dock .seq-extract-btn .scene-dock-run-icon svg {
  width: 12px;
  height: 12px;
}

.char-dock .seq-extract-btn .scene-engine-price {
  font-size: 11px;
  opacity: 0.92;
  margin-left: 2px;
  white-space: nowrap;
}

.char-run-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px;
  flex: 0 0 auto;
  width: 196px;
  min-width: 168px;
  max-width: 210px;
}

.char-run-stack .char-bg-field {
  width: 100%;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.char-run-stack .char-bg-field .seq-chip-label {
  font-size: 11px;
  line-height: 1;
  padding-left: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

.char-run-stack .char-bg-field select {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 28px;
  font-size: 12px;
  border-radius: 8px;
  padding: 0 4px;
}

.char-prompt-wrap .scene-dock-prompt {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
  resize: none;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}

.seq-export-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
}

.seq-export-size .seq-field input {
  width: 56px;
}

.seq-export-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #2e3a4c;
  background: #0e1520;
  color: #7d9894;
  cursor: pointer;
  flex-shrink: 0;
}

.seq-export-lock:hover {
  border-color: #4a5a70;
  color: #c5d4d2;
}

.seq-export-lock.is-locked {
  color: #4fd9d0;
  border-color: #2d6a66;
  background: #122033;
}

.seq-export-lock .seq-lock-icon[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .scene-dock,
  .seq-dock,
  .char-dock {
    bottom: 68px;
    width: calc(100vw - 16px);
  }

  .seq-dock-row-top {
    flex-wrap: wrap;
  }

  .seq-preview-box {
    width: 100%;
    min-width: 0;
  }

  .char-compose-row {
    flex-direction: column;
  }

  .char-facing-compose {
    flex-direction: column;
    gap: 8px;
  }

  .char-facing-compose .char-facing-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .char-run-stack {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }

  .scene-dock-row-top {
    flex-wrap: wrap;
  }

  .scene-dock-upload,
  .scene-dock-thumb-box,
  .scene-dock-thumb {
    width: 56px;
    height: 56px;
  }

  .scene-dock-prompt-wrap {
    flex: 1 1 calc(100% - 140px);
    min-height: 56px;
  }

  .scene-dock-prompt {
    min-height: 56px;
  }

  .scene-dock-run {
    flex-direction: row;
    width: 100%;
    height: 44px;
    gap: 8px;
  }

  .seq-extract-btn.scene-dock-run {
    width: auto;
    min-width: 96px;
    height: 46px;
  }
}

.auth-balance {
  font-size: 13px;
  color: #9ee8e2;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(63, 208, 200, 0.12);
  border: 1px solid rgba(63, 208, 200, 0.28);
}

.auth-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(63, 208, 200, 0.35);
  background: linear-gradient(180deg, #1e2a3a 0%, #172030 100%);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  max-width: min(280px, 42vw);
}

.auth-profile-btn[hidden] {
  display: none !important;
}

.auth-profile-btn:hover {
  border-color: #3fd0c8;
  box-shadow: 0 0 0 1px rgba(63, 208, 200, 0.25);
}

.auth-profile-btn-static {
  cursor: default;
  pointer-events: none;
}

.auth-profile-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.auth-profile-balance {
  font-size: 13px;
  font-weight: 700;
  color: #9ee8e2;
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 120px;
}

.scene-engine-price {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #f0c674;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
}

.auth-modal[hidden] {
  display: none !important;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(4, 8, 14, 0.72);
  cursor: pointer;
}

.seq-crop-export-size {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 4px 0 8px;
}

.seq-crop-export-size .seq-field {
  flex: 1;
  min-width: 0;
}

.seq-crop-export-size .seq-field input {
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
}

.seq-crop-export-name {
  display: block;
  margin: 0 0 4px;
}

.seq-crop-export-name input {
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
}

.seq-crop-export-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted, #8ba3a0);
  line-height: 1.4;
}

.seq-crop-export-hint:last-of-type {
  margin-bottom: 14px;
}

.auth-modal-dialog {
  position: relative;
  width: min(380px, 92vw);
  padding: 22px 22px 18px;
  border-radius: 14px;
  background: #141c1b;
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.app-alert-dialog {
  width: min(340px, 92vw);
  padding: 18px 18px 16px;
  background:
    linear-gradient(180deg, rgba(63, 208, 200, 0.08) 0%, transparent 42%),
    #141c1b;
  animation: app-alert-in 0.18s ease-out;
}

.app-alert-modal {
  z-index: 120;
}

.app-upload-loader {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  background: rgba(4, 8, 14, 0.62);
  backdrop-filter: blur(2px);
}

.app-upload-loader[hidden] {
  display: none !important;
}

.app-upload-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 160px;
  padding: 22px 28px 18px;
  border-radius: 16px;
  background: #141c1b;
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}

.app-upload-loader-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: auto;
  user-select: none;
  pointer-events: none;
}

.app-upload-loader-text {
  font-size: 13px;
  font-weight: 600;
  color: #d7e8e5;
  letter-spacing: 0.02em;
}

.app-alert-dialog[data-tone="warn"] {
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.1) 0%, transparent 42%),
    #141c1b;
}

.app-alert-dialog[data-tone="ok"] {
  background:
    linear-gradient(180deg, rgba(52, 211, 153, 0.1) 0%, transparent 42%),
    #141c1b;
}

.app-alert-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.app-alert-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(63, 208, 200, 0.14);
  color: #7de0d6;
  border: 1px solid rgba(63, 208, 200, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.app-alert-dialog[data-tone="warn"] .app-alert-icon {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.app-alert-dialog[data-tone="ok"] .app-alert-icon {
  background: rgba(52, 211, 153, 0.14);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

.app-alert-icon-svg {
  display: none;
}

.app-alert-dialog[data-tone="info"] .app-alert-icon-info,
.app-alert-dialog[data-tone="warn"] .app-alert-icon-warn,
.app-alert-dialog[data-tone="ok"] .app-alert-icon-ok {
  display: block;
}

.app-alert-copy {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.app-alert-dialog h2 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.app-alert-msg {
  margin: 0;
  color: #b8d0cd;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.app-alert-actions {
  justify-content: stretch;
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(36, 48, 65, 0.95);
}

.app-alert-actions .btn {
  flex: 1 1 auto;
  min-height: 36px;
  font-weight: 600;
}

@keyframes app-alert-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-modal-dialog.auth-modal-wide {
  width: min(420px, 94vw);
}

.nobg-engine-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.nobg-engine-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.nobg-engine-opt:hover {
  border-color: rgba(63, 208, 200, 0.55);
  background: rgba(63, 208, 200, 0.1);
}

.nobg-engine-opt[hidden] {
  display: none !important;
}

.nobg-engine-name {
  font-size: 15px;
  font-weight: 600;
}

.nobg-engine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

.nobg-local-kind {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.nobg-local-kind-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: #d7e8e5;
  user-select: none;
}

.nobg-local-kind-opt input {
  margin: 0;
  accent-color: #3fd0c8;
}

.nobg-engine-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.auth-modal-dialog h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.auth-modal-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 3px;
  border-radius: 10px;
  background: #0f141c;
  border: 1px solid var(--border);
}

.auth-tabs[hidden],
.auth-panel[hidden],
.auth-reg-step[hidden],
#authRegWxQrBlock[hidden],
#authRegWxPhoneBlock[hidden],
#authRegPwdStep2Block[hidden] {
  display: none !important;
}

.auth-step-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.auth-step-actions .btn {
  flex: 1;
  margin-top: 0;
}

.auth-tab {
  flex: 1;
  border: 0;
  border-radius: 8px;
  padding: 8px 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.auth-tab.is-active {
  background: #2a9e96;
  color: #fff;
  font-weight: 600;
}

.auth-panel .btn.accent,
.auth-panel > .btn {
  width: 100%;
  margin-top: 4px;
}

.auth-qr-box {
  display: grid;
  place-items: center;
  min-height: 200px;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #0f141c;
  border: 1px dashed var(--border);
}

.auth-qr-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}

.auth-qr-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.auth-code-row {
  display: flex;
  gap: 8px;
}

.auth-code-row input {
  flex: 1;
}

.auth-code-row .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-step {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 4px;
  border-radius: 8px;
  background: #0f141c;
  border: 1px solid transparent;
}

.auth-step.is-active {
  color: #9ee8e2;
  border-color: rgba(63, 208, 200, 0.45);
  background: rgba(63, 208, 200, 0.12);
}

.auth-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}

.auth-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #1c2827;
  color: var(--text);
}

.auth-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.auth-modal-actions .btn {
  flex: 1;
}

.auth-modal-msg {
  min-height: 1.2em;
  margin-top: 10px;
  font-size: 13px;
  color: #8fd19e;
}

.auth-modal-msg.is-error {
  color: #ff8b8b;
}

.auth-field textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f141c;
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  min-height: 110px;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.auth-avatar,
.auth-avatar-fallback,
.profile-avatar,
.profile-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.auth-avatar-fallback,
.profile-avatar-fallback {
  display: grid;
  place-items: center;
  background: #243836;
  color: #9ee8e2;
  font-size: 12px;
  font-weight: 700;
}

/* display:grid 会盖掉 UA 的 [hidden]，上传头像后仍露出「？」 */
.auth-avatar[hidden],
.auth-avatar-fallback[hidden],
.profile-avatar[hidden],
.profile-avatar-fallback[hidden],
.profile-wx-avatar[hidden],
.profile-wx-avatar-fallback[hidden],
.toolbar .auth-avatar[hidden],
.toolbar .auth-avatar-fallback[hidden] {
  display: none !important;
}

.profile-avatar,
.profile-avatar-fallback {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

.profile-avatar-wrap {
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
}

.profile-avatar-wrap > .profile-avatar,
.profile-avatar-wrap > .profile-avatar-fallback {
  grid-area: 1 / 1;
}

.profile-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.profile-page > .toolbar,
.profile-page > .profile-toolbar {
  flex-shrink: 0;
}

.profile-page[hidden] {
  display: none !important;
}

.profile-back {
  display: inline-flex;
  text-decoration: none;
}

.profile-back .toolbar-logo {
  pointer-events: auto;
}

.profile-page-title {
  font-size: 16px;
  font-weight: 700;
}

.profile-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 16px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(63, 208, 200, 0.18), transparent 55%),
    var(--bg);
}

.profile-card {
  width: min(920px, 100%);
  padding: 24px 22px 28px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.profile-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 28px;
  align-items: start;
}

.profile-col-right {
  border-left: 1px solid var(--border);
  padding-left: 28px;
}

.profile-col-left .profile-head {
  margin-bottom: 0;
}

.profile-col-right .profile-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.profile-lead-tight {
  margin-bottom: 10px;
}

.recharge-lead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.recharge-lead-row .profile-lead-tight {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.btn-recharge-history {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 13px;
}

.recharge-hist-dialog {
  width: min(860px, 96vw);
  max-height: min(92vh, 820px);
  overflow: auto;
  padding: 24px 28px;
}

.recharge-hist-dialog h2 {
  font-size: 20px;
}

.recharge-hist-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.recharge-hist-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}

.recharge-hist-field input,
.recharge-hist-field select {
  min-width: 160px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121820;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.recharge-hist-toolbar .btn {
  padding: 10px 18px;
  font-size: 14px;
  margin-top: 0;
}

.recharge-hist-list {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 16px;
  background: rgba(0, 0, 0, 0.2);
  min-height: 120px;
}

.recharge-hist-list .profile-recharge-item {
  padding: 12px 0;
}

.recharge-hist-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.recharge-pager-total {
  font-size: 14px;
  color: var(--muted);
  margin-right: auto;
}

.recharge-pager-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.recharge-pager-pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.recharge-pager-btn,
.recharge-pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #1a2230;
  color: #d7e8e5;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.recharge-pager-btn:hover:not(:disabled),
.recharge-pager-num:hover:not(.is-active) {
  border-color: #3fd0c8;
  color: #3fd0c8;
}

.recharge-pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.recharge-pager-num.is-active {
  border-color: #3fd0c8;
  background: rgba(63, 208, 200, 0.18);
  color: #7de0d6;
  font-weight: 700;
}

.recharge-pager-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 36px;
  color: var(--muted);
  font-size: 14px;
  user-select: none;
}

.recharge-pager-size select {
  min-width: 108px;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #1a2230;
  color: #d7e8e5;
  font-size: 14px;
  cursor: pointer;
}

.recharge-hist-dialog .auth-modal-actions {
  margin-top: 16px;
}

.recharge-hist-dialog .auth-modal-actions .btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

@media (max-width: 720px) {
  .profile-card {
    width: min(560px, 100%);
  }

  .profile-split {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .profile-col-right {
    border-left: 0;
    padding-left: 0;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .profile-col-right .profile-section:first-child {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }
}

.profile-lead {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.profile-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.profile-head-meta {
  flex: 1;
  min-width: 0;
}

.profile-balance {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #9ee8e2;
}

.profile-balance-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.profile-balance-row .profile-balance {
  margin-top: 0;
}

.recharge-packages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recharge-tip {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(143, 209, 158, 0.28);
  background:
    linear-gradient(135deg, rgba(143, 209, 158, 0.1), rgba(63, 208, 200, 0.06));
}

.recharge-tip-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #b8e6c2;
}

.recharge-tip-list {
  margin: 0;
  padding: 0 0 0 1.1em;
  font-size: 12px;
  line-height: 1.65;
  color: #a8bcb8;
}

.recharge-tip-list li + li {
  margin-top: 4px;
}

.recharge-tip-list strong {
  color: #d4f5f1;
  font-weight: 650;
}

.recharge-pkg {
  appearance: none;
  border: 1px solid var(--border);
  background: #1c2827;
  color: var(--text);
  border-radius: 10px;
  padding: 12px 10px;
  cursor: pointer;
  text-align: left;
}

.recharge-pkg:hover {
  border-color: #3fd0c8;
}

.recharge-pkg strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.recharge-pkg span {
  font-size: 12px;
  color: var(--muted);
}

.recharge-pay {
  margin-top: 14px;
  text-align: center;
}

.recharge-qr {
  width: 200px;
  height: 200px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  margin: 0 auto 10px;
  display: block;
}

.profile-username {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.profile-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.profile-section-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.profile-bound {
  font-size: 13px;
  color: #8fd19e;
  margin-bottom: 8px;
}

.profile-wx-bound {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-wx-avatar,
.profile-wx-avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-wx-avatar-fallback {
  display: grid;
  place-items: center;
  background: #243836;
  color: #9ee8e2;
  font-size: 16px;
  font-weight: 700;
}

.profile-wx-meta {
  min-width: 0;
}

.profile-wx-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.profile-wx-meta .profile-bound {
  margin-top: 2px;
  margin-bottom: 0;
}

.btn-wx-sync {
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 12px;
}

.profile-wx-qr-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.auth-tabs[hidden],
.auth-panel[hidden],
.auth-reg-step[hidden],
#authRegWxQrBlock[hidden],
#authRegWxPhoneBlock[hidden],
#authRegPwdStep2Block[hidden],
.profile-section [hidden],
.auth-field[hidden] {
  display: none !important;
}


/* —— 图片压缩 —— */
.compress-modal-dialog {
  max-width: 520px;
}

.compress-tabs {
  display: flex;
  gap: 6px;
  margin: 4px 0 12px;
}

.compress-pane {
  margin-bottom: 10px;
}

.compress-pane[hidden] {
  display: none !important;
}

.compress-pick {
  display: inline-flex;
  cursor: pointer;
}

.compress-file-list {
  max-height: 140px;
  overflow: auto;
  border: 1px solid #2e3a4c;
  border-radius: 10px;
  background: #0e1520;
  padding: 4px 0;
  margin-bottom: 6px;
}

.compress-file-list:empty {
  display: none;
}

.compress-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  font-size: 12px;
  color: #c8d8d5;
  border-bottom: 1px solid rgba(46, 58, 76, 0.55);
}

.compress-file-row:last-child {
  border-bottom: none;
}

.compress-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.compress-file-size {
  flex: 0 0 auto;
  color: #8b9e9a;
  font-variant-numeric: tabular-nums;
}

.compress-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: #8b9e9a;
}

.compress-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.compress-mode-btn {
  border: 1px solid #2e3a4c;
  background: #121a26;
  color: #c8d8d5;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.compress-mode-btn[hidden] {
  display: none !important;
}

.compress-mode-btn:hover {
  border-color: #3fd0c8;
}

.compress-mode-btn.is-active {
  border-color: #3fd0c8;
  background: rgba(63, 208, 200, 0.16);
  color: #e8f8f6;
}

.compress-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

.compress-fields[hidden] {
  display: none !important;
}

#compressCustomFields .seq-field input {
  width: 68px;
  min-width: 68px;
}

.compress-fields select {
  min-width: 96px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #2e3a4c;
  background: #0e1520;
  color: #d7e8e5;
  padding: 0 8px;
}

.compress-quality-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.compress-quality-field input[type="range"] {
  width: 120px;
}

.compress-quality-field #compressQualityVal {
  min-width: 24px;
  font-variant-numeric: tabular-nums;
  color: #c8d8d5;
}


/* —— 智能修图 —— */
.retouch-modal-dialog {
  max-width: 480px;
}

.retouch-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #2e3a4c;
  background: #0e1520;
}

.retouch-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d7e8e5;
  font-size: 13px;
  user-select: none;
}

.retouch-opt input {
  accent-color: var(--accent);
}

.retouch-opt input:disabled {
  opacity: 0.45;
}

.retouch-hint {
  margin: -4px 0 2px 24px;
  color: #8b9e9a;
  font-size: 12px;
  line-height: 1.45;
}

.retouch-opt-label {
  color: #8b9e9a;
  font-size: 12px;
  margin-right: 4px;
}

.retouch-intensity-row,
.retouch-nobg-engines,
.retouch-digitize-modes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-left: 22px;
}

.retouch-intensity-row[hidden],
.retouch-nobg-engines[hidden],
.retouch-digitize-modes[hidden] {
  display: none !important;
}

.gen-hist-dialog {
  width: min(920px, 96vw) !important;
  max-width: 960px;
}

.gen-hist-body {
  display: flex;
  gap: 14px;
  align-items: stretch;
  margin: 8px 0 12px;
  min-height: min(52vh, 420px);
}

.gen-hist-side {
  flex: 0 0 min(42%, 320px);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gen-hist-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 18px 4px;
}

.gen-hist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  max-height: min(56vh, 460px);
  overflow: auto;
  margin: 0;
  min-height: 0;
}

.gen-hist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  color: inherit;
}

.gen-hist-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.gen-hist-item:hover {
  border-color: rgba(63, 208, 200, 0.55);
  background: rgba(63, 208, 200, 0.08);
}

.gen-hist-item.is-selected {
  border-color: rgba(63, 208, 200, 0.9);
  background: rgba(63, 208, 200, 0.14);
  box-shadow: 0 0 0 1px rgba(63, 208, 200, 0.35);
}

.gen-hist-item.is-locked {
  border-color: rgba(232, 184, 74, 0.55);
}

.gen-hist-lock-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.gen-hist-lock-btn:hover {
  border-color: rgba(232, 184, 74, 0.7);
  background: rgba(232, 184, 74, 0.12);
  color: inherit;
}

.gen-hist-lock-btn.is-on {
  border-color: rgba(232, 184, 74, 0.9);
  background: rgba(232, 184, 74, 0.18);
  color: #e8b84a;
}

.gen-hist-thumbs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}

.gen-hist-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #121820;
  border-radius: 8px;
  flex-shrink: 0;
}

.gen-hist-thumb-ref {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(232, 184, 74, 0.55);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.gen-hist-meta {
  min-width: 0;
  flex: 1;
}

.gen-hist-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.gen-hist-sub {
  font-size: 12px;
  color: var(--muted);
}

.gen-hist-more {
  width: 100%;
  margin-top: 8px;
  flex-shrink: 0;
}

.gen-hist-preview {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.gen-hist-preview-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

.gen-hist-preview.is-empty .gen-hist-preview-placeholder {
  display: flex;
}

.gen-hist-preview:not(.is-empty) .gen-hist-preview-placeholder {
  display: none;
}

.gen-hist-preview.is-empty img,
.gen-hist-preview.is-empty .gen-hist-preview-video,
.gen-hist-preview.is-empty .gen-hist-preview-ref,
.gen-hist-preview.is-empty .gen-hist-preview-meta,
.gen-hist-preview.is-empty .gen-hist-preview-actions,
.gen-hist-preview img[hidden],
.gen-hist-preview-video[hidden],
.gen-hist-preview-ref[hidden],
.gen-hist-preview-meta[hidden],
.gen-hist-preview-actions[hidden] {
  display: none !important;
}

.gen-hist-preview-media {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.gen-hist-preview-ref {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 1 200px;
  max-width: min(42%, 260px);
}

.gen-hist-preview-ref img {
  display: block;
  width: 100%;
  max-height: min(36vh, 280px);
  margin: 0;
  object-fit: contain;
  background: repeating-conic-gradient(#1a2330 0% 25%, #243836 0% 50%) 0 0 / 16px 16px;
  border-radius: 8px;
  border: 1px solid rgba(232, 184, 74, 0.45);
}

.gen-hist-preview-ref figcaption {
  font-size: 12px;
  color: var(--muted);
}

.gen-hist-preview-media > img,
.gen-hist-preview-media > .gen-hist-preview-video {
  flex: 1 1 240px;
  max-width: min(100%, 520px);
  margin: 0;
}

.gen-hist-preview img,
.gen-hist-preview-video {
  display: block;
  width: 100%;
  max-height: min(42vh, 340px);
  margin: 0 0 10px;
  object-fit: contain;
  background: repeating-conic-gradient(#1a2330 0% 25%, #243836 0% 50%) 0 0 / 16px 16px;
  border-radius: 8px;
}

.gen-hist-preview-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  text-align: center;
}

.gen-hist-preview-actions {
  margin-top: auto;
  justify-content: flex-end;
}

.jobs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #0b1210;
  background: #6dffd6;
  vertical-align: middle;
}

.jobs-badge[hidden] {
  display: none !important;
}

.jobs-dialog {
  max-width: 560px;
}

.jobs-empty {
  padding: 18px 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 420px);
  overflow: auto;
  margin: 8px 0 14px;
}

.jobs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.jobs-item.is-queued {
  border-color: rgba(232, 184, 74, 0.45);
}

.jobs-item.is-running {
  border-color: rgba(109, 255, 214, 0.35);
}

.jobs-item.is-await {
  border-color: rgba(120, 170, 255, 0.45);
}

.jobs-item-main {
  min-width: 0;
  flex: 1;
}

.jobs-item-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.jobs-item-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
}

.jobs-item-actions {
  flex-shrink: 0;
}

.jobs-item-tip {
  font-size: 11px;
  color: var(--muted);
}

.jobs-cancel-btn {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .gen-hist-body {
    flex-direction: column;
    min-height: 0;
  }

  .gen-hist-side {
    flex: none;
    width: 100%;
  }

  .gen-hist-list {
    max-height: min(36vh, 280px);
  }

  .gen-hist-preview {
    min-height: 220px;
  }
}

.profile-gen-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-gen-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.profile-gen-item:last-child {
  border-bottom: 0;
}

.profile-gen-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #121820;
  border-radius: 8px;
  flex-shrink: 0;
}

.profile-gen-meta {
  min-width: 0;
  flex: 1;
}

.profile-gen-title {
  font-size: 14px;
  font-weight: 700;
}

.profile-gen-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.profile-gen-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.profile-gen-empty,
.profile-gen-more {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.profile-recharge-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 4px;
}

.profile-recharge-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.profile-recharge-item:last-child {
  border-bottom: 0;
}

.profile-recharge-main {
  min-width: 0;
}

.profile-recharge-title {
  font-weight: 700;
  font-size: 14px;
}

.profile-recharge-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
}

.profile-recharge-side {
  text-align: right;
  flex-shrink: 0;
}

.profile-recharge-status {
  font-size: 12px;
  font-weight: 700;
}

.profile-recharge-status.is-paid {
  color: #6ecf8a;
}

.profile-recharge-status.is-pending {
  color: #e8b86d;
}

.profile-recharge-status.is-cancelled {
  color: var(--muted);
}

.profile-recharge-status.is-closed {
  color: var(--muted);
}

.profile-recharge-empty,
.profile-recharge-more {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}

/* 新用户首次效果展示 */
.showcase-modal {
  z-index: 85;
}

.showcase-dialog {
  width: min(920px, 94vw);
  max-height: min(92vh, 880px);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.showcase-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9ab0ac;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.showcase-close:hover {
  color: #e8eef6;
  background: rgba(255, 255, 255, 0.06);
}

.showcase-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #3fd0c8;
}

.showcase-dialog h2 {
  margin: 0;
  padding-right: 28px;
  font-size: 18px;
}

.showcase-dialog .auth-modal-sub {
  margin: 0;
}

.showcase-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  flex: 1 1 auto;
  margin-top: 4px;
}

.showcase-frame {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 200px;
  max-height: min(58vh, 520px);
  border-radius: 12px;
  border: 1px solid #2a3a4e;
  background: #0a1018;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.showcase-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(58vh, 520px);
  object-fit: contain;
  background: #0a1018;
}

.showcase-nav {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #2e3a4c;
  background: #162030;
  color: #e8eef6;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.showcase-nav:hover {
  border-color: #3fd0c8;
  color: #9ee8e2;
}

.showcase-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 4px 0 2px;
}

.showcase-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: #3a4658;
  cursor: pointer;
}

.showcase-dot.is-active {
  background: #3fd0c8;
  width: 18px;
}

.showcase-actions {
  margin-top: 4px;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .showcase-dialog {
    width: min(100vw - 16px, 94vw);
    padding: 14px 12px 12px;
  }

  .showcase-nav {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .showcase-frame,
  .showcase-frame img {
    max-height: min(48vh, 360px);
  }
}

