:root {
  --bg: #f7f7f9;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --muted-2: #9a9aa0;
  --panel: rgba(255, 255, 255, .86);
  --panel-solid: #ffffff;
  --panel-2: #f9f9fb;
  --line: rgba(29, 29, 31, .09);
  --line-strong: rgba(29, 29, 31, .15);
  --accent: #0071e3;
  --accent-soft: #e8f2ff;
  --accent-softer: rgba(0, 113, 227, .09);
  --green: #34c759;
  --shadow: 0 28px 78px rgba(15, 23, 42, .16);
  --soft-shadow: 0 10px 34px rgba(15, 23, 42, .09);
  --inner-shadow: 0 1px 0 rgba(255, 255, 255, .84) inset;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(180deg, #fbfbfd 0, #f4f4f7 46%, #ededf1 100%);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button {
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

button:active {
  transform: scale(.985);
}

.app {
  height: 100vh;
  display: grid;
  grid-template-rows: 56px 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(252, 252, 253, .78);
  backdrop-filter: blur(28px) saturate(1.35);
  box-shadow: var(--inner-shadow), 0 10px 28px rgba(15, 23, 42, .04);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 260px;
}

.brand-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  object-fit: cover;
  flex: 0 0 auto;
}

.brand strong {
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -.01em;
}

.brand span, .dim {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn, .icon-btn, .field, select, input[type="color"] {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
  min-height: 34px;
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(1.2);
}

.btn, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
  box-shadow: var(--inner-shadow), 0 2px 8px rgba(15, 23, 42, .04);
}

.btn:hover, .icon-btn:hover, .preset:hover, .layer:hover {
  background: rgba(255, 255, 255, .96);
  border-color: rgba(0, 0, 0, .18);
  box-shadow: var(--inner-shadow), 0 8px 18px rgba(15, 23, 42, .08);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.preset:focus-visible,
.search:focus,
.control:focus,
select:focus {
  outline: 3px solid rgba(0, 113, 227, .18);
  border-color: var(--accent);
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 113, 227, .28);
}

.btn.primary:hover {
  background: #0077ed;
  border-color: #0077ed;
}

.icon-btn {
  width: 36px;
  padding: 0;
}

.ri,
.bsc-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.bsc-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bsc-icon * {
  vector-effect: non-scaling-stroke;
}

.bsc-eyedropper {
  fill: currentColor;
  stroke: none;
}

.icon-btn .ri,
.icon-btn .bsc-icon {
  width: 17px;
  height: 17px;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 320px;
}

aside {
  min-height: 0;
  overflow: auto;
  background: rgba(250, 250, 252, .64);
  backdrop-filter: blur(24px) saturate(1.24);
}

.left {
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-columns: 72px;
  overflow: visible;
  position: relative;
  z-index: 8;
}

.right {
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(24px) saturate(1.16);
}

.right .section {
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.inspector-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(24px) saturate(1.18);
  box-shadow: var(--inner-shadow);
}

.inspector-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.inspector-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-body {
  display: grid;
  gap: 0;
  padding: 0;
}

.inspector-group {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .86);
}

.inspector-group-title {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.inspector-content {
  display: grid;
  gap: 9px;
  padding: 0 12px 12px;
}

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

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

.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-field {
  min-width: 0;
}

.compact-field label {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-field input,
.compact-field select,
.compact-field textarea {
  width: 100%;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(118, 118, 128, .09);
  color: var(--ink);
  padding: 6px 8px;
  outline: none;
  font-size: 12px;
}

.compact-field input:hover,
.compact-field select:hover,
.compact-field textarea:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .94);
}

.compact-field input:focus,
.compact-field select:focus,
.compact-field textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .12);
}

.compact-field textarea {
  min-height: 72px;
  resize: vertical;
}

.inline-control {
  display: grid;
  grid-template-columns: 56px 1fr 42px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-control output {
  text-align: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.button-row.three {
  grid-template-columns: repeat(3, 1fr);
}

.text-metrics-grid {
  gap: 10px;
}

.text-metrics-grid .compact-field {
  display: grid;
  gap: 5px;
}

.text-metrics-grid .compact-field label {
  order: 2;
  margin: 0;
  text-align: center;
}

.text-metrics-grid .compact-field input {
  order: 1;
  text-align: center;
}

.font-combobox {
  position: relative;
}

.native-font-select {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.font-combobox-trigger {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(29, 29, 31, .075);
  border-radius: 12px;
  background: #f1f1f1;
  color: var(--figma-text);
  padding: 0 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
}

.font-combobox-trigger:focus-visible {
  outline: 2px solid var(--figma-blue);
  outline-offset: 2px;
}

#fontComboboxValue {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-combobox-arrow {
  color: var(--figma-muted);
  font-family: system-ui, sans-serif;
  font-size: 14px;
}

.font-combobox-popover {
  position: absolute;
  z-index: 18;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  padding: 8px;
  border: 1px solid var(--figma-line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
}

body > .font-combobox-popover {
  right: auto;
  top: auto;
}

.font-combobox-popover #fontSearch {
  width: 100%;
  min-height: 32px;
  margin: 0 0 8px;
  border: 1px solid var(--figma-line);
  border-radius: 9px;
  background: #f7f7f7;
  color: var(--figma-text);
  padding: 0 9px;
  font-size: 12px;
}

.font-combobox-list {
  display: grid;
  gap: 2px;
  max-height: 238px;
  overflow: auto;
}

.font-combobox-group {
  padding: 7px 8px 3px;
  color: var(--figma-muted);
  font: 700 10px/1.2 system-ui, sans-serif;
}

.font-combobox-option {
  min-height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--figma-text);
  padding: 0 8px;
  text-align: left;
  font-size: 12px;
}

.font-combobox-option:hover,
.font-combobox-option.active {
  background: var(--figma-blue-soft);
  color: #096fb9;
}

.font-combobox-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-combobox-option small {
  color: var(--figma-muted);
  font: 700 10px/1 system-ui, sans-serif;
}

.font-combobox-empty {
  padding: 14px 8px;
  color: var(--figma-muted);
  font-size: 12px;
  text-align: center;
}

.text-control-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.text-auto-width-btn {
  justify-self: stretch;
}

.text-align-row .mini-btn {
  min-height: 34px;
}

.text-align-row .mini-btn span {
  display: none;
}

.text-align-row .mini-btn .ri {
  width: 16px;
  height: 16px;
}

.mini-btn {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .74);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mini-btn .ri {
  width: 14px;
  height: 14px;
}

.mini-btn:hover {
  background: #fff;
  border-color: rgba(0, 0, 0, .24);
  box-shadow: 0 5px 14px rgba(15, 23, 42, .06);
}

.mini-btn.active {
  border-color: rgba(0, 113, 227, .42);
  background: var(--accent-soft);
  color: var(--accent);
}

.section {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.quick-tools {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 14px 8px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(246, 246, 249, .74));
  backdrop-filter: blur(26px) saturate(1.25);
}

.tool-chip {
  min-height: 62px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  position: relative;
}

.tool-chip:hover,
.tool-chip.active {
  border-color: rgba(0, 113, 227, .24);
  background: rgba(0, 113, 227, .09);
  color: var(--accent);
  box-shadow: var(--inner-shadow);
}

.tool-chip strong {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(118, 118, 128, .1);
  color: #4b5563;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.tool-chip span {
  font-size: 11px;
  line-height: 1;
}

.tool-chip.active strong {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 6px 20px rgba(0, 113, 227, .14);
}

.tool-panel {
  position: absolute;
  left: 72px;
  top: 8px;
  width: 372px;
  max-height: calc(100vh - 72px);
  min-height: 0;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(247, 247, 250, .74));
  border: 1px solid rgba(29, 29, 31, .09);
  border-radius: 22px;
  box-shadow: 0 28px 78px rgba(15, 23, 42, .18), var(--inner-shadow);
  backdrop-filter: blur(30px) saturate(1.28);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px) scale(.985);
  transform-origin: top left;
  transition: opacity .16s ease, transform .16s ease;
}

.left.panel-open .tool-panel,
.tool-panel:focus-within,
.tool-panel:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.tool-panel .section {
  display: none;
}

.tool-panel .section.panel-active {
  display: block;
}

.tool-panel .add-subpanel {
  display: none;
}

.tool-panel .add-subpanel.panel-active {
  display: grid;
  gap: 10px;
}

.section h2 {
  margin: 0 0 16px;
  font-size: 25px;
  text-transform: none;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}

.section h2 small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
}

.search, .control {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .8);
  padding: 8px 10px;
  outline: none;
  color: var(--ink);
  box-shadow: var(--inner-shadow);
}

.search::placeholder,
.control::placeholder {
  color: #9a9aa0;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.upload-card {
  width: 100%;
  min-height: 112px;
  border: 1px dashed rgba(0, 0, 0, .18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(247, 247, 250, .86));
  color: var(--ink);
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  padding: 15px;
  text-align: left;
  box-shadow: var(--inner-shadow);
  cursor: pointer;
}

.upload-card:hover {
  border-color: rgba(0, 113, 227, .42);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f0f1f4, #e7e9ee);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
}

.upload-card strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.upload-card > div > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.stock-panel {
  display: grid;
  gap: 12px;
  padding-top: 8px;
}

.stock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stock-head strong {
  font-size: 15px;
  font-weight: 800;
}

.stock-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stock-key-guide {
  border: 1px solid rgba(0, 113, 227, .16);
  border-radius: 14px;
  background: rgba(0, 113, 227, .05);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.stock-key-guide summary {
  cursor: pointer;
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 800;
  outline: none;
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 7px;
  list-style: none;
}

.stock-key-guide summary::-webkit-details-marker {
  display: none;
}

.stock-key-guide summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--accent);
  flex: 0 0 auto;
  transform: translateY(.5px);
}

.stock-key-guide[open] summary::before {
  transform: rotate(90deg) translateX(.5px);
}

.stock-key-guide ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.stock-key-guide li {
  margin: 2px 0;
}

.stock-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
}

.stock-search-row .compact-field {
  display: grid;
  grid-template-rows: 16px 40px;
  gap: 4px;
}

.stock-search-row .mini-btn {
  height: 40px;
  min-height: 40px;
  margin-bottom: 0;
  align-self: end;
  padding-top: 0;
  padding-bottom: 0;
}

.stock-search-row input {
  height: 40px;
  min-height: 40px;
}

.stock-compliance-note {
  padding: 8px 10px;
  border: 1px solid rgba(29, 29, 31, .08);
  border-radius: 8px;
  background: rgba(29, 29, 31, .035);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.image-attribution {
  padding: 9px 10px;
  border: 1px solid rgba(29, 29, 31, .08);
  border-radius: 8px;
  background: rgba(29, 29, 31, .035);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.image-attribution a {
  color: var(--ink);
  font-weight: 720;
  text-decoration: none;
}

.image-attribution a:hover {
  text-decoration: underline;
}

.stock-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 96px;
}

.stock-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .86);
  overflow: hidden;
  color: var(--ink);
  box-shadow: var(--inner-shadow);
}

.stock-card:hover {
  border-color: rgba(0, 113, 227, .38);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}

.stock-photo-btn {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  display: block;
  cursor: pointer;
}

.stock-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: #eceef2;
}

.stock-meta {
  display: grid;
  gap: 3px;
  padding: 8px;
  min-width: 0;
}

.stock-meta strong,
.stock-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-meta strong {
  font-size: 12px;
  font-weight: 800;
}

.stock-meta span {
  color: var(--muted);
  font-size: 11px;
}

.stock-meta a {
  color: inherit;
  text-decoration: none;
}

.stock-meta a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.stock-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  min-height: 18px;
}

.stock-status.is-error {
  color: #ef4444;
}

.upload-icon .ri,
.element-icon .ri,
.tool-chip strong .ri {
  width: 20px;
  height: 20px;
}

.element-icon .ri {
  width: 22px;
  height: 22px;
}

.grid {
  display: grid;
  gap: 8px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.element-group {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
}

.element-group:last-child {
  margin-bottom: 0;
}

.element-title {
  color: var(--ink);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 8px 0 4px;
}

.element-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.element-card {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(246, 246, 249, .76));
  color: var(--ink);
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 10px;
  padding: 15px 10px;
  text-align: center;
  box-shadow: var(--inner-shadow);
}

.element-card:hover {
  background: #fff;
  border-color: rgba(0, 113, 227, .32);
  box-shadow: var(--soft-shadow);
  transform: translateY(-1px);
}

.element-icon {
  width: 40px;
  height: 40px;
  border-radius: 15px;
  background: linear-gradient(180deg, #eef6ff, #e5f0ff);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
}

.element-card strong {
  display: block;
  font-size: 14px;
  font-weight: 760;
  margin-bottom: 2px;
}

.element-card span:last-child {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.prompt-generator {
  display: grid;
  gap: 12px;
}

.prompt-generator .compact-field textarea {
  min-height: 76px;
}

.prompt-generator .compact-field.output textarea {
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans Mono CJK SC", monospace;
  line-height: 1.58;
}

.prompt-generator .full {
  grid-column: 1 / -1;
}

.prompt-mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.prompt-mode-row .mini-btn {
  min-width: 0;
}

.prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.prompt-actions .mini-btn {
  flex: 1 1 96px;
}

.prompt-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.prompt-status.is-loading {
  color: rgba(29, 29, 31, .82);
  font-weight: 750;
}

.prompt-status.is-error {
  color: #b42318;
  font-weight: 750;
}

.image-ai-panel {
  display: grid;
  gap: 12px;
}

.image-ai-actions,
.mask-mode-row {
  display: grid;
  gap: 8px;
}

.image-ai-actions {
  grid-template-columns: 1fr 1fr;
}

.mask-mode-row {
  grid-template-columns: 1fr 1fr;
}

.image-ai-actions .mini-btn,
.mask-mode-row .mini-btn {
  min-width: 0;
}

.mask-mode-row .mini-btn.active {
  border-color: rgba(18, 185, 129, .8);
  background: linear-gradient(180deg, rgba(18, 185, 129, .18), rgba(18, 185, 129, .1));
  color: #047857;
  box-shadow: inset 0 0 0 1px rgba(18, 185, 129, .18), 0 8px 18px rgba(18, 185, 129, .12);
}

.mask-mode-row #maskEraseBtn.active {
  border-color: rgba(239, 68, 68, .82);
  background: linear-gradient(180deg, rgba(239, 68, 68, .17), rgba(239, 68, 68, .09));
  color: #b42318;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .18), 0 8px 18px rgba(239, 68, 68, .12);
}

.mask-mode-row .mini-btn.active::after {
  content: "已选";
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: currentColor;
  font-size: 10px;
  font-weight: 850;
}

.mask-edit-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(29, 29, 31, .09);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(247, 247, 250, .72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.mask-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mask-status.is-loading {
  color: rgba(29, 29, 31, .82);
  font-weight: 760;
}

.mask-status.is-error {
  color: #b42318;
  font-weight: 760;
}

.generation-progress {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(29, 29, 31, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.generation-progress.hidden {
  display: none;
}

.generation-progress-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(29, 29, 31, .08);
  overflow: hidden;
}

.generation-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #111111;
  transition: width .32s ease;
}

.generation-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(29, 29, 31, .56);
  font-size: 11px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.canvas-generation-placeholder {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity .22s ease;
}

.canvas-generation-placeholder.hidden {
  display: none;
}

.canvas-generation-card {
  width: min(78%, 340px);
  min-height: 148px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 20px 22px;
  border: 1px solid rgba(29, 29, 31, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 26px 80px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255, 255, 255, .72);
  color: rgba(29, 29, 31, .86);
  line-height: 1.35;
  text-align: left;
  backdrop-filter: blur(18px);
}

.canvas-generation-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 780;
}

.canvas-generation-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #111111;
  box-shadow: 0 0 0 7px rgba(214, 202, 0, .14);
  animation: pulseDot 1.35s ease-in-out infinite;
  flex: 0 0 auto;
}

.canvas-generation-placeholder.is-done .canvas-generation-dot {
  background: #1f9d55;
  box-shadow: 0 0 0 7px rgba(31, 157, 85, .12);
  animation: none;
}

