:root {
  --bg: #f7f6f3;
  --card: #f7f6f3;
  --ink: #2d2d2d;
  --muted: #6b7280;
  --accent: #5d6a7a;
  --accent-soft: #e8e6e1;
  --border: #e8e6e1;
  --shadow: 0 18px 40px rgba(45, 45, 45, 0.12);
  --sidebar-width: 252px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Crect width='120' height='120' fill='none'/%3E%3Ccircle cx='12' cy='18' r='1' fill='%239a8f83' fill-opacity='0.35'/%3E%3Ccircle cx='38' cy='26' r='1' fill='%239a8f83' fill-opacity='0.28'/%3E%3Ccircle cx='70' cy='14' r='1' fill='%239a8f83' fill-opacity='0.22'/%3E%3Ccircle cx='92' cy='44' r='1' fill='%239a8f83' fill-opacity='0.28'/%3E%3Ccircle cx='16' cy='64' r='1' fill='%239a8f83' fill-opacity='0.2'/%3E%3Ccircle cx='46' cy='78' r='1' fill='%239a8f83' fill-opacity='0.28'/%3E%3Ccircle cx='76' cy='62' r='1' fill='%239a8f83' fill-opacity='0.24'/%3E%3Ccircle cx='102' cy='96' r='1' fill='%239a8f83' fill-opacity='0.2'/%3E%3Ccircle cx='58' cy='104' r='1' fill='%239a8f83' fill-opacity='0.24'/%3E%3C/svg%3E");
  opacity: 0.35;
  mix-blend-mode: multiply;
  z-index: 0;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.22;
  z-index: 0;
  display: none;
}

.orb-a {
  width: 520px;
  height: 520px;
  background: #ead9c1;
  top: -180px;
  left: -160px;
}

.orb-b {
  width: 640px;
  height: 640px;
  background: #d9d2c6;
  bottom: -220px;
  right: -240px;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: 30px;
}

.run-btn {
  background: var(--ink);
  color: #f7f6f3;
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.run-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.run-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 26px 70px rgba(45, 45, 45, 0.25);
}

.canvas-app {
  position: relative;
  display: flex;
  flex-direction: row;
}

.canvas-app.is-sidebar-hidden .canvas-sidebar {
  transform: translateX(-100%);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgba(18, 20, 24, 0.1);
}

.sidebar-backdrop.is-hidden {
  display: none;
}

.canvas-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: rgba(247, 246, 243, 0.95);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 20;
  flex-shrink: 0;
  position: fixed;
  left: 0;
  top: 0;
  transition: transform 0.24s ease;
}

.canvas-sidebar.is-locked {
  opacity: 0.7;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 10px 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
}

.sidebar-brand-logo-row {
  width: 100%;
  display: flex;
  justify-content: center;
}

.sidebar-logo {
  width: min(256px, 100%);
  max-width: 256px;
  height: auto;
  aspect-ratio: 4 / 1;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  text-align: center;
}

.sidebar-toggle-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background: rgba(45, 45, 45, 0.08);
  color: var(--ink);
}

.sidebar-toggle-btn svg {
  width: 15px;
  height: 15px;
}

.sidebar-toggle-btn.is-hidden {
  display: none;
}

.sidebar-toggle-btn.is-ghost {
  border: 1px solid var(--border);
  background: rgba(247, 246, 243, 0.9);
}

.canvas-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

.canvas-group-title {
  font-size: 11px;
  color: #8b8f97;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 10px 8px 6px;
}

.canvas-list-empty {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 20px 8px;
}

.canvas-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.canvas-item:hover {
  background: rgba(45, 45, 45, 0.06);
}

.canvas-item.is-active {
  background: rgba(93, 106, 122, 0.1);
  border: 1px solid rgba(93, 106, 122, 0.2);
}

.canvas-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-item-name-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font-size: 13px;
  padding: 5px 8px;
  outline: none;
}

.canvas-item-name-input:focus {
  border-color: rgba(93, 106, 122, 0.45);
  box-shadow: 0 0 0 2px rgba(93, 106, 122, 0.12);
}

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

.canvas-item-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 8px);
  margin: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(45, 45, 45, 0.14);
  border-radius: 10px;
  background: rgba(45, 45, 45, 0.04);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.canvas-item-add:hover {
  background: rgba(93, 106, 122, 0.1);
  border-color: rgba(93, 106, 122, 0.28);
  color: var(--ink);
}

.canvas-item-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sidebar-user-area {
  position: relative;
  border-top: 1px solid var(--border);
  padding: 10px;
}

.sidebar-user-area.is-hidden {
  display: none;
}

.sidebar-user-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(45, 45, 45, 0.12);
  background: rgba(247, 246, 243, 0.9);
  color: var(--ink);
  cursor: pointer;
}

