/* ============================================================
   自定义响应式工具类
   断点：768px
   - m-* 前缀：移动端（max-width: 767px）
   - d-* 前缀：桌面端（min-width: 768px）
   注：此文件不经过 Tailwind 处理，直接原生 CSS 输出
   ============================================================ */

/* 键盘适配：--kb-vh 由 JS 监听 visualViewport 动态设置，
   无 JS 时回退到 100dvh，再回退到 100vh */
:root {
  --kb-vh: 1dvh;
}

html,
body,
#root {
  height: 100%;
  min-height: 100dvh;
  min-height: calc(var(--kb-vh, 1dvh) * 100);
}

/* 输入框聚焦时底部留出空间，避免被软键盘遮挡 */
@media (max-width: 767px) {
  input:focus,
  textarea:focus,
  select:focus,
  [contenteditable="true"]:focus {
    scroll-margin-bottom: 40vh;
    scroll-margin-bottom: calc(var(--kb-vh, 1dvh) * 40);
  }

  /* 键盘弹出时隐藏底部固定元素，避免叠加遮挡 */
  body.kb-open .kb-hidden {
    display: none !important;
  }

  /* 键盘弹出时给滚动容器底部留出空间 */
  body.kb-open .overflow-auto,
  body.kb-open .overflow-y-auto {
    padding-bottom: 32vh;
    padding-bottom: calc(var(--kb-vh, 1dvh) * 32);
  }

  /* 主滚动容器键盘弹出时的内边距（更精准） */
  body.kb-open .kb-scroll-container {
    padding-bottom: 50vh !important;
    padding-bottom: calc(var(--kb-vh, 1dvh) * 50) !important;
  }

  /* ========= 鸿蒙浏览器专项适配（focusin驱动） ========= */
  body.keyboard-open .kb-hidden {
    display: none !important;
  }

  body.keyboard-open .dialog-content-responsive {
    max-height: calc(100dvh - 2rem) !important;
    margin-bottom: 0;
  }

  /* 鸿蒙微信弹窗强制顶部对齐，避免fixed居中被键盘挡住底部 */
  body.keyboard-open [data-slot="dialog-content"],
  body.keyboard-open [data-slot="sheet-content"] {
    bottom: auto !important;
  }

  body.keyboard-open [data-slot="sheet-content"][data-side="bottom"] {
    top: 2rem !important;
    bottom: auto !important;
    max-height: calc(100dvh - 4rem) !important;
    transform: none !important;
  }

  /* 键盘弹出时弹窗高度适配 */
  body.kb-open .dialog-content-responsive {
    max-height: calc(var(--kb-vh, 1dvh) * 90) !important;
  }
}