.canvas-generation-placeholder.is-error .canvas-generation-dot {
  background: #d92d20;
  box-shadow: 0 0 0 7px rgba(217, 45, 32, .12);
  animation: none;
}

.canvas-generation-text {
  color: rgba(29, 29, 31, .58);
  font-size: 12px;
  font-weight: 650;
}

.canvas-generation-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(29, 29, 31, .08);
  overflow: hidden;
}

.canvas-generation-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #111111;
  transition: width .32s ease, background .2s ease;
}

.canvas-generation-placeholder.is-done .canvas-generation-fill {
  background: #1f9d55;
}

.canvas-generation-placeholder.is-error .canvas-generation-fill {
  background: #d92d20;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: .86; }
  50% { transform: scale(.78); opacity: .62; }
}

.font-tools {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(247, 247, 250, .72));
  box-shadow: var(--inner-shadow);
}

.font-tools-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.font-tools-head strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.font-tools-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.preset-list {
  display: grid;
  gap: 8px;
  max-height: 315px;
  overflow: auto;
  padding-right: 4px;
}

.preset {
  text-align: left;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .72);
  border-radius: 14px;
  padding: 10px 11px;
  display: grid;
  gap: 3px;
}

.preset.active {
  border-color: rgba(0, 113, 227, .36);
  background: linear-gradient(180deg, #eef6ff, #e7f1ff);
  box-shadow: 0 0 0 1px rgba(0, 113, 227, .1) inset;
}

.preset strong {
  font-size: 13px;
  font-weight: 650;
}

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

.custom-size-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--inner-shadow);
}

.custom-size-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
}

.custom-size-card .hint {
  margin: 0;
}

#newBlankBtn {
  width: 100%;
  min-height: 32px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
}

.logo-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.logo-item {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(245, 245, 248, .82));
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  padding: 10px;
  text-align: left;
  overflow: hidden;
  box-shadow: var(--inner-shadow);
}

.logo-item:hover {
  background: #fff;
  border-color: rgba(0, 113, 227, .24);
  box-shadow: var(--soft-shadow);
  transform: translateY(-1px);
}

.logo-item img {
  width: 100%;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .08));
}

.logo-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-wrap {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 42px 1fr;
}

.stage-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 252, .72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(16px);
}

.stage {
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, .92), transparent 34%),
    linear-gradient(135deg, #f1f2f6 0, #e8e9ef 100%);
}

.canvas-shell {
  position: relative;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .7);
  background: white;
  line-height: 0;
  border-radius: 4px;
  overflow: visible;
}

.selection-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.selection-box {
  position: absolute;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .86);
  pointer-events: none;
}

.swipe-select-box {
  position: absolute;
  border: 1px solid rgba(37, 99, 235, .82);
  background: rgba(37, 99, 235, .1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .74), inset 0 0 0 1px rgba(37, 99, 235, .18);
  pointer-events: none;
}

.selection-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid var(--accent);
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .16);
  pointer-events: auto;
}

.selection-handle[data-mode="resize"] {
  cursor: nwse-resize;
}

.selection-handle[data-mode="rotate"] {
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  cursor: grab;
}

.selection-handle[data-mode="crop"] {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-color: #ffb000;
  background: #fff8d7;
  cursor: grab;
}

.mask-editing .canvas-shell {
  cursor: crosshair;
}

.mask-editing .selection-handle {
  display: none;
}

.crop-editing .selection-box {
  border-color: #ffb000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .86), 0 0 0 4px rgba(255, 176, 0, .14);
}

.space-panning .stage,
.space-panning .canvas-shell,
.space-panning .selection-overlay {
  cursor: grab;
}

.space-panning.is-panning .stage,
.space-panning.is-panning .canvas-shell,
.space-panning.is-panning .selection-overlay {
  cursor: grabbing;
}

.inline-text-editor {
  position: absolute;
  z-index: 6;
  display: none;
  min-width: 44px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: inherit;
  box-shadow: none;
  caret-color: var(--figma-blue, #0d99ff);
  resize: none;
  overflow: auto;
  text-decoration: none;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-text-fill-color: currentColor;
  appearance: none;
}

.inline-text-editor.is-active {
  display: block;
}

.zoom-hud {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .88);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  box-shadow: var(--inner-shadow), 0 8px 24px rgba(0, 0, 0, .1);
  backdrop-filter: blur(18px) saturate(1.2);
  pointer-events: none;
}

.zoom-hud span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

canvas {
  display: block;
  background: white;
  image-rendering: auto;
  touch-action: none;
}

.label {
  display: block;
  margin: 11px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.toggle-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 4px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .66);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

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

input[type="color"] {
  width: 100%;
  padding: 2px;
  background: white;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.swatch {
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.layers {
  display: grid;
  gap: 7px;
  max-height: 205px;
  overflow: auto;
}

.layers.drop-to-end {
  padding-bottom: 4px;
  box-shadow: inset 0 -3px 0 #111111;
}

.layer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .76);
  border-radius: 12px;
  padding: 9px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  cursor: grab;
}

.layer-drag-handle {
  color: var(--muted-2);
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 1;
  opacity: .72;
}

.layer:hover .layer-drag-handle,
.layer.dragging .layer-drag-handle {
  color: var(--accent);
  opacity: 1;
}

.layer.active {
  border-color: rgba(0, 113, 227, .36);
  background: var(--accent-soft);
}

.layer:active {
  cursor: grabbing;
}

.layer.dragging {
  opacity: .56;
  transform: scale(.985);
}

.layer.drop-before {
  box-shadow: 0 -3px 0 #111111, inset 0 1px 0 rgba(255, 255, 255, .72);
}

.layer.drop-after {
  box-shadow: 0 3px 0 #111111, inset 0 1px 0 rgba(255, 255, 255, .72);
}

.layer-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.empty {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  background: rgba(255, 255, 255, .54);
}

.inspector-body > .empty {
  margin: 12px;
}

.dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .52), transparent 38%),
    rgba(29, 29, 31, .24);
  backdrop-filter: blur(20px) saturate(1.18);
  -webkit-backdrop-filter: blur(20px) saturate(1.18);
}

.dialog-card {
  width: min(420px, calc(100vw - 40px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(248, 248, 250, .88));
  box-shadow:
    0 42px 110px rgba(15, 23, 42, .24),
    inset 0 1px 0 rgba(255, 255, 255, .86);
  transform: translateY(0) scale(1);
  animation: dialogIn .18s var(--ease);
}

.dialog-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 20px 20px 14px;
  align-items: center;
}

.dialog-mark {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: rgba(17, 17, 17, .28);
  color: rgba(29, 29, 31, .86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 12px 24px rgba(17, 17, 17, .13);
}

.dialog-mark .ri {
  width: 20px;
  height: 20px;
}

.dialog-card.is-danger .dialog-mark {
  background: rgba(255, 77, 35, .13);
  color: #b42318;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 12px 24px rgba(180, 35, 24, .08);
}

.dialog-title {
  margin: 0;
  color: rgba(29, 29, 31, .92);
  font-size: 18px;
  line-height: 1.18;
  letter-spacing: -.02em;
  font-weight: 780;
}

.dialog-message {
  margin: 0;
  padding: 0 20px 18px 74px;
  color: rgba(29, 29, 31, .58);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid rgba(29, 29, 31, .07);
  background: rgba(255, 255, 255, .48);
}

.dialog-card.is-export-dialog .dialog-actions {
  justify-content: flex-start;
}

.dialog-actions .btn {
  min-width: 84px;
}

.dialog-actions .btn.primary.is-danger {
  border-color: rgba(180, 35, 24, .22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, 0)),
    #ff4d23;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 14px 28px rgba(180, 35, 24, .16);
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hidden { display: none !important; }

body.onboarding-image-demo #emptyPanel {
  display: none !important;
}

body.onboarding-image-demo .right:not(.has-selection) #propsPanel,
body.onboarding-image-demo #propsPanel.hidden {
  display: grid !important;
}

body.onboarding-image-demo #propsPanel > .inspector-group:not(#imageGroup) {
  display: none !important;
}

body.onboarding-image-demo #imageGroup,
body.onboarding-image-demo #imageGroup.hidden {
  display: block !important;
}

body.onboarding-image-demo #imageGroup .inspector-group-title::after {
  content: "引导演示";
  margin-left: auto;
  color: var(--figma-blue, #0d99ff);
  font-size: 11px;
  font-weight: 700;
}

.onboarding-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: block;
  background: transparent;
}

.onboarding-spotlight {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 260px;
  height: 180px;
  border: 2px solid var(--figma-blue, #0d99ff);
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px rgba(18, 18, 20, .26),
    0 18px 42px rgba(0, 0, 0, .14);
  pointer-events: none;
  transition: left .22s var(--ease), top .22s var(--ease), width .22s var(--ease), height .22s var(--ease);
}

.onboarding-card {
  position: fixed;
  left: 28px;
  top: 28px;
  width: min(390px, calc(100vw - 40px));
  border: 1px solid rgba(255, 255, 255, .84);
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .82);
  overflow: hidden;
  transition: left .22s var(--ease), top .22s var(--ease);
  animation: onboardingIn .2s var(--ease);
}

.onboarding-kicker {
  padding: 16px 18px 0;
  color: var(--figma-blue, #0d99ff);
  font-size: 11px;
  font-weight: 760;
}

.onboarding-title {
  margin: 6px 0 0;
  padding: 0 18px;
  color: var(--figma-text, #202124);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 780;
}

.onboarding-text {
  margin: 0;
  padding: 10px 18px 16px;
  color: var(--figma-muted, #737373);
  font-size: 13px;
  line-height: 1.58;
}

.onboarding-dots {
  display: flex;
  gap: 6px;
  padding: 0 18px 16px;
}

.onboarding-dot {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 999px;
  background: #d8d8d8;
  padding: 0;
}

.onboarding-dot.active {
  width: 22px;
  background: var(--figma-blue, #0d99ff);
}

.onboarding-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--figma-line, #e6e6e6);
  background: #fbfbfb;
}

.onboarding-actions .btn {
  min-height: 32px;
}

.onboarding-actions .btn:disabled {
  opacity: .38;
  cursor: default;
}

@keyframes onboardingIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .onboarding-card {
    width: calc(100vw - 28px);
  }

  .onboarding-actions {
    grid-template-columns: 1fr 1fr;
  }

  .onboarding-actions #onboardingSkipBtn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1100px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100vh; }
  .workspace { grid-template-columns: 1fr; }
  .left {
    display: block;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .quick-tools {
    grid-template-columns: repeat(4, 1fr);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .right { border: 0; border-bottom: 1px solid var(--line); }
  .stage { min-height: 520px; }
}

/* Apple-grade desktop refresh. Kept as a scoped visual layer so existing editor logic stays intact. */
:root {
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --muted-2: #a1a1a6;
  --panel: rgba(255, 255, 255, .72);
  --panel-solid: #ffffff;
  --panel-2: rgba(248, 248, 250, .86);
  --line: rgba(29, 29, 31, .08);
  --line-strong: rgba(29, 29, 31, .14);
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, .12);
  --accent-softer: rgba(10, 132, 255, .07);
  --shadow: 0 44px 120px rgba(15, 23, 42, .16), 0 14px 38px rgba(15, 23, 42, .08);
  --soft-shadow: 0 18px 44px rgba(15, 23, 42, .08);
  --inner-shadow: inset 0 1px 0 rgba(255, 255, 255, .78);
  --radius: 11px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

body {
  background:
    radial-gradient(circle at 18% -8%, rgba(255, 255, 255, .98), transparent 31%),
    radial-gradient(circle at 72% 0%, rgba(220, 232, 246, .42), transparent 28%),
    linear-gradient(180deg, #fbfbfd 0%, #f4f4f6 46%, #ebecf0 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(29, 29, 31, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 29, 31, .014) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 78%, transparent);
}

.app {
  height: 100dvh;
  grid-template-rows: 64px minmax(0, 1fr);
}

.topbar {
  position: relative;
  padding: 0 18px;
  border-bottom-color: rgba(29, 29, 31, .075);
  background: rgba(246, 246, 248, .74);
  backdrop-filter: blur(34px) saturate(1.45);
  -webkit-backdrop-filter: blur(34px) saturate(1.45);
  box-shadow: var(--inner-shadow), 0 1px 0 rgba(255, 255, 255, .64);
}

.window-lights {
  display: inline-grid;
  grid-template-columns: repeat(3, 12px);
  gap: 8px;
  margin-right: 10px;
  align-items: center;
}

.window-lights i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

.window-lights i:nth-child(1) { background: #ff5f57; }
.window-lights i:nth-child(2) { background: #febc2e; }
.window-lights i:nth-child(3) { background: #28c840; }

.brand {
  align-items: center;
  gap: 8px;
  min-width: 330px;
}

.brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1.05;
}

.brand strong {
  font-size: 14px;
  font-weight: 760;
  letter-spacing: .08em;
}

.brand span,
.dim {
  font-size: 11px;
  color: rgba(29, 29, 31, .52);
  font-weight: 620;
}

.toolbar {
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: 18px;
  background: rgba(255, 255, 255, .52);
  box-shadow: var(--inner-shadow), 0 10px 26px rgba(15, 23, 42, .045);
}

.update-pill {
  min-height: 32px;
  max-width: 210px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid rgba(29, 29, 31, .075);
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  color: rgba(29, 29, 31, .58);
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.update-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(29, 29, 31, .2);
}

.update-pill.is-checking::before,
.update-pill.is-downloading::before {
  background: var(--accent);
  animation: breathe 1.4s var(--ease) infinite;
}

.update-pill.is-ready {
  border-color: var(--accent-border);
  background: rgba(17, 17, 17, .28);
  color: rgba(29, 29, 31, .86);
}

.update-pill.is-ready::before {
  background: var(--accent);
}

.btn,
.icon-btn,
.field,
select,
input[type="color"] {
  min-height: 32px;
  border-color: rgba(29, 29, 31, .09);
  border-radius: 10px;
  background: rgba(255, 255, 255, .76);
  transition: transform .22s var(--ease), background .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}

.field,
select {
  color: rgba(29, 29, 31, .78);
  font-size: 12px;
  font-weight: 650;
  padding: 0 28px 0 10px;
}

.btn,
.icon-btn {
  font-size: 12px;
  font-weight: 720;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.btn:hover,
.icon-btn:hover,
.preset:hover,
.layer:hover {
  border-color: rgba(29, 29, 31, .18);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--inner-shadow), 0 12px 26px rgba(15, 23, 42, .07);
  transform: translateY(-1px);
}

button:active,
.element-card:active,
.preset:active,
.logo-item:active {
  transform: scale(.985);
}

.btn.primary {
  border-color: rgba(10, 132, 255, .58);
  background: linear-gradient(180deg, #1590ff, #0077ed);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 12px 26px rgba(10, 132, 255, .24);
}

.workspace {
  grid-template-columns: 72px minmax(540px, 1fr) 336px;
  background: rgba(246, 246, 248, .28);
}

aside {
  background: rgba(246, 246, 248, .62);
  backdrop-filter: blur(28px) saturate(1.32);
  -webkit-backdrop-filter: blur(28px) saturate(1.32);
}

.left {
  grid-template-columns: 72px;
  border-right-color: rgba(29, 29, 31, .07);
}

.right {
  border-left-color: rgba(29, 29, 31, .07);
  background: rgba(250, 250, 252, .78);
}

.quick-tools {
  gap: 8px;
  padding: 12px 8px;
  border-right-color: rgba(29, 29, 31, .065);
  background: rgba(255, 255, 255, .48);
}

.tool-chip {
  min-height: 58px;
  border-radius: 16px;
  padding: 7px 3px;
  color: rgba(29, 29, 31, .66);
  font-size: 11px;
  font-weight: 720;
}

.tool-chip strong {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: transparent;
  color: currentColor;
}

.tool-chip:hover,
.tool-chip.active {
  border-color: rgba(10, 132, 255, .18);
  background: rgba(10, 132, 255, .095);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .58);
}

.tool-chip.active strong {
  background: rgba(255, 255, 255, .9);
  color: var(--accent);
  box-shadow: 0 7px 18px rgba(10, 132, 255, .12);
}

.tool-panel {
  left: 72px;
  width: 372px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(247, 247, 250, .74));
}

.section {
  padding: 20px 18px 22px;
  border-bottom-color: rgba(29, 29, 31, .07);
}

.section h2,
.element-title {
  color: rgba(29, 29, 31, .92);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -.018em;
}

.section h2 small {
  color: rgba(29, 29, 31, .45);
  font-size: 11px;
  font-weight: 650;
}

.search,
.control {
  min-height: 38px;
  border-color: rgba(29, 29, 31, .075);
  border-radius: 13px;
  background: rgba(255, 255, 255, .76);
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .74), 0 8px 22px rgba(15, 23, 42, .035);
}

.preset-list {
  max-height: 342px;
  gap: 7px;
  margin-top: 10px;
}

.preset,
.layer {
  border-color: rgba(29, 29, 31, .055);
  border-radius: 13px;
  background: rgba(255, 255, 255, .54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .58);
}

.preset {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 10px 12px;
}

.preset strong,
.layer {
  font-size: 12px;
  font-weight: 690;
}

.preset span {
  grid-column: 1 / -1;
  font-size: 11px;
  color: rgba(29, 29, 31, .48);
}

.preset.active,
.layer.active {
  border-color: rgba(10, 132, 255, .28);
  background: rgba(10, 132, 255, .105);
  color: #075ea8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .54);
}

.upload-card,
.element-card,
.font-tools,
.logo-item,
.toggle-row,
.mini-btn {
  border-color: rgba(29, 29, 31, .075);
  background: rgba(255, 255, 255, .62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 10px 28px rgba(15, 23, 42, .04);
}

.upload-card {
  min-height: 104px;
  border-style: solid;
  border-radius: 20px;
}

.upload-icon,
.element-icon {
  background: rgba(10, 132, 255, .105);
  color: var(--accent);
}

.element-grid {
  gap: 8px;
}

.element-card {
  min-height: 98px;
  border-radius: 19px;
  padding: 13px 10px;
}

.element-card:hover,
.logo-item:hover,
.upload-card:hover {
  border-color: rgba(10, 132, 255, .24);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--inner-shadow), 0 18px 42px rgba(15, 23, 42, .075);
}

.logo-list {
  gap: 9px;
}

.logo-item {
  min-height: 90px;
  border-radius: 17px;
}

.stage-wrap {
  grid-template-rows: 46px minmax(0, 1fr);
  background: transparent;
}

.stage-info {
  padding: 0 18px;
  border-bottom-color: rgba(29, 29, 31, .06);
  background: rgba(250, 250, 252, .42);
  font-size: 11px;
  letter-spacing: .01em;
}

.stage-info span:first-child {
  color: rgba(29, 29, 31, .76);
  font-weight: 720;
}

.stage-info span:first-child::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #28c840;
  box-shadow: 0 0 0 5px rgba(40, 200, 64, .12);
  animation: breathe 2.4s var(--ease) infinite;
}

.stage {
  padding: 42px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .9), transparent 30%),
    linear-gradient(135deg, #edeff3 0%, #f7f7f9 48%, #e8ebf0 100%);
}

.canvas-shell {
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .92);
  overflow: visible;
}

canvas {
  border-radius: 12px;
}

.selection-box {
  border-color: var(--accent);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .88), 0 0 0 5px rgba(10, 132, 255, .08);
}

.selection-handle {
  border-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(10, 132, 255, .22), 0 0 0 1px rgba(255, 255, 255, .8);
}

.zoom-hud {
  right: 18px;
  bottom: 18px;
  min-height: 34px;
  border-color: rgba(255, 255, 255, .7);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--inner-shadow), 0 14px 36px rgba(15, 23, 42, .12);
}