.sidebar-user-btn svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.sidebar-username {
  font-size: 13px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-menu {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 8px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(30, 30, 30, 0.14);
  border-radius: 10px;
  background: rgba(247, 246, 243, 0.98);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
  padding: 8px;
}

.sidebar-user-menu.is-hidden {
  display: none;
}

.sidebar-user-menu-item {
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(45, 45, 45, 0.08);
  color: var(--ink);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.sidebar-user-menu-item:hover {
  background: rgba(93, 106, 122, 0.12);
}

.canvas-list-menu {
  position: fixed;
  z-index: 34;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(30, 30, 30, 0.14);
  background: rgba(247, 246, 243, 0.98);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.canvas-list-menu.is-hidden {
  display: none;
}

.canvas-list-menu-item {
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  color: #2b2420;
  background: rgba(45, 45, 45, 0.08);
  cursor: pointer;
}

.canvas-list-menu-item:hover {
  background: rgba(93, 106, 122, 0.12);
}

.section {
  margin-bottom: 14px;
}

.section.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag.active {
  background: rgba(93, 106, 122, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.preview {
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#proportionPreview {
  display: none;
}

.preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-family: inherit;
  resize: vertical;
}

.prompt-input {
  width: 100%;
  min-height: 88px;
  border-radius: 16px;
  border: 1px solid transparent;
  padding: 10px 12px 36px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  background: transparent;
  outline: none;
  overflow-y: auto;
  white-space: pre-wrap;
}

.prompt-input:focus {
  border-color: transparent;
  box-shadow: none;
}

.prompt-input:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.prompt-token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.6;
  user-select: none;
}

.prompt-token[data-type="style"],
.prompt-token[data-type="theme"] {
  background: rgba(93, 106, 122, 0.12);
  border-color: rgba(93, 106, 122, 0.28);
  color: var(--accent);
}

.prompt-token.is-free-style {
  background: rgba(45, 45, 45, 0.08);
  border-color: rgba(45, 45, 45, 0.18);
  color: var(--muted);
}

.prompt-token[data-type="view"],
.prompt-token[data-type="scene"],
.prompt-token[data-type="ui"] {
  background: rgba(61, 90, 128, 0.12);
  border-color: rgba(61, 90, 128, 0.28);
  color: #3d5a80;
}

.prompt-token[data-type="pose"],
.prompt-token[data-type="role"],
.prompt-token[data-type="proportion"] {
  background: rgba(45, 45, 45, 0.08);
  border-color: rgba(45, 45, 45, 0.18);
  color: var(--ink);
}

.tag-option.linked {
  box-shadow: 0 0 0 2px var(--accent);
}

.prompt-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  position: relative;
  width: 100%;
}

.prompt-tag-window {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 56px);
  background: rgba(247, 246, 243, 0.96);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(16, 16, 16, 0.08);
  z-index: 4;
}

.prompt-tag-window.is-hidden {
  display: none;
}

.prompt-tag-toggle {
  position: absolute;
  left: 12px;
  bottom: 10px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 0;
  z-index: 2;
}

.prompt-tagbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 8px;
  width: 100%;
  justify-content: flex-start;
  pointer-events: auto;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
}

.prompt-tagbar.is-hidden {
  display: none;
}

