:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #6c756e;
  --line: #dde2dd;
  --panel: #ffffff;
  --canvas: #f1f3ef;
  --green: #17643a;
  --green-dark: #0f4f2c;
  --lime: #cbe96a;
  --danger: #bc3e31;
  --image-gap: 5px;
  --editor-width: 760px;
  --image-radius: 0px;
  --image-shadow: none;
  --canvas-color: #ffffff;
  --default-image-width: 1395px;
  --image-item-width: 1395px;
  --image-item-height: 600px;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--canvas);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.menu-bar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 72px;
  padding: 0 clamp(20px, 4vw, 56px);
  border-bottom: 1px solid rgba(22, 51, 34, 0.12);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 10px 30px rgba(25, 43, 32, 0.04);
  backdrop-filter: blur(18px);
}

.quick-toolbar {
  position: sticky;
  z-index: 24;
  top: 72px;
  height: 52px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(22, 51, 34, 0.11);
  background: rgba(247, 250, 247, 0.96);
  box-shadow: 0 8px 22px rgba(25, 43, 32, 0.035);
  scrollbar-width: none;
  backdrop-filter: blur(16px);
}

.quick-toolbar::-webkit-scrollbar {
  display: none;
}

.quick-toolbar-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  min-width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 56px);
}

.quick-toolbar-label {
  margin-right: 5px;
  color: #7b857e;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.quick-tool-button {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #536057;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.quick-tool-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.quick-tool-button:hover,
.quick-tool-button[aria-expanded="true"],
.quick-tool-button.is-active {
  border-color: #c7d5c9;
  background: #eaf2e9;
  color: var(--green);
}

.quick-toolbar-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: #d7ddd7;
}

.settings-anchor.quick-highlight {
  border-radius: 10px;
  outline: 3px solid rgba(203, 233, 106, 0.42);
  outline-offset: 5px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--green);
  color: white;
}

.brand-mark svg {
  width: 23px;
  stroke: currentColor;
  stroke-width: 1.7;
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 14px;
  letter-spacing: 0.04em;
}

.brand-copy small {
  margin-top: 5px;
  color: #7b857e;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.view-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid #dce3dd;
  border-radius: 9px;
  background: #f8faf7;
  color: #58645b;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.view-button:hover,
.view-button[aria-expanded="true"] {
  border-color: #a8b9ab;
  background: #eef4ec;
  color: var(--green);
}

.view-button svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.menu {
  display: flex;
  align-self: stretch;
}

.menu-item {
  position: relative;
  height: 100%;
}

.menu-button {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 7px;
  padding: 0 22px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.menu-button:hover,
.menu-button[aria-expanded="true"] {
  color: var(--green);
}

.menu-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  transition: transform 160ms ease;
}

.menu-button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.file-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 238px;
  padding: 8px;
  border: 1px solid rgba(27, 56, 38, 0.13);
  border-radius: 13px;
  background: white;
  box-shadow: 0 20px 50px rgba(21, 47, 30, 0.15);
}

.file-menu-action {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.file-menu-action:hover {
  background: #eef5ed;
  color: var(--green);
}

.file-menu-action + .file-menu-action {
  margin-top: 5px;
  border-top: 1px solid #e4e9e4;
  border-radius: 0 0 9px 9px;
}

.file-menu-action svg {
  width: 25px;
  padding: 4px;
  border-radius: 7px;
  background: #e5f0e5;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.file-menu-action span {
  display: grid;
  gap: 3px;
}

.file-menu-action strong {
  font-size: 11px;
}

.file-menu-action small {
  color: #7d887f;
  font-size: 9px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  min-width: 96px;
  padding: 8px 12px;
  border: 1px solid #dfe6df;
  border-radius: 99px;
  background: #f8faf7;
  color: #5e6961;
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7e8981;
  box-shadow: 0 0 0 3px rgba(126, 137, 129, 0.12);
}

.status-chip.has-images .status-dot {
  background: #37a662;
  box-shadow: 0 0 0 3px rgba(55, 166, 98, 0.13);
}

.settings-panel {
  position: absolute;
  top: calc(100% + 62px);
  left: 50%;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 150px);
  padding: 22px;
  overflow-y: auto;
  transform: translateX(-50%);
  border: 1px solid rgba(27, 56, 38, 0.13);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(21, 47, 30, 0.16);
}

