/**
 * DogNet 移动端优化样式
 * 专门针对移动设备的响应式设计和交互优化
 * @version 2.0
 * @author DogNet Team
 * @update 2024 - 优化移动端显示不全问题
 */

/* ===== 基础移动端适配 ===== */
/* 针对所有移动设备的基础样式 */
@include mobile-basics;

/* 修复Safari视口问题 */
@viewport {
  width: device-width;
  initial-scale: 1.0;
  user-scalable: no;
}

/* 确保所有元素盒模型正确 */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* 全局滚动行为 */
html, body {
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  /* 容器优化 */
  .container {
    @apply px-3 max-w-full w-full overflow-x-hidden;
    width: 100% !important;
  }
  
  .container-fluid {
    @apply px-2 max-w-full w-full overflow-x-hidden;
    width: 100% !important;
  }

  /* 主内容区域优化 */
  .flex-1.flex {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  /* iframe优化 */
  iframe[name="main-frame"], #main-frame {
    @apply w-full h-full min-h-[calc(100vh-120px)] !important;
    border: none !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* 主内容区域优化 */
  .flex-1.relative {
    @apply w-full overflow-hidden !important;
  }

  /* 加载指示器优化 */
  #loading-indicator {
    @apply w-full h-full flex items-center justify-center glass backdrop-blur-glass z-50;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
  }

  #loading-indicator .animate-spin {
    @apply w-10 h-10 border-4 border-white/30 border-t-white rounded-full mb-4;
  }

  /* 顶部通知栏优化 */
  .glass.border-b {
    width: 100% !important;
    overflow-x: hidden !important;
  }

  /* 字体大小调整 */
  html {
    font-size: 14px;
  }
  
  body {
    @apply text-sm leading-relaxed overflow-x-hidden;
  }

  /* 标题优化 */
  h1 {
    @apply text-xl font-bold;
  }
  
  h2 {
    @apply text-lg font-semibold;
  }
  
  h3 {
    @apply text-base font-medium;
  }

  /* 680px以下设备优化 */
  @media (max-width: 680px) {
    /* 容器优化 */
    .container {
      @apply px-4 max-w-full w-full overflow-x-hidden;
    }
    
    .container-fluid {
      @apply px-3 max-w-full w-full overflow-x-hidden;
    }
    
    /* 字体大小调整 */
    html {
      font-size: 14px;
    }
    
    body {
      @apply text-sm leading-relaxed overflow-x-hidden;
    }
    
    /* 标题优化 */
    h1 {
      @apply text-xl font-bold;
    }
    
    h2 {
      @apply text-lg font-semibold;
    }
    
    h3 {
      @apply text-base font-medium;
    }

    /* 表单优化 */
    .form-input, input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="tel"], select, textarea {
      @apply h-11 text-base px-3.5 py-2.5;
    }

    .form-button, .btn {
      @apply h-11 px-5 text-base font-medium;
    }

    /* 卡片优化 */
    .card {
      @apply mx-2.5 mb-3.5 rounded-lg;
    }

    .card-header, .card-body, .card-footer {
      @apply p-3.5;
    }

    /* 工具类 */
    .sm-hidden {
      @apply hidden;
    }

    .sm-visible {
      @apply block;
    }

    .sm-text-sm {
      @apply text-sm;
    }
  }

  
  /* 容器优化 */
  .container {
    @apply px-3 max-w-full;
  }
  
  .container-fluid {
    @apply px-2;
  }

  /* 字体大小调整 */
  html {
    font-size: 14px;
  }
  
  body {
    @apply text-sm leading-relaxed;
  }

  /* 标题优化 */
  h1 {
    @apply text-xl font-bold;
  }
  
  h2 {
    @apply text-lg font-semibold;
  }
  
  h3 {
    @apply text-base font-medium;
  }
}

