:root {
  --blue: #b9e2f8;
  --button: #b9e2f8;
  --submit: #b9e2f8;
  --ink: #101820;
  --muted: #6e7780;
  --line: #e7edf2;
  --danger: #e64646;
}

* { box-sizing: border-box; }
html, body {
  position: relative;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}
#app {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; }
img, canvas { max-width: 100%; }
button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.view {
  display: none;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  padding: calc(22px + env(safe-area-inset-top)) clamp(16px, 5vw, 24px) calc(92px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
.view.active { display: block; }
.top { padding-top: 16px; }
.top.compact { padding-top: 0; }
h1, h2, h3, p { margin: 0; }
h1 {
  font-size: 32px;
  letter-spacing: 0;
  line-height: 1.2;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.top p {
  margin-top: 16px;
  font-size: 18px;
  line-height: 1.6;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  gap: 14px;
  margin-top: 26px;
}
.style-grid.single-style {
  grid-template-columns: minmax(150px, 180px);
  justify-content: center;
}
.login-entry {
  display: grid;
  gap: clamp(16px, 5vw, 22px);
  min-height: calc(100vh - 140px);
  align-content: center;
  width: min(calc(100vw - 48px), 420px);
  max-width: 100%;
  margin: 0 auto;
  min-width: 0;
  overflow-x: clip;
}
.login-entry h1 {
  text-align: center;
  font-size: clamp(28px, 9vw, 40px);
}
.entry-buttons {
  display: grid;
  gap: 20px;
  width: 100%;
  min-width: 0;
}
.entry-btn {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: clamp(54px, 14vw, 64px);
  border-radius: 999px;
  font-size: clamp(17px, 4.8vw, 20px);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entry-btn.taobao {
  background: #f4ef2d;
}
.entry-btn.pdd {
  background: #b9e2f8;
}
.entry-btn.active {
  outline: 0;
  box-shadow: inset 0 0 0 3px #111;
}
.order-login-form {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(20, 38, 54, .08);
}
.order-login-form h2 {
  font-size: 20px;
}
.order-login-form p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.order-login-form label {
  font-size: 14px;
  min-width: 0;
}
.order-login-form .primary {
  width: 100%;
  max-width: 100%;
}
.bound-order {
  margin-top: 18px;
  padding: 10px 12px;
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  background: #eef8ff;
  color: #176487;
  font-weight: 800;
  line-height: 1.45;
  word-break: break-all;
}
.style-card {
  width: 100%;
  min-height: clamp(132px, 38vw, 150px);
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #f0f4f7;
  box-shadow: 0 10px 24px rgba(20, 38, 54, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.style-card img {
  width: 100%;
  height: 100%;
  max-height: clamp(104px, 30vw, 124px);
  object-fit: contain;
  display: block;
}
.placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f2f7fb;
  color: #97a3ad;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-back {
  width: 42px;
  height: 42px;
  margin-left: -10px;
  font-size: 42px;
  line-height: 36px;
}
.page-title {
  text-align: center;
  font-size: 24px;
  margin: -40px 42px 32px;
}
.detail-cover-wrap {
  height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-cover {
  max-width: 82%;
  max-height: 190px;
  object-fit: contain;
}
#detailTitle {
  text-align: center;
  font-size: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #1c1c1c;
}
.info-block {
  text-align: center;
  padding: 28px 12px;
  border-bottom: 1px solid #d8d8d8;
}
.info-block h3 {
  font-size: 18px;
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.info-block p {
  color: #343b44;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-line;
}
.primary, .outline {
  min-height: 48px;
  border-radius: 999px;
  font-weight: 800;
  padding: 0 22px;
}
.primary {
  background: var(--button);
  color: #000;
}
#submitOrderBtn {
  background: var(--submit);
}
.outline {
  border: 1px solid #ccd8e2;
  background: #fff;
}
.wide {
  width: 100%;
  margin-top: 34px;
}
.guide {
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 22px;
}
.guide strong {
  display: block;
  font-size: 20px;
  margin-bottom: 8px;
}
.red { color: var(--danger); }
.stage-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}
.side-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.side-tabs button {
  min-height: 36px;
  padding: 8px 16px;
  border: 1px solid #d5e2ee;
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
}
.side-tabs button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.stage {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
  touch-action: pan-y;
}
.template-text-overlay {
  position: absolute;
  display: inline-block;
  pointer-events: auto;
  white-space: pre;
  overflow: visible;
  overflow-wrap: normal;
  word-break: keep-all;
  z-index: 9;
  cursor: move;
  outline: 0;
  user-select: text;
  touch-action: none;
}
.template-text-overlay.active,
.template-text-overlay:focus {
  box-shadow: 0 0 0 2px rgba(47, 109, 246, .75);
  background: rgba(255, 255, 255, .24);
}
.template-text-delete {
  position: absolute;
  z-index: 12;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .22);
  touch-action: manipulation;
}
.template-asset {
  position: absolute;
  overflow: hidden;
  z-index: 1;
  cursor: move;
  touch-action: none;
}
.template-asset img {
  position: absolute;
  max-width: none;
  max-height: none;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.template-asset.locked {
  pointer-events: none;
  box-shadow: none;
}
.template-asset.active {
  box-shadow: 0 0 0 2px rgba(47, 109, 246, .75);
}
.user-asset {
  position: absolute;
  z-index: 1;
  cursor: move;
  touch-action: none;
}
.user-asset img {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.user-asset.active {
  box-shadow: 0 0 0 2px rgba(47, 109, 246, .85);
}
.user-asset-delete {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 4;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .22);
  touch-action: manipulation;
}
.fixed-asset {
  position: absolute;
  z-index: 8;
  padding: 0;
  border: 0;
  cursor: pointer;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: center;
  mask-position: center;
}
.fixed-asset.movable {
  cursor: move;
  touch-action: none;
}
.fixed-asset.active {
  outline: 2px solid rgba(47, 109, 246, .85);
  outline-offset: 2px;
}
.fixed-asset.deleted {
  opacity: .18;
}
.fixed-asset-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 8px;
  padding: 10px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #fff;
}
.fixed-asset-tools span {
  font-weight: 700;
}
.fixed-asset-tools input[type="color"] {
  width: 48px;
  height: 40px;
  padding: 2px;
}
.fixed-asset-tools #fixedAssetDeleteBtn {
  border-color: #ef4444;
  color: #ef4444;
  font-weight: 800;
}
.text-size-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: min(100%, 560px);
  max-width: calc(100vw - 18px);
  margin-inline: auto;
  margin: 18px 0 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.text-size-tools span {
  font-weight: 700;
}
.text-size-tools button {
  width: 44px;
  min-width: 44px;
  padding: 10px 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.text-size-tools input {
  width: 82px;
  height: 44px;
  padding: 0 10px;
  text-align: center;
}
.text-size-tools select {
  flex: 1 1 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d7dee6;
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
}
.text-size-tools .text-color-input {
  width: 46px;
  min-width: 46px;
  padding: 2px;
}
.text-size-tools .text-center-btn {
  width: auto;
  min-width: 74px;
  padding-inline: 14px;
}
.text-size-tools .text-delete-btn {
  width: auto;
  min-width: 74px;
  padding-inline: 14px;
  color: #dc2626;
}
.text-editor-panel {
  display: grid;
  gap: 12px;
  margin: 18px 0 10px;
  padding: 14px;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  background: #fff;
}
.text-editor-panel strong {
  font-size: 16px;
}
.text-editor-panel label {
  display: grid;
  gap: 6px;
}
.hole {
  position: absolute;
  overflow: hidden;
  background: #000;
  z-index: 10;
  touch-action: pan-y;
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000;
  transform: translateZ(0);
}
.hole.filled {
  background: transparent;
  box-shadow: none;
}
.hole.active {
  z-index: 10;
}
.photo {
  position: absolute;
  max-width: none;
  max-height: none;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}
.plus {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .72);
  font-size: 42px;
  line-height: 1;
  font-weight: 300;
  transform: translateY(-2%);
}
.frame {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.selection-ring {
  position: absolute;
  z-index: 11;
  pointer-events: none;
  border: 3px solid var(--blue);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .95);
}
.selected-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 18px;
}
.selected-tools span {
  font-weight: 700;
}
.selected-tools button {
  min-width: 138px;
}
.selected-tools #userAssetScaleDownBtn,
.selected-tools #userAssetScaleUpBtn {
  min-width: 48px;
  width: 48px;
  padding: 0;
  touch-action: none;
}
.selected-tools #userAssetScaleInput {
  width: 76px;
  min-height: 44px;
  border: 1px solid #d7dee6;
  border-radius: 10px;
  text-align: center;
  font: inherit;
  font-weight: 700;
}
.unlimited-photo-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 12px;
}
.unlimited-photo-tools span {
  min-width: 64px;
  text-align: center;
  color: #1f2933;
  font-weight: 800;
}
.unlimited-photo-tools button {
  min-width: 96px;
}
.editor-toolbar {
  position: sticky;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 10px;
  margin: 18px -6px 10px;
  padding: 12px 10px;
  border-top: 1px solid rgba(223, 231, 238, .9);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}