.settings-panel::-webkit-scrollbar,
.thumbnail-list::-webkit-scrollbar {
  width: 7px;
}

.settings-panel::-webkit-scrollbar-thumb,
.thumbnail-list::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: #ccd4cd;
}

.settings-panel::before {
  display: none;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 25px;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel-heading h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 23px;
  font-weight: 600;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fafbf9;
  cursor: pointer;
}

.icon-button:hover {
  border-color: #b6c0b8;
  background: #f1f4f0;
}

.icon-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.setting-row label {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
}

.setting-row label span {
  color: #8a928c;
  font-size: 11px;
  font-weight: 400;
}

.number-control {
  display: grid;
  grid-template-columns: 42px 1fr auto 42px;
  align-items: center;
  overflow: hidden;
  height: 46px;
  border: 1px solid #d7ddd8;
  border-radius: 11px;
  background: #f7f9f6;
}

.number-control button {
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}

.number-control button:hover {
  background: #eaf0e9;
  color: var(--green);
}

.number-control input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: right;
  font-size: 15px;
  font-weight: 750;
  appearance: textfield;
}

.number-control input::-webkit-inner-spin-button,
.number-control input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.number-control span {
  padding: 0 10px 0 5px;
  color: #788179;
  font-size: 12px;
}

.text-button {
  margin-top: 17px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6e7871;
  cursor: pointer;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--green);
}

.panel-divider,
.thumbnail-divider {
  height: 1px;
  margin: 22px 0;
  background: #e7ebe7;
}

.effect-section {
  display: grid;
  gap: 18px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.section-heading h3 {
  margin: 5px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
  font-weight: 600;
}

.layer-badge {
  padding: 5px 8px;
  border: 1px solid #dce5dc;
  border-radius: 99px;
  background: #f4f7f3;
  color: #718076;
  font-size: 9px;
  font-weight: 800;
}

.dimension-setting {
  display: grid;
  gap: 6px;
}

.pixel-input {
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 30px;
  border: 1px solid #dce3dd;
  border-radius: 7px;
  background: #f7f9f6;
}

.pixel-input input {
  width: 68px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
  appearance: textfield;
}

.pixel-input input::-webkit-inner-spin-button,
.pixel-input input::-webkit-outer-spin-button {
  appearance: none;
}

.pixel-input span {
  padding: 0 7px 0 4px;
  color: #849087;
  font-size: 9px;
}

.canvas-color-setting {
  display: grid;
  gap: 12px;
}

.canvas-color-setting .slider-heading output {
  min-width: 128px;
}

.color-picker-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
}

#canvasColorInput,
#shadowColorInput {
  width: 42px;
  height: 36px;
  padding: 3px;
  border: 1px solid #d8dfd9;
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

#canvasColorInput::-webkit-color-swatch-wrapper,
#shadowColorInput::-webkit-color-swatch-wrapper,
#textColorInput::-webkit-color-swatch-wrapper,
#textShadowColorInput::-webkit-color-swatch-wrapper {
  padding: 0;
}

#canvasColorInput::-webkit-color-swatch,
#shadowColorInput::-webkit-color-swatch,
#textColorInput::-webkit-color-swatch,
#textShadowColorInput::-webkit-color-swatch {
  border: 0;
  border-radius: 5px;
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}

.color-palette button {
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid white;
  border-radius: 6px;
  background: var(--swatch-color);
  box-shadow: 0 0 0 1px #d5ddd6;
  cursor: pointer;
}

.color-palette button:hover,
.color-palette button.is-active {
  box-shadow: 0 0 0 2px var(--green);
  transform: scale(1.06);
}