.inspector-header {
  min-height: 54px;
  border-bottom-color: rgba(29, 29, 31, .07);
  background: rgba(255, 255, 255, .5);
}

.inspector-title {
  font-size: 13px;
  font-weight: 760;
  letter-spacing: -.01em;
}

.inspector-subtitle {
  max-width: 180px;
  color: rgba(29, 29, 31, .45);
  font-size: 11px;
}

.inspector-group {
  border-bottom-color: rgba(29, 29, 31, .07);
  background: rgba(255, 255, 255, .44);
}

.inspector-group-title {
  min-height: 40px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 760;
  color: rgba(29, 29, 31, .78);
}

.inspector-content {
  gap: 10px;
  padding: 0 14px 14px;
}

.compact-field label,
.label {
  color: rgba(29, 29, 31, .48);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .02em;
}

.compact-field input,
.compact-field select,
.compact-field textarea {
  min-height: 32px;
  border-color: rgba(29, 29, 31, .055);
  border-radius: 10px;
  background: rgba(255, 255, 255, .68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .66);
}

.compact-field input:focus,
.compact-field select:focus,
.compact-field textarea:focus,
.search:focus,
.control:focus,
select:focus {
  border-color: rgba(10, 132, 255, .62);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, .12);
}

.mini-btn {
  min-height: 32px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 720;
}

.inline-control {
  grid-template-columns: 52px minmax(0, 1fr) 42px;
  color: rgba(29, 29, 31, .54);
  font-size: 11px;
}

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

.swatch {
  height: 24px;
  border-radius: 999px;
  border-color: rgba(29, 29, 31, .16);
}

.empty {
  border-color: rgba(29, 29, 31, .12);
  border-radius: 15px;
  background: rgba(255, 255, 255, .46);
  color: rgba(29, 29, 31, .52);
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: .82; }
  50% { transform: scale(.72); opacity: 1; }
}

@media (max-width: 1100px) {
  .app { min-height: 100dvh; }
  .workspace { grid-template-columns: 1fr; }
  .brand { min-width: 0; }
  .window-lights { display: none; }
  .toolbar { justify-content: flex-start; }
  .quick-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .left {
    display: block;
    overflow: visible;
  }
  .tool-panel {
    position: static;
    width: auto;
    max-height: none;
    margin: 0 10px 12px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .stage { padding: 26px; }
}

/* YOUXIAKE yellow theme */
:root {
  --accent: #111111;
  --accent-ink: #ffffff;
  --accent-soft: rgba(17, 17, 17, .08);
  --accent-softer: rgba(17, 17, 17, .05);
  --accent-border: rgba(17, 17, 17, .22);
  --accent-shadow: rgba(17, 17, 17, .14);
}

.topbar {
  background:
    linear-gradient(90deg, rgba(17, 17, 17, .13), transparent 34%),
    rgba(246, 246, 248, .78);
}

.brand strong {
  color: rgba(29, 29, 31, .86);
}

.brand-copy::before {
  content: "";
  width: 32px;
  height: 3px;
  margin-bottom: 4px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 6px 16px var(--accent-shadow);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.preset:focus-visible,
.search:focus,
.control:focus,
select:focus,
.compact-field input:focus,
.compact-field select:focus,
.compact-field textarea:focus {
  outline-color: rgba(17, 17, 17, .32);
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, .18);
}

.btn.primary {
  border-color: rgba(17, 17, 17, .54);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .36), rgba(255, 255, 255, 0)),
    var(--accent);
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .76), 0 14px 28px var(--accent-shadow);
}

.btn.primary:hover {
  border-color: rgba(17, 17, 17, .56);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .48), rgba(255, 255, 255, 0)),
    #111111;
  color: var(--accent-ink);
}

.tool-chip:hover,
.tool-chip.active {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: #111111;
}

.tool-chip.active strong {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px var(--accent-shadow), inset 0 1px 0 rgba(255, 255, 255, .72);
}

.preset.active,
.layer.active {
  position: relative;
  border-color: var(--accent-border);
  background:
    linear-gradient(90deg, rgba(17, 17, 17, .1), rgba(255, 255, 255, .7));
  color: #111111;
}

.preset.active::after,
.layer.active::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, .2);
}

.upload-icon,
.element-icon {
  background: var(--accent-soft);
  color: #111111;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .64);
}

.element-card:hover,
.logo-item:hover,
.upload-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--inner-shadow), 0 18px 42px rgba(15, 23, 42, .075), 0 0 0 4px rgba(17, 17, 17, .08);
}

.stage-info span:first-child::before {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(17, 17, 17, .22);
}

.canvas-shell {
  box-shadow:
    0 48px 120px rgba(15, 23, 42, .18),
    0 14px 38px rgba(15, 23, 42, .08),
    0 0 0 1px rgba(255, 255, 255, .96),
    0 0 0 7px rgba(17, 17, 17, .08);
  overflow: visible;
}

.selection-box {
  border-color: #111111;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .9), 0 0 0 5px rgba(17, 17, 17, .18);
}

.selection-handle {
  border-color: #111111;
  background: var(--accent);
  box-shadow: 0 4px 14px var(--accent-shadow), 0 0 0 1px rgba(255, 255, 255, .8);
}

input[type="range"],
.toggle-row input {
  accent-color: #111111;
}

/* Inspector 2.0 */
.right {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(246, 246, 248, .64)),
    rgba(250, 250, 252, .78);
}

.inspector-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 66px;
  padding: 11px 16px;
  align-items: flex-start;
  border-bottom-color: rgba(29, 29, 31, .06);
  background:
    linear-gradient(90deg, rgba(17, 17, 17, .18), transparent 44%),
    rgba(255, 255, 255, .68);
  backdrop-filter: blur(30px) saturate(1.35);
  -webkit-backdrop-filter: blur(30px) saturate(1.35);
}

.inspector-header::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(17, 17, 17, .8), rgba(29, 29, 31, .06), transparent);
}

.inspector-title {
  display: grid;
  gap: 5px;
  margin: 0;
  color: rgba(29, 29, 31, .92);
  font-size: 16px;
  line-height: 1;
  letter-spacing: -.018em;
}

.inspector-title::after {
  content: "Properties";
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgba(29, 29, 31, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  color: rgba(29, 29, 31, .46);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .02em;
}

.inspector-subtitle {
  max-width: 150px;
  min-height: 24px;
  margin-top: 1px;
  padding: 6px 9px;
  border: 1px solid rgba(29, 29, 31, .075);
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  color: rgba(29, 29, 31, .56);
  text-align: right;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.right.has-selection .inspector-subtitle {
  border-color: var(--accent-border);
  background: rgba(17, 17, 17, .28);
  color: rgba(29, 29, 31, .82);
}

.inspector-body {
  display: block;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  scrollbar-width: thin;
}

.inspector-body > .empty {
  margin: 0;
  min-height: 92px;
  display: grid;
  align-content: center;
  border-style: solid;
  border-color: rgba(29, 29, 31, .07);
  background:
    linear-gradient(135deg, rgba(17, 17, 17, .12), transparent 42%),
    rgba(255, 255, 255, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .68), 0 18px 36px rgba(15, 23, 42, .045);
}

#propsPanel {
  display: grid;
  gap: 10px;
}

.inspector-group {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(29, 29, 31, .065);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .58));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .76), 0 14px 30px rgba(15, 23, 42, .045);
}

.inspector-group::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: transparent;
  transition: background .2s var(--ease);
}

.right.has-selection #propsPanel .inspector-group:first-child::before,
.inspector-group:hover::before {
  background: var(--accent);
}

.inspector-group-title {
  min-height: 46px;
  padding: 0 12px 0 14px;
  cursor: pointer;
  user-select: none;
  color: rgba(29, 29, 31, .82);
  font-size: 12px;
  letter-spacing: .01em;
}

.inspector-group-title span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inspector-group-title span:first-child::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(29, 29, 31, .16);
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, .05);
}

.inspector-group:nth-child(1) .inspector-group-title span:first-child::before,
#propsPanel + .inspector-group .inspector-group-title span:first-child::before {
  background: var(--accent);
}

.inspector-toggle {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(29, 29, 31, .07);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: rgba(29, 29, 31, .52);
  background: rgba(255, 255, 255, .56);
  transition: transform .2s var(--ease), background .2s var(--ease);
}

.inspector-toggle svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  transform: rotate(90deg);
  transition: transform .2s var(--ease);
}

.inspector-group.collapsed .inspector-toggle svg {
  transform: rotate(0deg);
}

.inspector-group.collapsed .inspector-content {
  display: none;
}

.inspector-content {
  gap: 12px;
  padding: 0 12px 14px 14px;
}

.field-grid {
  gap: 9px;
}

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

.compact-field {
  position: relative;
}

.compact-field label {
  margin-bottom: 6px;
  color: rgba(29, 29, 31, .5);
  font-size: 10px;
  letter-spacing: .04em;
}

.compact-field input,
.compact-field select,
.compact-field textarea {
  min-height: 36px;
  border-color: rgba(29, 29, 31, .075);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .62));
  color: rgba(29, 29, 31, .9);
  font-size: 12px;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.compact-field input[type="color"] {
  height: 38px;
  padding: 3px;
  border-radius: 13px;
}

.compact-field textarea {
  min-height: 86px;
  line-height: 1.45;
}

.toggle-row {
  min-height: 58px;
  margin: 0;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(17, 17, 17, .14), rgba(255, 255, 255, .66));
  font-size: 12px;
}

.toggle-row input {
  width: 28px;
  height: 18px;
  appearance: none;
  border-radius: 999px;
  background: rgba(29, 29, 31, .18);
  position: relative;
  transition: background .18s var(--ease);
}

.toggle-row input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
  transition: transform .18s var(--ease);
}

.toggle-row input:checked {
  background: #111111;
}

.toggle-row input:checked::after {
  transform: translateX(10px);
}

.button-row {
  gap: 7px;
}

.mini-btn {
  min-height: 36px;
  border-color: rgba(29, 29, 31, .075);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .6));
  color: rgba(29, 29, 31, .74);
}

.mini-btn .ri {
  width: 15px;
  height: 15px;
  opacity: .78;
}

.mini-btn:hover {
  border-color: var(--accent-border);
  background: rgba(255, 255, 255, .94);
  color: rgba(29, 29, 31, .9);
}

.mini-btn.active {
  border-color: var(--accent-border);
  background: var(--accent);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 10px 20px var(--accent-shadow);
}

.mini-btn.active .ri {
  opacity: 1;
}

.inline-control {
  grid-template-columns: 58px minmax(0, 1fr) 44px;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid rgba(29, 29, 31, .06);
  border-radius: 14px;
  background: rgba(255, 255, 255, .5);
}

.inline-control output {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(29, 29, 31, .055);
  color: rgba(29, 29, 31, .74);
  font-size: 10px;
  font-weight: 760;
}

input[type="range"] {
  height: 4px;
}

.swatches {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.swatch {
  height: 28px;
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 1px rgba(29, 29, 31, .12), 0 5px 12px rgba(15, 23, 42, .06);
}

.background-color-panel {
  display: grid;
  gap: 12px;
}

.color-control {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 9px;
  border: 1px solid rgba(29, 29, 31, .08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(248, 248, 250, .7));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78);
}

.color-preview {
  position: relative;
  min-height: 54px;
  border: 1px solid rgba(29, 29, 31, .12);
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(29, 29, 31, .08) 25%, transparent 25% 75%, rgba(29, 29, 31, .08) 75%),
    linear-gradient(45deg, rgba(29, 29, 31, .08) 25%, transparent 25% 75%, rgba(29, 29, 31, .08) 75%);
  background-position: 0 0, 6px 6px;
  background-size: 12px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 8px 18px rgba(15, 23, 42, .06);
}

.color-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--preview-color, #ffffff);
}

.color-fields {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-content: stretch;
}

.color-hex {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(29, 29, 31, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .84);
  color: rgba(29, 29, 31, .88);
  padding: 0 10px;
  outline: none;
  font: 760 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.color-hex:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, .18);
}