@media (max-width: 767px) {
  .m-hidden { display: none !important; }
  .m-block { display: block !important; }
  .m-flex { display: flex !important; }
  .m-grid { display: grid !important; }
  .m-inline-flex { display: inline-flex !important; }
  .m-inline-block { display: inline-block !important; }

  .m-flex-col { flex-direction: column !important; }
  .m-flex-col-reverse { flex-direction: column-reverse !important; }
  .m-flex-row { flex-direction: row !important; }
  .m-flex-row-reverse { flex-direction: row-reverse !important; }
  .m-flex-wrap { flex-wrap: wrap !important; }
  .m-flex-nowrap { flex-wrap: nowrap !important; }
  .m-flex-1 { flex: 1 1 0% !important; }
  .m-flex-auto { flex: 1 1 auto !important; }
  .m-grow { flex-grow: 1 !important; }
  .m-grow-0 { flex-grow: 0 !important; }
  .m-shrink-0 { flex-shrink: 0 !important; }
  .m-shrink { flex-shrink: 1 !important; }

  .m-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
  .m-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .m-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .m-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }

  .m-col-span-1 { grid-column: span 1 / span 1 !important; }
  .m-col-span-2 { grid-column: span 2 / span 2 !important; }
  .m-col-span-3 { grid-column: span 3 / span 3 !important; }
  .m-col-span-full { grid-column: 1 / -1 !important; }

  .m-gap-0 { gap: 0 !important; }
  .m-gap-1 { gap: 0.25rem !important; }
  .m-gap-1\.5 { gap: 0.375rem !important; }
  .m-gap-2 { gap: 0.5rem !important; }
  .m-gap-3 { gap: 0.75rem !important; }
  .m-gap-4 { gap: 1rem !important; }
  .m-gap-5 { gap: 1.25rem !important; }
  .m-gap-6 { gap: 1.5rem !important; }
  .m-gap-8 { gap: 2rem !important; }

  .m-gap-x-2 { column-gap: 0.5rem !important; }
  .m-gap-x-3 { column-gap: 0.75rem !important; }
  .m-gap-x-4 { column-gap: 1rem !important; }
  .m-gap-y-2 { row-gap: 0.5rem !important; }
  .m-gap-y-3 { row-gap: 0.75rem !important; }
  .m-gap-y-4 { row-gap: 1rem !important; }

  .m-space-x-0 > * + * { margin-left: 0 !important; }
  .m-space-x-2 > * + * { margin-left: 0.5rem !important; }
  .m-space-y-1 > * + * { margin-top: 0.25rem !important; }
  .m-space-y-2 > * + * { margin-top: 0.5rem !important; }
  .m-space-y-3 > * + * { margin-top: 0.75rem !important; }
  .m-space-y-4 > * + * { margin-top: 1rem !important; }
  .m-space-y-6 > * + * { margin-top: 1.5rem !important; }

  .m-p-0 { padding: 0 !important; }
  .m-p-1 { padding: 0.25rem !important; }
  .m-p-2 { padding: 0.5rem !important; }
  .m-p-3 { padding: 0.75rem !important; }
  .m-p-4 { padding: 1rem !important; }
  .m-p-6 { padding: 1.5rem !important; }

  .m-px-0 { padding-left: 0 !important; padding-right: 0 !important; }
  .m-px-1 { padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
  .m-px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
  .m-px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
  .m-px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
  .m-px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }

  .m-py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
  .m-py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
  .m-py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
  .m-py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
  .m-py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .m-py-6 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }

  .m-pl-0 { padding-left: 0 !important; }
  .m-pl-1 { padding-left: 0.25rem !important; }
  .m-pl-2 { padding-left: 0.5rem !important; }
  .m-pl-3 { padding-left: 0.75rem !important; }
  .m-pl-4 { padding-left: 1rem !important; }
  .m-pr-0 { padding-right: 0 !important; }
  .m-pr-1 { padding-right: 0.25rem !important; }
  .m-pr-2 { padding-right: 0.5rem !important; }
  .m-pr-3 { padding-right: 0.75rem !important; }
  .m-pr-4 { padding-right: 1rem !important; }
  .m-pt-0 { padding-top: 0 !important; }
  .m-pt-1 { padding-top: 0.25rem !important; }
  .m-pt-2 { padding-top: 0.5rem !important; }
  .m-pt-3 { padding-top: 0.75rem !important; }
  .m-pt-4 { padding-top: 1rem !important; }
  .m-pb-0 { padding-bottom: 0 !important; }
  .m-pb-1 { padding-bottom: 0.25rem !important; }
  .m-pb-2 { padding-bottom: 0.5rem !important; }
  .m-pb-3 { padding-bottom: 0.75rem !important; }
  .m-pb-4 { padding-bottom: 1rem !important; }
  .m-pb-6 { padding-bottom: 1.5rem !important; }
  .m-pb-8 { padding-bottom: 2rem !important; }

  .m-m-0 { margin: 0 !important; }
  .m-m-1 { margin: 0.25rem !important; }
  .m-m-2 { margin: 0.5rem !important; }
  .m-m-3 { margin: 0.75rem !important; }
  .m-m-4 { margin: 1rem !important; }

  .m-mx-0 { margin-left: 0 !important; margin-right: 0 !important; }
  .m-mx-2 { margin-left: 0.5rem !important; margin-right: 0.5rem !important; }
  .m-mx-3 { margin-left: 0.75rem !important; margin-right: 0.75rem !important; }
  .m-mx-4 { margin-left: 1rem !important; margin-right: 1rem !important; }
  .m-mx-auto { margin-left: auto !important; margin-right: auto !important; }

  .m-my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
  .m-my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
  .m-my-3 { margin-top: 0.75rem !important; margin-bottom: 0.75rem !important; }
  .m-my-4 { margin-top: 1rem !important; margin-bottom: 1rem !important; }

  .m-mt-0 { margin-top: 0 !important; }
  .m-mt-1 { margin-top: 0.25rem !important; }
  .m-mt-2 { margin-top: 0.5rem !important; }
  .m-mt-3 { margin-top: 0.75rem !important; }
  .m-mt-4 { margin-top: 1rem !important; }
  .m-mt-6 { margin-top: 1.5rem !important; }
  .m-mt-8 { margin-top: 2rem !important; }
  .m-mt-auto { margin-top: auto !important; }

  .m-mb-0 { margin-bottom: 0 !important; }
  .m-mb-1 { margin-bottom: 0.25rem !important; }
  .m-mb-2 { margin-bottom: 0.5rem !important; }
  .m-mb-3 { margin-bottom: 0.75rem !important; }
  .m-mb-4 { margin-bottom: 1rem !important; }
  .m-mb-6 { margin-bottom: 1.5rem !important; }
  .m-mb-8 { margin-bottom: 2rem !important; }

  .m-ml-0 { margin-left: 0 !important; }
  .m-ml-1 { margin-left: 0.25rem !important; }
  .m-ml-2 { margin-left: 0.5rem !important; }
  .m-ml-3 { margin-left: 0.75rem !important; }
  .m-ml-4 { margin-left: 1rem !important; }
  .m-ml-auto { margin-left: auto !important; }

  .m-mr-0 { margin-right: 0 !important; }
  .m-mr-1 { margin-right: 0.25rem !important; }
  .m-mr-2 { margin-right: 0.5rem !important; }
  .m-mr-3 { margin-right: 0.75rem !important; }
  .m-mr-4 { margin-right: 1rem !important; }
  .m-mr-auto { margin-right: auto !important; }

  .m-w-full { width: 100% !important; }
  .m-w-auto { width: auto !important; }
  .m-w-1\/2 { width: 50% !important; }
  .m-w-1\/3 { width: 33.333% !important; }
  .m-w-2\/3 { width: 66.667% !important; }
  .m-w-1\/4 { width: 25% !important; }
  .m-w-3\/4 { width: 75% !important; }
  .m-min-w-0 { min-width: 0 !important; }
  .m-min-w-full { min-width: 100% !important; }
  .m-max-w-full { max-width: 100% !important; }
  .m-max-w-none { max-width: none !important; }
  .m-max-w-xs { max-width: 20rem !important; }
  .m-max-w-sm { max-width: 24rem !important; }
  .m-max-w-md { max-width: 28rem !important; }
  .m-max-w-lg { max-width: 32rem !important; }
  .m-max-w-xl { max-width: 36rem !important; }

  .m-h-auto { height: auto !important; }
  .m-h-full { height: 100% !important; }
  .m-h-screen { height: 100vh !important; }
  .m-h-dvh { height: 100dvh !important; }
  .m-h-svh { height: 100svh !important; }
  .m-min-h-0 { min-height: 0 !important; }
  .m-min-h-screen { min-height: 100vh !important; }
  .m-max-h-\[70vh\] { max-height: 70vh !important; }
  .m-max-h-\[80vh\] { max-height: 80vh !important; }
  .m-max-h-\[90vh\] { max-height: 90vh !important; }
  .m-max-h-full { max-height: 100% !important; }

  .m-text-left { text-align: left !important; }
  .m-text-center { text-align: center !important; }
  .m-text-right { text-align: right !important; }

  .m-text-xs { font-size: 0.75rem !important; line-height: 1rem !important; }
  .m-text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
  .m-text-base { font-size: 1rem !important; line-height: 1.5rem !important; }
  .m-text-lg { font-size: 1.125rem !important; line-height: 1.75rem !important; }
  .m-text-xl { font-size: 1.25rem !important; line-height: 1.75rem !important; }
  .m-text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; }
  .m-text-3xl { font-size: 1.875rem !important; line-height: 2.25rem !important; }

  .m-font-thin { font-weight: 100 !important; }
  .m-font-light { font-weight: 300 !important; }
  .m-font-normal { font-weight: 400 !important; }
  .m-font-medium { font-weight: 500 !important; }
  .m-font-semibold { font-weight: 600 !important; }
  .m-font-bold { font-weight: 700 !important; }

  .m-leading-none { line-height: 1 !important; }
  .m-leading-tight { line-height: 1.25 !important; }
  .m-leading-snug { line-height: 1.375 !important; }
  .m-leading-normal { line-height: 1.5 !important; }
  .m-leading-relaxed { line-height: 1.625 !important; }

  .m-tracking-tight { letter-spacing: -0.025em !important; }
  .m-tracking-normal { letter-spacing: 0em !important; }
  .m-tracking-wide { letter-spacing: 0.025em !important; }

  .m-rounded-none { border-radius: 0 !important; }
  .m-rounded-sm { border-radius: 0.125rem !important; }
  .m-rounded { border-radius: 0.25rem !important; }
  .m-rounded-md { border-radius: 0.375rem !important; }
  .m-rounded-lg { border-radius: 0.5rem !important; }
  .m-rounded-full { border-radius: 9999px !important; }
  .m-rounded-t-none { border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
  .m-rounded-b-none { border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; }

  .m-border-0 { border-width: 0 !important; }
  .m-border-2 { border-width: 2px !important; }
  .m-border { border-width: 1px !important; }
  .m-border-l-0 { border-left-width: 0 !important; }
  .m-border-r-0 { border-right-width: 0 !important; }
  .m-border-t-0 { border-top-width: 0 !important; }
  .m-border-b-0 { border-bottom-width: 0 !important; }

  .m-overflow-hidden { overflow: hidden !important; }
  .m-overflow-auto { overflow: auto !important; }
  .m-overflow-x-auto { overflow-x: auto !important; }
  .m-overflow-y-auto { overflow-y: auto !important; }
  .m-overflow-visible { overflow: visible !important; }
  .m-overflow-scroll { overflow: scroll !important; }
  .m-overflow-x-scroll { overflow-x: scroll !important; }
  .m-overflow-y-scroll { overflow-y: scroll !important; }
  .m-overflow-clip { overflow: clip !important; }

  .m-whitespace-nowrap { white-space: nowrap !important; }
  .m-whitespace-normal { white-space: normal !important; }
  .m-whitespace-pre { white-space: pre !important; }
  .m-whitespace-pre-wrap { white-space: pre-wrap !important; }
  .m-break-words { word-break: break-word !important; overflow-wrap: break-word !important; }
  .m-break-all { word-break: break-all !important; }

  .m-truncate {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .m-line-clamp-2 {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
  }
  .m-line-clamp-3 {
    display: -webkit-box !important;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
  }

  .m-justify-start { justify-content: flex-start !important; }
  .m-justify-center { justify-content: center !important; }
  .m-justify-between { justify-content: space-between !important; }
  .m-justify-end { justify-content: flex-end !important; }
  .m-justify-around { justify-content: space-around !important; }
  .m-justify-evenly { justify-content: space-evenly !important; }

  .m-items-start { align-items: flex-start !important; }
  .m-items-center { align-items: center !important; }
  .m-items-end { align-items: flex-end !important; }
  .m-items-stretch { align-items: stretch !important; }
  .m-items-baseline { align-items: baseline !important; }

  .m-content-start { align-content: flex-start !important; }
  .m-content-center { align-content: center !important; }
  .m-content-end { align-content: flex-end !important; }
  .m-content-between { align-content: space-between !important; }
  .m-content-around { align-content: space-around !important; }

  .m-self-auto { align-self: auto !important; }
  .m-self-start { align-self: flex-start !important; }
  .m-self-end { align-self: flex-end !important; }
  .m-self-center { align-self: center !important; }
  .m-self-stretch { align-self: stretch !important; }

  .m-align-top { vertical-align: top !important; }
  .m-align-middle { vertical-align: middle !important; }
  .m-align-bottom { vertical-align: bottom !important; }

  .m-order-first { order: -9999 !important; }
  .m-order-last { order: 9999 !important; }
  .m-order-none { order: 0 !important; }
  .m-order-1 { order: 1 !important; }
  .m-order-2 { order: 2 !important; }
  .m-order-3 { order: 3 !important; }

  .m-opacity-0 { opacity: 0 !important; }
  .m-opacity-50 { opacity: 0.5 !important; }
  .m-opacity-70 { opacity: 0.7 !important; }
  .m-opacity-100 { opacity: 1 !important; }

  .m-shadow-none { box-shadow: none !important; }
  .m-shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important; }
  .m-shadow { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important; }
  .m-shadow-md { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important; }
  .m-shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) !important; }

  .m-sticky { position: sticky !important; }
  .m-static { position: static !important; }
  .m-relative { position: relative !important; }
  .m-absolute { position: absolute !important; }
  .m-fixed { position: fixed !important; }

  .m-top-0 { top: 0 !important; }
  .m-top-1 { top: 0.25rem !important; }
  .m-top-2 { top: 0.5rem !important; }
  .m-top-4 { top: 1rem !important; }
  .m-top-auto { top: auto !important; }
  .m-left-0 { left: 0 !important; }
  .m-left-1 { left: 0.25rem !important; }
  .m-left-2 { left: 0.5rem !important; }
  .m-left-4 { left: 1rem !important; }
  .m-left-auto { left: auto !important; }
  .m-right-0 { right: 0 !important; }
  .m-right-1 { right: 0.25rem !important; }
  .m-right-2 { right: 0.5rem !important; }
  .m-right-4 { right: 1rem !important; }
  .m-right-auto { right: auto !important; }
  .m-bottom-0 { bottom: 0 !important; }
  .m-bottom-1 { bottom: 0.25rem !important; }
  .m-bottom-2 { bottom: 0.5rem !important; }
  .m-bottom-4 { bottom: 1rem !important; }
  .m-bottom-auto { bottom: auto !important; }
  .m-inset-0 { inset: 0 !important; }
  .m-inset-x-0 { left: 0 !important; right: 0 !important; }
  .m-inset-y-0 { top: 0 !important; bottom: 0 !important; }

  .m-z-0 { z-index: 0 !important; }
  .m-z-10 { z-index: 10 !important; }
  .m-z-20 { z-index: 20 !important; }
  .m-z-30 { z-index: 30 !important; }
  .m-z-40 { z-index: 40 !important; }
  .m-z-50 { z-index: 50 !important; }
  .m-z-\[100\] { z-index: 100 !important; }

  .m-visible { visibility: visible !important; }
  .m-invisible { visibility: hidden !important; }

  .m-scale-100 { transform: scale(1) !important; }
  .m-scale-95 { transform: scale(0.95) !important; }
  .m-scale-90 { transform: scale(0.9) !important; }

  .m-min-h-screen { min-height: 100vh !important; }
  .m-h-screen { height: 100vh !important; }

  /* 表格响应式 */
  .m-table-text-sm table { font-size: 0.75rem !important; }
  .m-table-compact th,
  .m-table-compact td { padding: 0.25rem 0.5rem !important; }
}