.editor-toolbar button {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 64px;
  border: 0;
  background: transparent;
  color: #1f2933;
  font-size: 14px;
  font-weight: 800;
}
.editor-toolbar button span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f2f7fb;
  color: var(--blue);
  font-size: 22px;
  line-height: 1;
}
.editor-history-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0 14px;
}
.editor-history-tools button {
  min-height: 44px;
  color: #475569;
}
.editor-history-tools button:disabled {
  opacity: .42;
}
.preset-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  max-height: min(58vh, 460px);
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: #fff;
  box-shadow: 0 -12px 32px rgba(15, 23, 42, .18);
}
.preset-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.preset-panel-head button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f3f6f9;
  font-size: 24px;
}
.preset-asset-grid {
  overflow: auto;
  max-height: calc(min(58vh, 460px) - 74px);
}
.preset-category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.preset-category-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #d8e0ea;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 13px;
}
.preset-category-tabs button.active {
  border-color: var(--blue);
  background: #edf8ff;
  color: #0f6ea8;
  font-weight: 700;
}
.preset-asset-items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.preset-asset-grid button {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #fff;
}
.preset-asset-grid .preset-category-tabs button {
  display: block;
  padding: 0 14px;
  border: 1px solid #d8e0ea;
  border-radius: 999px;
}
.preset-asset-grid .preset-category-tabs button.active {
  border-color: var(--blue);
  background: #edf8ff;
}
.preset-asset-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 6px;
}
.preset-upload-option {
  align-content: center;
  min-height: 96px;
  color: var(--blue);
  border-style: dashed !important;
  background: #f8fbff !important;
}
.preset-upload-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  background: #eef7ff;
  color: var(--blue);
  font-size: 28px;
  line-height: 1;
}
.preset-asset-grid span {
  min-width: 0;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
.actions .primary {
  grid-column: span 2;
}
.confirm-layout {
  display: grid;
  gap: 22px;
}
.preview-image {
  width: 100%;
  max-height: min(68vh, 720px);
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.order-fields {
  display: grid;
  gap: 14px;
}
.order-fields h3 { font-size: 20px; }
.order-fields p { color: var(--muted); }
label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}
input, textarea {
  width: 100%;
  border: 1px solid #cfd9e4;
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 12px;
  background: #fff;
  font-size: 16px;
}
textarea { resize: vertical; }
.notice {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: #fff6f6;
  color: #a32929;
  line-height: 1.5;
}
.notice:not(.error) {
  background: #eef8ff;
  color: #176487;
}
.notice.error {
  background: #fff6f6;
  color: #a32929;
}
.order-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
.order-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.order-item img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  background: #f6f9fb;
}
.order-item h3 {
  font-size: 16px;
  margin-bottom: 8px;
}
.order-item p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}
.order-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.outline.small {
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  border-color: #cfd9e4;
  background: #fff;
}
.outline.danger {
  color: #b42318;
  border-color: #f2c3bc;
}
.order-detail {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}
.order-detail-preview {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #f6f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.order-detail-body {
  display: grid;
  gap: 14px;
}
.order-detail-body h3 {
  font-size: 22px;
}
.status-line {
  width: max-content;
  padding: 6px 12px;
  border-radius: 999px;
  color: #146c43;
  background: #eaf7ef;
  font-weight: 800;
}
.order-detail dl {
  display: grid;
  gap: 10px;
}
.order-detail dl div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.order-detail dt {
  color: var(--muted);
}
.order-detail dd {
  font-weight: 700;
}
.detail-actions {
  margin-top: 4px;
}
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid #edf1f4;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.bottom-nav button {
  font-size: 16px;
  color: #808894;
}
.bottom-nav .on { color: #000; font-weight: 800; }
.cropper {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #050505;
  color: #fff;
  padding: calc(60px + env(safe-area-inset-top)) 24px calc(30px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cropper-title {
  text-align: center;
  font-size: 18px;
  margin-bottom: 70px;
}
.cropper-window {
  position: relative;
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  background: #3c3a3a;
  touch-action: none;
}
.cropper-window::before,
.cropper-window::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cropper-window::before { border: 2px solid rgba(255,255,255,.45); }
.cropper-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: auto;
}
.cropper-actions .outline,
.cropper-actions .primary {
  color: #000;
}
.cropper-actions .primary { grid-column: span 2; }
.hidden { display: none !important; }

@media (min-width: 760px) {
  .view {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding-left: 34px;
    padding-right: 34px;
  }
  .style-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .confirm-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .bottom-nav { max-width: 980px; left: 50%; transform: translateX(-50%); }
}

@media (max-width: 760px) {
  .text-size-tools {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    left: 50%;
    z-index: 1200;
    width: min(560px, calc(100vw - 18px));
    max-width: calc(100vw - 18px);
    margin: 0;
    padding: 8px;
    border: 1px solid #dbe5ef;
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
    transform: translateX(-50%);
  }
  .text-size-tools span {
    font-size: 14px;
    white-space: nowrap;
  }
  .text-size-tools button {
    height: 36px;
    min-width: 38px;
    padding: 7px 0;
  }
  .text-size-tools input {
    width: 64px;
    height: 36px;
  }
  .text-size-tools select {
    flex-basis: 100%;
    height: 36px;
  }
  .text-size-tools .text-color-input {
    width: 38px;
    min-width: 38px;
    height: 36px;
    padding: 2px;
  }
  .text-size-tools .text-center-btn {
    min-width: 62px;
    padding-inline: 10px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .text-size-tools {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    left: 50%;
    z-index: 1200;
    width: min(560px, calc(100vw - 18px));
    max-width: calc(100vw - 18px);
    margin: 0;
    padding: 8px;
    border: 1px solid #dbe5ef;
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
    transform: translateX(-50%);
  }
  .text-size-tools span {
    font-size: 14px;
    white-space: nowrap;
  }
  .text-size-tools button {
    height: 36px;
    min-width: 38px;
    padding: 7px 0;
  }
  .text-size-tools input {
    width: 64px;
    height: 36px;
  }
  .text-size-tools select {
    flex-basis: 100%;
    height: 36px;
  }
  .text-size-tools .text-color-input {
    width: 38px;
    min-width: 38px;
    height: 36px;
    padding: 2px;
  }
  .text-size-tools .text-center-btn {
    min-width: 62px;
    padding-inline: 10px;
  }
  .view {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }
  [data-view="login"] {
    padding-left: 0;
    padding-right: 0;
  }
  .login-entry {
    width: min(calc(100vw - 48px), 360px);
    max-width: calc(100vw - 48px);
    min-height: calc(100vh - 80px);
    margin-left: auto;
    margin-right: auto;
    align-content: center;
    justify-items: stretch;
  }
  .login-entry h1 {
    font-size: clamp(28px, 8vw, 36px);
  }
  .entry-btn {
    min-height: clamp(52px, 12vw, 62px);
    font-size: clamp(17px, 4.4vw, 20px);
  }
  [data-view="home"] .top {
    padding-top: 8px;
    text-align: left;
  }
  [data-view="home"] h1 {
    font-size: clamp(28px, 8vw, 34px);
  }
  [data-view="home"] .top p {
    margin-top: 12px;
    font-size: 16px;
  }
  .style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .style-grid.single-style {
    grid-template-columns: minmax(168px, 48vw);
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .view {
    width: 100%;
    overflow-x: hidden;
    padding-left: 18px;
    padding-right: 18px;
  }
  [data-view="login"] {
    padding-left: 0;
    padding-right: 0;
  }
  .login-entry {
    width: min(calc(100vw - 48px), 360px);
    max-width: calc(100vw - 48px);
  }
  [data-view="home"] .top {
    padding-top: 8px;
    text-align: left;
  }
  [data-view="home"] h1 {
    font-size: clamp(28px, 8vw, 34px);
  }
  [data-view="home"] .top p {
    margin-top: 12px;
    font-size: 16px;
  }
  .bound-order {
    margin-top: 14px;
    padding: 9px 10px;
  }
  .style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
  }
  .style-grid.single-style {
    grid-template-columns: minmax(168px, 48vw);
    justify-content: center;
  }
  .style-card {
    min-height: auto;
    padding: 12px;
  }
  .style-card img {
    max-height: none;
  }
  .bottom-nav {
    height: calc(58px + env(safe-area-inset-bottom));
  }
  .confirm-layout {
    gap: 16px;
  }
  .preview-image {
    max-height: 58vh;
  }
  .side-tabs {
    gap: 10px;
    margin-bottom: 14px;
  }
  .side-tabs button {
    min-width: 88px;
    min-height: 42px;
    padding: 8px 18px;
    font-size: 16px;
  }
  .selected-tools {
    margin: 18px 0 14px;
    gap: 10px;
  }
  .selected-tools button {
    min-width: min(142px, calc((100vw - 58px) / 2));
  }
  #pngUploadTools button {
    min-width: min(150px, calc((100vw - 48px) / 2));
  }
  .custom-create-tools button {
    min-width: min(140px, calc((100vw - 58px) / 2));
  }
  .editor-toolbar button {
    min-width: 0;
  }
  .actions {
    gap: 14px;
    margin-top: 18px;
  }
}

@media (max-width: 380px) {
  .style-grid {
    gap: 10px;
  }
  .style-card {
    padding: 12px;
  }
  .top p {
    font-size: 16px;
  }
  .bound-order {
    font-size: 14px;
  }
}