.color-picker-shell {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(29, 29, 31, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
  display: grid;
  place-items: center;
  color: rgba(29, 29, 31, .7);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.color-picker-shell input[type="color"] {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.palette-label {
  color: rgba(29, 29, 31, .48);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.background-color-panel .swatches {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
  margin-top: 0;
}

.background-color-panel .swatch {
  position: relative;
  height: 31px;
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: 11px;
  box-shadow: 0 0 0 1px rgba(29, 29, 31, .11), 0 8px 15px rgba(15, 23, 42, .055);
}

.background-color-panel .swatch:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(29, 29, 31, .18), 0 10px 20px rgba(15, 23, 42, .08);
}

.background-color-panel .swatch.active {
  box-shadow: 0 0 0 2px #111111, 0 0 0 6px rgba(17, 17, 17, .2), 0 12px 22px rgba(15, 23, 42, .09);
}

.layers {
  max-height: 255px;
  gap: 8px;
}

.layer {
  min-height: 40px;
  border-radius: 13px;
  padding: 8px 9px 8px 11px;
}

.layer-type {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(29, 29, 31, .055);
  color: rgba(29, 29, 31, .48);
  font-size: 10px;
  text-transform: capitalize;
}

.layer.active .layer-type {
  background: rgba(255, 255, 255, .66);
  color: rgba(29, 29, 31, .72);
}

.right:not(.has-selection) #propsPanel {
  display: none;
}

/* Figma-like editor surface: fixed panels and quiet chrome. */
:root {
  --figma-bg: #f3f3f3;
  --figma-panel: #fbfbfb;
  --figma-panel-2: #f7f7f7;
  --figma-line: #e6e6e6;
  --figma-line-strong: #d4d4d4;
  --figma-text: #202124;
  --figma-muted: #737373;
  --figma-blue: #0d99ff;
  --figma-blue-soft: #e5f4ff;
  --figma-shadow: 0 18px 40px rgba(15, 23, 42, .12);
}

body {
  background: var(--figma-bg);
}

body::after,
.window-lights,
.brand-copy::before,
.stage-info span:first-child::before,
.inspector-header::after,
.inspector-group::before,
.inspector-group-title span:first-child::before,
.preset.active::after,
.layer.active::after {
  display: none;
}

.app {
  grid-template-rows: 48px minmax(0, 1fr);
  background: var(--figma-bg);
}

.topbar {
  padding: 0 12px;
  border-bottom: 1px solid var(--figma-line);
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.brand {
  min-width: 244px;
  align-items: center;
  gap: 10px;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.brand strong {
  color: var(--figma-text);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0;
}

.brand span,
.dim {
  color: var(--figma-muted);
  font-size: 11px;
  font-weight: 620;
}

.toolbar {
  margin-left: auto;
  padding: 0;
  gap: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.btn,
.icon-btn,
.field,
select,
input[type="color"] {
  min-height: 30px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--figma-text);
}

.btn,
.icon-btn {
  padding: 0 9px;
  font-size: 12px;
  font-weight: 650;
}

.icon-btn {
  width: 30px;
}

.field,
select {
  padding: 0 24px 0 8px;
  font-size: 12px;
  font-weight: 620;
}

.btn:hover,
.icon-btn:hover,
.preset:hover,
.layer:hover {
  border-color: transparent;
  background: #f1f1f1;
  box-shadow: none;
  transform: none;
}

.btn.primary {
  border-color: #0d99ff;
  background: #0d99ff;
  color: #ffffff;
  box-shadow: none;
}

.btn.primary:hover {
  border-color: #007be5;
  background: #007be5;
  color: #ffffff;
}

.workspace {
  grid-template-columns: 318px minmax(420px, 1fr) 280px;
  background: var(--figma-bg);
}

aside,
.left,
.right,
.quick-tools,
.tool-panel,
.stage-wrap,
.stage-info,
.inspector-header {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.left {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  border-right: 1px solid var(--figma-line);
  background: var(--figma-panel);
  overflow: hidden;
}

.quick-tools {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 4px;
  padding: 10px 7px;
  border-right: 1px solid var(--figma-line);
  background: #ffffff;
  overflow: auto;
}

.tool-chip {
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  padding: 5px 2px;
  color: #505050;
  font-size: 10px;
  font-weight: 650;
  gap: 3px;
  background: transparent;
}

.tool-chip strong {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: transparent;
  color: currentColor;
  box-shadow: none;
}

.tool-chip span {
  font-size: 10px;
  line-height: 1;
}

.tool-chip:hover,
.tool-chip.active {
  border-color: transparent;
  background: var(--figma-blue-soft);
  color: #096fb9;
  box-shadow: none;
}

.tool-chip.active strong {
  background: transparent;
  color: #096fb9;
  box-shadow: none;
}

.tool-panel {
  position: static;
  width: auto;
  max-height: none;
  min-height: 0;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  border: 0;
  border-radius: 0;
  background: var(--figma-panel);
  box-shadow: none;
  overflow: auto;
}

.tool-panel .section {
  padding: 14px 11px 16px;
}

.tool-panel > .section {
  display: none;
}

.tool-panel > .section.panel-active {
  display: block;
}

.tool-panel .add-subpanel {
  display: none;
}

.tool-panel .add-subpanel.panel-active {
  display: grid;
  gap: 8px;
}

.section {
  border-bottom: 1px solid var(--figma-line);
  background: transparent;
}

.section h2,
.element-title {
  margin-bottom: 12px;
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
}

#addSection > h2 {
  margin-bottom: 8px;
}

#addSection .element-group {
  margin-bottom: 14px;
}

#mascotPanel,
#logoSection {
  padding-top: 13px;
}

#mascotPanel .element-title,
#logoSection h2 {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 9px;
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 720;
}

.section h2 small {
  color: var(--figma-muted);
  font-size: 10px;
  font-weight: 600;
}

.search,
.control,
.field,
.compact-field input,
.compact-field select,
.compact-field textarea,
.color-hex {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f1f1f1;
  color: var(--figma-text);
  box-shadow: none;
  font-size: 12px;
  font-weight: 560;
  outline: 0;
}

.compact-field label,
.label,
.palette-label {
  margin-bottom: 5px;
  color: var(--figma-muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.search:focus,
.control:focus,
.field:focus,
select:focus,
.compact-field input:focus,
.compact-field select:focus,
.compact-field textarea:focus,
.color-hex:focus {
  border-color: var(--figma-blue);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(13, 153, 255, .16);
  outline: 0;
}

.preset-list {
  max-height: 310px;
  gap: 2px;
  margin-top: 9px;
  padding-right: 0;
}

.preset,
.layer,
.upload-card,
.element-card,
.font-tools,
.logo-item,
.custom-size-card,
.toggle-row,
.mini-btn,
.color-control {
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
}

.preset {
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 8px 9px;
}

.preset strong,
.layer {
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 620;
}

.preset span {
  color: var(--figma-muted);
  font-size: 10px;
}

.preset.active,
.layer.active,
.mini-btn.active {
  border-color: transparent;
  background: var(--figma-blue-soft);
  color: #096fb9;
  box-shadow: none;
}

.custom-size-card,
.font-tools,
.background-color-panel {
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--figma-line);
  border-radius: 8px;
  background: #ffffff;
}

.font-tools.needs-local-fonts,
.font-tools.is-reading-fonts {
  border-color: rgba(13, 153, 255, .38);
}

.font-tools.needs-local-fonts #localFontsBtn,
.font-tools.is-reading-fonts #localFontsBtn {
  background: var(--figma-blue-soft);
  color: #096fb9;
  animation: breathe 1.45s var(--ease) infinite;
}

.custom-size-card h3,
.font-tools-head strong {
  font-size: 12px;
  font-weight: 720;
}

.upload-card {
  min-height: 86px;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px dashed var(--figma-line-strong);
  background: #ffffff;
}

.upload-card #imageUploadMeta {
  font-size: 10px;
  line-height: 1.28;
}

.upload-icon,
.element-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #f1f1f1;
  color: var(--figma-text);
  box-shadow: none;
}

.element-grid {
  grid-template-columns: 1fr;
  gap: 4px;
}

.element-card {
  min-height: 50px;
  grid-template-columns: 34px 1fr;
  justify-items: start;
  gap: 9px;
  padding: 8px;
  text-align: left;
}

.element-card:hover,
.logo-item:hover,
.upload-card:hover {
  border-color: transparent;
  background: #f1f1f1;
  box-shadow: none;
  transform: none;
}

.logo-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: none;
  overflow: visible;
}

.logo-item {
  min-height: 68px;
  padding: 7px;
  border: 1px solid transparent;
  background: #ffffff;
}

.stage-wrap {
  grid-template-rows: 36px minmax(0, 1fr);
  min-width: 0;
  background: var(--figma-bg);
}

.stage-info {
  padding: 0 14px;
  border-bottom: 1px solid var(--figma-line);
  background: var(--figma-bg);
  color: var(--figma-muted);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0;
}

.stage-info span:first-child {
  color: var(--figma-text);
  font-weight: 650;
}

.stage {
  padding: 46px 56px;
  background: var(--figma-bg);
}

.canvas-shell {
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
  overflow: visible;
}

canvas {
  border-radius: 2px;
}

.selection-box {
  border: 1.5px solid var(--figma-blue);
  border-radius: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .82);
}

.selection-label {
  position: absolute;
  left: -1.5px;
  top: -24px;
  max-width: 180px;
  overflow: hidden;
  color: var(--figma-blue);
  font-size: 12px;
  font-weight: 720;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.selection-handle {
  min-width: 0;
  min-height: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  padding: 0;
  border: 1.5px solid var(--figma-blue);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  appearance: none;
}

.selection-handle[data-mode="resize"] {
  cursor: nwse-resize;
}

.selection-handle[data-mode="resize"][data-name="ne"],
.selection-handle[data-mode="resize"][data-name="sw"] {
  cursor: nesw-resize;
}

.selection-handle[data-mode="resize"]::before,
.selection-handle[data-mode="rotate"]::before {
  position: absolute;
  display: block;
  width: 18px;
  height: 18px;
  color: #111111;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .74);
  opacity: 0;
  transform: scale(.92);
  transition: opacity .12s ease, transform .12s ease;
}

.selection-handle[data-mode="resize"]::before {
  content: "⌟";
  left: 50%;
  top: 50%;
  margin: -9px 0 0 -9px;
}

.selection-handle[data-mode="resize"][data-name="nw"]::before { transform: rotate(180deg) scale(.92); }
.selection-handle[data-mode="resize"][data-name="ne"]::before { transform: rotate(-90deg) scale(.92); }
.selection-handle[data-mode="resize"][data-name="sw"]::before { transform: rotate(90deg) scale(.92); }

.selection-handle[data-mode="resize"][data-name="nw"]:hover::before,
.selection-handle[data-mode="resize"][data-name="nw"]:focus-visible::before { transform: rotate(180deg) scale(1); }
.selection-handle[data-mode="resize"][data-name="ne"]:hover::before,
.selection-handle[data-mode="resize"][data-name="ne"]:focus-visible::before { transform: rotate(-90deg) scale(1); }
.selection-handle[data-mode="resize"][data-name="sw"]:hover::before,
.selection-handle[data-mode="resize"][data-name="sw"]:focus-visible::before { transform: rotate(90deg) scale(1); }

.selection-handle[data-mode="resize"]:hover::before,
.selection-handle[data-mode="resize"]:focus-visible::before,
.selection-handle[data-mode="rotate"]:hover::before,
.selection-handle[data-mode="rotate"]:focus-visible::before {
  opacity: 1;
  transform: scale(1);
}

.selection-handle[data-mode="resize"][data-name="nw"]:hover::before,
.selection-handle[data-mode="resize"][data-name="nw"]:focus-visible::before { transform: rotate(180deg) scale(1); }
.selection-handle[data-mode="resize"][data-name="ne"]:hover::before,
.selection-handle[data-mode="resize"][data-name="ne"]:focus-visible::before { transform: rotate(-90deg) scale(1); }
.selection-handle[data-mode="resize"][data-name="sw"]:hover::before,
.selection-handle[data-mode="resize"][data-name="sw"]:focus-visible::before { transform: rotate(90deg) scale(1); }

.selection-handle[data-mode="rotate"] {
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: grab;
  opacity: 0;
  transition: opacity .12s ease;
}

.selection-handle[data-mode="rotate"]::before {
  content: "↻";
  left: 50%;
  top: 50%;
  margin: -9px 0 0 -9px;
}

.selection-handle[data-mode="rotate"]:hover,
.selection-handle[data-mode="rotate"]:focus-visible {
  opacity: 1;
}

.zoom-hud {
  right: 14px;
  bottom: 14px;
  min-height: 28px;
  border: 1px solid var(--figma-line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--figma-text);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .1);
}

.right {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  border-left: 1px solid var(--figma-line);
  background: var(--figma-panel);
  overflow: hidden;
}

.inspector-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 48px;
  padding: 0 14px;
  align-items: center;
  border-bottom: 1px solid var(--figma-line);
  background: #ffffff;
}

.inspector-title {
  display: block;
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0;
}

.inspector-title::after {
  display: none;
}

.inspector-subtitle {
  min-height: 0;
  max-width: 140px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--figma-muted);
  font-size: 11px;
  text-align: right;
}

.right.has-selection .inspector-subtitle {
  border-color: transparent;
  background: transparent;
  color: #096fb9;
}

.inspector-body {
  padding: 0;
  overflow: auto;
  background: var(--figma-panel);
}

.inspector-body > .empty {
  min-height: 84px;
  margin: 10px;
  border-style: solid;
  border-color: var(--figma-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
  color: var(--figma-muted);
  font-size: 12px;
}

#propsPanel {
  gap: 0;
}

.inspector-group {
  border: 0;
  border-bottom: 1px solid var(--figma-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.inspector-group-title {
  min-height: 40px;
  padding: 0 14px;
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0;
}

.inspector-toggle {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--figma-muted);
}

.inspector-toggle:hover {
  background: #eeeeee;
}

.inspector-content {
  gap: 9px;
  padding: 0 14px 12px;
}

#appearanceGroup .inspector-content {
  gap: 9px;
}

#appearanceGroup .inspector-content > * + * {
  margin-top: 0;
}

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

.inline-control {
  grid-template-columns: 50px minmax(0, 1fr) 38px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--figma-muted);
  font-size: 11px;
}

.inline-control output {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--figma-text);
  font-size: 11px;
  font-weight: 620;
}

.appearance-row {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  align-items: end;
  gap: 10px;
}

.appearance-color-field input[type="color"] {
  width: 34px;
  height: 30px;
  min-height: 30px;
  padding: 3px;
  border-radius: 6px;
  background: #f1f1f1;
}

.appearance-color-input {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 0;
  min-height: 30px;
  border-radius: 6px;
  background: #f1f1f1;
  overflow: hidden;
}

.appearance-color-input input[type="color"] {
  border-radius: 6px 0 0 6px;
  background: transparent;
}

.appearance-color-input input[type="text"] {
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 620;
  text-transform: uppercase;
}

.native-color-input {
  display: none;
}

.color-swatch-button {
  width: 34px;
  height: 30px;
  min-height: 30px;
  padding: 4px;
  border: 0;
  border-radius: 6px 0 0 6px;
  background: transparent;
  cursor: pointer;
}

.color-swatch-button::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: var(--field-color, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

.custom-color-popover {
  position: fixed;
  z-index: 1000;
  width: 272px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .2);
}

.custom-color-plane {
  position: relative;
  height: 148px;
  border-radius: 4px;
  background:
    linear-gradient(to top, #000000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #ffffff, var(--picker-hue, #ff0000));
  cursor: crosshair;
  overflow: hidden;
}

.custom-color-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .72);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.custom-color-controls {
  display: grid;
  grid-template-columns: 36px 36px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.custom-eyedropper-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: #f4f4f4;
  color: #111111;
  cursor: pointer;
}

.custom-eyedropper-btn:disabled {
  opacity: .36;
  cursor: not-allowed;
}

.custom-eyedropper-btn svg {
  width: 18px;
  height: 18px;
}

body.is-canvas-eyedropper canvas {
  cursor: crosshair;
}

.canvas-eyedropper-loupe {
  position: fixed;
  z-index: 1300;
  width: 132px;
  height: 132px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #111111;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .32), 0 0 0 1px rgba(0, 0, 0, .45);
  overflow: visible;
  pointer-events: none;
}

.canvas-eyedropper-loupe canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.canvas-eyedropper-label {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  min-width: max-content;
  max-width: 188px;
  padding: 5px 8px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .88);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .22);
}

.custom-color-preview {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}

.custom-hue-range {
  width: 100%;
  accent-color: #111111;
}