.prompt-primary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.prompt-primary-btn {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-primary-btn.is-active {
  background: #1b1b1b;
  border-color: #1b1b1b;
  color: #f7f6f3;
}

.prompt-submenu {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt-submenu.is-hidden {
  display: none;
}

.tag-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tag-group-title {
  font-size: 12px;
  color: var(--muted);
}

.tag-option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-option {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-option.is-active {
  background: rgba(93, 106, 122, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.style-option {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.style-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.style-option .style-fallback {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 0 6px;
}

.style-option.is-free .style-fallback {
  position: relative;
  padding-top: 52px;
}

.style-option.is-free .style-fallback::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(45, 45, 45, 0.2);
  transform: translateX(-50%);
}

.style-option.is-free .style-fallback::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 2px;
  height: 36px;
  background: rgba(45, 45, 45, 0.35);
  transform: translateX(-50%) rotate(45deg);
}

.prompt-row textarea,
.prompt-row .prompt-input {
  flex: 1;
}

.prompt-input-wrap {
  position: relative;
  flex: 1;
  background: rgba(247, 246, 243, 0.95);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 48px 6px 8px;
}

.prompt-input-wrap .prompt-input {
  padding-right: 8px;
}

.run-btn-icon {
  position: absolute;
  right: 12px;
  bottom: 10px;
  transform: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: var(--ink);
  color: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 3;
}

.run-btn-icon:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.run-btn-icon:hover {
  box-shadow: 0 0 0 3px rgba(45, 45, 45, 0.12);
  transform: scale(1.02);
}

.run-btn-icon .icon-stop {
  display: none;
}

.run-btn-icon.is-running {
  background: var(--accent);
  color: white;
}

.run-btn-icon.is-running .icon-play {
  display: none;
}

.run-btn-icon.is-running .icon-stop {
  display: block;
}

.prompt-row .run-btn {
  white-space: nowrap;
  padding: 12px 24px;
}

.gallery {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.gallery-item {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
}

.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.gallery-item .caption {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
}

.canvas-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  flex: 1;
  min-height: 360px;
}

.canvas-shell.fullscreen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 0;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.canvas-toolbar.floating {
  position: absolute;
  top: 26px;
  left: 32px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(247, 246, 243, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  z-index: 5;
}

.logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo {
  height: 40px;
  width: auto;
  display: block;
  color: var(--ink);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 18, 0.32);
  backdrop-filter: blur(4px);
}

.auth-gate.is-hidden {
  display: none;
}

.auth-card {
  width: min(420px, 92vw);
  background: rgba(247, 246, 243, 0.98);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 46px rgba(16, 16, 16, 0.24);
  padding: 20px;
  text-align: center;
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
}

.auth-desc {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.auth-qr-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-qr-container {
  width: 280px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(247, 246, 243, 0.92);
  overflow: hidden;
}

#wechatQrContainer iframe,
#wechatQrContainer img,
#wechatQrContainer > div {
  margin-left: auto;
  margin-right: auto;
}

.auth-link {
  margin-top: 10px;
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.auth-link:hover {
  color: var(--ink);
}

.auth-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

.auth-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--ink);
  color: #f7f6f3;
  font-size: 13px;
  cursor: pointer;
}

.auth-btn.ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}

.auth-btn.is-hidden {
  display: none;
}

.auth-hint {
  margin-top: 10px;
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

.canvas-caption {
  font-weight: 600;
  color: var(--ink);
}

.canvas-stage {
  position: relative;
  border-radius: 0;
  background: linear-gradient(180deg, #f7f6f3 0%, #efece6 100%);
  flex: 1;
  overflow: hidden;
}

.canvas-status {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(247, 246, 243, 0.92);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  box-shadow: 0 12px 32px rgba(16, 16, 16, 0.12);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.prompt-body .canvas-status {
  margin-bottom: 0;
}

.canvas-status.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
}

.canvas-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
}

.canvas-stage.is-panning canvas {
  cursor: grabbing;
}

#localImageInput {
  display: none;
}

.selection-toolbar {
  position: absolute;
  display: none;
  z-index: 30;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(247, 246, 243, 0.96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.selection-toolbar.is-visible {
  display: inline-flex;
}

.canvas-context-menu {
  position: absolute;
  z-index: 31;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(30, 30, 30, 0.12);
  background: rgba(247, 246, 243, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
}

.canvas-context-menu.is-hidden {
  display: none;
}

.context-menu-item {
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  background: rgba(45, 45, 45, 0.08);
  color: #2b2420;
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.context-menu-item:hover {
  background: rgba(45, 45, 45, 0.16);
}
.context-menu-item.is-hidden {
  display: none;
}


.batch-panel {
  position: absolute;
  z-index: 32;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  width: min(260px, 70vw);
  border-radius: 16px;
  background: rgba(247, 246, 243, 0.98);
  border: 1px solid var(--border);
  box-shadow: 0 16px 32px rgba(16, 16, 16, 0.14);
  pointer-events: auto;
}

.batch-panel.is-hidden {
  display: none;
}

.style-panel {
  position: absolute;
  z-index: 32;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  width: min(320px, 80vw);
  border-radius: 16px;
  background: rgba(247, 246, 243, 0.98);
  border: 1px solid var(--border);
  box-shadow: 0 16px 32px rgba(16, 16, 16, 0.14);
  pointer-events: auto;
}

.style-panel.is-hidden {
  display: none;
}

.style-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.style-chip {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 6px;
  background: rgba(247, 246, 243, 0.75);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease, border 0.2s ease;
}

.style-chip:hover {
  background: rgba(247, 246, 243, 0.95);
  border-color: rgba(45, 45, 45, 0.2);
}

.batch-panel-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.batch-panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.batch-model-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
  padding: 4px 8px;
  font-size: 12px;
}

.batch-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--ink);
}

.batch-field span {
  color: var(--muted);
}

.batch-field input,
.batch-field textarea {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 6px 8px;
  font-size: 12px;
  background: rgba(247, 246, 243, 0.8);
  color: var(--ink);
  outline: none;
}

.batch-field textarea {
  resize: vertical;
  min-height: 44px;
}

.batch-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.batch-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(93, 106, 122, 0.16);
  color: var(--ink);
  cursor: pointer;
}

.batch-btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.toolbar-btn svg {
  width: 16px;
  height: 16px;
}

.toolbar-btn:hover {
  background: rgba(93, 106, 122, 0.12);
  transform: translateY(-1px);
}

.toolbar-btn.is-hidden {
  display: none;
}

.model-viewer {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 20, 20, 0.5);
  backdrop-filter: blur(6px);
}

.model-viewer.is-hidden {
  display: none;
}

.model-viewer-card {
  width: min(860px, 92vw);
  height: min(680px, 78vh);
  border-radius: 20px;
  background: rgba(247, 246, 243, 0.98);
  border: 1px solid rgba(120, 120, 120, 0.2);
  box-shadow: 0 24px 48px rgba(10, 10, 10, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.model-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(239, 236, 230, 0.9);
  border-bottom: 1px solid rgba(120, 120, 120, 0.2);
}

.model-viewer-title {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.model-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-viewer-action {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
  cursor: pointer;
}

.model-viewer-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.model-viewer-action.is-hidden {
  display: none;
}

.model-viewer-close {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
  cursor: pointer;
}

.model-viewer-body {
  position: relative;
  flex: 1;
  background: linear-gradient(135deg, rgba(230, 227, 221, 0.9), rgba(237, 234, 228, 0.9));
}

.model-viewer-body::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0) 52%, rgba(20, 18, 14, 0.16) 100%);
}