/* ===== 表单移动端优化 ===== */
/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  /* 表单容器 */
  .form-container {
    @apply p-4 mx-2 w-full overflow-hidden;
  }
  
  /* 表单输入框 */
  .form-input,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  select,
  textarea {
    @apply h-12 text-base px-4 py-3 w-full;
    min-height: 48px; /* 增大触摸目标 */
    -webkit-appearance: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box;
  }

  /* 文本域适配 */
  textarea {
    min-height: 100px;
    resize: vertical;
  }
  
  /* 表单标签 */
  .form-label,
  label {
    @apply text-sm font-medium mb-2 block;
  }
  
  /* 表单组 */
  .form-group {
    @apply mb-4;
  }
  
  /* 表单网格布局 */
  .form-grid {
    @apply grid grid-cols-1 gap-4;
  }
  
  /* 表单按钮 */
  .form-button,
  .btn {
    @apply h-12 px-6 text-base font-medium rounded-lg w-full;
    min-height: 48px;
    touch-action: manipulation;
    transition: all 0.3s ease;
  }

  /* 按钮组优化 */
  .form-button-group {
    @apply flex flex-col gap-3 mt-6 w-full;
  }

  .form-button-group .btn {
    @apply w-full;
  }
  
  /* 表单按钮组 */
  .form-button-group {
    @apply flex flex-col gap-3 mt-6;
  }
  
  .form-button-group .btn {
    @apply w-full;
  }
}

/* ===== 按钮和触摸优化 ===== */
/* 所有移动设备通用 */
.btn, .button, .sidebar-item, .tab-item, .menu-item, button, [role="button"], .clickable {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  /* 所有可点击元素的最小尺寸 */
  .btn,
  .button,
  .sidebar-item,
  .tab-item,
  .menu-item,
  button,
  [role="button"],
  .clickable {
    min-height: 48px;
    min-width: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
  }
  
  /* 按钮间距 */
  .btn + .btn,
  .button + .button {
    @apply ml-0 mt-3;
  }
  
  /* 图标按钮 */
  .icon-btn {
    @apply w-12 h-12 flex items-center justify-center rounded-lg;
  }
  
  /* 浮动操作按钮 */
  .fab {
    @apply fixed bottom-6 right-6 w-14 h-14 rounded-full shadow-lg z-50;
    @apply bg-primary text-white flex items-center justify-center;
  }
}

/* ===== 导航优化 ===== */
/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  /* 侧边栏 */
  .sidebar {
    @apply fixed inset-y-0 left-0 z-50 w-64 max-w-full;
    @apply transform -translate-x-full transition-transform duration-300 ease-in-out;
    @apply bg-white shadow-xl overflow-y-auto;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15) !important;
  }
  
  .sidebar.open {
    @apply transform translate-x-0;
  }

  /* 侧边栏遮罩 */
  #mobile-overlay {
    @apply fixed inset-0 bg-black/50 z-40 hidden;
    backdrop-filter: blur(2px);
  }

  #mobile-overlay:not(.hidden) {
    @apply block;
  }
  
  /* 侧边栏项目 */
  .sidebar-item, .menu-item {
    @apply flex items-center px-4 py-3 text-base;
    @apply border-b border-gray-100 last:border-b-0;
    min-height: 52px;
    touch-action: manipulation;
  }
  
  .sidebar-item i {
    @apply w-6 text-center mr-3 text-lg;
  }
  
  /* 侧边栏子菜单 */
  .sidebar-submenu {
    @apply bg-gray-50;
  }
  
  .sidebar-submenu .sidebar-item {
    @apply pl-12 py-2 text-sm;
    min-height: 44px;
  }
  
  /* 底部标签栏 */
  .tab-bar {
    @apply fixed bottom-0 left-0 right-0 z-40;
    @apply bg-white border-t border-gray-200 shadow-lg;
    @apply flex justify-around items-center h-16;
    padding-bottom: env(safe-area-inset-bottom);
    width: 100%;
    box-sizing: border-box;
  }
  
  .tab-item {
    @apply flex flex-col items-center justify-center;
    @apply text-xs text-gray-500 py-2 px-1;
    @apply transition-colors duration-200;
    min-width: 44px;
    min-height: 44px;
  }
  
  .tab-item.active {
    @apply text-primary;
  }
  
  .tab-item i {
    @apply text-lg mb-1;
  }
}