/* 桌面端（≥768px） */
@media (min-width: 768px) {
  .d-hidden { display: none !important; }
  .d-block { display: block !important; }
  .d-flex { display: flex !important; }
  .d-grid { display: grid !important; }
  .d-inline-flex { display: inline-flex !important; }
  .d-inline-block { display: inline-block !important; }

  .d-flex-col { flex-direction: column !important; }
  .d-flex-row { flex-direction: row !important; }
  .d-flex-wrap { flex-wrap: wrap !important; }
  .d-flex-nowrap { flex-wrap: nowrap !important; }
  .d-flex-1 { flex: 1 1 0% !important; }

  .d-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
  .d-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .d-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .d-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .d-grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .d-grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }

  .d-col-span-1 { grid-column: span 1 / span 1 !important; }
  .d-col-span-2 { grid-column: span 2 / span 2 !important; }
  .d-col-span-3 { grid-column: span 3 / span 3 !important; }
  .d-col-span-4 { grid-column: span 4 / span 4 !important; }
  .d-col-span-full { grid-column: 1 / -1 !important; }

  .d-gap-1 { gap: 0.25rem !important; }
  .d-gap-2 { gap: 0.5rem !important; }
  .d-gap-3 { gap: 0.75rem !important; }
  .d-gap-4 { gap: 1rem !important; }
  .d-gap-5 { gap: 1.25rem !important; }
  .d-gap-6 { gap: 1.5rem !important; }
  .d-gap-8 { gap: 2rem !important; }

  .d-gap-x-2 { column-gap: 0.5rem !important; }
  .d-gap-x-3 { column-gap: 0.75rem !important; }
  .d-gap-x-4 { column-gap: 1rem !important; }
  .d-gap-y-2 { row-gap: 0.5rem !important; }
  .d-gap-y-3 { row-gap: 0.75rem !important; }
  .d-gap-y-4 { row-gap: 1rem !important; }

  .d-space-x-2 > * + * { margin-left: 0.5rem !important; }
  .d-space-x-3 > * + * { margin-left: 0.75rem !important; }
  .d-space-x-4 > * + * { margin-left: 1rem !important; }
  .d-space-y-0 > * + * { margin-top: 0 !important; }
  .d-space-y-2 > * + * { margin-top: 0.5rem !important; }

  .d-p-0 { padding: 0 !important; }
  .d-p-2 { padding: 0.5rem !important; }
  .d-p-3 { padding: 0.75rem !important; }
  .d-p-4 { padding: 1rem !important; }
  .d-p-6 { padding: 1.5rem !important; }
  .d-p-8 { padding: 2rem !important; }

  .d-px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
  .d-px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
  .d-px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
  .d-px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
  .d-px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }

  .d-py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
  .d-py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
  .d-py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
  .d-py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .d-py-6 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }

  .d-pl-0 { padding-left: 0 !important; }
  .d-pl-2 { padding-left: 0.5rem !important; }
  .d-pl-3 { padding-left: 0.75rem !important; }
  .d-pl-4 { padding-left: 1rem !important; }
  .d-pr-0 { padding-right: 0 !important; }
  .d-pr-2 { padding-right: 0.5rem !important; }
  .d-pr-3 { padding-right: 0.75rem !important; }
  .d-pr-4 { padding-right: 1rem !important; }
  .d-pt-0 { padding-top: 0 !important; }
  .d-pt-2 { padding-top: 0.5rem !important; }
  .d-pt-3 { padding-top: 0.75rem !important; }
  .d-pt-4 { padding-top: 1rem !important; }
  .d-pb-0 { padding-bottom: 0 !important; }
  .d-pb-2 { padding-bottom: 0.5rem !important; }
  .d-pb-3 { padding-bottom: 0.75rem !important; }
  .d-pb-4 { padding-bottom: 1rem !important; }
  .d-pb-6 { padding-bottom: 1.5rem !important; }
  .d-pb-8 { padding-bottom: 2rem !important; }

  .d-m-0 { margin: 0 !important; }
  .d-mx-0 { margin-left: 0 !important; margin-right: 0 !important; }
  .d-mx-auto { margin-left: auto !important; margin-right: auto !important; }
  .d-my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }

  .d-mt-0 { margin-top: 0 !important; }
  .d-mt-2 { margin-top: 0.5rem !important; }
  .d-mt-3 { margin-top: 0.75rem !important; }
  .d-mt-4 { margin-top: 1rem !important; }
  .d-mt-6 { margin-top: 1.5rem !important; }
  .d-mt-8 { margin-top: 2rem !important; }

  .d-mb-0 { margin-bottom: 0 !important; }
  .d-mb-2 { margin-bottom: 0.5rem !important; }
  .d-mb-3 { margin-bottom: 0.75rem !important; }
  .d-mb-4 { margin-bottom: 1rem !important; }
  .d-mb-6 { margin-bottom: 1.5rem !important; }
  .d-mb-8 { margin-bottom: 2rem !important; }

  .d-ml-0 { margin-left: 0 !important; }
  .d-ml-2 { margin-left: 0.5rem !important; }
  .d-ml-3 { margin-left: 0.75rem !important; }
  .d-ml-4 { margin-left: 1rem !important; }
  .d-mr-0 { margin-right: 0 !important; }
  .d-mr-2 { margin-right: 0.5rem !important; }
  .d-mr-3 { margin-right: 0.75rem !important; }
  .d-mr-4 { margin-right: 1rem !important; }

  .d-w-full { width: 100% !important; }
  .d-w-auto { width: auto !important; }
  .d-w-1\/2 { width: 50% !important; }
  .d-w-1\/3 { width: 33.333% !important; }
  .d-w-2\/3 { width: 66.667% !important; }
  .d-w-1\/4 { width: 25% !important; }
  .d-w-3\/4 { width: 75% !important; }
  .d-max-w-none { max-width: none !important; }
  .d-max-w-full { max-width: 100% !important; }
  .d-max-w-xs { max-width: 20rem !important; }
  .d-max-w-sm { max-width: 24rem !important; }
  .d-max-w-md { max-width: 28rem !important; }
  .d-max-w-lg { max-width: 32rem !important; }
  .d-max-w-xl { max-width: 36rem !important; }
  .d-max-w-2xl { max-width: 42rem !important; }
  .d-max-w-3xl { max-width: 48rem !important; }
  .d-max-w-4xl { max-width: 56rem !important; }
  .d-min-w-0 { min-width: 0 !important; }

  .d-text-left { text-align: left !important; }
  .d-text-center { text-align: center !important; }
  .d-text-right { text-align: right !important; }

  .d-text-xs { font-size: 0.75rem !important; line-height: 1rem !important; }
  .d-text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
  .d-text-base { font-size: 1rem !important; line-height: 1.5rem !important; }
  .d-text-lg { font-size: 1.125rem !important; line-height: 1.75rem !important; }
  .d-text-xl { font-size: 1.25rem !important; line-height: 1.75rem !important; }
  .d-text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; }
  .d-text-3xl { font-size: 1.875rem !important; line-height: 2.25rem !important; }

  .d-font-normal { font-weight: 400 !important; }
  .d-font-medium { font-weight: 500 !important; }
  .d-font-semibold { font-weight: 600 !important; }
  .d-font-bold { font-weight: 700 !important; }

  .d-leading-tight { line-height: 1.25 !important; }
  .d-leading-snug { line-height: 1.375 !important; }
  .d-leading-normal { line-height: 1.5 !important; }

  .d-justify-start { justify-content: flex-start !important; }
  .d-justify-end { justify-content: flex-end !important; }
  .d-justify-center { justify-content: center !important; }
  .d-justify-between { justify-content: space-between !important; }
  .d-justify-around { justify-content: space-around !important; }
  .d-justify-evenly { justify-content: space-evenly !important; }

  .d-items-start { align-items: flex-start !important; }
  .d-items-center { align-items: center !important; }
  .d-items-end { align-items: flex-end !important; }
  .d-items-stretch { align-items: stretch !important; }
  .d-items-baseline { align-items: baseline !important; }

  .d-content-start { align-content: flex-start !important; }
  .d-content-center { align-content: center !important; }
  .d-content-end { align-content: flex-end !important; }

  .d-self-start { align-self: flex-start !important; }
  .d-self-end { align-self: flex-end !important; }
  .d-self-center { align-self: center !important; }
  .d-self-stretch { align-self: stretch !important; }

  .d-overflow-hidden { overflow: hidden !important; }
  .d-overflow-auto { overflow: auto !important; }
  .d-overflow-visible { overflow: visible !important; }

  .d-visible { visibility: visible !important; }
  .d-invisible { visibility: hidden !important; }

  .d-order-first { order: -9999 !important; }
  .d-order-last { order: 9999 !important; }
  .d-order-none { order: 0 !important; }

  .d-rounded-none { border-radius: 0 !important; }
  .d-rounded-sm { border-radius: 0.125rem !important; }
  .d-rounded-md { border-radius: 0.375rem !important; }
  .d-rounded-lg { border-radius: 0.5rem !important; }
  .d-rounded-full { border-radius: 9999px !important; }

  .d-shadow-none { box-shadow: none !important; }
  .d-shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important; }
  .d-shadow { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important; }
  .d-shadow-md { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important; }
  .d-shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) !important; }

  .d-sticky { position: sticky !important; }
  .d-static { position: static !important; }
  .d-relative { position: relative !important; }
  .d-absolute { position: absolute !important; }
  .d-fixed { position: fixed !important; }

  .d-top-0 { top: 0 !important; }
  .d-bottom-0 { bottom: 0 !important; }
  .d-left-0 { left: 0 !important; }
  .d-right-0 { right: 0 !important; }
  .d-inset-0 { inset: 0 !important; }
  .d-inset-x-0 { left: 0 !important; right: 0 !important; }

  .d-z-10 { z-index: 10 !important; }
  .d-z-20 { z-index: 20 !important; }
  .d-z-30 { z-index: 30 !important; }
  .d-z-40 { z-index: 40 !important; }
  .d-z-50 { z-index: 50 !important; }

  .d-h-auto { height: auto !important; }
  .d-h-full { height: 100% !important; }
  .d-min-h-screen { min-height: 100vh !important; }

  .d-grow { flex-grow: 1 !important; }
  .d-shrink-0 { flex-shrink: 0 !important; }
  .d-shrink { flex-shrink: 1 !important; }

  .d-break-words { word-break: break-word !important; overflow-wrap: break-word !important; }
  .d-truncate {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .d-whitespace-nowrap { white-space: nowrap !important; }
  .d-whitespace-normal { white-space: normal !important; }
}

