.tuce-template-total-bubble {
  --tuce-template-accent: #1677ff;
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  margin-left: auto;
  padding: 0 16px 0 11px;
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--tuce-template-accent) 22%, #d8e1e7);
  border-radius: 999px;
  background: #eef6ff;
  background: color-mix(in srgb, var(--tuce-template-accent) 9%, #ffffff);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--tuce-template-accent) 12%, transparent);
  color: var(--tuce-template-accent);
  line-height: 1;
  white-space: nowrap;
}

.tuce-template-total-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.tuce-template-total-value {
  color: var(--tuce-template-accent);
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.tuce-template-new-badge {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #ff4d4f;
  color: #ffffff;
  font: 700 10px/12px system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  transform: translate(50%, -45%);
  cursor: pointer;
}

.tuce-template-new-badge[hidden] {
  display: none;
}

.tuce-template-new-badge::after {
  position: absolute;
  inset: -8px;
  content: "";
}

.tuce-template-new-badge:focus-visible {
  outline: 2px solid #ff7875;
  outline-offset: 2px;
}

[data-tuce-template-stat-card] {
  column-gap: 10px;
}

[data-tuce-template-stat-card] > br {
  display: none !important;
}

[data-tuce-template-countdown-slot] {
  flex: 1 1 auto;
  min-width: 0;
}

.tuce-mobile-category-trigger,
.tuce-mobile-category-overlay,
.tuce-mobile-pane-tabs {
  display: none;
}

.ant-modal-mask {
  z-index: 2147483099 !important;
}

.ant-modal-wrap {
  z-index: 2147483100 !important;
}

.ant-popover {
  z-index: 2147483150 !important;
}

@media (min-width: 768px) and (max-width: 1023px) {
  html.tuce-compact-active [data-tuce-home-header] {
    height: auto !important;
  }

  html.tuce-compact-active [data-tuce-home-header-inner] {
    padding: 14px 16px 10px !important;
  }

  html.tuce-compact-active .tuce-home-banner {
    margin-top: 0 !important;
  }

  html.tuce-compact-active [data-tuce-home-sidebar] {
    width: 140px !important;
    flex: 0 0 140px !important;
  }

  html.tuce-compact-active [data-tuce-home-content] {
    width: calc(100% - 140px) !important;
    min-width: 0 !important;
    padding-right: 12px !important;
  }

  html.tuce-compact-active [data-tuce-home-content] .itme {
    width: calc(20% - 10px) !important;
    margin-left: 8px !important;
  }
}

@media (max-width: 899px) {
  [data-tuce-template-stat-card] {
    column-gap: 7px;
  }

  [data-tuce-template-countdown-slot] {
    margin-left: 0 !important;
  }

  [data-tuce-template-stat-card] .ant-statistic-content {
    font-size: 30px !important;
    white-space: nowrap;
  }

  .tuce-template-total-bubble {
    gap: 4px;
    padding: 0 14px 0 9px;
  }

  .tuce-template-total-label {
    font-size: 11px;
  }

  .tuce-template-total-value {
    font-size: 15px;
  }

  body[data-tuce-mobile-page="editor"] {
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  .tuce-mobile-pane-tabs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    min-height: 46px;
    padding: 5px max(8px, env(safe-area-inset-right)) 5px max(8px, env(safe-area-inset-left));
    background: #fff;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #d8dee6;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
  }

  .tuce-mobile-pane-tabs button {
    min-width: 0;
    min-height: 36px;
    margin: 0;
    border: 0;
    border-right: 1px solid #d8dee6;
    border-radius: 0;
    background: #f6f8fa;
    color: #475569;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
  }

  .tuce-mobile-pane-tabs button:first-child {
    border-radius: 6px 0 0 6px;
  }

  .tuce-mobile-pane-tabs button:last-child {
    border-right: 0;
    border-radius: 0 6px 6px 0;
  }

  .tuce-mobile-pane-tabs button.is-active {
    background: #1677ff;
    color: #fff;
  }

  [data-tuce-mobile-editor] {
    display: block !important;
    width: 100% !important;
    height: calc(100dvh - var(--tuce-editor-top-offset, 46px)) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  [data-tuce-mobile-editor] > [data-tuce-editor-pane] {
    display: none !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding-right: max(8px, env(safe-area-inset-right)) !important;
    padding-left: max(8px, env(safe-area-inset-left)) !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  [data-tuce-mobile-editor] > [data-tuce-editor-pane][data-tuce-mobile-active="true"] {
    display: block !important;
  }

  [data-tuce-editor-pane="parameters"] .menuMian,
  [data-tuce-editor-pane="parameters"] .fromItme,
  [data-tuce-editor-pane="templates"] .menuMian,
  [data-tuce-editor-pane="templates"] .fromItme {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important;
    overflow: visible !important;
  }

  [data-tuce-mobile-editor] > [data-tuce-editor-pane="preview"] {
    position: relative !important;
    padding: 8px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #eef1f4 !important;
  }

  [data-tuce-mobile-editor] > [data-tuce-editor-pane="preview"] > * {
    max-width: 100%;
    margin-right: auto;
    margin-left: auto;
  }

  [data-tuce-mobile-editor] > [data-tuce-editor-pane="preview"] > [data-tuce-mobile-preview-adapted] {
    top: 8px !important;
    left: 8px !important;
    width: var(--tuce-preview-base-width) !important;
    max-width: none !important;
    margin: 0 !important;
    transform: scale(var(--tuce-preview-scale)) !important;
    transform-origin: 0 0 !important;
  }

  [data-tuce-mobile-preview-spacer] {
    display: block;
    width: 1px;
    min-height: 1px;
    pointer-events: none;
  }

  [data-tuce-editor-pane="templates"] {
    position: relative !important;
    background: #fff !important;
  }

  [data-tuce-editor-pane="templates"] .editField {
    position: absolute !important;
    top: 0 !important;
    right: 4px !important;
    left: auto !important;
  }

  [data-tuce-editor-pane="templates"] [style*="position: fixed"][style*="bottom: 0px"] {
    right: 0 !important;
    left: auto !important;
    max-width: 100% !important;
  }

  [data-tuce-editor-pane="parameters"] .ant-btn,
  [data-tuce-editor-pane="templates"] .ant-btn,
  [data-tuce-editor-pane="parameters"] button,
  [data-tuce-editor-pane="templates"] button {
    min-height: 38px;
  }

  [data-tuce-editor-pane="parameters"] input,
  [data-tuce-editor-pane="templates"] input,
  [data-tuce-editor-pane="parameters"] textarea,
  [data-tuce-editor-pane="templates"] textarea,
  [data-tuce-editor-pane="parameters"] .ant-select,
  [data-tuce-editor-pane="templates"] .ant-select {
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  html.tuce-mobile-active,
  html.tuce-mobile-active body,
  html.tuce-mobile-active #app {
    width: 100%;
    min-width: 0;
    min-height: 100%;
  }

  html.tuce-mobile-active[data-tuce-mobile-page="home"] {
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
  }

  html.tuce-mobile-active[data-tuce-mobile-page="home"] body,
  html.tuce-mobile-active[data-tuce-mobile-page="home"] #app {
    height: auto !important;
    min-height: 100dvh;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    touch-action: pan-y;
  }

  body[data-tuce-mobile-page="login"],
  body[data-tuce-mobile-page="home"] {
    overflow-x: hidden;
  }

  body[data-tuce-mobile-page="login"] {
    overflow-y: auto !important;
  }

  body[data-tuce-mobile-page="login"] [data-tuce-mobile-login-shell],
  body[data-tuce-mobile-page="login"] .login-container {
    width: 100% !important;
    min-height: 100dvh !important;
    padding: max(52px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
    overflow-y: auto !important;
  }

  body[data-tuce-mobile-page="login"] [data-tuce-mobile-login-card],
  body[data-tuce-mobile-page="login"] .login-box,
  body[data-tuce-mobile-page="login"] .login-container:not(:has(.login-box)) {
    width: min(100%, 380px) !important;
    max-width: 380px !important;
  }

  body[data-tuce-mobile-page="login"] [data-tuce-mobile-login-card],
  body[data-tuce-mobile-page="login"] .login-box {
    max-height: none;
    padding: 20px 16px !important;
    overflow: visible !important;
  }

  body[data-tuce-mobile-page="login"] .tuce-password-visibility {
    width: 24px !important;
    min-width: 24px !important;
    height: 22px !important;
    min-height: 22px !important;
  }

  body[data-tuce-mobile-page="login"] [data-tuce-mobile-login-card] {
    margin-right: auto !important;
    margin-left: auto !important;
  }

  body[data-tuce-mobile-page="login"] input,
  body[data-tuce-mobile-page="login"] .ant-input,
  body[data-tuce-mobile-page="login"] button,
  body[data-tuce-mobile-page="login"] .ant-btn {
    min-height: 44px;
    font-size: 16px;
  }

  [data-tuce-mobile-home] {
    height: auto !important;
    min-height: 100dvh;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
    overflow: visible !important;
    background: #f0f1f5 !important;
    touch-action: pan-y;
  }

  [data-tuce-home-header] {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  [data-tuce-home-header-inner] {
    padding: max(10px, env(safe-area-inset-top)) 10px 8px !important;
  }

  .tuce-home-banner {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    align-items: stretch !important;
    margin-top: 0 !important;
  }

  .tuce-home-banner > div {
    width: 100% !important;
    min-height: 0 !important;
    padding: 8px 10px !important;
  }

  .tuce-home-banner > div:first-of-type {
    min-height: 52px !important;
  }

  .tuce-home-banner .flex {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .tuce-home-banner .itmeTop {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin-left: 0 !important;
    padding: 3px 7px;
    font-size: 13px !important;
    white-space: nowrap;
  }

  [data-tuce-home-layout] {
    display: block !important;
    margin-top: 0 !important;
    touch-action: pan-y;
  }

  [data-tuce-home-content] {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 6px calc(18px + env(safe-area-inset-bottom)) !important;
    overflow: visible !important;
    touch-action: pan-y;
  }

  [data-tuce-home-content] .main,
  [data-tuce-home-content] .main_type2 {
    width: 100% !important;
    height: auto !important;
    min-height: calc(100dvh - 190px) !important;
    padding: 2px 0 78px !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  [data-tuce-home-content] .itme {
    width: calc(33.333% - 8px) !important;
    height: 84px !important;
    margin: 6px 4px 0 !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    vertical-align: top;
  }

  [data-tuce-home-content] .itmeImage {
    height: 44px !important;
    padding-top: 9px !important;
  }

  [data-tuce-home-content] .itmeImage img {
    width: 30px !important;
    height: 30px !important;
  }

  [data-tuce-home-disclaimer] {
    position: static !important;
    width: auto !important;
    margin: 14px 8px 0 !important;
    padding: 0 !important;
    color: #6b7280;
    font-size: 11px !important;
    line-height: 1.5;
  }

  [data-tuce-home-sidebar] {
    position: fixed !important;
    top: var(--tuce-home-drawer-top, 30px);
    bottom: 0;
    left: 0;
    z-index: 2147483002 !important;
    display: block !important;
    width: min(82vw, 320px) !important;
    height: calc(100dvh - var(--tuce-home-drawer-top, 30px)) !important;
    max-height: calc(100dvh - var(--tuce-home-drawer-top, 30px)) !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    padding: 12px 12px max(16px, env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #fff !important;
    box-shadow: 14px 0 32px rgba(15, 23, 42, .22);
    overscroll-behavior: contain;
    touch-action: none;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }

  [data-tuce-home-sidebar] .scroll-container {
    display: block !important;
    width: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  [data-tuce-home-sidebar] button {
    min-height: 42px;
  }

  body.tuce-mobile-home-drawer-open {
    overflow: hidden !important;
  }

  html.tuce-mobile-home-drawer-open {
    overflow-y: hidden !important;
  }

  body.tuce-mobile-home-drawer-open [data-tuce-home-sidebar] {
    transform: translateX(0);
  }

  .tuce-mobile-category-trigger {
    position: fixed;
    bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
    left: max(14px, env(safe-area-inset-left));
    z-index: 2147483001;
    display: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #0f5ec7;
    border-radius: 50%;
    background: #1677ff;
    box-shadow: 0 8px 20px rgba(22, 119, 255, .3);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }

  body[data-tuce-mobile-page="home"] .tuce-mobile-category-trigger {
    display: flex;
  }

  .tuce-mobile-category-overlay {
    position: fixed;
    top: var(--tuce-home-drawer-top, 30px);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483000;
    display: none;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, .42);
  }

  body.tuce-mobile-home-drawer-open .tuce-mobile-category-overlay {
    display: block;
  }

  .ant-modal {
    top: 0 !important;
    width: calc(100vw - 24px) !important;
    max-width: 560px !important;
    margin: 12px auto !important;
    padding-bottom: 0 !important;
  }

  .ant-modal-wrap {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .ant-modal-content {
    max-height: calc(100dvh - 24px);
    border-radius: 8px !important;
    overflow: auto;
  }

  .ant-modal-body {
    max-height: calc(100dvh - 150px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ant-modal-footer .ant-btn {
    min-height: 40px;
  }

  .tuce-order-rule-overlay {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .tuce-order-rule-dialog {
    box-sizing: border-box;
    width: min(360px, 100%) !important;
    max-height: 100% !important;
  }

  .ant-tabs-nav-wrap {
    overflow-x: auto;
  }
}

@media (max-width: 899px) {
  .tuce-multi-window-entry {
    display: none !important;
  }

  body.tuce-mobile-image-exporting [data-tuce-mobile-editor] > [data-tuce-editor-pane="preview"] {
    position: fixed !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    left: -20000px !important;
    z-index: -1 !important;
    display: block !important;
    width: 1300px !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    pointer-events: none !important;
  }

  body.tuce-mobile-image-exporting [data-tuce-editor-pane="preview"] > .resizable-div {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 1300px !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    transform: none !important;
    transform-origin: 0 0 !important;
  }

  body.tuce-mobile-image-exporting [data-tuce-editor-pane="preview"] .content,
  body.tuce-mobile-image-exporting [data-tuce-editor-pane="preview"] #showImage {
    width: 1300px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.tuce-mobile-image-exporting [data-tuce-mobile-preview-spacer] {
    display: none !important;
  }
}

@media (max-width: 360px) {
  .tuce-template-total-bubble {
    padding-right: 18px;
  }

  [data-tuce-template-stat-card] .ant-statistic-content {
    font-size: 20px !important;
  }
}

@media (max-width: 340px) {
  [data-tuce-home-content] .itme {
    width: calc(50% - 8px) !important;
  }
}

@media (max-width: 899px) and (orientation: landscape) {
  [data-tuce-mobile-editor] {
    height: calc(100dvh - var(--tuce-editor-top-offset, 44px)) !important;
  }

  .tuce-mobile-pane-tabs {
    min-height: 40px;
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .tuce-mobile-pane-tabs button {
    min-height: 32px;
  }
}

#tuce-mobile-image-action-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483200;
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: rgb(15 23 42 / 58%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

#tuce-mobile-image-action-overlay * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.tuce-mobile-image-action-dialog {
  display: flex;
  width: min(460px, 100%);
  max-height: min(760px, calc(100dvh - 28px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgb(15 23 42 / 24%);
  color: #172033;
}

.tuce-mobile-image-action-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf1f5;
}

.tuce-mobile-image-action-dialog h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
}

.tuce-mobile-image-action-dialog header p {
  margin: 6px 0 0;
  color: #56657a;
  font-size: 14px;
  line-height: 1.65;
}

.tuce-mobile-image-action-close {
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: #718096;
  font-size: 26px;
  line-height: 1;
}

.tuce-mobile-image-action-preview {
  min-height: 180px;
  padding: 14px;
  overflow: auto;
  background: #f3f6f9;
  text-align: center;
  overscroll-behavior: contain;
}

.tuce-mobile-image-action-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(52dvh, 520px);
  margin: 0 auto;
  border: 1px solid #d8e0e8;
  background: #ffffff;
  object-fit: contain;
  -webkit-touch-callout: default;
  user-select: auto;
}

.tuce-mobile-image-action-status {
  min-height: 20px;
  padding: 8px 18px 0;
  color: #237804;
  font-size: 13px;
  line-height: 20px;
}

.tuce-mobile-image-action-status.is-error {
  color: #c53929;
}

.tuce-mobile-image-action-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 18px;
}

.tuce-mobile-image-action-dialog footer button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #ffffff;
  color: #26364d;
  font-size: 14px;
}

.tuce-mobile-image-action-dialog footer button.primary {
  border-color: #1677ff;
  background: #1677ff;
  color: #ffffff;
}

.tuce-mobile-image-action-dialog button:focus-visible {
  outline: 3px solid rgb(22 119 255 / 28%);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .tuce-mobile-image-action-dialog {
    max-height: calc(100dvh - 28px);
  }

  .tuce-mobile-image-action-dialog footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tuce-mobile-image-action-dialog footer button {
    width: 100%;
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tuce-mobile-image-action-overlay * {
    scroll-behavior: auto !important;
  }
}
