.preview-meitu {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #e8edf0;
  color: #202a2e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.preview-meitu * {
  box-sizing: border-box;
}

.preview-meitu button {
  cursor: pointer;
  font: inherit;
}

.preview-meitu__shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.preview-meitu__header {
  height: 60px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #dbe2e5;
}

.preview-meitu__brand,
.preview-meitu__header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-meitu__brand strong {
  font-size: 16px;
}

.preview-meitu__brand span {
  padding: 3px 7px;
  border-radius: 4px;
  background: #e8f4ee;
  color: #247358;
  font-size: 12px;
}

.preview-meitu__icon,
.preview-meitu__zoom button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #47565d;
  font-size: 22px !important;
  line-height: 1;
}

.preview-meitu__icon:hover,
.preview-meitu__zoom button:hover {
  background: #eaf0f2;
}

.preview-meitu__done {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #1e6d8e;
  border-radius: 4px;
  background: #1e6d8e;
  color: white;
  font-size: 13px !important;
}

.preview-meitu__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  min-height: 0;
  flex: 1;
}

.preview-meitu__stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: #252d30;
}

.preview-meitu__frame {
  max-width: 100%;
  max-height: calc(100dvh - 155px);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #394246;
  box-shadow: 0 10px 32px #10191d66;
}

.preview-meitu__frame img {
  display: block;
  max-width: min(760px, 100%);
  max-height: calc(100dvh - 155px);
  object-fit: contain;
  transition: filter 160ms ease, transform 160ms ease;
}

.preview-meitu__frame[data-ratio="square"],
.preview-meitu__frame[data-ratio="portrait"] {
  width: min(70vh, 70vw, 640px);
  max-width: 100%;
}

.preview-meitu__frame[data-ratio="square"] {
  aspect-ratio: 1;
}

.preview-meitu__frame[data-ratio="portrait"] {
  aspect-ratio: 4 / 5;
  width: min(56vh, 60vw, 510px);
}

.preview-meitu__frame[data-ratio="square"] img,
.preview-meitu__frame[data-ratio="portrait"] img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.preview-meitu__stagebar {
  width: min(760px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #e6edee;
  font-size: 12px;
}

.preview-meitu__zoom {
  display: flex;
  align-items: center;
  gap: 4px;
}

.preview-meitu__zoom button {
  color: #e6edee;
}

.preview-meitu__zoom button:hover {
  background: #465155;
}

.preview-meitu__zoom output {
  width: 42px;
  text-align: center;
}

.preview-meitu__panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid #dbe2e5;
}

.preview-meitu__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid #e1e7e9;
}

.preview-meitu__tabs button {
  height: 54px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #607179;
  font-size: 13px;
}

.preview-meitu__tabs button[aria-selected="true"] {
  border-bottom-color: #1e6d8e;
  color: #155674;
  font-weight: 600;
}

.preview-meitu__panel-body {
  padding: 22px 20px;
  overflow-y: auto;
  flex: 1;
}

.preview-meitu__panel-body h2 {
  margin: 0 0 20px;
  font-size: 14px;
  font-weight: 600;
}

.preview-meitu__slider {
  display: block;
  margin-bottom: 23px;
}

.preview-meitu__slider span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
}

.preview-meitu__slider output {
  color: #6f7d82;
  font-variant-numeric: tabular-nums;
}

.preview-meitu__slider input {
  width: 100%;
  accent-color: #1e6d8e;
}

.preview-meitu__outline,
.preview-meitu__segments button,
.preview-meitu__presets button {
  border: 1px solid #d5dfe2;
  border-radius: 4px;
  background: #fff;
  color: #35434a;
  font-size: 13px !important;
}

.preview-meitu__outline {
  width: 100%;
  min-height: 36px;
}

.preview-meitu__outline[aria-pressed="true"],
.preview-meitu__segments button[aria-pressed="true"],
.preview-meitu__presets button[aria-pressed="true"] {
  border-color: #1e6d8e;
  background: #ebf5f8;
  color: #155674;
}

.preview-meitu__presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.preview-meitu__presets button {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 9px;
  padding: 12px;
}

.preview-meitu__swatch {
  width: 28px;
  height: 28px;
  border: 1px solid #cbd4d7;
  border-radius: 3px;
  background: #b6c5c5;
}

.preview-meitu__swatch.clear { background: #91c7c6; }
.preview-meitu__swatch.warm { background: #d9ae87; }
.preview-meitu__swatch.mono { background: #828d90; }

.preview-meitu__segments {
  display: flex;
  gap: 7px;
  margin-bottom: 28px;
}

.preview-meitu__segments button {
  min-width: 52px;
  min-height: 36px;
  padding: 0 10px;
}

.preview-meitu__footer {
  padding: 14px 20px;
  border-top: 1px solid #e1e7e9;
  color: #697a81;
  font-size: 12px;
}

@media (max-width: 720px) {
  .preview-meitu__header {
    height: 54px;
    padding: 0 12px;
  }

  .preview-meitu__header-actions {
    gap: 4px;
  }

  .preview-meitu__workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 45dvh) minmax(0, 1fr);
  }

  .preview-meitu__stage {
    gap: 8px;
    padding: 12px;
  }

  .preview-meitu__frame,
  .preview-meitu__frame img {
    max-height: calc(45dvh - 58px);
  }

  .preview-meitu__frame[data-ratio="square"],
  .preview-meitu__frame[data-ratio="portrait"] {
    width: min(35dvh, 85vw);
  }

  .preview-meitu__panel {
    border-left: 0;
    border-top: 1px solid #dbe2e5;
  }

  .preview-meitu__tabs button {
    height: 42px;
  }

  .preview-meitu__panel-body {
    padding: 16px;
  }
}