.custom-rgb-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.custom-rgb-row label {
  display: grid;
  gap: 4px;
  color: var(--figma-text);
  font-size: 11px;
  font-weight: 620;
  text-align: center;
}

.custom-rgb-row input {
  width: 100%;
  min-height: 34px;
  padding: 0 6px;
  border: 1px solid var(--figma-line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--figma-text);
  font-size: 14px;
  font-weight: 620;
  text-align: center;
}

.appearance-inline-control {
  grid-template-columns: 42px minmax(0, 1fr) 36px;
}

.appearance-number-control {
  grid-template-columns: 44px minmax(0, 1fr) 22px;
  align-items: center;
}

#overallOpacityControl {
  grid-template-columns: 72px minmax(0, 1fr) 22px;
}

.appearance-number-control input[type="number"] {
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: #f1f1f1;
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 620;
  text-align: right;
}

.appearance-number-control input[type="number"]::-webkit-inner-spin-button,
.appearance-number-control input[type="number"]::-webkit-outer-spin-button {
  opacity: 0;
}

.appearance-slider-number-control {
  grid-template-columns: 32px minmax(62px, 1fr) 48px 18px;
  align-items: center;
  gap: 7px;
  grid-column: 1 / -1;
}

.appearance-slider-number-control input[type="range"] {
  width: 100%;
  min-width: 0;
}

.appearance-slider-number-control input[type="number"] {
  min-height: 30px;
  width: 48px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: #f1f1f1;
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 620;
  text-align: right;
}

.appearance-slider-number-control input[type="number"]::-webkit-inner-spin-button,
.appearance-slider-number-control input[type="number"]::-webkit-outer-spin-button {
  opacity: 0;
}

.number-suffix {
  color: var(--figma-muted);
  font-size: 11px;
  font-weight: 620;
}

.appearance-gradient-panel {
  display: grid;
  gap: 9px;
}

.appearance-section {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.appearance-section summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 36px;
  padding: 0 9px 0 10px;
  border: 1px solid var(--figma-line);
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 620;
  list-style: none;
  cursor: pointer;
  border-radius: 8px;
  background: #f7f7f7;
  transition: background .14s ease, border-color .14s ease;
}

.appearance-section summary:hover {
  border-color: var(--figma-line-strong);
  background: #f1f1f1;
}

.appearance-section summary small {
  margin-left: 4px;
  color: var(--figma-muted);
  font-size: 10px;
  font-weight: 560;
}

.appearance-section[open] summary {
  border-color: rgba(13, 153, 255, .28);
  background: var(--figma-blue-soft);
  color: #096fb9;
}

.appearance-section[open] summary small {
  color: #096fb9;
}

.appearance-section summary::-webkit-details-marker {
  display: none;
}

.appearance-section-actions {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #ffffff;
  color: var(--figma-muted);
  font-size: 14px;
  font-weight: 720;
  line-height: 1;
}

.appearance-section-actions::before {
  content: "+";
}

.appearance-section[open] .appearance-section-actions {
  color: #096fb9;
}

.appearance-section[open] .appearance-section-actions::before {
  content: "−";
}

.appearance-section-body {
  display: grid;
  gap: 9px;
  padding-bottom: 0;
}

.toggle-row {
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  background: #f1f1f1;
  font-size: 12px;
  white-space: nowrap;
}

.toggle-row span,
.toggle-row input {
  flex: 0 0 auto;
}

.toggle-field .toggle-row {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0 8px;
  border-radius: 6px;
  background: #f1f1f1;
  box-shadow: none;
}

.toggle-field .toggle-row span {
  color: rgba(29, 29, 31, .9);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1;
}

.toggle-field .toggle-row input {
  width: 28px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: rgba(29, 29, 31, .18);
  box-shadow: none;
}

.toggle-field .toggle-row input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
  transition: transform .18s var(--ease);
}

.toggle-field .toggle-row input:checked {
  background: #111111;
}

.toggle-field .toggle-row input:checked::after {
  transform: translateX(10px);
}

.mini-btn {
  min-height: 30px;
  background: #f1f1f1;
  color: var(--figma-text);
  font-size: 11px;
  font-weight: 620;
}

.mini-btn:hover {
  border-color: transparent;
  background: #e9e9e9;
  color: var(--figma-text);
}

.background-color-panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.background-color-field {
  width: 100%;
}

.background-color-field .appearance-color-input {
  grid-template-columns: 34px minmax(0, 1fr);
}

.background-color-panel .swatches {
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.color-control {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  padding: 0;
  background: transparent;
}

.color-preview {
  min-height: 30px;
  border-radius: 6px;
  box-shadow: none;
}

.color-fields {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.color-picker-shell {
  border-color: transparent;
  border-radius: 6px;
  background: #f1f1f1;
  box-shadow: none;
  font-size: 11px;
}

.background-color-panel .swatches {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.background-color-panel .swatch {
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, .12);
  box-shadow: none;
}

.background-color-panel .swatch.active {
  box-shadow: 0 0 0 2px var(--figma-blue);
}

.layers {
  max-height: 220px;
  gap: 2px;
}

.layer {
  min-height: 30px;
  padding: 6px 7px;
  cursor: grab;
}

.layer-type {
  padding: 0;
  background: transparent;
  color: var(--figma-muted);
  font-size: 10px;
}

.prompt-generator {
  display: grid;
  gap: 10px;
}

.ai-block {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 8px;
  background: #ffffff;
}

.ai-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.ai-block-head strong {
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 720;
}

.ai-block-head span {
  min-width: 0;
  color: var(--figma-muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.ai-account-block {
  position: relative;
  background: #f7f7f7;
}

.ai-account-block .mini-btn {
  flex: 0 0 auto;
  min-height: 28px;
  padding-inline: 10px;
  white-space: nowrap;
}

.api-key-help {
  position: static;
  flex: 0 0 auto;
  min-width: 0;
}

.api-key-guide-popover {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  z-index: 30;
  width: auto;
  padding: 10px 11px;
  border: 1px solid rgba(29, 29, 31, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
  color: var(--figma-text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity .14s var(--ease), transform .14s var(--ease);
}

.api-key-help:hover .api-key-guide-popover,
.api-key-help:focus-within .api-key-guide-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.api-key-guide-popover strong {
  display: block;
  margin-bottom: 6px;
  color: var(--figma-text);
  font-size: 12px;
  font-weight: 720;
  white-space: normal;
}

.api-key-guide-popover ol {
  margin: 0;
  padding-left: 16px;
  color: var(--figma-muted);
  font-size: 11px;
  line-height: 1.55;
}

.api-key-guide-popover li {
  margin: 2px 0;
}

.compact-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--figma-muted);
  font-size: 11px;
  line-height: 1.35;
}

.compact-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.prompt-mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(0, 113, 227, .16);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(0, 113, 227, .08), rgba(0, 113, 227, .035));
}

.prompt-mode-row .mini-btn {
  min-width: 0;
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(29, 29, 31, .68);
  box-shadow: none;
  font-size: 11px;
  font-weight: 760;
}

.prompt-mode-row .mini-btn:hover {
  background: rgba(255, 255, 255, .56);
  color: var(--figma-text);
  box-shadow: none;
}

.prompt-mode-row .mini-btn.active {
  background: #ffffff;
  color: var(--figma-blue);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 0 0 1px rgba(0, 113, 227, .16);
}

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

.ai-generation-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-generation-actions .hidden + .mini-btn {
  grid-column: 1 / -1;
}

.ai-edit-block .ai-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-edit-block .ai-actions .hidden + .mini-btn {
  grid-column: 1 / -1;
}

.ai-edit-block textarea {
  min-height: 72px;
}

.seedream-edit-mode-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.seedream-edit-guide,
.seedream-edit-selection-status {
  margin: 0;
  color: var(--figma-muted);
  font-size: 11px;
  line-height: 1.55;
}

.seedream-edit-selection-status {
  padding: 8px 10px;
  border: 1px solid rgba(0, 113, 227, .14);
  border-radius: 8px;
  background: rgba(0, 113, 227, .045);
  color: rgba(29, 29, 31, .72);
}

.seedream-edit-selection-status.is-ready {
  border-color: rgba(31, 157, 85, .28);
  background: rgba(31, 157, 85, .07);
  color: #167244;
}

.seedream-edit-selection-status.is-error {
  border-color: rgba(217, 45, 32, .24);
  background: rgba(217, 45, 32, .06);
  color: #b42318;
}

.seedream-edit-selection-status.is-loading {
  border-color: rgba(0, 113, 227, .26);
  background: rgba(0, 113, 227, .07);
  color: #075fb8;
}

.seedream-edit-preview-field textarea {
  min-height: 104px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans Mono CJK SC", monospace;
  font-size: 10px;
  line-height: 1.5;
}

.seedream-edit-launcher {
  width: 100%;
  min-height: 42px;
  border-color: rgba(0, 113, 227, .28);
  background: linear-gradient(135deg, #0b79ed, #0057c8);
  color: #fff;
  box-shadow: 0 12px 24px rgba(0, 88, 199, .2), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.seedream-edit-launcher:hover {
  border-color: rgba(0, 113, 227, .5);
  background: linear-gradient(135deg, #1687f8, #075fcf);
  color: #fff;
}

.seedream-edit-launcher-status {
  min-height: 17px;
  margin: 0;
  color: var(--figma-muted);
  font-size: 11px;
  line-height: 1.5;
}

.seedream-edit-launcher-status.is-ready {
  color: #167244;
}

.seedream-edit-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 17, 20, .54);
  backdrop-filter: blur(10px) saturate(.85);
  animation: seedream-modal-fade-in .18s ease-out both;
}

.seedream-edit-workspace {
  position: relative;
  width: min(1180px, calc(100vw - 48px));
  height: min(780px, calc(100dvh - 48px));
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) 110px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: #111214;
  color: #f5f5f7;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, .38),
    0 8px 24px rgba(0, 0, 0, .2);
  animation: seedream-modal-rise-in .22s cubic-bezier(.2, .75, .25, 1) both;
}

@keyframes seedream-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes seedream-modal-rise-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.seedream-studio-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background: rgba(18, 19, 22, .94);
  backdrop-filter: blur(24px);
}

.seedream-studio-title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.seedream-studio-title > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.seedream-studio-title strong,
.seedream-studio-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seedream-studio-title strong {
  font-size: 14px;
  letter-spacing: -.01em;
}

.seedream-studio-title small {
  color: rgba(255, 255, 255, .5);
  font-size: 11px;
}

.seedream-studio-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #49a6ff, #0064d8 62%, #6138ff);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0, 100, 216, .28);
}

.seedream-studio-modes {
  width: min(440px, 40vw);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .07);
}

.seedream-studio-modes .mini-btn {
  color: rgba(255, 255, 255, .62);
}

.seedream-studio-modes .mini-btn:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.seedream-studio-modes .mini-btn.active {
  background: #fff;
  color: #076bd8;
}

.seedream-studio-close {
  justify-self: end;
  width: 36px;
  height: 36px;
  padding: 0;
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .07);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.seedream-studio-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.seedream-studio-stage {
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 34px;
  background:
    radial-gradient(circle at 50% 40%, rgba(66, 72, 82, .34), transparent 44%),
    linear-gradient(135deg, #17191d, #0e0f11);
}

.seedream-studio-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .12;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .1) 1px, transparent 1px);
  background-size: 24px 24px;
}

.seedream-studio-canvas {
  position: relative;
  z-index: 1;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
  border-radius: 6px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .16);
  overflow: hidden;
}

.seedream-studio-canvas img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, calc(100vw - 430px));
  max-height: calc(min(780px, 100dvh - 48px) - 242px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.seedream-studio-canvas canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: crosshair;
  touch-action: none;
}

.seedream-annotation-strip {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
  pointer-events: auto;
}

.seedream-annotation-strip::-webkit-scrollbar {
  display: none;
}