.model-viewer-body canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.model-viewer-hint {
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-size: 11px;
  color: rgba(70, 70, 70, 0.75);
  background: rgba(247, 246, 243, 0.8);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(120, 120, 120, 0.2);
}

.model-viewer-tune {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 300px;
  max-width: calc(100% - 28px);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(120, 120, 120, 0.24);
  background: rgba(247, 246, 243, 0.94);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.model-viewer-tune.is-hidden {
  display: none;
}

.model-viewer-tune-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 2px;
}

.model-viewer-tune-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink);
}

.model-viewer-tune-row input[type="range"] {
  width: 100%;
}

.model-viewer-tune-row span {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.model-viewer-tune-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.activity-box {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(247, 246, 243, 0.72);
  max-height: 300px;
  overflow: hidden;
}

.activity-box.is-hidden {
  display: none;
}

.activity-box[open] {
  overflow: visible;
}

.activity-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  text-align: center;
}

.activity-title::-webkit-details-marker {
  display: none;
}

.activity-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow: auto;
  padding-top: 10px;
}

.control-dock {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: min(1120px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
  pointer-events: none;
}

.bottom-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: nowrap;
}

.tags-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px 10px;
  background: rgba(247, 246, 243, 0.85);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 12px 32px rgba(16, 16, 16, 0.12);
  backdrop-filter: blur(10px);
  overflow: visible;
  flex: 0 1 520px;
  max-width: 520px;
  pointer-events: auto;
}

.prompt-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 0 0 560px;
  pointer-events: auto;
}

.tag-with-preview {
  display: block;
}

.prompt-panel {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  min-height: 120px;
  width: 100%;
}

.prompt-tabs {
  display: flex;
  gap: 8px;
}

.prompt-tab {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f7f6f3;
  border: 1px solid #1b1b1b;
  font-size: 12px;
  font-weight: 600;
  color: #1b1b1b;
  cursor: pointer;
}

.prompt-tab.is-active {
  background: #1b1b1b;
  border-color: #1b1b1b;
  color: #f7f6f3;
}

.prompt-body {
  position: relative;
  margin-top: 0;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}


.tags-panel.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dock-spacer {
  width: 100%;
}

.activity-float {
  position: relative;
  right: auto;
  top: auto;
  transform: none;
  flex: 0 0 200px;
  width: 200px;
  z-index: 12;
  opacity: 0.65;
  background: rgba(247, 246, 243, 0.6);
  border-style: solid;
  pointer-events: auto;
}

.log-entry {
  background: rgba(247, 246, 243, 0.75);
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
}

.log-entry span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.gallery-item.is-pending {
  position: relative;
  overflow: hidden;
}

.gallery-item.is-pending::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(247, 246, 243, 0), rgba(61, 90, 128, 0.28), rgba(247, 246, 243, 0));
  animation: progress-sheen 1.6s infinite linear;
}

@keyframes progress-sheen {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 212px;
  }

  .canvas-shell.fullscreen {
    padding: 20px;
  }

  .canvas-toolbar.floating {
    left: 20px;
    right: 20px;
    top: 18px;
  }

  .control-dock {
    width: min(96vw, 720px);
  }

  .bottom-row {
    flex-direction: column;
    align-items: center;
  }

  .tag-with-preview {
    flex-direction: column;
    align-items: flex-start;
  }

  .preview {
    width: 100%;
    height: 120px;
  }

  .activity-float {
    position: static;
    transform: none;
    width: min(320px, 90vw);
    margin: 0 auto 16px;
  }
}