/* ===== 卡片和内容优化 ===== */
/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  /* 卡片 */
  .card {
    @apply mx-2 mb-4 rounded-lg shadow-sm w-full overflow-hidden;
    box-sizing: border-box !important;
  }

  .card-header, .card-body, .card-footer {
    @apply p-4 w-full box-sizing: border-box !important;
  }

  /* 小屏幕设备优化 (576px以下) */
  @media (max-width: 576px) {
    .card {
      @apply mx-1.5 mb-3;
    }
  }

  /* 表格优化 */
  table {
    @apply w-full overflow-x-auto block;
    display: block !important;
  }

  thead, tbody, tr, th, td {
    display: block !important;
  }

  thead tr {
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
  }

  tr {
    margin-bottom: 15px !important;
    border-bottom: 2px solid #eee !important;
  }

  td {
    border: none !important;
    border-bottom: 1px solid #eee !important;
    position: relative !important;
    padding-left: 50% !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }

  td:before {
    position: absolute !important;
    top: 6px !important;
    left: 6px !important;
    width: 45% !important;
    padding-right: 10px !important;
    white-space: nowrap !important;
    content: attr(data-label) !important;
    font-weight: bold !important;
  }

  /* 信息网格优化 */
  .info-grid {
    @apply grid grid-cols-1 gap-3 w-full;
  }
  
  .card-header {
    @apply p-4 border-b border-gray-100;
  }
  
  .card-body {
    @apply p-4;
  }
  
  .card-footer {
    @apply p-4 border-t border-gray-100;
  }
  
  /* 信息网格 */
  .info-grid {
    @apply grid grid-cols-1 gap-3;
  }
  
  .info-item {
    @apply bg-gray-50 p-3 rounded-lg;
  }
  
  .info-label {
    @apply text-xs text-gray-500 mb-1;
  }
  
  .info-value {
    @apply text-sm font-medium;
  }
}

/* ===== 表格移动端优化 ===== */
/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  /* 隐藏传统表格，使用卡片布局 */
  .table-responsive {
    @apply block;
  }
  
  .mobile-table {
    @apply space-y-3;
  }
  
  .mobile-table-item {
    @apply bg-white rounded-lg shadow-sm border border-gray-200 p-4;
  }
  
  .mobile-table-header {
    @apply flex justify-between items-center mb-3 pb-3 border-b border-gray-100;
  }
  
  .mobile-table-body {
    @apply space-y-2;
  }
  
  .mobile-table-row {
    @apply flex justify-between items-center py-1;
  }
  
  .mobile-table-label {
    @apply text-sm text-gray-500;
  }
  
  .mobile-table-value {
    @apply text-sm font-medium text-right;
  }
}

/* ===== 模态框和弹窗优化 ===== */
/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  .modal {
    @apply p-4;
  }
  
  .modal-content {
    @apply w-full max-w-none mx-0 my-8;
    @apply rounded-lg shadow-xl;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }
  
  .modal-header {
    @apply p-4 border-b border-gray-200;
  }
  
  .modal-body {
    @apply p-4;
  }
  
  .modal-footer {
    @apply p-4 border-t border-gray-200;
    @apply flex flex-col gap-3;
  }
  
  .modal-footer .btn {
    @apply w-full;
  }
}

/* ===== 通知和消息优化 ===== */
/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  .notification-bar {
    @apply mx-2 my-3 text-sm;
  }
  
  .alert {
    @apply mx-2 mb-4 p-3 rounded-lg text-sm;
  }
  
  .toast {
    @apply fixed top-4 left-4 right-4 z-50;
    @apply bg-white shadow-lg rounded-lg p-4;
    @apply transform transition-transform duration-300;
  }
  
  .toast.show {
    @apply translate-y-0;
  }
  
  .toast.hide {
    @apply -translate-y-full;
  }
}

/* ===== iframe 优化 ===== */
/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  .iframe-container {
    @apply relative w-full;
    padding-bottom: calc(100vh - 140px); /* 减去头部和底部导航的高度 */
  }
  
  .iframe-container iframe {
    @apply absolute top-0 left-0 w-full h-full border-0;
  }
  
  /* 主内容区域适配 */
  .main-content {
    @apply pb-20; /* 为底部标签栏留出空间 */
    padding-bottom: calc(4rem + env(safe-area-inset-bottom));
  }
}

/* ===== 加载和状态优化 ===== */
/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  .loading {
    @apply flex items-center justify-center p-8;
  }
  
  .loading-spinner {
    @apply w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin;
  }
  
  .empty-state {
    @apply text-center py-12 px-4;
  }
  
  .empty-state-icon {
    @apply text-4xl text-gray-300 mb-4;
  }
  
  .empty-state-text {
    @apply text-gray-500 text-sm;
  }
  
  /* 加载动画 */
  .loading-dots {
    display: inline-block;
  }
  
  .loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
  }
  
  /* 移动端加载指示器优化 */
  #loading-indicator {
    @apply w-full h-full flex items-center justify-center;
    z-index: 9999 !important;
  }
  
  /* 通知栏优化 */
  .notification-scroll {
    animation: scroll 20s linear infinite;
    padding: 0 10px;
  }
  
  @keyframes scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
  }
}