.color-palette [data-canvas-color="#ffffff"] { --swatch-color: #ffffff; }
.color-palette [data-canvas-color="#f1f3ef"] { --swatch-color: #f1f3ef; }
.color-palette [data-canvas-color="#171b18"] { --swatch-color: #171b18; }
.color-palette [data-canvas-color="#fff2d8"] { --swatch-color: #fff2d8; }
.color-palette [data-canvas-color="#ef4444"] { --swatch-color: #ef4444; }
.color-palette [data-canvas-color="#22c55e"] { --swatch-color: #22c55e; }
.color-palette [data-canvas-color="#3b82f6"] { --swatch-color: #3b82f6; }
.color-palette [data-canvas-color="#facc15"] { --swatch-color: #facc15; }

.rgb-controls {
  display: grid;
  gap: 7px;
}

.rgb-row {
  display: grid;
  grid-template-columns: 14px 1fr 30px;
  align-items: center;
  gap: 8px;
}

.rgb-row label {
  color: #617067;
  font-size: 9px;
  font-weight: 900;
}

.rgb-row .value-slider {
  margin: 0;
}

.rgb-row output {
  color: #657169;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.auto-height-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -6px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f2f6f1;
  color: #748078;
  font-size: 9px;
}

.auto-height-status output {
  color: var(--green-dark);
  font-weight: 850;
}

.canvas-limit-status {
  margin-top: 8px;
  background: #fff8e8;
  color: #87651e;
}

.auto-height-status[hidden] {
  display: none;
}

.slider-setting {
  display: grid;
  gap: 10px;
}

.slider-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.slider-heading label {
  font-size: 12px;
  font-weight: 720;
}

.slider-heading output {
  min-width: 54px;
  padding: 4px 7px;
  border-radius: 6px;
  background: #eef3ed;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.value-slider {
  width: 100%;
  height: 18px;
  margin: 8px 0 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.value-slider::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(
    to right,
    var(--green) 0 var(--range-progress, 0%),
    #dce3dc var(--range-progress, 0%) 100%
  );
}

.value-slider::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  margin-top: -6px;
  appearance: none;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 1px 5px rgba(18, 65, 36, 0.28);
}

.value-slider::-moz-range-track {
  height: 5px;
  border-radius: 99px;
  background: #dce3dc;
}

.value-slider::-moz-range-progress {
  height: 5px;
  border-radius: 99px;
  background: var(--green);
}

.value-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 1px 5px rgba(18, 65, 36, 0.28);
}

.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
}

.switch-row > span:first-child {
  display: grid;
  gap: 4px;
}

.switch-row strong {
  font-size: 12px;
}

.switch-row small {
  color: #879088;
  font-size: 10px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-control {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: #cfd6d0;
  transition: background 150ms ease;
}

.switch-control::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(25, 41, 30, 0.18);
  content: "";
  transition: transform 150ms ease;
}

.switch-row input:checked + .switch-control {
  background: var(--green);
}

.switch-row input:checked + .switch-control::after {
  transform: translateX(16px);
}

.switch-row input:focus-visible + .switch-control {
  outline: 3px solid rgba(23, 100, 58, 0.18);
  outline-offset: 2px;
}

.shadow-controls {
  display: grid;
  gap: 19px;
  margin: 0;
  padding: 2px 0 0;
  border: 0;
  transition: opacity 150ms ease;
}

.shadow-controls:disabled {
  opacity: 0.38;
}

.aspect-ratio-option {
  padding: 12px;
  border: 1px solid #e1e7e1;
  border-radius: 11px;
  background: #f7f9f6;
}

.dimension-setting.is-disabled {
  opacity: 0.38;
}

.preview-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 15px;
  border: 1px solid #e1e7e1;
  border-radius: 12px;
  background: #f7f9f6;
}

.switch-row.compact small {
  max-width: 180px;
  line-height: 1.4;
}

.apply-button {
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.apply-button:disabled {
  background: #c8cfca;
  cursor: default;
}

.thumbnail-panel {
  position: fixed;
  z-index: 25;
  top: 136px;
  bottom: 16px;
  left: 16px;
  display: flex;
  width: 244px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(27, 56, 38, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 65px rgba(21, 47, 30, 0.15);
  backdrop-filter: blur(18px);
  flex-direction: column;
}

.thumbnail-panel[hidden] {
  display: none;
}

.text-panel {
  position: fixed;
  z-index: 26;
  top: 136px;
  right: 16px;
  bottom: 16px;
  display: flex;
  width: 320px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(27, 56, 38, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 22px 65px rgba(21, 47, 30, 0.15);
  backdrop-filter: blur(18px);
  flex-direction: column;
}

.text-panel[hidden] {
  display: none;
}

.text-panel-scroll {
  min-height: 0;
  margin-top: 16px;
  overflow-y: auto;
  padding-right: 4px;
}

.text-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.text-primary-action,
.text-secondary-action,
.font-source-actions button {
  min-height: 38px;
  border: 1px solid #d5ddd6;
  border-radius: 9px;
  background: white;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.text-primary-action {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.text-primary-action.is-active {
  border-color: #bedc5d;
  background: var(--lime);
  color: #18301f;
  box-shadow: 0 0 0 3px rgba(203, 233, 106, 0.28);
}

.text-primary-action:disabled,
.text-secondary-action:disabled {
  opacity: 0.45;
  cursor: default;
}

.text-placement-hint {
  margin: 9px 2px 0;
  color: #748078;
  font-size: 10px;
  line-height: 1.55;
}

.text-control-card,
.font-browser {
  margin-top: 16px;
  padding: 13px;
  border: 1px solid #e1e6e1;
  border-radius: 12px;
  background: #f7f9f6;
}

.text-control-heading,
.font-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.text-control-heading strong,
.font-section-heading strong {
  font-size: 11px;
}

.text-control-heading span,
.font-section-heading span {
  color: #7b867e;
  font-size: 9px;
}

#textContentInput {
  width: 100%;
  margin-top: 10px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid #d9e0da;
  border-radius: 8px;
  outline: none;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  line-height: 1.55;
}

#textContentInput:focus,
.font-search-input:focus,
#textSizeInput:focus {
  border-color: #7ca087;
  box-shadow: 0 0 0 3px rgba(23, 100, 58, 0.09);
}

.text-size-row,
.text-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  color: #59655c;
  font-size: 10px;
  font-weight: 700;
}

.text-size-buttons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.text-size-buttons button {
  min-width: 34px;
  height: 30px;
  border: 1px solid #d6ddd7;
  border-radius: 7px;
  background: white;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

#textSizeInput {
  width: 58px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid #d6ddd7;
  border-radius: 7px;
  outline: none;
  background: white;
  text-align: center;
}

#textColorInput,
#textShadowColorInput {
  width: 42px;
  height: 30px;
  padding: 2px;
  border: 1px solid #d6ddd7;
  border-radius: 7px;
  background: white;
  cursor: pointer;
}

.text-color-palette {
  margin-top: 9px;
  grid-template-columns: repeat(8, 1fr);
}

.color-palette-disclosure {
  margin-top: 9px;
}

.color-palette-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #d9e0da;
  border-radius: 8px;
  background: #ffffff;
  color: #59655c;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  list-style: none;
  user-select: none;
}

.color-palette-disclosure summary::-webkit-details-marker {
  display: none;
}

.color-palette-disclosure summary::after {
  content: "+";
  color: var(--green);
  font-size: 16px;
  line-height: 1;
}

.color-palette-disclosure[open] summary::after {
  content: "−";
}

.color-palette-disclosure .text-color-palette {
  margin-top: 9px;
}

.text-shadow-toggle {
  margin-top: 12px;
  padding-top: 13px;
  border-top: 1px solid #dfe5df;
}

.text-shadow-controls {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.text-shadow-controls:disabled {
  opacity: 0.48;
}

.text-shadow-controls:disabled .color-palette-disclosure {
  pointer-events: none;
}

.text-shadow-slider {
  margin-top: 12px;
}

.font-access-note {
  margin: 8px 0 10px;
  color: #78837b;
  font-size: 9px;
  line-height: 1.55;
}

.font-source-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.font-folder-button {
  grid-column: 1 / -1;
}

.font-source-actions button:hover,
.text-secondary-action:hover,
.text-size-buttons button:hover {
  border-color: #8fa594;
  background: #eef4ec;
}

.font-search-input {
  width: 100%;
  height: 34px;
  margin-top: 9px;
  padding: 0 10px;
  border: 1px solid #d9e0da;
  border-radius: 8px;
  outline: none;
  background: white;
  font-size: 10px;
}

.font-section-heading {
  margin-top: 15px;
}

.all-font-heading {
  padding-top: 12px;
  border-top: 1px solid #e0e5e0;
}

.font-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.font-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 5px;
}

.font-apply-button,
.font-favorite-button {
  border: 1px solid #dce2dc;
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.font-apply-button {
  min-width: 0;
  padding: 8px 9px;
  overflow: hidden;
  text-align: left;
}

.font-apply-button:hover,
.font-item.is-selected .font-apply-button {
  border-color: #789981;
  background: #edf4ec;
}

.font-preview-sample {
  display: block;
  overflow: hidden;
  color: #243128;
  font-size: 17px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-preview-name {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #7b857d;
  font: 8px/1.2 Inter, "Microsoft YaHei", sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-favorite-button {
  display: grid;
  width: 32px;
  padding: 0;
  place-items: center;
  color: #9aa49c;
  font-size: 15px;
}

.font-favorite-button.is-favorite {
  border-color: #d6b94a;
  background: #fff9df;
  color: #c19700;
}

.font-empty {
  margin: 8px 0 0;
  color: #8a948c;
  font-size: 9px;
  text-align: center;
}

.thumbnail-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.thumbnail-panel-heading h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 20px;
  font-weight: 600;
}

.zoom-control {
  margin-top: 24px;
  padding: 13px;
  border-radius: 12px;
  background: #f2f5f1;
}

.zoom-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 9px;
}

.zoom-presets button {
  padding: 5px 0;
  border: 1px solid #dae1db;
  border-radius: 6px;
  background: white;
  color: #69746b;
  cursor: pointer;
  font-size: 9px;
}

.zoom-presets button:hover,
.zoom-presets button.is-active {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.thumbnail-list {
  display: grid;
  gap: 9px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.thumbnail-sort-hint {
  margin: -8px 0 14px;
  color: #7b877e;
  font-size: 10px;
}

.thumbnail-item {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px;
  border: 1px solid #e1e6e1;
  border-radius: 10px;
  background: white;
  cursor: grab;
  text-align: left;
  user-select: none;
}

.thumbnail-item:hover,
.thumbnail-item.is-active {
  border-color: #84a68e;
  background: #f0f6ef;
}

.thumbnail-list.is-sorting .thumbnail-item {
  transition: opacity 120ms ease, transform 120ms ease;
}

.thumbnail-item.is-dragging {
  opacity: 0.38;
  cursor: grabbing;
}

.thumbnail-item.drag-before::before,
.thumbnail-item.drag-after::after {
  position: absolute;
  right: 3px;
  left: 3px;
  z-index: 3;
  height: 3px;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(203, 233, 106, 0.7);
  content: "";
}

.thumbnail-item.drag-before::before {
  top: -6px;
}

.thumbnail-item.drag-after::after {
  bottom: -6px;
}

.thumbnail-preview {
  position: relative;
  overflow: hidden;
  width: 58px;
  height: 58px;
  border-radius: 7px;
  background: #e8ece8;
}

.thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-number {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 5px;
  background: rgba(17, 34, 22, 0.78);
  color: white;
  font-size: 8px;
  font-weight: 800;
}

.thumbnail-name {
  overflow: hidden;
  color: #4f5a52;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thumbnail-empty {
  margin: 6px 0 0;
  color: #8b948d;
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.app-shell.thumbnails-open .workspace {
  width: min(1540px, calc(100% - 300px));
  transform: translateX(130px);
}

.workspace {
  width: min(1540px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(38px, 6vw, 72px) 0 80px;
  transition: width 180ms ease, transform 180ms ease;
}

.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 26px;
}

.workspace-heading h1 {
  margin: 9px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(30px, 4vw, 45px);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.workspace-hint {
  max-width: 380px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: right;
}

.drop-zone {
  position: relative;
  min-height: 520px;
  padding: 34px;
  overflow: auto;
  border: 1px solid #d7ddd7;
  border-radius: 24px;
  outline: none;
  background-color: #e9ece7;
  background-image: radial-gradient(#cbd1cb 0.7px, transparent 0.7px);
  background-size: 14px 14px;
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.45), 0 24px 60px rgba(32, 53, 38, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.drop-zone:focus-visible {
  border-color: var(--green);
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.45), 0 0 0 4px rgba(23, 100, 58, 0.12);
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  text-align: center;
}

.drop-zone:not(.is-empty) .empty-state {
  display: none;
}

.drop-visual {
  position: relative;
  width: 112px;
  height: 100px;
  margin-bottom: 17px;
}

.image-card {
  position: absolute;
  display: grid;
  width: 76px;
  height: 78px;
  place-items: center;
  border: 1px solid #bac3ba;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 25px rgba(28, 49, 34, 0.09);
}

.image-card-back {
  top: 3px;
  left: 15px;
  transform: rotate(-8deg);
  background: #f5f8f2;
}

.image-card-front {
  right: 4px;
  bottom: 2px;
  transform: rotate(5deg);
}

.image-card-front svg {
  width: 43px;
  stroke: var(--green);
  stroke-width: 1.6;
}

.plus-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 4px solid #e9ece7;
  border-radius: 50%;
  background: var(--lime);
  color: var(--green-dark);
  font-size: 19px;
  font-weight: 500;
}

.empty-state h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 25px;
  font-weight: 600;
}

.empty-state p {
  margin: 10px 0 22px;
  color: #737d75;
  font-size: 12px;
}

.primary-button {
  min-width: 116px;
  padding: 11px 20px;
  border: 0;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 9px 22px rgba(23, 100, 58, 0.2);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.canvas-viewport {
  position: relative;
  flex: 0 0 auto;
  margin: 0 auto;
  transition: width 160ms ease, height 160ms ease;
}

.canvas-stage {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  background: var(--canvas-color);
  box-shadow: 0 0 0 1px rgba(22, 51, 34, 0.12), 0 12px 32px rgba(28, 45, 34, 0.08);
  transform-origin: top left;
}

.canvas-size-badge {
  position: sticky;
  z-index: 4;
  top: 10px;
  left: 10px;
  display: block;
  width: max-content;
  max-width: calc(100vw - 90px);
  padding: 7px 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(18, 43, 27, 0.84);
  box-shadow: 0 5px 16px rgba(16, 31, 21, 0.16);
  color: white;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(7px);
}

.drop-zone.is-empty .canvas-viewport {
  display: none;
}

.image-list {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: var(--image-gap);
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  overflow-anchor: none;
}

.text-overlay-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.canvas-stage.is-placing-text,
.canvas-stage.is-placing-text .image-item {
  cursor: crosshair;
}

.text-object {
  position: absolute;
  max-width: calc(100% - 12px);
  margin: 0;
  padding: 4px 6px;
  transform: translate(-50%, -50%);
  border: 0;
  outline: none;
  background: transparent;
  color: white;
  cursor: grab;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  pointer-events: auto;
  user-select: none;
}

.text-object.is-dragging,
body.is-moving-text .text-object {
  cursor: grabbing;
}

.text-object.is-dragging {
  z-index: 2;
}

.text-object:hover,
.text-object.is-selected {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.drop-zone.is-empty .image-list {
  width: 100%;
}

.image-list.uniform-size .image-item {
  width: var(--image-item-width);
  height: var(--image-item-height);
  flex: 0 0 auto;
}

.image-list.uniform-size .image-item img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.image-list.is-sorting .image-item:not(.is-dragging) {
  will-change: transform;
}

.image-item {
  position: relative;
  width: min(var(--default-image-width), 100%);
  margin: 0;
  border-radius: var(--image-radius);
  background: white;
  box-shadow: var(--image-shadow);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: opacity 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.image-item:hover {
  z-index: 2;
  box-shadow: var(--image-shadow);
}

.image-item:active {
  cursor: grabbing;
}

body.is-reordering,
body.is-reordering * {
  cursor: grabbing !important;
}

body.is-reordering,
body.is-reordering .drop-zone,
body.is-reordering .canvas-viewport,
body.is-reordering .canvas-stage,
body.is-reordering .image-list {
  overflow-anchor: none;
}

.image-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  pointer-events: none;
  user-select: none;
}

.image-item.is-dragging {
  z-index: 6;
  outline: 2px solid var(--green);
  outline-offset: -2px;
  opacity: 0.42;
  transform: scale(0.992);
  will-change: transform;
}

.image-item.drag-before::before,
.image-item.drag-after::after {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 5;
  height: 3px;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(203, 233, 106, 0.8);
  content: "";
}

.image-item.drag-before::before {
  top: -4px;
}

.image-item.drag-after::after {
  bottom: -4px;
}

.drag-handle,
.remove-button,
.item-meta {
  position: absolute;
  z-index: 4;
  opacity: 0;
  transition: opacity 130ms ease, transform 130ms ease;
}

.image-item:hover .drag-handle,
.image-item:hover .remove-button,
.image-item:hover .item-meta,
.image-item:focus-within .remove-button {
  opacity: 1;
}

.drag-handle {
  top: 50%;
  left: 14px;
  display: grid;
  width: 32px;
  height: 40px;
  place-items: center;
  transform: translateY(-50%) translateX(-3px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  background: rgba(16, 32, 21, 0.77);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.13);
  color: white;
  backdrop-filter: blur(5px);
}

.image-item:hover .drag-handle {
  transform: translateY(-50%) translateX(0);
}

.drag-handle svg {
  width: 18px;
  fill: currentColor;
}

.remove-button {
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  transform: translateY(-2px);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  background: rgba(21, 30, 24, 0.76);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.image-item:hover .remove-button {
  transform: translateY(0);
}

.remove-button:hover {
  background: var(--danger);
}

.remove-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.item-meta {
  right: 58px;
  bottom: 12px;
  left: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  background: rgba(16, 28, 20, 0.75);
  color: white;
  font-size: 10px;
  backdrop-filter: blur(7px);
}

.order-badge {
  display: grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 5px;
  background: var(--lime);
  color: var(--green-dark);
  font-weight: 850;
}

.file-name {
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dimensions {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.67);
}

.drop-overlay {
  position: absolute;
  z-index: 20;
  inset: 10px;
  display: grid;
  visibility: hidden;
  place-items: center;
  border: 2px dashed var(--green);
  border-radius: 18px;
  background: rgba(240, 248, 235, 0.9);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(7px);
  transition: opacity 130ms ease, visibility 130ms ease;
}

.drop-zone.is-file-over .drop-overlay {
  visibility: visible;
  opacity: 1;
}

.drop-overlay > div {
  display: grid;
  justify-items: center;
  gap: 13px;
  color: var(--green);
}

.drop-overlay svg {
  width: 48px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.drop-overlay strong {
  font-size: 16px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 11px 16px;
  transform: translateY(14px);
  border-radius: 10px;
  background: #15251a;
  box-shadow: 0 12px 30px rgba(14, 34, 21, 0.22);
  color: white;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 680px) {
  .menu-bar {
    grid-template-columns: 1fr auto;
    height: 64px;
    padding: 0 16px;
  }

  .menu {
    grid-column: 2;
    grid-row: 1;
  }

  .status-chip {
    display: none;
  }

  .brand-copy small {
    display: none;
  }

  .header-left {
    gap: 8px;
  }

  .quick-toolbar {
    top: 64px;
    height: 48px;
  }

  .quick-toolbar-inner {
    padding: 0 10px;
  }

  .quick-toolbar-label {
    display: none;
  }

  .quick-tool-button {
    height: 32px;
    padding: 0 9px;
  }

  .view-button span {
    display: none;
  }

  .settings-panel {
    top: calc(100% + 54px);
    right: -8px;
    left: auto;
    max-height: calc(100vh - 130px);
    transform: none;
  }

  .settings-panel::before {
    right: 35px;
    left: auto;
  }

  .workspace {
    width: calc(100% - 24px);
    padding-top: 32px;
  }

  .workspace-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .workspace-hint {
    text-align: left;
  }

  .drop-zone {
    min-height: 430px;
    padding: 15px;
    border-radius: 18px;
  }

  .thumbnail-panel {
    top: 124px;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }

  .text-panel {
    top: 124px;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }

  .app-shell.thumbnails-open .workspace {
    width: calc(100% - 24px);
    transform: none;
  }

  .item-meta {
    display: none;
  }

  .drag-handle,
  .remove-button {
    opacity: 0.92;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