.seedream-annotation-chip {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 24px;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 5px 4px 6px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  background: rgba(20, 22, 26, .82);
  color: rgba(255, 255, 255, .76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 24px rgba(0, 0, 0, .2);
  backdrop-filter: blur(14px);
  animation: seedream-annotation-in .18s cubic-bezier(.2, .75, .25, 1) both;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.seedream-annotation-chip:hover,
.seedream-annotation-chip:focus-within {
  outline: none;
  border-color: rgba(88, 178, 255, .5);
  background: rgba(24, 31, 41, .92);
}

.seedream-annotation-chip.is-active {
  border-color: rgba(88, 178, 255, .84);
  background: rgba(15, 45, 76, .92);
  box-shadow: inset 0 0 0 1px rgba(88, 178, 255, .16), 0 8px 28px rgba(0, 84, 168, .22);
}

.seedream-annotation-chip.is-complete:not(.is-active) {
  opacity: .78;
}

.seedream-annotation-chip-select {
  display: grid;
  grid-template-columns: 20px auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.seedream-annotation-chip-number {
  position: relative;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1484ff;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.seedream-annotation-chip.is-complete .seedream-annotation-chip-number::after {
  content: "✓";
  position: absolute;
  margin: 17px 0 0 17px;
  width: 11px;
  height: 11px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(20, 22, 26, .9);
  border-radius: 50%;
  background: #1484ff;
  color: #fff;
  font-size: 7px;
  line-height: 1;
}

.seedream-annotation-chip code {
  font-size: 10px;
  white-space: nowrap;
}

.seedream-annotation-chip-remove {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, .54);
  font: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.seedream-annotation-chip-remove:hover,
.seedream-annotation-chip-remove:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.seedream-annotation-chip-remove:active {
  transform: scale(.92);
}

@keyframes seedream-annotation-in {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.seedream-studio-hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: min(680px, 80%);
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(15, 16, 18, .78);
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
}

.seedream-studio-inspector {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
  border-left: 1px solid rgba(255, 255, 255, .08);
  background: #f7f7f9;
  color: var(--ink);
}

.seedream-studio-inspector-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.seedream-studio-inspector-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.seedream-studio-inspector-head strong {
  font-size: 13px;
}

.seedream-studio-inspector-head > div {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.seedream-studio-inspector-head small {
  color: #1484ff;
  font-size: 10px;
  font-weight: 750;
}

.seedream-studio-inspector .seedream-edit-selection-status {
  font-size: 12px;
}

.seedream-studio-inspector .seedream-edit-preview-field textarea {
  min-height: 220px;
  resize: none;
}

.seedream-studio-facts {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.seedream-studio-facts strong,
.seedream-studio-facts code {
  color: var(--ink);
  font-size: 11px;
  text-align: right;
}

.seedream-studio-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 16px 22px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: #f7f7f9;
  color: var(--ink);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, .16);
}

.seedream-studio-prompt {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.seedream-studio-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.seedream-studio-prompt label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.seedream-studio-prompt-head span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 113, 227, .08);
  color: #0069d9;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .02em;
}

.seedream-studio-prompt textarea {
  width: 100%;
  min-height: 68px;
  max-height: 92px;
  padding: 12px 14px;
  border: 1px solid rgba(29, 29, 31, .14);
  border-radius: 12px;
  outline: none;
  resize: none;
  background: #fff;
  color: var(--ink);
  line-height: 1.5;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
}

.seedream-studio-prompt textarea:focus {
  border-color: rgba(0, 113, 227, .55);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .1);
}

.seedream-studio-prompt textarea:disabled {
  background: #ededf0;
  color: var(--muted);
  cursor: not-allowed;
}

.seedream-studio-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.seedream-studio-actions .btn {
  min-height: 44px;
  white-space: nowrap;
}

@media (max-width: 1000px) {
  .seedream-edit-modal-layer {
    padding: 12px;
  }

  .seedream-edit-workspace {
    width: calc(100vw - 24px);
    height: calc(100dvh - 24px);
  }

  .seedream-studio-body {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .seedream-studio-canvas img {
    max-height: calc(100dvh - 268px);
  }
}

@media (max-width: 760px) {
  .seedream-edit-modal-layer {
    padding: 0;
  }

  .seedream-edit-workspace {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .seedream-studio-header {
    grid-template-columns: 1fr auto;
    padding: 12px 14px;
  }

  .seedream-studio-modes {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .seedream-studio-close {
    grid-column: 2;
    grid-row: 1;
  }

  .seedream-studio-body {
    grid-template-columns: 1fr;
  }

  .seedream-studio-inspector {
    display: none;
  }

  .seedream-studio-canvas img {
    max-width: calc(100vw - 36px);
    max-height: calc(100dvh - 300px);
  }

  .seedream-studio-composer {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 14px;
  }

  .seedream-studio-actions {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .seedream-edit-modal-layer,
  .seedream-edit-workspace,
  .seedream-annotation-chip {
    animation: none;
  }
}

/* Professional control system — shared by every functional panel. */
:root {
  --control-surface: #f2f3f4;
  --control-surface-hover: #e9ebed;
  --control-surface-pressed: #e1e4e7;
  --control-border: #dfe1e4;
  --control-border-strong: #c9cdd2;
  --control-label: #6f747b;
  --control-blue: #2764dc;
  --control-blue-soft: #e8eefb;
  --control-danger: #c63d3d;
}

.compact-field,
.inline-control,
.appearance-row {
  min-width: 0;
}

.compact-field label,
.label,
.palette-label,
.text-control-label {
  margin-bottom: 5px;
  color: var(--control-label);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .01em;
}

.compact-field input,
.compact-field select,
.compact-field textarea,
.search,
.control,
.font-combobox-trigger {
  border: 1px solid transparent;
  background-color: var(--control-surface);
  color: #25282d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .48);
}

.compact-field input:hover,
.compact-field select:hover,
.compact-field textarea:hover,
.search:hover,
.control:hover,
.font-combobox-trigger:hover {
  border-color: var(--control-border);
  background-color: #f7f7f8;
}

.compact-field input:focus,
.compact-field select:focus,
.compact-field textarea:focus,
.search:focus,
.control:focus,
.font-combobox-trigger:focus-visible {
  border-color: #4d79d8;
  background-color: #ffffff;
  outline: 0;
  box-shadow: 0 0 0 2px rgba(39, 100, 220, .12), inset 0 1px 0 rgba(255, 255, 255, .7);
}

.right input[type="number"],
.right input[type="text"],
.right select,
.tool-panel input,
.tool-panel select,
.tool-panel textarea {
  font-variant-numeric: tabular-nums;
}

.right input[type="number"] {
  font-family: "Geist Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.right .field-grid,
.right .inspector-content {
  gap: 10px;
}

.right .compact-field input,
.right .compact-field select,
.right .compact-field textarea {
  min-height: 32px;
  border-radius: 7px;
}

.right .compact-field:focus-within label {
  color: #2459bd;
}

.right .button-row {
  gap: 6px;
}

.right .mini-btn {
  min-height: 32px;
  border-color: transparent;
  border-radius: 7px;
  background: var(--control-surface);
  color: #3e4248;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42);
}

.right .mini-btn:hover {
  border-color: var(--control-border);
  background: #f8f8f9;
}

.right .mini-btn.active {
  border-color: #c8d7f5;
  background: var(--control-blue-soft);
  color: #225bc7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}

.right .mini-btn:active:not(:disabled) {
  background: var(--control-surface-pressed);
}

.inspector-group-title {
  cursor: default;
}

.inspector-group-title[role="button"] {
  cursor: pointer;
}

.inspector-group-title[role="button"]:focus-visible {
  outline: 2px solid rgba(39, 100, 220, .28);
  outline-offset: -2px;
}

.inspector-toggle {
  display: grid;
  place-items: center;
}

.inspector-toggle svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.inline-control input[type="range"],
.custom-hue-range {
  height: 16px;
  margin: 0;
  appearance: none;
  background: transparent;
}

.inline-control input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: #d7dade;
  box-shadow: inset 0 1px 1px rgba(32, 36, 42, .08);
}

.inline-control input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  appearance: none;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--control-blue);
  box-shadow: 0 0 0 1px rgba(32, 36, 42, .16), 0 2px 5px rgba(32, 36, 42, .16);
}

.appearance-color-input {
  min-height: 32px;
  grid-template-columns: 36px minmax(0, 1fr);
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--control-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .46);
}

.appearance-color-input:hover {
  border-color: var(--control-border);
  background: #f8f8f9;
}

.appearance-color-input:focus-within {
  border-color: #4d79d8;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(39, 100, 220, .12);
}

.appearance-color-input input[type="text"] {
  min-height: 30px;
  padding-inline: 8px;
  font: 620 11px/1 "Geist Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: -.01em;
}

.color-swatch-button {
  width: 36px;
  height: 30px;
  min-height: 30px;
  padding: 5px;
  border-right: 1px solid rgba(32, 36, 42, .08);
  border-radius: 7px 0 0 7px;
}

.color-swatch-button:hover {
  background: rgba(255, 255, 255, .7);
}

.color-swatch-button::before {
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(32, 36, 42, .14), 0 1px 2px rgba(32, 36, 42, .08);
}

.appearance-number-control input[type="number"],
.appearance-slider-number-control input[type="number"] {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--control-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42);
}

.appearance-number-control input[type="number"]:hover,
.appearance-slider-number-control input[type="number"]:hover {
  border-color: var(--control-border);
  background: #f8f8f9;
}

.appearance-section {
  gap: 10px;
}

.appearance-section summary {
  min-height: 34px;
  padding: 0 7px 0 10px;
  border-color: transparent;
  border-radius: 7px;
  background: var(--control-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42);
}

.appearance-section summary:hover {
  border-color: var(--control-border);
  background: #f8f8f9;
}

.appearance-section[open] summary {
  border-color: #cad8f4;
  background: var(--control-blue-soft);
  color: #225bc7;
}

.appearance-section-actions {
  border: 1px solid rgba(32, 36, 42, .07);
  background: rgba(255, 255, 255, .72);
}

.toggle-row,
.toggle-field .toggle-row {
  min-height: 32px;
  border-radius: 7px;
  background: var(--control-surface);
}

.toggle-field .toggle-row input:checked {
  background: var(--control-blue);
}

.background-color-panel {
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.palette-label {
  margin: 2px 0 0;
}

.background-color-panel .swatches {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  margin-top: 0;
}

.background-color-panel .swatch {
  position: relative;
  height: 27px;
  border: 1px solid rgba(32, 36, 42, .15);
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3);
}

.background-color-panel .swatch:hover {
  border-color: rgba(32, 36, 42, .32);
  transform: translateY(-1px);
}

.background-color-panel .swatch.active {
  box-shadow: 0 0 0 2px #fafafa, 0 0 0 4px var(--control-blue);
}

.custom-color-popover {
  width: 292px;
  padding: 12px;
  border: 1px solid rgba(32, 36, 42, .14);
  border-radius: 12px;
  background: rgba(253, 253, 253, .98);
  box-shadow: 0 24px 60px rgba(27, 31, 37, .2), 0 3px 12px rgba(27, 31, 37, .1), inset 0 1px 0 rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  transform-origin: top right;
  animation: control-popover-in .16s var(--editor-ease) both;
}

.custom-color-head {
  min-height: 30px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.custom-color-head > div {
  display: grid;
  gap: 2px;
}

.custom-color-head span {
  color: #898d94;
  font-size: 9px;
  font-weight: 680;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.custom-color-head strong {
  color: #25282d;
  font-size: 12px;
  font-weight: 720;
}

.custom-color-head code {
  padding: 5px 7px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: #f3f4f5;
  color: #44484f;
  font: 620 10px/1 "Geist Mono", "SFMono-Regular", Consolas, monospace;
}

.custom-color-plane {
  height: 166px;
  border: 1px solid rgba(32, 36, 42, .14);
  border-radius: 8px;
  background:
    linear-gradient(to top, #121418, rgba(18, 20, 24, 0)),
    linear-gradient(to right, #ffffff, var(--picker-hue, #e14f4f));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.custom-color-cursor {
  width: 15px;
  height: 15px;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(18, 20, 24, .7), 0 2px 5px rgba(18, 20, 24, .22);
}

.custom-color-controls {
  grid-template-columns: 34px 34px minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.custom-eyedropper-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--control-border);
  border-radius: 7px;
  background: #f2f3f4;
  color: #34383e;
}

.custom-eyedropper-btn:hover {
  border-color: var(--control-border-strong);
  background: #ffffff;
}

.custom-color-preview {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(32, 36, 42, .16), 0 1px 2px rgba(32, 36, 42, .08);
}

.custom-hue-control {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 16px;
  align-content: center;
  gap: 2px;
}

.custom-hue-control > span {
  color: #858990;
  font-size: 9px;
  font-weight: 650;
}

.custom-hue-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e64c4c, #e5d24d, #54c86b, #4bc8c3, #4e75df, #a15bdb, #e64c4c);
  box-shadow: inset 0 0 0 1px rgba(32, 36, 42, .12);
}

.custom-hue-range::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -3px;
  appearance: none;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--picker-hue, #e14f4f);
  box-shadow: 0 0 0 1px rgba(32, 36, 42, .25), 0 2px 5px rgba(32, 36, 42, .18);
}

.custom-rgb-row {
  gap: 7px;
  margin-top: 11px;
}

.custom-rgb-row label {
  gap: 5px;
  color: #777b82;
  font-size: 9px;
  font-weight: 680;
}

.custom-rgb-row input {
  min-height: 32px;
  border-color: var(--control-border);
  border-radius: 7px;
  background: #f3f4f5;
  color: #292c31;
  font: 620 11px/1 "Geist Mono", "SFMono-Regular", Consolas, monospace;
}

.custom-rgb-row input:hover {
  border-color: var(--control-border-strong);
  background: #ffffff;
}

.custom-rgb-row input:focus {
  border-color: #4d79d8;
  background: #ffffff;
  outline: 0;
  box-shadow: 0 0 0 2px rgba(39, 100, 220, .12);
}

.custom-color-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px -12px -12px;
  padding: 8px 12px;
  border-top: 1px solid rgba(32, 36, 42, .08);
  border-radius: 0 0 12px 12px;
  background: #f7f7f8;
  color: #858990;
  font-size: 9px;
}

body.is-canvas-eyedropper::before {
  content: "点击画布采样 · Esc 取消";
  position: fixed;
  z-index: 1299;
  left: 50%;
  top: 66px;
  padding: 7px 10px;
  border: 1px solid rgba(32, 36, 42, .16);
  border-radius: 7px;
  background: rgba(253, 253, 253, .96);
  color: #34383e;
  box-shadow: 0 8px 22px rgba(27, 31, 37, .16);
  font-size: 10px;
  font-weight: 650;
  transform: translateX(-50%);
  pointer-events: none;
}

.canvas-eyedropper-loupe {
  width: 124px;
  height: 124px;
  border-color: #ffffff;
  background: #17191d;
  box-shadow: 0 12px 30px rgba(27, 31, 37, .28), 0 0 0 1px rgba(27, 31, 37, .42);
}

.canvas-eyedropper-label {
  bottom: -29px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  background: rgba(23, 25, 29, .92);
  font: 620 9px/1 "Geist Mono", "SFMono-Regular", Consolas, monospace;
}

#shapeTools .element-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

#shapeTools .element-card {
  min-height: 82px;
  grid-template-columns: 1fr;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 9px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f2f3f4;
  text-align: center;
}

#shapeTools .element-card:hover {
  border-color: var(--control-border);
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(27, 31, 37, .06);
  transform: translateY(-1px);
}

#shapeTools .element-icon {
  width: 34px;
  height: 34px;
  border: 0;
  background: #ffffff;
  color: #33373d;
  box-shadow: 0 0 0 1px var(--control-border);
}

#shapeTools .element-card > span:last-child {
  display: grid;
  gap: 2px;
}

#shapeTools .element-card strong {
  font-size: 11px;
}

#shapeTools .element-card > span:last-child > span {
  font-size: 9px;
}

#textTools .element-grid {
  gap: 3px;
}

#textTools .element-card,
.element-card {
  border: 1px solid transparent;
  border-radius: 8px;
}

#textTools .element-card:hover,
.element-card:hover {
  border-color: var(--control-border);
  background: #ffffff;
}

.upload-card {
  border-color: var(--control-border-strong);
  border-radius: 9px;
  background: #ffffff;
}

.upload-card:hover {
  border-color: #7b9bdc;
  background: #f8faff;
}

.upload-icon {
  border: 1px solid var(--control-border);
  background: #f2f3f4;
}

.font-tools,
.custom-size-card {
  border-color: var(--control-border);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(27, 31, 37, .025);
}

.font-combobox-trigger {
  min-height: 34px;
  border-radius: 7px;
}

.font-combobox-popover {
  padding: 7px;
  border-color: rgba(32, 36, 42, .14);
  border-radius: 10px;
  box-shadow: 0 18px 46px rgba(27, 31, 37, .18), 0 2px 8px rgba(27, 31, 37, .08);
}

.font-combobox-option {
  border-radius: 6px;
}

.font-combobox-option:hover,
.font-combobox-option.active {
  background: var(--control-blue-soft);
  color: #225bc7;
}

.ai-block {
  gap: 11px;
  padding: 12px;
  border-color: var(--control-border);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(27, 31, 37, .025);
}

.ai-account-block {
  background: #f7f7f8;
}

.ai-block-head {
  min-height: 25px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(32, 36, 42, .08);
}

.ai-block-head strong {
  font-size: 11px;
  font-weight: 720;
}

.prompt-mode-row {
  gap: 3px;
  padding: 3px;
  border-color: var(--control-border);
  border-radius: 8px;
  background: #eef0f2;
}

.prompt-mode-row .mini-btn.active {
  color: #225bc7;
  box-shadow: 0 1px 3px rgba(27, 31, 37, .09), inset 0 0 0 1px rgba(32, 36, 42, .05);
}

.seedream-edit-launcher {
  min-height: 38px;
  border-color: #2158c7;
  border-radius: 8px;
  background: var(--control-blue);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .17), 0 3px 8px rgba(39, 100, 220, .2);
}

.seedream-edit-launcher:hover {
  border-color: #1d4faf;
  background: #225ac8;
}

.generation-progress {
  border: 1px solid #cfdbf4;
  border-radius: 8px;
  background: #f4f7fd;
}

.generation-progress-bar {
  background: #dce5f7;
}

.generation-progress-fill {
  background: var(--control-blue);
}

.image-ai-panel {
  gap: 10px;
}

.image-ai-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.image-ai-actions .mini-btn:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.mask-edit-card {
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: #f7f7f8;
}

.mask-status,
.stock-status,
.prompt-status {
  border-radius: 7px;
  color: #777b82;
  font-size: 10px;
  line-height: 1.5;
}

.layers {
  gap: 3px;
  max-height: 240px;
  padding: 3px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: #f4f5f6;
}

.layer {
  min-height: 34px;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  padding: 6px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
}

.layer:hover {
  border-color: var(--control-border);
  background: #ffffff;
}

.layer.active {
  border-color: #cbd9f5;
  background: var(--control-blue-soft);
  color: #225bc7;
}

.layer-drag-handle {
  color: #a2a6ad;
  opacity: .35;
}

.layer:hover .layer-drag-handle,
.layer.active .layer-drag-handle {
  opacity: 1;
}

.layer-type {
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(32, 36, 42, .055);
  color: #7c8087;
  font: 620 8px/1 "Geist Mono", "SFMono-Regular", Consolas, monospace;
  text-transform: uppercase;
}

.layer.active .layer-type {
  background: rgba(39, 100, 220, .1);
  color: #225bc7;
}

.layers > .empty,
.stock-results > .empty,
.logo-list > .empty {
  border-color: var(--control-border);
  border-radius: 8px;
  background: #f7f7f8;
  color: #8a8e95;
}