/* ===== 安全区域适配 (iOS) ===== */
@supports (padding: max(0px)) {
  .safe-area-top {
    padding-top: max(1rem, env(safe-area-inset-top));
  }
  
  .safe-area-bottom {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  
  .safe-area-left {
    padding-left: max(1rem, env(safe-area-inset-left));
  }
  
  .safe-area-right {
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

/* ===== 触摸反馈优化 ===== */
@media (max-width: 768px) {
  /* 移除默认的触摸高亮 */
  * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }
  
  /* 自定义触摸反馈 */
  .touch-feedback {
    position: relative;
    overflow: hidden;
  }
  
  .touch-feedback::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
  }
  
  .touch-feedback:active::before {
    width: 200px;
    height: 200px;
  }
}

/* ===== 滚动优化 ===== */
@media (max-width: 768px) {
  /* 平滑滚动 */
  html {
    scroll-behavior: smooth;
  }
  
  /* 滚动条样式 */
  ::-webkit-scrollbar {
    width: 4px;
  }
  
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  
  ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
  }
  
  /* 防止过度滚动 */
  .no-overscroll {
    overscroll-behavior: none;
  }
}

/* ===== 性能优化 ===== */
/* 所有移动设备通用 */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

.reduce-repaint {
  backface-visibility: hidden;
  perspective: 1000px;
}

/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  /* 硬件加速 */
  .gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
  }
  
  /* 减少重绘 */
  .reduce-repaint {
    backface-visibility: hidden;
    perspective: 1000px;
  }
}

/* ===== 辅助功能优化 ===== */
/* 所有移动设备通用 */

/* 下拉菜单优化 */
.dropdown-menu {
    @apply absolute z-50 w-full max-w-xs bg-white rounded-lg shadow-lg overflow-hidden transform transition-all duration-200 ease-in-out;
    box-sizing: border-box !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto !important;
}

.dropdown-item {
    @apply px-4 py-3 text-base w-full text-left;
    min-height: 48px;
    touch-action: manipulation;
    transition: all 0.2s ease;
}