/* ========= Dialog/Sheet 移动端响应式 ========= */
@media (max-width: 767px) {
  .dialog-content-responsive {
    max-width: calc(100vw - 1.5rem) !important;
    max-height: calc(100dvh - 1.5rem) !important;
    padding: 1rem !important;
    width: 100% !important;
  }
  .dialog-header-responsive {
    text-align: left !important;
  }
  .dialog-footer-responsive {
    flex-direction: column-reverse !important;
    gap: 0.5rem !important;
  }
  .dialog-footer-responsive > * {
    width: 100% !important;
  }

  .dialog-content-sm { max-width: 24rem !important; }
  .dialog-content-md { max-width: 28rem !important; }
  .dialog-content-lg { max-width: 32rem !important; }
  .dialog-content-xl { max-width: 36rem !important; }

  /* 底部 Sheet 内容区支持滚动 */
  [data-slot="sheet-content"][data-side="bottom"] {
    max-height: 85dvh !important;
    max-height: calc(var(--kb-vh, 1dvh) * 85) !important;
    overflow-y: auto !important;
  }
}

@media (min-width: 768px) {
  .dialog-content-sm { max-width: 24rem !important; }
  .dialog-content-md { max-width: 32rem !important; }
  .dialog-content-lg { max-width: 42rem !important; }
  .dialog-content-xl { max-width: 52rem !important; }
}

/* 安全区域 */
.safe-pb {
  padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
}
.safe-pt {
  padding-top: calc(12px + env(safe-area-inset-top)) !important;
}
.safe-pl {
  padding-left: calc(12px + env(safe-area-inset-left)) !important;
}
.safe-pr {
  padding-right: calc(12px + env(safe-area-inset-right)) !important;
}

/* 底部固定汇总面板安全区域 */
.safe-bottom-panel {
  padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
}

/* 防止 iOS 输入框自动缩放：16px 最小字号 */
@media (max-width: 767px) {
  input, textarea, select, button {
    font-size: 16px !important;
  }
}
