/* 移动端响应式设计通用样式 */

/* 添加移动端专用类 */
@tailwind utilities;
@layer utilities {
    .mobile-hidden {
        @apply hidden md:block;
    }
    
    .mobile-only {
        @apply block md:hidden;
    }
    
    .mobile-flex {
        @apply flex md:hidden;
    }
    
    .text-responsive {
        @apply text-base md:text-lg;
    }
    
    .text-responsive-lg {
        @apply text-xl md:text-2xl;
    }
}

/* 基础移动端优化样式 */
@media (max-width: 768px) {
    /* 隐藏粒子背景以提高性能 */
    #particles-js {
        display: none;
    }
    
    /* 标题响应式字体大小 */
    .header-title {
        font-size: 1.5rem !important;
    }
    
    .header-subtitle {
        font-size: 1rem !important;
    }
    
    /* 卡片内边距调整 */
    .card-padding {
        padding: 1rem !important;
    }
    
    /* 文本响应式字体大小 */
    .text-responsive {
        font-size: 0.875rem !important;
    }
    
    .text-responsive-lg {
        font-size: 1rem !important;
    }
    
    /* 按钮响应式尺寸 */
    .btn-responsive {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }
    
    /* 网格响应式布局 */
    .grid-responsive {
        grid-template-columns: 1fr !important;
    }
    
    /* 隐藏在移动端不需要的元素 */
    .hide-on-mobile {
        display: none !important;
    }
    
    /* 表格响应式优化 */
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.25rem !important;
    }
    
    /* 减少间距 */
    .gap-responsive {
        gap: 0.5rem !important;
    }
    
    .mb-responsive {
        margin-bottom: 1rem !important;
    }
    
    .p-responsive {
        padding: 1rem !important;
    }
}

/* 小屏幕设备优化 (最大宽度 480px) */
@media (max-width: 480px) {
    .header-title {
        font-size: 1.25rem !important;
    }
    
    .header-subtitle {
        font-size: 0.875rem !important;
    }
    
    .card-padding {
        padding: 0.75rem !important;
    }
    
    .table-responsive {
        font-size: 0.65rem;
    }
    
    /* 进一步减少间距 */
    .gap-responsive-sm {
        gap: 0.25rem !important;
    }
    
    .mb-responsive-sm {
        margin-bottom: 0.75rem !important;
    }
    
    .p-responsive-sm {
        padding: 0.75rem !important;
    }
}

/* 触摸友好的按钮和链接 */
.touch-friendly {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 移动端导航菜单样式 */
.mobile-menu {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    max-width: 320px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    border-right: 2px solid rgba(6, 182, 212, 0.3);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    display: none;
}

.mobile-menu.hidden {
    display: none;
}

.mobile-menu.block {
    display: flex;
    flex-direction: column;
}

.mobile-menu.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(6, 182, 212, 0.2);
    display: flex;
    flex-direction: column;
}

/* 移动端菜单背景遮罩 */
.mobile-menu.open::before {
    content: '';
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    animation: fadeIn 0.3s ease;
}

/* 菜单项样式 */
.mobile-menu a,
.mobile-menu button {
    position: relative;
}

.mobile-menu a::before,
.mobile-menu button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #06b6d4 0%, #0ea5e9 100%);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform 0.3s ease;
    border-radius: 4px 0 0 4px;
}

.mobile-menu a:hover::before,
.mobile-menu button:hover::before {
    transform: scaleY(1);
}

/* 菜单内容样式 */
.mobile-menu .flex-col {
    padding-top: 0.5rem;
}

.mobile-menu h2 {
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.mobile-menu ul li a {
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.3) 0%, rgba(75, 85, 99, 0.2) 100%);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.mobile-menu ul li a:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(14, 165, 233, 0.1) 100%);
    border: 1px solid rgba(6, 182, 212, 0.5);
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.15);
}

.mobile-menu i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* 关闭按钮样式 */
#closeMobileMenuBtn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(55, 65, 81, 0.5);
    border: 1px solid rgba(6, 182, 212, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

#closeMobileMenuBtn:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.6);
    transform: rotate(90deg);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

/* 菜单动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 移动端模态框优化 */
@media (max-width: 768px) {
    .modal-responsive {
        width: 95% !important;
        max-width: none !important;
        margin: 1rem !important;
    }
    
    .modal-header-responsive {
        padding: 0.75rem !important;
    }
    
    .modal-body-responsive {
        padding: 1rem !important;
    }
    
    .modal-footer-responsive {
        padding: 0.75rem !important;
    }
}

/* 输入框在移动端的优化 */
@media (max-width: 768px) {
    .input-responsive {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 0.5rem !important;
    }
    
    .form-group-responsive {
        margin-bottom: 1rem !important;
    }
}