@font-face {
  font-family: "Mushin";
  src: url("./assets/fonts/mushin.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Zhaizai Marker";
  src: url("./assets/fonts/zhaizai-marker.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Fusion Pixel SC";
  src: url("./assets/fonts/fusion-pixel-sc.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Fusion Pixel JP";
  src: url("./assets/fonts/fusion-pixel-jp.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Wafu Pop";
  src: url("./assets/fonts/wafu-pop.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Darts Font";
  src: url("./assets/fonts/darts-font.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Nagino";
  src: url("./assets/fonts/nagino.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Mushin Mobile";
  src: url("./assets/fonts/mushin-mobile.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Zhaizai Marker Mobile";
  src: url("./assets/fonts/zhaizai-marker-mobile.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Fusion Pixel SC Mobile";
  src: url("./assets/fonts/fusion-pixel-sc-mobile.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Fusion Pixel JP Mobile";
  src: url("./assets/fonts/fusion-pixel-jp-mobile.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.text-font-system {
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif !important;
}

.text-font-mushin {
  font-family: "Mushin", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif !important;
}

.text-font-zhaizai-marker {
  font-family: "Zhaizai Marker", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif !important;
}

.text-font-fusion-pixel-sc {
  font-family: "Fusion Pixel SC", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif !important;
}

.text-font-fusion-pixel-jp {
  font-family: "Fusion Pixel JP", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif !important;
}

.text-font-wafu-pop {
  font-family: "Wafu Pop", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif !important;
}

.text-font-darts-font {
  font-family: "Darts Font", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif !important;
}

.text-font-nagino {
  font-family: "Nagino", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif !important;
}

@media (max-width: 760px), (min-width: 761px) and (max-width: 1180px) and (orientation: portrait) {
  .text-font-mushin {
    font-family: "Mushin Mobile", "Mushin", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif !important;
  }

  .text-font-zhaizai-marker {
    font-family: "Zhaizai Marker Mobile", "Zhaizai Marker", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif !important;
  }

  .text-font-fusion-pixel-sc {
    font-family: "Fusion Pixel SC Mobile", "Fusion Pixel SC", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif !important;
  }

  .text-font-fusion-pixel-jp {
    font-family: "Fusion Pixel JP Mobile", "Fusion Pixel JP", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", sans-serif !important;
  }
}

.font-warmup-probe {
  position: fixed;
  left: -9999px;
  top: -9999px;
  z-index: -1;
  width: auto;
  height: auto;
  opacity: 0.01;
  pointer-events: none;
  font-size: 32px;
  line-height: 1;
  white-space: nowrap;
}

:root {
  --bg-0: #f7f2f6;
  --bg-1: #f3e8ee;
  --panel: rgba(255, 250, 253, 0.82);
  --panel-strong: rgba(255, 248, 252, 0.94);
  --line: rgba(50, 33, 46, 0.14);
  --line-strong: rgba(50, 33, 46, 0.22);
  --text: #211722;
  --muted: rgba(33, 23, 34, 0.62);
  --accent-dark: #1a121a;
  --accent-mid: #4a2f45;
  --accent-soft: #e2bfd0;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --fs-xxs: 11px;
  --fs-xs: 12px;
  --fs-sm: 12.5px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --border-1: 1px;
  --shadow-soft: 0 12px 30px rgba(56, 36, 54, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at 10% 12%, rgba(239, 213, 230, 0.44) 0%, transparent 38%),
    radial-gradient(circle at 84% 18%, rgba(229, 198, 221, 0.38) 0%, transparent 42%),
    linear-gradient(145deg, var(--bg-0) 0%, var(--bg-1) 100%);
}

body::before {
  content: "UX LAB";
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9999;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(65, 39, 60, 0.2);
  background: rgba(33, 22, 32, 0.78);
  color: #fff4fb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  pointer-events: none;
  box-shadow: 0 8px 28px rgba(39, 24, 37, 0.16);
}

html.tablet-landscape-locked,
html.tablet-landscape-locked body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f7f1f6;
}

html.tablet-landscape-locked body::before {
  content: "请将 iPad 旋转为竖屏使用";
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #241825;
  font-size: 20px;
  font-weight: 760;
  line-height: 1.45;
  text-align: center;
  background:
    radial-gradient(circle at 28% 26%, rgba(251, 234, 244, 0.86) 0%, transparent 42%),
    radial-gradient(circle at 74% 76%, rgba(239, 208, 227, 0.72) 0%, transparent 44%),
    linear-gradient(145deg, #f8f2f6 0%, #f1e4eb 100%);
}

html.tablet-landscape-locked body::after {
  content: "当前版本已锁定移动端竖屏布局，避免横屏控制器错位。";
  position: fixed;
  left: 24px;
  right: 24px;
  top: calc(50% + 42px);
  z-index: 10000;
  color: rgba(35, 28, 34, 0.54);
  font-size: 14px;
  font-weight: 520;
  line-height: 1.5;
  text-align: center;
}

html.tablet-landscape-locked .studio-shell,
html.tablet-landscape-locked .export-modal {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

.studio-shell {
  height: 100dvh;
  padding: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: 96px 320px minmax(560px, 1fr) 340px;
}

.studio-shell > * {
  min-height: 0;
  height: 100%;
}

.panel {
  border: var(--border-1) solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.SidebarNav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 10px;
}

.brand-block {
  width: 100%;
  border: var(--border-1) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  padding: 10px 10px;
  text-align: center;
  overflow: hidden;
  container-type: inline-size;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
  margin: -2px auto 2px;
  animation: logoFloat 2.6s ease-in-out infinite;
}

.brand-block h1 {
  margin: 0;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  font-weight: 700;
}

.brand-title {
  margin: -1px 0 0;
  display: grid;
  gap: 2px;
  justify-items: center;
  font-size: clamp(15px, 1.2vw, 20px);
  font-weight: 760;
  line-height: 1.1;
  letter-spacing: 0.14em;
}

.brand-title > span {
  display: block;
  width: 3.6em;
  text-align: center;
  white-space: nowrap;
}

.brand-block p {
  margin: 4px 0 0;
  font-size: var(--fs-xxs);
  color: var(--muted);
  line-height: 1.3;
}

.brand-subtitle {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 9px auto 0;
  overflow: visible;
  white-space: nowrap;
  text-overflow: clip;
  padding: 0;
  box-sizing: border-box;
  text-align: center;
  line-height: 1.25;
  min-height: 1.25em;
  font-size: clamp(9px, 11cqw, 12px);
  letter-spacing: 0.01em;
  transform: translateX(-4px);
}

.brand-subtitle::after {
  content: "|";
  margin-left: 1px;
  vertical-align: baseline;
  color: rgba(33, 23, 34, 0.55);
  animation: cursorBlink 0.8s steps(1, end) infinite;
}

.nav-list {
  width: 100%;
  display: grid;
  gap: 8px;
}

.nav-item {
  border: var(--border-1) solid var(--line);
  background: var(--panel-strong);
  border-radius: 16px;
  min-height: 64px;
  padding: 6px;
  color: var(--text);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.nav-item:hover {
  transform: translateY(-1px);
  background: #fff9fd;
  border-color: var(--line-strong);
}

.nav-item.active {
  background: linear-gradient(150deg, #261b26, #1a121a);
  color: #fceef7;
  border-color: transparent;
}

.nav-item.active:hover {
  background: linear-gradient(150deg, #3a2738, #241925);
  color: #fff3fa;
  border-color: rgba(255, 226, 243, 0.28);
}

.nav-icon {
  font-size: var(--fs-md);
  line-height: 1;
}

.nav-label {
  font-size: var(--fs-xxs);
  letter-spacing: 0.06em;
  font-weight: 650;
}

.ContentPanel,
.PropertyPanel {
  overflow: auto;
  padding: 12px;
}

.PropertyPanel .panel-title {
  font-size: 12px;
  line-height: 1.15;
}

.PropertyPanel .sub-note {
  font-size: 11px;
  line-height: 1.25;
}

.PropertyPanel .prop-block {
  border-radius: 14px;
  padding: 10px 12px;
}

.PropertyPanel .control-stack {
  gap: 8px;
}

.PropertyPanel .control-item {
  gap: 4px;
}

.control-item.slider-control {
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.PropertyPanel .control-item label {
  font-size: 11px;
  line-height: 1.1;
}

.PropertyPanel input[type="range"] {
  min-height: 16px;
}

.panel-title {
  margin: 0;
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  font-weight: 700;
  color: rgba(30, 20, 29, 0.86);
}

.sub-note {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.45;
}

.tool-pane {
  display: none;
  gap: 10px;
}

.tool-pane.active {
  display: grid;
}

.card-block,
.prop-block {
  margin-top: 8px;
  border: var(--border-1) solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px;
  background: var(--panel-strong);
}

.prop-block h3,
.field-title {
  margin: 0 0 6px;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: rgba(33, 23, 34, 0.74);
  font-weight: 650;
}

input[type="file"] {
  width: 100%;
  min-height: 48px;
  border: var(--border-1) solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 7px 8px;
  font-size: var(--fs-sm);
  font-weight: 540;
  letter-spacing: 0.01em;
}

input[type="file"]::file-selector-button {
  border: var(--border-1) solid rgba(45, 28, 42, 0.22);
  border-radius: 11px;
  padding: 7px 12px;
  margin-right: 10px;
  background: linear-gradient(145deg, #fff8fd, #f4e7f0);
  color: #1f1320;
  font-size: var(--fs-sm);
  font-weight: 560;
  letter-spacing: 0.02em;
  cursor: pointer;
}

input[type="file"].native-file-picker-proxy {
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0.01;
  pointer-events: none;
}

button {
  border: var(--border-1) solid var(--line);
  background: linear-gradient(150deg, #fff9fd, #f9edf4);
  border-radius: 999px;
  min-height: 36px;
  padding: 0 11px;
  color: #221622;
  cursor: pointer;
  font-size: var(--fs-xxs);
  font-weight: 540;
  line-height: 1.2;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  background: linear-gradient(150deg, #fff4fb, #f4dfe9);
  border-color: var(--line-strong);
}

button.primary {
  width: 100%;
  color: #fff;
  font-weight: 700;
  border-color: transparent;
  background: linear-gradient(120deg, #2d1d2d, #1a121a 60%, #4f3548);
}

button.is-active {
  background: linear-gradient(130deg, #2a1c2a, #1a121a);
  color: #fef2f8;
  border-color: transparent;
}

button.is-active:hover {
  background: linear-gradient(130deg, #3a2738, #241925);
  color: #fff5fb;
  border-color: rgba(255, 226, 243, 0.28);
}

.inline-actions {
  display: grid;
  gap: 10px;
}

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

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

.inline-actions button {
  min-height: 42px;
  height: auto;
  padding: 8px 12px;
  white-space: normal;
  line-height: 1.28;
}

.filter-panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 3px;
  border: 1px solid rgba(50, 33, 46, 0.1);
  border-radius: 999px;
  background: rgba(255, 250, 253, 0.72);
}

.filter-panel-tab {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  color: rgba(33, 23, 34, 0.58);
}

.filter-panel-tab.is-active {
  background: linear-gradient(130deg, #2a1c2a, #1a121a);
  color: #fef2f8;
}

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

.font-picker-btn {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 999px;
  line-height: 1;
  text-align: center;
  overflow: hidden;
}

.font-picker-name,
.font-picker-sample {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-picker-name {
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 11px;
}

.font-picker-sample {
  font-family: var(--font-preview-family, "Avenir Next", "PingFang SC", sans-serif);
  font-size: 13px;
  font-weight: 400;
}

.font-picker-btn.is-active {
  background: linear-gradient(130deg, #2a1c2a, #1a121a);
  color: #fef2f8;
  border-color: transparent;
}

.font-picker-btn[data-font-status="error"] {
  border-color: rgba(196, 55, 95, 0.42);
}

.preset-grid,
.text-template-list,
.sticker-pack-list,
.control-stack,
.layer-list {
  display: grid;
  gap: 6px;
}

.preset-chip {
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 48px;
  border-radius: 16px;
  text-align: left;
  padding: 8px 11px;
  font-size: var(--fs-sm);
  font-weight: 540;
  line-height: 1.4;
  letter-spacing: 0;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

.preset-name {
  display: block;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.25;
  color: #271b29;
}

.preset-desc {
  display: block;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  color: rgba(39, 27, 41, 0.68);
}

.preset-chip.is-active .preset-name,
.preset-chip.is-active .preset-desc {
  color: #fff2f8;
}

.preset-chip.is-active {
  background: linear-gradient(130deg, #2f1f2f, #1d141d);
  border-color: rgba(255, 216, 236, 0.24);
}

.preset-chip.is-active:hover {
  background: linear-gradient(130deg, #3a2738, #241925);
  border-color: rgba(255, 226, 243, 0.3);
}

.preset-chip:hover {
  background: linear-gradient(150deg, #fff6fb, #f6e5ef);
}

.text-template-list .text-preset-chip {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 12px;
  gap: 0;
}

.text-preset-content {
  display: block;
  font-family: var(--text-preset-family, "Avenir Next", "PingFang SC", sans-serif);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 400;
  font-synthesis: none;
  color: #2d2030;
  letter-spacing: 0;
}

.sticker-pack {
  border: var(--border-1) solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: #fffafe;
}

.sticker-pack h4 {
  margin: 0 0 7px;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: rgba(33, 23, 34, 0.76);
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.sticker-btn {
  position: relative;
  min-height: 48px;
  border-radius: 12px;
  padding: 5px;
  background: #fff;
  overflow: hidden;
}

.sticker-btn::before {
  content: "♡";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(74, 47, 69, 0.24);
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

.sticker-btn img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 38px;
  object-fit: contain;
  opacity: 1;
  transition: opacity 0.16s ease;
}

.CanvasStage {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.mobile-stage-logo {
  display: none;
}

.mobile-layer-dock {
  display: none;
}

.canvas-toolbar {
  display: grid;
  grid-template-columns: repeat(4, auto) 1fr;
  gap: 8px;
  align-items: center;
}

.toolbar-btn {
  min-height: 34px;
  font-size: var(--fs-xxs);
}

#undoBtn {
  font-weight: 700;
}

.toolbar-btn.compare {
  justify-self: end;
  padding-inline: 18px;
}

.toolbar-btn.is-active {
  background: linear-gradient(130deg, #2a1c2a, #1a121a);
  color: #fef2f8;
  border-color: transparent;
}

.toolbar-btn.is-active:hover {
  background: linear-gradient(130deg, #3a2738, #241925);
  color: #fff5fb;
  border-color: rgba(255, 226, 243, 0.3);
}

.canvas-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  border: var(--border-1) solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 35% 20%, rgba(251, 234, 244, 0.74) 0%, transparent 40%),
    radial-gradient(circle at 72% 74%, rgba(239, 208, 227, 0.62) 0%, transparent 44%),
    #f2e6ec;
  padding: 12px;
}

.canvas-frame {
  position: relative;
  width: min(100%, 980px);
  height: min(100%, 100%);
  border-radius: 18px;
  border: var(--border-1) solid var(--line);
  overflow: visible;
  background: #f6eef2;
  contain: layout;
  touch-action: none;
}

.canvas-frame.interactive {
  cursor: zoom-in;
}

#editorCanvas,
.overlay-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  border-radius: inherit;
}

#editorCanvas {
  overflow: hidden;
  will-change: filter;
}

.overlay-layer {
  pointer-events: auto;
  contain: layout;
}

.canvas-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  font-size: var(--fs-md);
  color: var(--muted);
  cursor: pointer;
}

.control-stack.muted {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.layer-control-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: rgba(33, 23, 34, 0.78);
}

.control-item {
  display: grid;
  gap: 5px;
}

.control-item label {
  font-size: 11px;
  color: rgba(33, 23, 34, 0.74);
  line-height: 1.15;
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-swatch {
  position: relative;
  display: block;
  width: 52px;
  min-width: 52px;
  height: 30px;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0;
  background: #e7d3ea;
}

.native-color-input {
  position: absolute;
  inset: 0;
  opacity: 0.01;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input[type="range"] {
  width: 100%;
  accent-color: #3b2536;
  min-height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4a2f45 0%, #4a2f45 var(--range-progress, 50%), rgba(33, 23, 34, 0.1) var(--range-progress, 50%), rgba(33, 23, 34, 0.1) 100%);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border: none;
  border-radius: 999px;
  background: rgba(33, 23, 34, 0.1);
}

input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: #4a2f45;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 1px solid rgba(43, 30, 41, 0.18);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(32, 20, 31, 0.18);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(43, 30, 41, 0.18);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(32, 20, 31, 0.18);
}

input[type="range"].hsl-range {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  background: transparent;
}

input[type="range"].hsl-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--hsl-track, linear-gradient(90deg, #aaa, #ddd));
}

input[type="range"].hsl-range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  border: none;
  background: var(--hsl-track, linear-gradient(90deg, #aaa, #ddd));
}

input[type="range"].hsl-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 999px;
  border: 1px solid rgba(43, 30, 41, 0.24);
  background: #fff;
  box-shadow: 0 1px 6px rgba(32, 20, 31, 0.2);
}

input[type="range"].hsl-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(43, 30, 41, 0.24);
  background: #fff;
  box-shadow: 0 1px 6px rgba(32, 20, 31, 0.2);
}

input[type="text"],
input[type="color"],
textarea {
  border: var(--border-1) solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 8px;
}

textarea {
  resize: vertical;
  min-height: 88px;
}

.layer-row {
  border: var(--border-1) solid var(--line);
  border-radius: 13px;
  padding: 6px;
  background: #fffafe;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.layer-row.selected {
  border-color: rgba(52, 33, 47, 0.42);
  box-shadow: 0 0 0 2px rgba(226, 191, 208, 0.5);
}

.layer-actions {
  display: flex;
  gap: 4px;
}

.layer-row > button {
  min-width: 0;
  min-height: 30px;
  font-size: var(--fs-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-actions button {
  min-width: 26px;
  min-height: 26px;
  padding: 0 6px;
  border-radius: 9px;
  font-size: var(--fs-xxs);
}

.hsl-channel-btn {
  min-height: 42px;
  min-width: 42px;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.hsl-channel-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 4px;
  row-gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 8px 4px;
  overflow: visible;
}

.hsl-heart {
  width: 34px;
  height: 31px;
  display: block;
  fill: var(--hsl-swatch, #e86a70);
  transform: translateY(1px);
  filter: drop-shadow(0 1px 2px rgba(36, 24, 34, 0.16));
}

.hsl-channel-btn.is-active {
  box-shadow: none;
}

.hsl-channel-btn.is-active .hsl-heart {
  filter: drop-shadow(0 0 5px rgba(160, 235, 145, 0.9)) drop-shadow(0 0 9px rgba(160, 235, 145, 0.45));
  transform: translateY(1px) scale(1.02);
}

.overlay-item {
  position: absolute;
  transform: translate(-50%, -50%);
  transform-origin: center;
  touch-action: none;
  user-select: none;
  cursor: move;
  will-change: transform;
  transform: translate3d(0, 0, 0) translate(-50%, -50%);
  backface-visibility: hidden;
}

.overlay-item.selected {
  outline: none;
}

.overlay-item.selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(64, 43, 61, 0.66);
  border-radius: 2px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 3;
  transform: translateZ(0);
}

.overlay-preview {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  z-index: 1;
}

.overlay-item.is-transforming .overlay-preview {
  opacity: 1;
}

.overlay-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.overlay-preview.text-preview {
  display: grid;
  place-items: center;
  white-space: pre;
  text-align: center;
  line-height: 1.18;
  overflow: visible;
}

.overlay-preview.mosaic-preview {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(74, 47, 69, 0.22);
  backdrop-filter: blur(2px);
}

.overlay-preview.mosaic-preview.mosaic-shape-circle {
  border-radius: 999px;
}

.overlay-preview.mosaic-preview.mosaic-shape-heart {
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  overflow: visible;
}

.overlay-preview.mosaic-preview.mosaic-shape-heart svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 4px rgba(32, 21, 31, 0.16));
}

.overlay-preview.mosaic-preview.mosaic-shape-heart .mosaic-heart-path {
  fill: rgba(255, 255, 255, 0.22);
  stroke: rgba(74, 47, 69, 0.38);
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.overlay-preview.blush-preview {
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 130, 190, 0.34) 0%, rgba(250, 150, 205, 0.18) 55%, rgba(250, 170, 220, 0) 100%);
}

.overlay-item.overlay-mosaic.selected {
  outline: none;
}

.overlay-item.overlay-mosaic.selected::after {
  display: none;
}

.overlay-handle {
  position: absolute;
  z-index: 4;
  --handle-size: 20px;
  width: var(--handle-size);
  height: var(--handle-size);
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(32, 21, 31, 0.4);
  background: rgba(255, 248, 252, 0.96);
  box-shadow: 0 1px 6px rgba(33, 22, 31, 0.2);
  display: grid;
  place-items: center;
  touch-action: none;
  transform: scale(var(--handle-scale-x, 1), var(--handle-scale-y, 1));
  transform-origin: center;
}

.overlay-handle::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 999px;
}

.overlay-handle.scale {
  right: -12px;
  bottom: -12px;
  cursor: nwse-resize;
}

.overlay-handle.rotate {
  left: 50%;
  top: -30px;
  transform: translateX(-50%) scale(var(--handle-scale-x, 1), var(--handle-scale-y, 1));
  cursor: grab;
  width: var(--handle-size);
  height: var(--handle-size);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #311f30;
  display: grid;
  place-items: center;
}

.overlay-handle.delete {
  right: -12px;
  top: -12px;
  width: var(--handle-size);
  height: var(--handle-size);
  border-radius: 999px;
  border: 1px solid rgba(54, 34, 49, 0.55);
  background: rgba(255, 244, 250, 0.98);
  color: #3a2234;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.overlay-handle.copy {
  left: -12px;
  top: -12px;
  width: var(--handle-size);
  height: var(--handle-size);
  border-radius: 999px;
  border: 1px solid rgba(54, 34, 49, 0.45);
  background: rgba(255, 248, 252, 0.98);
  color: #3a2234;
  font-size: 10px;
  line-height: 1;
  cursor: copy;
}

.export-modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(24, 16, 24, 0.35);
  z-index: 999;
  padding: 16px;
}

.export-modal.show {
  display: grid;
}

.export-modal-panel {
  width: min(680px, 100%);
  max-height: min(90dvh, 860px);
  overflow: auto;
  border: var(--border-1) solid var(--line);
  border-radius: 20px;
  background: rgba(255, 248, 252, 0.96);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

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

.export-modal-note {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.export-preview-wrap {
  border: var(--border-1) solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 8px;
}

#exportPreviewImage {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.export-download-btn {
  min-height: 36px;
  border: var(--border-1) solid var(--line);
  background: linear-gradient(150deg, #fff9fd, #f9edf4);
  border-radius: 999px;
  padding: 8px 11px;
  color: #221622;
  text-decoration: none;
  font-size: var(--fs-xxs);
  font-weight: 540;
  display: grid;
  place-items: center;
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-7px);
  }
}

@keyframes cursorBlink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}


.overlay-handle.stretch-x {
  right: -12px;
  top: 50%;
  transform: translateY(-50%) scale(var(--handle-scale-x, 1), var(--handle-scale-y, 1));
  cursor: ew-resize;
}

.overlay-handle.stretch-y {
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%) scale(var(--handle-scale-x, 1), var(--handle-scale-y, 1));
  cursor: ns-resize;
}

.blush-control.blush-left .overlay-handle.delete {
  right: -12px;
  left: auto;
}

.blush-control.blush-left .overlay-handle.scale {
  left: -12px;
  right: auto;
  cursor: nesw-resize;
}

.blush-control.blush-right .overlay-handle.delete {
  right: -12px;
  left: auto;
}

.blush-control.blush-right .overlay-handle.scale {
  right: -12px;
  left: auto;
  cursor: nwse-resize;
}

@media (max-width: 1360px) {
  .studio-shell {
    grid-template-columns: 88px 290px minmax(440px, 1fr) 310px;
  }
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .studio-shell {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-areas:
      "nav"
      "content"
      "canvas"
      "props";
  }

  .studio-shell > * {
    height: auto;
  }

  .SidebarNav {
    grid-area: nav;
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
  }

  .brand-block {
    min-width: 130px;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    width: auto;
  }

  .nav-item {
    min-width: 86px;
    min-height: 56px;
  }

  .ContentPanel {
    grid-area: content;
  }

  .CanvasStage {
    grid-area: canvas;
    min-height: 62vh;
  }

  .PropertyPanel {
    grid-area: props;
  }

  .canvas-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar-btn.compare {
    justify-self: auto;
    grid-column: 1 / -1;
  }

  .canvas-frame {
    height: auto;
    max-height: none;
  }
}

@media (max-width: 760px), (min-width: 761px) and (max-width: 1180px) and (orientation: portrait) {
  :root {
    --radius-xl: 18px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --fs-xs: 12px;
    --fs-sm: 13px;
    --mobile-canvas-h: clamp(430px, 58dvh, 620px);
    --mobile-nav-h: 46px;
    --mobile-controls-top: calc(var(--mobile-canvas-h) + var(--mobile-nav-h));
  }

  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    background: #f7f1f6;
  }

  .studio-shell {
    height: 100dvh;
    min-height: 0;
    padding: 0;
    gap: 0;
    display: block;
    background: #f7f1f6;
  }

  .panel {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .CanvasStage {
    position: fixed;
    z-index: 2;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-canvas-h);
    min-height: var(--mobile-canvas-h);
    padding: 0;
    gap: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .mobile-stage-logo {
    position: absolute;
    z-index: 4;
    left: 14px;
    top: 56px;
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
    padding: 5px;
    border: 1px solid rgba(50, 33, 46, 0.12);
    border-radius: 12px;
    background: rgba(255, 248, 252, 0.76);
    box-shadow: 0 8px 20px rgba(56, 36, 54, 0.08);
    backdrop-filter: blur(10px);
  }

  .mobile-layer-dock {
    position: absolute;
    z-index: 5;
    top: 56px;
    right: 14px;
    display: grid;
    justify-items: end;
    gap: 6px;
    pointer-events: none;
  }

  .mobile-layer-toggle {
    pointer-events: auto;
    min-height: 34px;
    min-width: 58px;
    padding: 0 10px;
    border-radius: 999px;
    border-color: rgba(50, 33, 46, 0.14);
    background: rgba(255, 248, 252, 0.78);
    color: rgba(33, 23, 34, 0.72);
    font-size: 11px;
    font-weight: 650;
    box-shadow: 0 8px 20px rgba(56, 36, 54, 0.08);
    backdrop-filter: blur(10px);
  }

  .mobile-layer-dock:not(.has-layers) .mobile-layer-toggle {
    display: none;
  }

  .mobile-layer-menu {
    pointer-events: auto;
    display: none;
    width: min(72vw, 260px);
    max-height: min(42dvh, 280px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    border: 1px solid rgba(50, 33, 46, 0.14);
    border-radius: 16px;
    background: rgba(255, 248, 252, 0.94);
    box-shadow: 0 18px 38px rgba(56, 36, 54, 0.14);
    backdrop-filter: blur(16px);
  }

  .mobile-layer-dock.is-open .mobile-layer-menu {
    display: grid;
    gap: 6px;
  }

  .mobile-layer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 5px;
    align-items: center;
    padding: 5px;
    border: 1px solid rgba(50, 33, 46, 0.1);
    border-radius: 12px;
    background: rgba(255, 250, 253, 0.74);
  }

  .mobile-layer-row.selected {
    border-color: rgba(80, 51, 74, 0.34);
    background: rgba(255, 240, 248, 0.95);
  }

  .mobile-layer-select,
  .mobile-layer-action {
    min-height: 28px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.15;
    background: transparent;
  }

  .mobile-layer-select {
    min-width: 0;
    padding: 0 6px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-layer-action {
    min-width: 28px;
    padding: 0 7px;
  }

  .canvas-toolbar {
    order: 0;
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 6px 9px 7px;
    border-bottom: 1px solid rgba(50, 33, 46, 0.12);
    background: rgba(255, 248, 252, 0.88);
    backdrop-filter: blur(14px);
  }

  .toolbar-btn {
    flex: 0 1 16.5%;
    min-width: 0;
    min-height: 28px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
    border-color: rgba(50, 33, 46, 0.16);
    background: rgba(255, 250, 253, 0.88);
    color: #241825;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  #clearCanvasBtn,
  #restoreOriginalBtn {
    display: inline-flex;
  }

  .toolbar-btn.compare {
    flex: 0 0 clamp(104px, 23%, 138px);
    margin-left: auto;
    padding-inline: 6px;
  }

  #clearCanvasBtn,
  #restoreOriginalBtn {
    letter-spacing: 0;
  }

  .canvas-stage {
    min-height: 0;
    border: 0;
    border-radius: 0;
    padding: 8px 10px 12px;
    background:
      radial-gradient(circle at 35% 20%, rgba(251, 234, 244, 0.78) 0%, transparent 40%),
      radial-gradient(circle at 72% 74%, rgba(239, 208, 227, 0.66) 0%, transparent 44%),
      linear-gradient(145deg, #f8f2f6 0%, #f1e4eb 100%);
  }

  .canvas-frame {
    width: min(92vw, 440px);
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    border: 1px solid rgba(50, 33, 46, 0.14);
    background: #f6eef2;
    box-shadow: 0 14px 36px rgba(56, 36, 54, 0.08);
  }

  .canvas-empty {
    inset: 50% auto auto 50%;
    width: min(68vw, 260px);
    min-height: 126px;
    transform: translate(-50%, -50%);
    border: 2px dashed rgba(74, 47, 69, 0.24);
    border-radius: 22px;
    background: rgba(255, 250, 253, 0.44);
    color: rgba(35, 28, 34, 0.46);
    font-size: 0;
  }

  .canvas-empty::before {
    content: "地雷系编辑器";
    display: block;
    font-size: 18px;
    font-weight: 760;
    color: rgba(33, 25, 32, 0.82);
  }

  .canvas-empty::after {
    content: "点击开始加工♡";
    display: block;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 540;
    color: rgba(35, 28, 34, 0.45);
  }

  .SidebarNav {
    position: fixed;
    z-index: 6;
    top: var(--mobile-canvas-h);
    left: 0;
    right: 0;
    height: var(--mobile-nav-h);
    display: block;
    padding: 0;
    overflow: visible;
    border-top: 1px solid rgba(50, 33, 46, 0.14);
    border-bottom: 1px solid rgba(50, 33, 46, 0.12);
    background: rgba(255, 248, 252, 0.94);
    backdrop-filter: blur(14px);
  }

  .brand-block {
    display: none;
  }

  .nav-list {
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
  }

  .nav-item {
    min-width: 0;
    min-height: var(--mobile-nav-h);
    padding: 3px 2px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(33, 23, 34, 0.48);
    gap: 1px;
  }

  .nav-item:hover {
    transform: none;
    background: transparent;
  }

  .nav-item.active {
    position: relative;
    background: transparent;
    color: #1f161f;
  }

  .nav-item.active::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, #e679ad, #c68ba7);
  }

  .nav-icon {
    font-size: 15px;
  }

  .nav-label {
    font-size: 10px;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .ContentPanel,
  .PropertyPanel {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 5;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 9px 14px;
    border-top: 1px solid rgba(50, 33, 46, 0.12);
    background: #f7f1f6;
    backdrop-filter: blur(14px);
  }

  .ContentPanel {
    top: var(--mobile-controls-top);
    bottom: max(0px, env(safe-area-inset-bottom));
    max-height: none;
  }

  .PropertyPanel {
    top: var(--mobile-controls-top);
    bottom: max(0px, env(safe-area-inset-bottom));
    max-height: none;
    padding-top: 8px;
    border-top: 1px solid rgba(50, 33, 46, 0.12);
    font-size: 12px;
    background: #f7f1f6;
  }

  .PropertyPanel.is-empty {
    display: none;
  }

  .studio-shell[data-active-tool="filters"] .ContentPanel {
    bottom: auto;
    height: 54px;
  }

  .studio-shell[data-active-tool="filters"] .PropertyPanel {
    top: calc(var(--mobile-controls-top) + 54px);
  }

  .studio-shell[data-active-tool="project"] .ContentPanel {
    bottom: max(0px, env(safe-area-inset-bottom));
  }

  .studio-shell[data-active-tool="mosaic"] .ContentPanel,
  .studio-shell[data-active-tool="text"] .ContentPanel {
    bottom: auto;
    height: 94px;
  }

  .studio-shell[data-active-tool="stickers"] .ContentPanel {
    bottom: auto;
    height: 126px;
  }

  .studio-shell[data-active-tool="mosaic"] .PropertyPanel,
  .studio-shell[data-active-tool="text"] .PropertyPanel {
    top: calc(var(--mobile-controls-top) + 94px);
  }

  .studio-shell[data-active-tool="stickers"] .PropertyPanel {
    top: calc(var(--mobile-controls-top) + 126px);
  }

  .studio-shell[data-mobile-layer-panel="open"][data-active-tool="mosaic"] .ContentPanel,
  .studio-shell[data-mobile-layer-panel="open"][data-active-tool="stickers"] .ContentPanel,
  .studio-shell[data-mobile-layer-panel="open"][data-active-tool="text"] .ContentPanel {
    display: none;
  }

  .studio-shell[data-mobile-layer-panel="open"][data-active-tool="mosaic"] .PropertyPanel,
  .studio-shell[data-mobile-layer-panel="open"][data-active-tool="stickers"] .PropertyPanel,
  .studio-shell[data-mobile-layer-panel="open"][data-active-tool="text"] .PropertyPanel {
    top: var(--mobile-controls-top);
    bottom: max(0px, env(safe-area-inset-bottom));
  }

  .studio-shell[data-mobile-layer-panel="collapsed"][data-active-tool="mosaic"] .PropertyPanel,
  .studio-shell[data-mobile-layer-panel="collapsed"][data-active-tool="stickers"] .PropertyPanel,
  .studio-shell[data-mobile-layer-panel="collapsed"][data-active-tool="text"] .PropertyPanel {
    display: none;
  }

  .studio-shell[data-mobile-layer-panel="collapsed"][data-active-tool="mosaic"] .ContentPanel,
  .studio-shell[data-mobile-layer-panel="collapsed"][data-active-tool="stickers"] .ContentPanel,
  .studio-shell[data-mobile-layer-panel="collapsed"][data-active-tool="text"] .ContentPanel {
    bottom: auto;
    height: auto;
    max-height: none;
  }

  .studio-shell[data-mobile-layer-panel="collapsed"][data-active-tool="text"] .ContentPanel {
    bottom: max(0px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .PropertyPanel > .panel-title,
  .PropertyPanel > .sub-note {
    display: none;
  }

  #propListBlock {
    display: none !important;
  }

  .tool-pane.active {
    gap: 8px;
  }

  .tool-pane[data-pane="project"].active {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .tool-pane[data-pane="project"] .import-upload-block {
    display: none;
  }

  .tool-pane[data-pane="filters"].active {
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: stretch;
  }

  .tool-pane > .panel-title,
  .tool-pane > .sub-note {
    display: none;
  }

  .card-block,
  .prop-block {
    margin-top: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .prop-block {
    padding: 8px 10px;
    border: 1px solid rgba(62, 41, 57, 0.12);
    border-radius: 12px;
    background: rgba(255, 252, 254, 0.88);
  }

  .prop-block + .prop-block {
    margin-top: 8px;
    border-top: 1px solid rgba(50, 33, 46, 0.08);
  }

  .field-title,
  .prop-block h3 {
    margin: 0 0 5px;
    font-size: 11px;
    color: rgba(33, 23, 34, 0.62);
  }

  .preset-grid,
  .text-template-list,
  .sticker-pack-list,
  .control-stack,
  .layer-list {
    gap: 8px;
  }

  .control-stack.muted {
    font-size: 12px;
    line-height: 1.35;
    font-weight: 500;
    color: rgba(33, 23, 34, 0.5);
  }

  .layer-control-title {
    font-size: 12px;
    line-height: 1.25;
    font-weight: 620;
  }

  .preset-chip {
    min-height: 28px;
    border-radius: 11px;
    padding: 4px 8px;
    border-color: rgba(50, 33, 46, 0.14);
    background: rgba(255, 250, 253, 0.9);
    box-shadow: 0 4px 12px rgba(56, 36, 54, 0.035);
  }

  .preset-name {
    font-size: 12px;
    line-height: 1.12;
  }

  .preset-desc {
    font-size: 12px;
  }

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

  .tool-pane[data-pane="filters"] .field-title,
  .tool-pane[data-pane="filters"] .preset-desc {
    display: none;
  }

  .tool-pane[data-pane="filters"] .card-block {
    min-width: 0;
  }

  .tool-pane[data-pane="filters"] #originalFilterBtn {
    height: 100%;
    min-height: 36px;
    padding-inline: 8px;
  }

  .tool-pane[data-pane="filters"] .preset-chip {
    min-height: 36px;
    justify-items: center;
    text-align: center;
    padding: 4px 6px;
  }

  .tool-pane[data-pane="filters"] .preset-name {
    font-size: 11px;
  }

  .inline-actions {
    gap: 6px;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  }

  .filter-panel-tabs {
    gap: 4px;
    padding: 2px;
  }

  .filter-panel-tab {
    min-height: 24px;
    font-size: 10.5px;
  }

  .font-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .font-picker-btn {
    min-height: 29px;
    padding: 4px 7px;
  }

  .font-picker-name {
    font-size: 10px;
  }

  .font-picker-sample {
    font-size: 11px;
  }

  .hsl-channel-row {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    column-gap: 0;
    row-gap: 0;
    padding: 0 6px;
    justify-content: stretch;
    justify-items: center;
  }

  .hsl-channel-btn {
    width: 38px;
    height: 38px;
    flex-basis: auto;
    min-width: 0;
    min-height: 38px;
  }

  .hsl-heart {
    width: 35px;
    height: 32px;
  }

  .inline-actions button,
  button.primary,
  input[type="file"] {
    min-height: 30px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
  }

  input[type="file"],
  input[type="text"],
  input[type="color"],
  textarea,
  select {
    border-color: rgba(50, 33, 46, 0.14);
    background: rgba(255, 250, 253, 0.92);
    color: #211722;
    font-size: 16px;
  }

  input[type="range"] {
    accent-color: #4a2f45;
    min-height: 38px;
    touch-action: none;
  }

  input[type="range"]::-webkit-slider-runnable-track {
    height: 7px;
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
    margin-top: -10.5px;
  }

  input[type="range"]::-moz-range-track,
  input[type="range"]::-moz-range-progress {
    height: 7px;
  }

  input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }

  .sticker-pack {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .sticker-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 2px;
  }

  .sticker-btn {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 36px;
    padding: 3px;
    border-radius: 10px;
    border-color: rgba(50, 33, 46, 0.14);
    background: rgba(255, 250, 253, 0.92);
  }

  .sticker-btn img {
    width: 100%;
    height: 24px;
    object-fit: contain;
  }

  @media (min-width: 761px) and (max-width: 1180px) and (orientation: portrait) {
    .canvas-toolbar {
      padding-right: 4px;
    }

    .toolbar-btn.compare {
      flex-basis: clamp(120px, 22%, 180px);
      margin-left: auto;
    }

    .sticker-grid {
      grid-template-columns: repeat(auto-fill, minmax(88px, 108px));
      justify-content: start;
      align-items: start;
      gap: 8px;
    }

    .sticker-btn {
      width: 108px;
      height: 88px;
      min-height: 0;
      aspect-ratio: auto;
      padding: 5px;
    }

    .sticker-btn img {
      height: 40px;
      max-width: 78px;
      margin: 0 auto;
    }
  }

  .export-modal-note {
    color: #2a1d2a;
    font-weight: 620;
  }

  .export-download-btn {
    max-width: 150px;
    margin-top: 12px;
    margin-inline: auto;
    display: grid;
    opacity: 0.58;
    font-size: 11px;
    min-height: 30px;
  }

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

  .text-template-list .text-preset-chip {
    min-height: 30px;
    padding: 4px 8px;
  }

  .text-preset-content {
    font-size: 11px;
    line-height: 1.15;
  }

  .control-item {
    gap: 5px;
  }

  .control-item label {
    font-size: 11px;
  }

  input[type="range"] {
    min-height: 22px;
  }

  .layer-row {
    border-radius: 14px;
    padding: 8px;
    border-color: rgba(50, 33, 46, 0.14);
    background: rgba(255, 250, 253, 0.9);
  }

  .layer-row > button {
    font-size: 11px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overlay-handle {
    --handle-size: 20px;
  }

  .overlay-handle.scale {
    right: -12px;
    bottom: -12px;
  }

  .overlay-handle.stretch-x {
    right: -12px;
  }

  .overlay-handle.stretch-y {
    bottom: -12px;
  }

  .overlay-handle.delete,
  .overlay-handle.copy {
    font-size: 13px;
  }

  .overlay-handle.rotate {
    top: -34px;
  }
}

@media (max-width: 390px) {
  .nav-label {
    font-size: 9.5px;
  }

  .nav-icon {
    font-size: 14px;
  }

  .toolbar-btn {
    padding-inline: 8px;
  }

  .ContentPanel {
    max-height: none;
  }

  .PropertyPanel {
    max-height: none;
  }
}