@keyframes control-popover-in {
  from { opacity: 0; transform: translateY(-4px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1100px) {
  .custom-color-popover {
    width: 276px;
  }

  .custom-color-plane {
    height: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .custom-color-popover {
    animation: none;
  }
}

.prompt-generator .compact-field.output textarea {
  min-height: 190px;
}

.prompt-status {
  padding: 0 2px;
}

.tool-panel,
.tool-panel .section,
.prompt-generator,
.ai-block,
.ai-block-head,
.prompt-mode-row,
.prompt-actions,
.field-grid,
.compact-field {
  min-width: 0;
  max-width: 100%;
}

.tool-panel {
  overflow-x: hidden;
}

.prompt-generator *,
.prompt-generator *::before,
.prompt-generator *::after {
  box-sizing: border-box;
}

.prompt-generator .field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prompt-generator .compact-field input,
.prompt-generator .compact-field select,
.prompt-generator .compact-field textarea,
.prompt-generator .mini-btn {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.ai-block-head strong {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.ai-block-head .api-key-help {
  flex: 0 0 auto;
}

.ai-block-head .mini-btn {
  width: auto;
  max-width: 128px;
}

.ai-block-head span,
.prompt-status,
.compact-check span {
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .prompt-generator .field-grid,
  .prompt-mode-row,
  .ai-generation-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: 100dvh;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .left {
    grid-template-columns: 1fr;
    border-right: 0;
    border-bottom: 1px solid var(--figma-line);
  }

  .quick-tools {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--figma-line);
  }

  .tool-panel {
    max-height: none;
  }

  .right {
    border-left: 0;
    border-top: 1px solid var(--figma-line);
  }

  .stage {
    min-height: 520px;
    padding: 30px 18px;
  }
}

body.seedream-studio-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .seedream-studio-header .seedream-studio-modes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 2026 editor foundation — workflow hierarchy before decoration. */
:root {
  --figma-bg: #e9eaec;
  --figma-panel: #fafafa;
  --figma-panel-2: #f4f4f5;
  --figma-line: #e2e3e5;
  --figma-line-strong: #cfd1d4;
  --figma-text: #15171a;
  --figma-muted: #6d7178;
  --figma-blue: #2764dc;
  --figma-blue-soft: #eaf0fc;
  --figma-shadow: 0 18px 44px rgba(26, 31, 38, .14);
  --editor-ease: cubic-bezier(.2, .8, .2, 1);
}

body {
  color: var(--figma-text);
  font-family: "Geist", "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--figma-bg);
}

body::after {
  display: none;
}

button,
select,
input,
textarea {
  transition: color .14s var(--editor-ease), background-color .14s var(--editor-ease), border-color .14s var(--editor-ease), box-shadow .14s var(--editor-ease), opacity .14s var(--editor-ease), transform .14s var(--editor-ease);
}

button:active:not(:disabled) {
  transform: translateY(1px) scale(.985);
}

button:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.app {
  grid-template-rows: 52px minmax(0, 1fr);
  background: var(--figma-bg);
}

.topbar {
  position: relative;
  z-index: 20;
  gap: 18px;
  padding: 0 10px 0 14px;
  border-bottom-color: rgba(21, 23, 26, .1);
  background: rgba(252, 252, 252, .94);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .92), 0 6px 18px rgba(26, 31, 38, .035);
  backdrop-filter: blur(20px) saturate(1.16);
  -webkit-backdrop-filter: blur(20px) saturate(1.16);
}

.brand {
  min-width: 274px;
  gap: 9px;
}

.brand-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(21, 23, 26, .07), 0 3px 8px rgba(21, 23, 26, .09);
}

.brand-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 7px;
}

.brand strong {
  font-size: 12px;
  font-weight: 780;
  letter-spacing: -.01em;
}

.document-name {
  max-width: 116px;
  overflow: hidden;
  color: #4f5359 !important;
  font-size: 11px !important;
  font-weight: 650 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-name::before {
  content: "/";
  margin-right: 7px;
  color: #b4b7bc;
  font-weight: 500;
}

.document-size {
  min-width: max-content;
  padding: 3px 6px;
  border-radius: 5px;
  background: #f0f1f2;
  color: #72767d !important;
  font: 600 10px/1.2 "Geist Mono", "SFMono-Regular", Consolas, monospace !important;
}

.toolbar {
  min-width: 0;
  flex-wrap: nowrap;
  gap: 8px;
}

.toolbar-cluster {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(21, 23, 26, .075);
  border-radius: 8px;
  background: rgba(244, 245, 246, .86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78);
}

.file-cluster {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.toolbar .btn,
.toolbar .icon-btn,
.toolbar .field {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.toolbar .icon-btn {
  width: 29px;
  padding: 0;
}

.toolbar .icon-btn:hover,
.toolbar .btn:hover,
.toolbar .field:hover {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(21, 23, 26, .08);
}

.toolbar .field {
  padding-right: 25px;
  font-size: 11px;
}

#zoomSelect {
  width: 96px;
}

.export-scale-field {
  width: 53px;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  color: #757980;
  font-size: 10px;
  font-weight: 620;
  white-space: nowrap;
}

.save-state-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #309566;
  box-shadow: 0 0 0 3px rgba(48, 149, 102, .1);
}

.toolbar .btn.primary {
  min-height: 30px;
  padding-inline: 12px;
  border: 1px solid #2158c7;
  background: #2764dc;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 5px rgba(39, 100, 220, .22);
}

.toolbar .btn.primary:hover {
  border-color: #1e50b8;
  background: #235bc9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 3px 8px rgba(39, 100, 220, .28);
}

.workspace {
  grid-template-columns: 332px minmax(440px, 1fr) 304px;
}

.left {
  grid-template-columns: 60px minmax(0, 1fr);
  border-right-color: rgba(21, 23, 26, .1);
  background: #fafafa;
}

.quick-tools {
  gap: 3px;
  padding: 8px 6px;
  border-right-color: var(--figma-line);
  background: #f6f6f7;
  scrollbar-width: none;
}

.quick-tools::-webkit-scrollbar {
  display: none;
}

.tool-chip {
  min-height: 52px;
  gap: 3px;
  border-radius: 8px;
  color: #64686f;
}

.tool-chip::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 13px;
  bottom: 13px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--figma-blue);
  opacity: 0;
  transform: scaleY(.4);
  transition: opacity .16s var(--editor-ease), transform .16s var(--editor-ease);
}

.tool-chip strong {
  width: 27px;
  height: 27px;
  border-radius: 6px;
}

.tool-chip span {
  font-size: 10px;
  font-weight: 640;
}

.tool-chip:hover {
  background: #eceef1;
  color: #30343a;
}

.tool-chip.active {
  background: #e8eefb;
  color: #1f5dcc;
}

.tool-chip.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.tool-panel {
  background: #fafafa;
  scrollbar-color: #c8cbd0 transparent;
  scrollbar-width: thin;
}

.tool-panel .section {
  padding: 16px 14px 18px;
}

.tool-panel > .section > h2 {
  position: sticky;
  top: -16px;
  z-index: 3;
  min-height: 45px;
  margin: -16px -14px 12px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(21, 23, 26, .07);
  background: rgba(250, 250, 250, .95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.section h2,
.element-title,
#mascotPanel .element-title,
#logoSection h2 {
  color: #202329;
  font-size: 12px;
  font-weight: 740;
}

.section h2 small {
  padding: 3px 6px;
  border-radius: 5px;
  background: #eff0f1;
  color: #777b82;
  font-size: 9px;
}

.search,
.control,
.field,
.compact-field input,
.compact-field select,
.compact-field textarea,
.color-hex {
  min-height: 32px;
  border-color: #e7e8ea;
  background: #f1f2f3;
}

.compact-field input:hover,
.compact-field select:hover,
.compact-field textarea:hover,
.search:hover,
.control:hover {
  border-color: #d4d6d9;
  background: #f6f6f7;
}

.search:focus,
.control:focus,
.field:focus,
select:focus,
.compact-field input:focus,
.compact-field select:focus,
.compact-field textarea:focus,
.color-hex:focus {
  border-color: #4c79da;
  box-shadow: 0 0 0 2px rgba(39, 100, 220, .13);
}

.preset-list {
  gap: 3px;
}

.preset {
  position: relative;
  min-height: 50px;
  padding: 8px 10px;
  border-radius: 7px;
}

.preset:hover,
.element-card:hover,
.logo-item:hover {
  background: #eef0f2;
}

.preset.active,
.layer.active,
.mini-btn.active {
  background: #e7eefc;
  color: #1e5bc7;
}

.custom-size-card,
.font-tools,
.background-color-panel,
.ai-block {
  border-color: #e1e3e6;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(21, 23, 26, .025);
}

.stage-wrap {
  grid-template-rows: 38px minmax(0, 1fr);
  background: var(--figma-bg);
}

.stage-info {
  gap: 16px;
  padding: 0 13px;
  border-bottom-color: rgba(21, 23, 26, .09);
  background: #f5f5f6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .76);
}

.document-context {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.context-label {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid #d9dce0;
  border-radius: 5px;
  background: #ffffff;
  color: #62666d;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
}

#docInfo {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-hints {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #777b82 !important;
  font-size: 10px;
  font-weight: 560;
}

kbd {
  min-width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 4px;
  border: 1px solid #d6d8dc;
  border-bottom-color: #c5c8cd;
  border-radius: 4px;
  background: #ffffff;
  color: #54585f;
  font: 600 9px/1.4 "Geist Mono", "SFMono-Regular", Consolas, monospace;
  box-shadow: 0 1px 0 rgba(21, 23, 26, .06);
}

.stage {
  padding: 48px 60px 64px;
  background-color: var(--figma-bg);
  background-image: radial-gradient(circle, rgba(80, 85, 92, .17) .65px, transparent .75px);
  background-size: 16px 16px;
}

.canvas-shell {
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(21, 23, 26, .12), 0 20px 46px rgba(21, 23, 26, .13), 0 3px 10px rgba(21, 23, 26, .08);
  transition: box-shadow .2s var(--editor-ease);
}

.canvas-shell:focus-within {
  box-shadow: 0 0 0 1px rgba(39, 100, 220, .5), 0 22px 52px rgba(21, 23, 26, .15), 0 3px 10px rgba(21, 23, 26, .09);
}

.zoom-hud {
  right: 16px;
  bottom: 16px;
  min-height: 32px;
  gap: 2px;
  padding: 3px;
  border-color: rgba(21, 23, 26, .12);
  border-radius: 8px;
  background: rgba(252, 252, 252, .94);
  box-shadow: 0 8px 22px rgba(21, 23, 26, .13), inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: auto;
}

.zoom-control,
.zoom-value {
  min-height: 24px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #4f535a;
}

.zoom-control {
  width: 25px;
  padding: 0;
  font-size: 15px;
}

.zoom-value {
  min-width: 48px;
  padding: 0 7px;
}

.zoom-value strong {
  font: 650 10px/1 "Geist Mono", "SFMono-Regular", Consolas, monospace;
}

.zoom-control:hover,
.zoom-value:hover {
  background: #eceef1;
  color: #1f2328;
}

.right {
  grid-template-rows: 44px minmax(0, 1fr);
  border-left-color: rgba(21, 23, 26, .1);
  background: #fafafa;
}

.inspector-header {
  min-height: 44px;
  padding: 0 13px;
  border-bottom-color: var(--figma-line);
  background: #fdfdfd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.inspector-title {
  font-size: 12px;
  font-weight: 740;
}

.inspector-subtitle {
  max-width: 166px;
  padding: 3px 6px;
  border-radius: 5px;
  background: #f1f2f3;
  color: #73777e;
  font-size: 10px;
  font-weight: 620;
}

.right.has-selection .inspector-subtitle {
  background: #eaf0fc;
  color: #1f5dcc;
}

.inspector-body {
  background: #fafafa;
  scrollbar-color: #c8cbd0 transparent;
  scrollbar-width: thin;
}

.inspector-body > .empty.inspector-empty-state {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 34px 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

.inspector-empty-state strong {
  color: #34383e;
  font-size: 12px;
  font-weight: 700;
}

.inspector-empty-state > span:not(.empty-state-icon) {
  max-width: 220px;
  color: #858990;
  font-size: 11px;
  line-height: 1.55;
}

.inspector-empty-state small {
  margin-top: 7px;
  color: #94989f;
  font-size: 9px;
}

.empty-state-icon {
  position: relative;
  width: 42px;
  height: 42px;
  margin-bottom: 5px;
  border: 1px solid #d7d9dd;
  border-radius: 10px;
  background: #f3f4f5;
}

.empty-state-icon::before,
.empty-state-icon::after,
.empty-state-icon span {
  content: "";
  position: absolute;
  background: #ffffff;
  box-shadow: 0 0 0 1px #cfd2d7;
}

.empty-state-icon::before {
  inset: 10px 13px 12px 9px;
  transform: rotate(-5deg);
}

.empty-state-icon::after {
  inset: 12px 9px 9px 14px;
  transform: rotate(6deg);
}

.empty-state-icon span {
  z-index: 1;
  width: 6px;
  height: 6px;
  right: 7px;
  bottom: 7px;
  border-radius: 2px;
  background: #2764dc;
  box-shadow: 0 0 0 2px #ffffff;
}

.inspector-group {
  border-bottom-color: var(--figma-line);
}

.inspector-group-title {
  min-height: 38px;
  padding: 0 13px;
  font-weight: 700;
}

.inspector-group-title:hover {
  background: #f3f4f5;
}

.inspector-toggle {
  transition: transform .16s var(--editor-ease), background-color .14s var(--editor-ease);
}

.inspector-group.collapsed .inspector-toggle {
  transform: rotate(-90deg);
}

.inspector-content {
  padding: 1px 13px 13px;
}

.mini-btn {
  min-height: 31px;
  border: 1px solid #e4e5e7;
  background: #f1f2f3;
}

.mini-btn:hover {
  border-color: #d5d7da;
  background: #e9eaec;
}

.selection-box {
  border-color: #2764dc;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .82);
}

.selection-label {
  color: #215ac7;
  font-size: 11px;
  font-weight: 700;
}

.selection-handle {
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-color: #2764dc;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .85);
}

.onboarding-layer {
  background: rgba(31, 34, 39, .43);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.onboarding-card,
.dialog-card {
  border: 1px solid rgba(21, 23, 26, .11);
  border-radius: 12px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 24px 70px rgba(21, 23, 26, .22), inset 0 1px 0 rgba(255, 255, 255, .94);
}

@media (max-width: 1320px) {
  .save-state,
  .update-btn {
    display: none;
  }

  .brand {
    min-width: 244px;
  }

  .workspace {
    grid-template-columns: 318px minmax(420px, 1fr) 286px;
  }

  .stage-hints span:nth-child(3) {
    display: none;
  }
}

@media (max-width: 1160px) {
  .document-name,
  .stage-hints {
    display: none;
  }

  .brand {
    min-width: 158px;
  }

  .brand-copy {
    grid-template-columns: auto auto;
  }
}

@media (max-width: 1100px) {
  .topbar {
    min-height: 52px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .quick-tools {
    grid-template-columns: repeat(7, minmax(68px, 1fr));
  }

  .tool-chip::before {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: -1px;
    width: auto;
    height: 2px;
    transform: scaleX(.4);
  }

  .tool-chip.active::before {
    transform: scaleX(1);
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  body {
    overflow: hidden;
  }

  .app {
    height: 100dvh;
    min-height: 0;
  }

  .brand {
    min-width: 145px;
  }

  .workspace {
    grid-template-columns: 278px minmax(340px, 1fr) 250px;
  }

  .left {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    border-right: 1px solid rgba(21, 23, 26, .1);
    border-bottom: 0;
  }

  .quick-tools {
    grid-template-columns: 1fr;
    border-right: 1px solid var(--figma-line);
    border-bottom: 0;
  }

  .tool-chip::before {
    left: -6px;
    right: auto;
    top: 13px;
    bottom: 13px;
    width: 2px;
    height: auto;
    transform: scaleY(.4);
  }

  .tool-chip.active::before {
    transform: scaleY(1);
  }

  .tool-panel {
    max-height: none;
  }

  .stage {
    min-height: 0;
    padding: 36px 34px 54px;
  }

  .right {
    border-top: 0;
    border-left: 1px solid rgba(21, 23, 26, .1);
  }

  .update-btn,
  .save-state,
  .export-scale-field {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  select,
  input,
  textarea,
  .tool-chip::before,
  .inspector-toggle {
    transition-duration: .01ms !important;
  }
}

/* ================================================================
   Independent workbench + modal system
   A restrained, task-first visual language shared by all focused flows.
   ================================================================ */

.seedream-edit-modal-layer {
  padding: 20px;
  background: rgba(13, 15, 18, .72);
  backdrop-filter: blur(8px) saturate(.9);
}

.seedream-edit-workspace {
  width: min(1240px, calc(100vw - 40px));
  height: min(820px, calc(100dvh - 40px));
  grid-template-rows: 58px minmax(0, 1fr) 116px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: #17191d;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, .42),
    0 8px 24px rgba(0, 0, 0, .24);
}

.seedream-studio-header {
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 440px) minmax(220px, 1fr);
  min-width: 0;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: #17191d;
}

.seedream-studio-title {
  min-width: 0;
  gap: 10px;
}

.seedream-studio-title > span:last-child {
  min-width: 0;
}

.seedream-studio-title strong {
  color: rgba(255, 255, 255, .94);
  font-size: 13px;
  font-weight: 620;
  letter-spacing: -.01em;
}

.seedream-studio-title small {
  overflow: hidden;
  color: rgba(255, 255, 255, .5);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seedream-studio-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: #2457d6;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
  font-size: 13px;
  font-weight: 720;
}

.seedream-studio-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-self: center;
  width: min(100%, 404px);
  padding: 3px;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px;
  background: rgba(255, 255, 255, .045);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .14);
}

.seedream-studio-modes .mini-btn {
  min-height: 30px;
  flex: 1;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, .58);
  box-shadow: none;
  font-size: 12px;
  font-weight: 560;
}

.seedream-studio-modes .mini-btn:hover {
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .88);
}

.seedream-studio-modes .mini-btn.active {
  background: #f7f8fa;
  color: #17191d;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
}

.seedream-studio-modes .mini-btn:focus-visible,
.seedream-studio-close:focus-visible {
  outline: 2px solid #7aa7ff;
  outline-offset: 2px;
}

.seedream-studio-close {
  justify-self: end;
  width: 30px;
  height: 30px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, .58);
  box-shadow: none;
}

