/**
 * A.I.D.E.N. System v80.0 - 移动端优化样式
 */

/* 汉堡菜单 */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        padding: 10px;
        cursor: pointer;
        background: transparent;
        border: none;
    }
    
    .nav-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: #fff;
        transition: all 0.3s;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* 移动端导航菜单 */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(2, 6, 23, 0.98);
        backdrop-filter: blur(40px);
        flex-direction: column;
        padding: 20px;
        gap: 8px;
        transform: translateY(-100%);
        opacity: 0;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
    }
    
    .nav-item {
        width: 100%;
        padding: 14px 20px;
        text-align: left;
        border-radius: 12px;
    }
    
    .nav-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    
    /* 底部导航 */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 68px;
        background: rgba(2, 6, 23, 0.98);
        backdrop-filter: blur(40px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        align-items: center;
        justify-content: space-around;
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    }
    
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 12px;
        text-decoration: none;
        color: #64748b;
        font-size: 0.7rem;
        font-weight: 600;
        transition: all 0.3s;
        min-width: 60px;
    }
    
    .mobile-nav-item .icon {
        font-size: 1.4rem;
        transition: all 0.3s;
    }
    
    .mobile-nav-item:hover,
    .mobile-nav-item.active {
        color: #667eea;
        transform: translateY(-2px);
    }
    
    .mobile-nav-item.active .icon {
        filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.6));
    }
    
    .mobile-nav-item:active {
        transform: scale(0.95);
    }
    
    .mobile-nav-item.cta {
        background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.15));
        border: 1px solid rgba(245, 158, 11, 0.3);
        border-radius: 16px;
        padding: 8px 16px;
        color: #fbbf24;
    }
    
    /* 返回顶部按钮 */
    .back-to-top {
        position: fixed;
        bottom: 80px;
        right: 20px;
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, #667eea, #764ba2);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        z-index: 999;
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
        border: none;
        color: #fff;
    }
    
    .back-to-top.visible {
        opacity: 1;
        visibility: visible;
    }
    
    .back-to-top:hover {
        transform: translateY(-4px);
        box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
    }
    
    /* 卡片移动端优化 */
    .card {
        padding: 20px;
        border-radius: 20px;
    }
    
    /* 按钮移动端优化 */
    .btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 1rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    /* 表格移动端 */
    .table-container {
        border-radius: 12px;
    }
    
    th, td {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    /* 表单移动端 */
    input, textarea, select {
        padding: 16px;
        font-size: 16px; /* 防止 iOS 缩放 */
    }
    
    /* 网格布局移动端 */
    .grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* 特性卡片移动端 */
    .feature-card {
        padding: 24px;
    }
    
    .feature-icon {
        font-size: 2.5rem;
    }
    
    .feature-title {
        font-size: 1.2rem;
    }
    
    /* 价格卡片移动端 */
    .pricing-card {
        padding: 24px;
        margin: 16px 0;
    }
    
    .plan-price {
        font-size: 2rem;
    }
    
    /* 页脚移动端 */
    .footer {
        padding: 40px 20px;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
}

/* 平板优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 桌面端隐藏移动端元素 */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    
    .back-to-top {
        display: none !important;
    }
    
    .nav-toggle {
        display: none !important;
    }
}

/* 横屏优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-bottom-nav {
        height: 56px;
    }
    
    .mobile-nav-item {
        font-size: 0.65rem;
        padding: 6px 10px;
    }
    
    .mobile-nav-item .icon {
        font-size: 1.2rem;
    }
}

/* iPhone 安全区域 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增大触摸目标 */
    .btn {
        min-height: 44px;
    }
    
    .mobile-nav-item {
        min-height: 44px;
    }
    
    /* 移除 hover 效果 */
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-dark: #000000;
        --bg-darker: #020617;
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