.dropdown-item:active {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 侧边栏下拉菜单优化 */
.sidebar-dropdown {
    @apply flex items-center justify-between px-4 py-3 text-base w-full;
    min-height: 48px;
    touch-action: manipulation;
    transition: all 0.2s ease;
}

/* 工具提示优化 */
[tooltip] {
    position: relative;
}

[tooltip]:after {
    content: attr(tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.2s ease;
}

[tooltip]:hover:after {
    opacity: 1;
}

/* 小屏幕设备额外优化 (375px以下) */
@media (max-width: 375px) {
    /* 优化小屏幕上的下拉菜单 */
    .dropdown-menu {
        @apply max-w-none rounded-t-none rounded-b-lg;
        bottom: 0 !important;
        top: auto !important;
        transform: none !important;
    }
}
.focus-visible {
  @apply outline-none ring-2 ring-primary ring-offset-2;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  /* 焦点可见性 */
  .focus-visible {
    @apply outline-none ring-2 ring-primary ring-offset-2;
  }
  
  /* 屏幕阅读器 */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* ===== 动画优化 ===== */
/* 所有移动设备通用 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

.slide-down {
  animation: slideDown 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  /* 减少动画以提高性能 */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
  
  /* 常用动画 */
  .fade-in {
    animation: fadeIn 0.3s ease-in-out;
  }
  
  .slide-up {
    animation: slideUp 0.3s ease-out;
  }
  
  .slide-down {
    animation: slideDown 0.3s ease-out;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  @keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  
  @keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
}

/* ===== 工具类 ===== */
/* 所有移动设备通用 */
.mobile-hidden {
  @apply hidden md:block;
}

.mobile-visible {
  @apply block md:hidden;
}

/* 平板设备 (768px以下) */
@media (max-width: 768px) {
  .mobile-flex {
    @apply flex;
  }

  .mobile-grid {
    @apply grid;
  }

  .mobile-full-width {
    @apply w-full;
  }

  .mobile-center {
    @apply mx-auto text-center;
  }

  .mobile-spacing {
    @apply px-4 py-3;
  }

  .mobile-text-sm {
    @apply text-sm;
  }

  .mobile-text-xs {
    @apply text-xs;
  }

/* 手机设备 (480px以下) */
@media (max-width: 480px) {
  /* 基础优化 */
  html {
    font-size: 13px;
  }

  body {
    @apply text-xs leading-relaxed;
  }

  h1 {
    @apply text-lg font-bold;
  }

  h2 {
    @apply text-base font-semibold;
  }

  h3 {
    @apply text-sm font-medium;
  }

  /* 容器优化 */
  .container {
    @apply px-2 max-w-full;
  }

  .container-fluid {
    @apply px-1;
  }

  /* 表单优化 */
  .form-input, input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="tel"], select, textarea {
    @apply h-10 text-sm px-3 py-2;
    min-height: 40px;
  }

  .form-button, .btn {
    @apply h-10 px-4 text-sm font-medium;
    min-height: 40px;
  }

  /* 导航优化 */
  .sidebar {
    @apply w-64;
  }

  .sidebar-item {
    @apply px-3 py-2 text-sm;
    min-height: 44px;
  }

  /* 卡片优化 */
  .card {
    @apply mx-1 mb-3;
  }

  .card-header, .card-body, .card-footer {
    @apply p-3;
  }

  /* 表格优化 */
  .mobile-table-item {
    @apply p-3;
  }

  /* 模态框优化 */
  .modal-content {
    @apply my-4;
    max-height: calc(100vh - 2rem);
  }

  /* iframe 优化 */
  .iframe-container {
    padding-bottom: calc(100vh - 120px);
  }

  /* 工具类扩展 */
  .xs-hidden {
    @apply hidden;
  }

  .xs-visible {
    @apply block;
  }

  .xs-text-xs {
    @apply text-xs;
  }
}

/* 超小屏幕设备 (360px以下) */
@media (max-width: 360px) {
  /* 进一步减小字体 */
  html {
    font-size: 12px;
  }

  body {
    @apply text-[11px] leading-relaxed;
  }

  /* 更紧凑的布局 */
  .container {
    @apply px-1.5;
  }

  .container-fluid {
    @apply px-1;
  }

  .form-group {
    @apply mb-2.5;
  }

  .form-input, input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="tel"], select, textarea {
    @apply h-9 px-2.5 py-2 text-xs;
    min-height: 38px;
  }

  .form-button, .btn {
    @apply h-9 px-3 text-xs font-medium;
    min-height: 38px;
  }

  .card {
    @apply mx-1 mb-2 rounded-md;
  }

  .card-header, .card-body, .card-footer {
    @apply p-2.5;
  }

  .tab-bar {
    @apply h-13;
  }

  .tab-item {
    @apply py-1.5;
  }

  .tab-item i {
    @apply text-base;
  }

  .tab-item span {
    @apply text-[10px];
  }

  .fab {
    @apply w-11 h-11 bottom-3 right-3;
  }

  /* 标题优化 */
  h1 {
    @apply text-base font-bold;
  }

  h2 {
    @apply text-sm font-semibold;
  }

  h3 {
    @apply text-xs font-medium;
  }

  /* 边距优化 */
  .mobile-spacing {
    @apply px-3 py-2.5;
  }

  /* 模态框优化 */
  .modal-content {
    @apply my-2;
    max-height: calc(100vh - 1rem);
  }

  /* iframe 优化 */
  .iframe-container {
    padding-bottom: calc(100vh - 100px);
  }

  /* 工具类扩展 */
  .xxs-hidden {
    @apply hidden;
  }

  .xxs-visible {
    @apply block;
  }

  .xxs-text-xxs {
    @apply text-[10px];
  }
}

/* 自定义Tailwind工具类 */
@layer utilities {
  .content-auto {
    content-visibility: auto;
  }

  .backdrop-blur-sm {
    backdrop-filter: blur(4px);
  }

  .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }
}
  .mobile-hidden {
    @apply hidden;
  }
  
  .mobile-visible {
    @apply block;
  }
  
  .mobile-flex {
    @apply flex;
  }
  
  .mobile-grid {
    @apply grid;
  }
  
  .mobile-full-width {
    @apply w-full;
  }
  
  .mobile-center {
    @apply mx-auto text-center;
  }
  
  .mobile-spacing {
    @apply px-4 py-3;
  }
  
  .mobile-text-sm {
    @apply text-sm;
  }
  
  .mobile-text-xs {
    @apply text-xs;
  }
}