.seedream-studio-close:hover {
  border-color: rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.seedream-studio-body {
  grid-template-columns: minmax(0, 1fr) 312px;
  min-height: 0;
  background: #202226;
}

.seedream-studio-stage {
  isolation: isolate;
  min-width: 0;
  padding: 34px 34px 64px;
  background-color: #24262b;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .11) .7px, transparent .8px);
  background-size: 18px 18px;
}

.seedream-studio-stage::before {
  display: none;
}

.seedream-studio-canvas {
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 5px;
  background: #111317;
  box-shadow:
    0 16px 36px rgba(0, 0, 0, .34),
    0 2px 8px rgba(0, 0, 0, .28);
}

.seedream-studio-canvas img {
  max-width: min(100%, 820px);
  max-height: calc(100dvh - 286px);
}

.seedream-studio-canvas canvas {
  border-radius: 4px;
}

.seedream-studio-hint {
  bottom: 18px;
  max-width: calc(100% - 36px);
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 7px;
  background: rgba(20, 22, 26, .88);
  color: rgba(255, 255, 255, .66);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
  font-size: 11px;
  line-height: 1.45;
  backdrop-filter: blur(8px);
}

.seedream-annotation-strip {
  top: auto;
  left: 18px;
  right: 18px;
  bottom: 18px;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: rgba(20, 22, 26, .9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .26);
  backdrop-filter: blur(10px);
}

.seedream-annotation-chip {
  min-height: 34px;
  border-color: rgba(255, 255, 255, .1);
  border-radius: 7px;
  background: rgba(255, 255, 255, .055);
  color: rgba(255, 255, 255, .72);
  box-shadow: none;
}

.seedream-annotation-chip:hover,
.seedream-annotation-chip:focus-within {
  border-color: rgba(122, 167, 255, .5);
  background: rgba(255, 255, 255, .08);
  box-shadow: none;
}

.seedream-annotation-chip.is-active {
  border-color: #5f8fff;
  background: rgba(64, 112, 230, .2);
  box-shadow: 0 0 0 1px rgba(95, 143, 255, .12);
}

.seedream-annotation-chip-number {
  border-radius: 5px;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .86);
}

.seedream-annotation-chip.is-active .seedream-annotation-chip-number {
  background: #3c6fe4;
  color: #fff;
}

.seedream-studio-inspector {
  width: 312px;
  min-width: 0;
  padding: 0;
  gap: 0;
  overflow-y: auto;
  border-left: 1px solid rgba(21, 23, 26, .12);
  background: #fbfbfc;
  color: #202228;
}

.seedream-studio-inspector-head {
  min-height: 66px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.seedream-studio-inspector-head span {
  color: #7a7f89;
  font-size: 10px;
  font-weight: 680;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.seedream-studio-inspector-head strong {
  color: #1c1e23;
  font-size: 12px;
  font-weight: 620;
}

.seedream-studio-inspector-head small {
  padding: 2px 6px;
  border: 1px solid #dfe3e8;
  border-radius: 5px;
  background: #f7f8fa;
  color: #626771;
  font-size: 10px;
  font-weight: 560;
}

.seedream-studio-inspector .seedream-edit-selection-status {
  position: relative;
  margin: 0;
  padding: 13px 16px 13px 32px;
  border: 0;
  border-bottom: 1px solid #e7e9ed;
  border-radius: 0;
  background: #f6f8fb;
  color: #555b66;
  font-size: 11px;
  line-height: 1.55;
}

.seedream-studio-inspector .seedream-edit-selection-status::before {
  position: absolute;
  top: 18px;
  left: 17px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #858b95;
  content: "";
}

.seedream-studio-inspector .seedream-edit-selection-status.is-ready::before {
  background: #27805b;
}

.seedream-studio-inspector .seedream-edit-selection-status.is-error::before {
  background: #c64646;
}

.seedream-studio-inspector .seedream-edit-selection-status.is-loading::before {
  background: #356ee4;
  animation: focused-status-pulse 1.2s ease-in-out infinite;
}

.seedream-studio-inspector .seedream-edit-preview-field {
  padding: 16px;
  border-bottom: 1px solid #e7e9ed;
}

.seedream-studio-inspector .seedream-edit-preview-field label {
  margin-bottom: 7px;
  color: #565c66;
  font-size: 11px;
  font-weight: 620;
}

.seedream-studio-inspector .seedream-edit-preview-field textarea {
  min-height: 142px;
  padding: 10px 11px;
  border: 1px solid #dcdfe5;
  border-radius: 7px;
  background: #fff;
  color: #31353c;
  box-shadow: inset 0 1px 2px rgba(20, 23, 28, .035);
  font-size: 11px;
  line-height: 1.6;
}

.seedream-studio-facts {
  margin: 0;
  padding: 14px 16px;
  gap: 9px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #777c86;
  font-size: 10px;
}

.seedream-studio-facts strong,
.seedream-studio-facts code {
  justify-self: end;
  color: #30343a;
  font-size: 10px;
  font-weight: 590;
}

.seedream-studio-composer {
  min-width: 0;
  padding: 14px 16px;
  gap: 14px;
  border-top: 1px solid #dfe2e7;
  background: #fbfbfc;
  box-shadow: 0 -8px 28px rgba(18, 21, 26, .045);
}

.seedream-studio-prompt-head {
  margin-bottom: 6px;
}

.seedream-studio-prompt label {
  color: #25282e;
  font-size: 11px;
  font-weight: 640;
}

.seedream-studio-prompt-head span {
  padding: 2px 6px;
  border: 1px solid #dfe3e8;
  border-radius: 5px;
  background: #f4f5f7;
  color: #656a74;
  font-size: 10px;
}

.seedream-studio-prompt textarea {
  min-height: 64px;
  padding: 10px 11px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  background: #fff;
  color: #24272c;
  box-shadow: inset 0 1px 2px rgba(20, 23, 28, .035);
  font-size: 12px;
  line-height: 1.5;
}

.seedream-studio-prompt textarea:hover {
  border-color: #bbc1ca;
}

.seedream-studio-prompt textarea:focus {
  border-color: #3972e8;
  box-shadow: 0 0 0 3px rgba(57, 114, 232, .12);
}

.seedream-studio-prompt textarea:disabled {
  border-color: #e2e5e9;
  background: #f2f3f5;
  color: #9398a1;
}

.seedream-studio-actions {
  align-self: end;
  padding-bottom: 1px;
  gap: 7px;
}

.seedream-studio-actions .btn {
  min-height: 34px;
  border-radius: 7px;
}

.seedream-studio-actions .btn.primary {
  min-width: 92px;
  border-color: #2457d6;
  background: #2457d6;
  box-shadow: 0 1px 2px rgba(16, 43, 112, .2);
}

.seedream-studio-actions .btn.primary:hover {
  border-color: #1949c3;
  background: #1949c3;
}

@keyframes focused-status-pulse {
  0%, 100% { opacity: .45; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1); }
}

/* Dialogs: explicit hierarchy, predictable choices and visible focus. */
.dialog-layer {
  padding: 24px;
  background: rgba(20, 22, 26, .36);
  backdrop-filter: blur(10px) saturate(.9);
}

.dialog-card {
  width: min(440px, calc(100vw - 48px));
  padding: 20px;
  border: 1px solid rgba(30, 34, 40, .12);
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 24px 64px rgba(19, 23, 30, .2),
    0 5px 16px rgba(19, 23, 30, .1);
}

.dialog-head {
  align-items: center;
  gap: 11px;
}

.dialog-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid #dfe3e8;
  border-radius: 9px;
  background: #f5f6f8;
  color: #343941;
  box-shadow: none;
}

.dialog-title {
  color: #202329;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.dialog-message {
  margin-top: 14px;
  color: #666c76;
  font-size: 12px;
  line-height: 1.65;
}

.dialog-actions {
  margin-top: 20px;
  gap: 8px;
}

.dialog-actions .btn {
  min-height: 34px;
  border-radius: 7px;
}

.dialog-actions .btn:focus-visible {
  outline: 2px solid rgba(48, 105, 224, .72);
  outline-offset: 2px;
}

.dialog-card.is-danger .dialog-mark {
  border-color: #f1cccc;
  background: #fff3f3;
  color: #b83e3e;
}

.dialog-card.is-export-dialog {
  position: relative;
  width: min(520px, calc(100vw - 48px));
  padding: 22px;
}

.dialog-card.is-export-dialog::after {
  position: absolute;
  top: 26px;
  right: 22px;
  color: #969ba4;
  content: "Esc 关闭";
  font-size: 10px;
  font-weight: 520;
}

.dialog-card.is-export-dialog .dialog-message {
  max-width: 410px;
  margin-bottom: 2px;
  padding-right: 8px;
}

.dialog-card.is-export-dialog .dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  margin-top: 18px;
  gap: 8px;
}

.dialog-card.is-export-dialog .dialog-actions .btn {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 58px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: 10px 13px;
  border-color: #dde1e7;
  border-radius: 8px;
  background: #fff;
  color: #262a31;
  box-shadow: 0 1px 2px rgba(20, 23, 28, .025);
  font-size: 12px;
  font-weight: 640;
  text-align: left;
}

.dialog-card.is-export-dialog .dialog-actions .btn:hover {
  border-color: #aeb7c5;
  background: #f8f9fb;
  box-shadow: 0 2px 5px rgba(20, 23, 28, .06);
  transform: translateY(-1px);
}

.dialog-card.is-export-dialog .dialog-actions .btn:focus-visible {
  border-color: #356ee4;
  box-shadow: 0 0 0 3px rgba(53, 110, 228, .12);
  outline: none;
}

.dialog-card.is-export-dialog .dialog-actions .btn::after {
  display: block;
  margin-top: 3px;
  color: #838994;
  font-size: 10px;
  font-weight: 440;
  line-height: 1.3;
}

#exportYoudesignChoiceBtn {
  border-color: #aebde3;
  background: #f5f8ff;
  color: #214da7;
}

#exportYoudesignChoiceBtn::after {
  content: "工程文件 · 可再次导入编辑";
}

#exportSvgChoiceBtn::after {
  content: "矢量文件 · 保留文字和图形";
}

.is-export-dialog #appDialogConfirm::after {
  content: "图片文件 · 支持透明背景";
}

.is-export-dialog #appDialogCancel::after {
  content: "图片文件 · 适合照片发布";
}

/* Onboarding: progress is legible and the next action always wins. */
.onboarding-layer {
  isolation: isolate;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.onboarding-spotlight {
  z-index: 1;
  border: 1px solid rgba(88, 133, 230, .9);
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px rgba(18, 21, 26, .58),
    0 0 0 4px rgba(65, 112, 218, .13),
    0 10px 28px rgba(20, 24, 31, .12);
}

.onboarding-card {
  z-index: 2;
  width: min(408px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid rgba(30, 34, 40, .14);
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 24px 60px rgba(15, 19, 25, .24),
    0 4px 14px rgba(15, 19, 25, .12);
}

.onboarding-kicker {
  margin-bottom: 7px;
  color: #3563c4;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.onboarding-title {
  color: #22252b;
  font-size: 16px;
  font-weight: 660;
  letter-spacing: -.012em;
}

.onboarding-text {
  min-height: 52px;
  margin-top: 8px;
  color: #636974;
  font-size: 12px;
  line-height: 1.65;
}

.onboarding-dots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  margin-top: 16px;
  gap: 5px;
}

.onboarding-dot {
  width: auto;
  height: 3px;
  min-height: 3px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: #e2e5e9;
  box-shadow: none;
}

.onboarding-dot:hover {
  background: #c7ccd4;
}

.onboarding-dot.active {
  width: auto;
  background: #356ee4;
  transform: none;
}

.onboarding-dot:focus-visible {
  outline: 2px solid rgba(53, 110, 228, .55);
  outline-offset: 3px;
}

.onboarding-actions {
  margin-top: 16px;
  padding-top: 14px;
  gap: 7px;
  border-top: 1px solid #eceef1;
}

.onboarding-actions .btn {
  min-height: 33px;
  border-radius: 7px;
}

.onboarding-actions #onboardingSkipBtn {
  margin-right: auto;
  border-color: transparent;
  background: transparent;
  color: #777d87;
  box-shadow: none;
}

.onboarding-actions #onboardingSkipBtn:hover {
  background: #f2f3f5;
  color: #3f444c;
}

@media (max-width: 1000px) {
  .seedream-edit-workspace {
    grid-template-rows: 56px minmax(0, 1fr) 126px;
  }

  .seedream-studio-header {
    grid-template-columns: minmax(180px, 1fr) minmax(300px, 380px) 40px;
  }

  .seedream-studio-body {
    grid-template-columns: minmax(0, 1fr) 276px;
  }

  .seedream-studio-inspector {
    width: 276px;
  }

  .seedream-studio-stage {
    padding: 26px 24px 60px;
  }
}

@media (max-width: 760px) {
  .seedream-edit-modal-layer {
    padding: 0;
  }

  .seedream-edit-workspace {
    width: 100vw;
    height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border: 0;
    border-radius: 0;
  }

  .seedream-studio-header {
    grid-template-columns: minmax(0, 1fr) 36px;
    grid-template-rows: 52px 42px;
    padding: 0 12px;
  }

  .seedream-studio-modes {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin-bottom: 6px;
  }

  .seedream-studio-close {
    grid-column: 2;
    grid-row: 1;
  }

  .seedream-studio-body {
    display: block;
    overflow-y: auto;
  }

  .seedream-studio-stage {
    min-height: 58dvh;
    padding: 20px 16px 60px;
  }

  .seedream-studio-canvas img {
    max-height: 50dvh;
  }

  .seedream-studio-inspector {
    width: 100%;
    border-top: 1px solid #dfe2e7;
    border-left: 0;
  }

  .seedream-studio-composer {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
    gap: 8px;
  }

  .seedream-studio-actions {
    align-self: stretch;
    justify-content: flex-end;
  }

  .dialog-card.is-export-dialog .dialog-actions {
    grid-template-columns: 1fr;
  }

  .dialog-card.is-export-dialog::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .seedream-studio-inspector .seedream-edit-selection-status.is-loading::before {
    animation: none;
  }
}

/* Keep the visible image and its interaction canvas on the exact same box. */
.seedream-studio-canvas {
  box-sizing: content-box;
  max-width: none;
  max-height: none;
}

.seedream-studio-canvas img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}
