/**
 * 移动端全局样式 - 增强版
 * 使用!important确保移动端样式优先级
 * 完全重构移动端布局
 */

/* ==================== 移动端基础重置 ==================== */
@media screen and (max-width: 1024px) {
    
    * {
        -webkit-tap-highlight-color: transparent !important;
    }
    
    html {
        font-size: 14px !important;
        overflow-x: hidden !important;
    }
    
    body {
        font-size: 14px !important;
        overflow-x: hidden !important;
        -webkit-text-size-adjust: 100% !important;
        max-width: 100vw !important;
        position: relative !important;
    }
}

/* ==================== 汉堡菜单按钮(强制显示) ==================== */
@media screen and (max-width: 1024px) {
    
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        height: 44px !important;
        background: #ffffff !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 10px !important;
        cursor: pointer !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1) !important;
        position: fixed !important;
        top: 12px !important;
        left: 12px !important;
        z-index: 10000 !important;
        transition: all 0.3s ease !important;
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95) !important;
        background: #f5f5f5 !important;
    }
    
    .mobile-menu-toggle i {
        font-size: 22px !important;
        color: #333 !important;
    }
}

/* ==================== 侧边栏移动端完全重构 ==================== */
@media screen and (max-width: 1024px) {
    
    .sidebar,
    aside,
    .dashboard-container > aside,
    .proxy-container > aside {
        position: fixed !important;
        left: -100% !important;
        top: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        width: 280px !important;
        max-width: 80vw !important;
        z-index: 9999 !important;
        background: #ffffff !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15) !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .sidebar.mobile-open,
    aside.mobile-open {
        left: 0 !important;
    }
    
    /* 侧边栏Logo */
    .sidebar .logo,
    aside .logo,
    .sidebar-logo {
        padding: 20px 16px !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    .sidebar .logo h2,
    aside .logo h2 {
        font-size: 20px !important;
    }
    
    /* 侧边栏导航 */
    .sidebar-nav,
    aside nav {
        padding: 16px 0 !important;
    }
    
    .nav-section {
        margin-bottom: 20px !important;
    }
    
    .nav-title {
        font-size: 12px !important;
        padding: 8px 20px !important;
    }
    
    .nav-item {
        margin: 4px 12px !important;
    }
    
    .nav-link {
        padding: 12px 16px !important;
        font-size: 15px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .nav-link i {
        font-size: 18px !important;
        margin-right: 12px !important;
    }
}

/* ==================== 遮罩层 ==================== */
@media screen and (max-width: 1024px) {
    
    .mobile-sidebar-overlay {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.6) !important;
        z-index: 9998 !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
        backdrop-filter: blur(2px) !important;
        -webkit-backdrop-filter: blur(2px) !important;
    }
    
    .mobile-sidebar-overlay.active {
        display: block !important;
        opacity: 1 !important;
    }
}

/* ==================== 主内容区完全重构 ==================== */
@media screen and (max-width: 1024px) {
    
    .main-content,
    main,
    .dashboard-container,
    .proxy-container,
    .dashboard-container > div:not(.sidebar):not(aside),
    .proxy-container > div:not(.sidebar):not(aside) {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding: 16px !important;
        padding-top: 72px !important;
    }
}

/* ==================== 顶部导航栏重构 ==================== */
@media screen and (max-width: 1024px) {
    
    .top-header,
    header,
    .header {
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 12px 16px !important;
        padding-left: 68px !important;
        background: #ffffff !important;
        z-index: 1000 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    }
    
    .header-left h1,
    .top-header h1 {
        font-size: 18px !important;
        margin: 0 !important;
    }
    
    .header-right {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    .header-btn {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* 隐藏用户名,只显示头像 */
    .user-info .user-name,
    .user-dropdown-trigger .user-name {
        display: none !important;
    }
    
    .user-avatar,
    .user-info img {
        width: 38px !important;
        height: 38px !important;
    }
}

/* ==================== 卡片网格完全重构 ==================== */
@media screen and (max-width: 768px) {
    
    .plans-grid,
    .proxy-grid,
    .grid,
    .cards-grid,
    [class*="grid"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        grid-template-columns: 1fr !important;
    }
    
    .plan-card,
    .proxy-card,
    .card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    
    .plans-grid,
    .proxy-grid,
    .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

/* ==================== 套餐卡片移动端 ==================== */
@media screen and (max-width: 1024px) {
    
    .plan-card,
    .proxy-card {
        padding: 20px !important;
        border-radius: 12px !important;
    }
    
    .plan-header h3,
    .card-title {
        font-size: 20px !important;
    }
    
    .plan-price,
    .price {
        font-size: 32px !important;
        margin: 16px 0 !important;
    }
    
    .plan-features,
    .features-list {
        margin: 16px 0 !important;
    }
    
    .plan-features li {
        font-size: 14px !important;
        padding: 10px 0 !important;
    }
    
    .plan-card .btn,
    .proxy-card .btn,
    .card .btn {
        width: 100% !important;
        padding: 14px !important;
        font-size: 15px !important;
        min-height: 48px !important;
    }
}

/* ==================== 模态框完全重构 ==================== */
@media screen and (max-width: 768px) {
    
    .modal,
    .profile-modal,
    [class*="modal"] {
        padding: 0 !important;
    }
    
    .modal-content,
    .profile-modal-content,
    [class*="modal-content"] {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    .modal-header,
    .profile-modal-header {
        padding: 16px !important;
        position: sticky !important;
        top: 0 !important;
        background: #ffffff !important;
        z-index: 10 !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    .modal-header h2,
    .profile-modal-header h2 {
        font-size: 18px !important;
        margin: 0 !important;
    }
    
    .modal-body,
    .profile-modal-body {
        padding: 16px !important;
        max-height: calc(100vh - 70px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .modal-close,
    .profile-modal-close {
        width: 40px !important;
        height: 40px !important;
        font-size: 20px !important;
    }
}

/* ==================== 表单完全重构 ==================== */
@media screen and (max-width: 1024px) {
    
    .form-group,
    .input-group {
        margin-bottom: 16px !important;
    }
    
    .form-label,
    label {
        font-size: 14px !important;
        margin-bottom: 8px !important;
        display: block !important;
    }
    
    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    textarea,
    select {
        width: 100% !important;
        font-size: 16px !important;
        padding: 12px 14px !important;
        border-radius: 8px !important;
        border: 1px solid #ddd !important;
        min-height: 44px !important;
    }
    
    textarea {
        min-height: 120px !important;
    }
    
    .btn,
    button[type="submit"],
    button[type="button"],
    .button {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 16px !important;
        min-height: 48px !important;
        border-radius: 10px !important;
        margin-top: 8px !important;
        font-weight: 500 !important;
    }
    
    .btn-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .btn-group .btn {
        width: 100% !important;
    }
}

/* ==================== 订单卡片移动端 ==================== */
@media screen and (max-width: 1024px) {
    
    .order-card,
    .order-item {
        padding: 16px !important;
        margin-bottom: 16px !important;
        border-radius: 12px !important;
    }
    
    .order-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        margin-bottom: 16px !important;
    }
    
    .order-no {
        font-size: 15px !important;
        word-break: break-all !important;
    }
    
    .order-status {
        padding: 6px 14px !important;
        font-size: 13px !important;
    }
    
    .order-details,
    .order-info {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .order-detail-item,
    .info-row {
        display: flex !important;
        justify-content: space-between !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid #f5f5f5 !important;
        font-size: 14px !important;
    }
    
    .order-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        margin-top: 16px !important;
    }
    
    .order-actions .btn {
        width: 100% !important;
    }
}

/* ==================== 配置面板移动端 ==================== */
@media screen and (max-width: 1024px) {
    
    .config-section,
    .settings-section {
        padding: 16px !important;
        margin-bottom: 16px !important;
        border-radius: 12px !important;
    }
    
    .config-grid,
    .settings-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .config-item,
    .setting-item {
        padding: 12px !important;
        border-radius: 8px !important;
    }
    
    .config-label,
    .setting-label {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }
    
    .config-value,
    .setting-value {
        font-size: 15px !important;
    }
}

/* ==================== 表格移动端 ==================== */
@media screen and (max-width: 768px) {
    
    table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 8px !important;
    }
    
    thead {
        display: none !important;
    }
    
    tbody,
    tr,
    td {
        display: block !important;
        width: 100% !important;
    }
    
    tr {
        margin-bottom: 16px !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 8px !important;
        padding: 12px !important;
        background: #fff !important;
    }
    
    td {
        text-align: left !important;
        padding: 8px 0 !important;
        border: none !important;
    }
    
    td:before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        margin-right: 8px !important;
        color: #666 !important;
    }
}

/* ==================== 登录注册页面移动端 ==================== */
@media screen and (max-width: 1024px) {
    
    .auth-container {
        display: block !important;
        padding: 0 !important;
        min-height: 100vh !important;
    }
    
    .auth-left {
        display: none !important;
    }
    
    .auth-right,
    .auth-card {
        width: 100% !important;
        min-height: 100vh !important;
        padding: 24px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
    
    .auth-form {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .logo-section,
    .auth-logo {
        text-align: center !important;
        margin-bottom: 32px !important;
    }
    
    .logo-section h1,
    .auth-logo h1 {
        font-size: 28px !important;
    }
    
    .logo-section p,
    .auth-logo p {
        font-size: 14px !important;
    }
    
    .google-login-btn {
        padding: 14px 16px !important;
        font-size: 15px !important;
        width: 100% !important;
        min-height: 48px !important;
    }
    
    .divider {
        margin: 24px 0 !important;
    }
}

/* ==================== 空状态移动端 ==================== */
@media screen and (max-width: 768px) {
    
    .empty-state,
    .no-service-state,
    .no-data {
        padding: 40px 20px !important;
        text-align: center !important;
    }
    
    .empty-state .icon,
    .no-service-state .icon {
        width: 80px !important;
        height: 80px !important;
        margin: 0 auto 20px !important;
    }
    
    .empty-state .icon i,
    .no-service-state .icon i {
        font-size: 36px !important;
    }
    
    .empty-state h3,
    .no-service-state h3 {
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }
    
    .empty-state p,
    .no-service-state p {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
    
    .empty-state .btn,
    .no-service-state .btn {
        margin-top: 20px !important;
        width: auto !important;
        min-width: 200px !important;
    }
}

/* ==================== 页面标题移动端 ==================== */
@media screen and (max-width: 768px) {
    
    .page-header {
        padding: 16px 0 !important;
        margin-bottom: 20px !important;
    }
    
    .page-title,
    h1.title {
        font-size: 24px !important;
        margin-bottom: 8px !important;
    }
    
    .page-subtitle,
    .subtitle {
        font-size: 14px !important;
        color: #666 !important;
    }
}

/* ==================== 用户下拉菜单移动端 ==================== */
@media screen and (max-width: 768px) {
    
    .user-dropdown,
    .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
        max-height: 70vh !important;
        overflow-y: auto !important;
    }
    
    .user-dropdown::before,
    .dropdown-menu::before {
        display: none !important;
    }
    
    .dropdown-item {
        padding: 16px 20px !important;
        font-size: 16px !important;
        min-height: 52px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .dropdown-item i {
        margin-right: 12px !important;
        font-size: 18px !important;
    }
}

/* ==================== 提示信息移动端 ==================== */
@media screen and (max-width: 768px) {
    
    .notification,
    .toast,
    .alert,
    #customerServiceToast {
        position: fixed !important;
        top: 72px !important;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        max-width: calc(100vw - 32px) !important;
        transform: none !important;
        z-index: 10001 !important;
    }
}

/* ==================== 客服/登录状态卡片移动端 ==================== */
@media screen and (max-width: 768px) {
    
    .service-info {
        padding: 20px !important;
    }
    
    .service-avatar img {
        width: 80px !important;
        height: 80px !important;
    }
    
    .service-contacts {
        margin-top: 20px !important;
    }
    
    .contact-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 14px !important;
    }
    
    .contact-item .copy-btn {
        align-self: stretch !important;
        width: 100% !important;
    }
    
    .login-status-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .device-list {
        max-height: 300px !important;
    }
    
    .device-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 14px !important;
    }
    
    .device-item .revoke-btn {
        width: 100% !important;
    }
}

/* ==================== iOS特殊修复 ==================== */
@media screen and (max-width: 1024px) {
    
    /* 修复iOS输入框缩放 */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
    
    /* 修复iOS fixed定位 */
    .sidebar,
    .mobile-menu-toggle,
    .top-header {
        -webkit-transform: translate3d(0, 0, 0) !important;
        transform: translate3d(0, 0, 0) !important;
    }
    
    /* 优化iOS滚动 */
    .sidebar,
    .modal-body,
    .profile-modal-body {
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* 禁用iOS选择高亮 */
    * {
        -webkit-user-select: none !important;
        user-select: none !important;
    }
    
    input,
    textarea {
        -webkit-user-select: text !important;
        user-select: text !important;
    }
}

/* ==================== 小屏幕优化 ==================== */
@media screen and (max-width: 375px) {
    
    body {
        font-size: 13px !important;
    }
    
    .mobile-menu-toggle {
        width: 40px !important;
        height: 40px !important;
        top: 10px !important;
        left: 10px !important;
    }
    
    .top-header {
        padding-left: 60px !important;
    }
    
    .modal-content,
    .profile-modal-content {
        width: 100vw !important;
    }
    
    .btn,
    button {
        font-size: 14px !important;
        padding: 12px 18px !important;
    }
}

/* ==================== 触摸优化 ==================== */
@media screen and (max-width: 1024px) {
    
    /* 增大点击区域 */
    a,
    button,
    .btn,
    .nav-link,
    .clickable {
        min-height: 44px !important;
        min-width: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
    }
    
    /* 触摸反馈 */
    a:active,
    button:active,
    .btn:active,
    .nav-link:active {
        opacity: 0.7 !important;
        transform: scale(0.98) !important;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .mobile-sidebar-overlay,
    .header-right,
    .order-actions,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
}

/* ==================== 强制显示汉堡菜单(桌面端隐藏) ==================== */
@media screen and (min-width: 1025px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .mobile-sidebar-overlay {
        display: none !important;
    }
}
    
    /* 基础字体和视口优化 */
    body {
        font-size: 14px;
        -webkit-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* 防止横向滚动 */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* 容器适配 */
    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* ==================== 移动端汉堡菜单按钮 ==================== */
@media screen and (max-width: 1024px) {
    
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: white;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 1000;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }
    
    .mobile-menu-toggle i {
        font-size: 20px;
        color: #333;
    }
    
    /* 默认隐藏汉堡菜单(PC端不显示) */
    @media screen and (min-width: 1025px) {
        .mobile-menu-toggle {
            display: none !important;
        }
    }
}

/* ==================== 侧边栏移动端适配 ==================== */
@media screen and (max-width: 1024px) {
    
    .sidebar {
        position: fixed !important;
        left: -280px !important;
        top: 0 !important;
        height: 100vh !important;
        width: 280px !important;
        z-index: 9998 !important;
        transition: left 0.3s ease !important;
        overflow-y: auto !important;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.mobile-open {
        left: 0 !important;
    }
    
    /* 移动端遮罩层 */
    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9997;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* ==================== 主内容区移动端适配 ==================== */
@media screen and (max-width: 1024px) {
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 72px 16px 16px !important;
    }
    
    .dashboard-container,
    .proxy-container {
        margin-left: 0 !important;
        padding: 72px 16px 16px !important;
    }
}

/* ==================== 头部导航栏移动端适配 ==================== */
@media screen and (max-width: 1024px) {
    
    .top-header {
        padding: 12px 16px !important;
        padding-left: 64px !important; /* 为汉堡菜单留空间 */
    }
    
    .header-left h1 {
        font-size: 18px !important;
    }
    
    .header-right {
        gap: 8px !important;
    }
    
    .header-btn {
        width: 36px !important;
        height: 36px !important;
    }
    
    .user-avatar {
        width: 36px !important;
        height: 36px !important;
    }
    
    .user-name {
        display: none !important; /* 移动端隐藏用户名 */
    }
}

/* ==================== 卡片网格移动端适配 ==================== */
@media screen and (max-width: 1024px) {
    
    .plans-grid,
    .proxy-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
    
    .plans-grid,
    .proxy-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==================== 套餐卡片移动端适配 ==================== */
@media screen and (max-width: 1024px) {
    
    .plan-card,
    .proxy-card {
        padding: 20px !important;
    }
    
    .plan-header h3 {
        font-size: 20px !important;
    }
    
    .plan-price {
        font-size: 28px !important;
    }
    
    .plan-features li {
        font-size: 13px !important;
        padding: 10px 0 !important;
    }
}

/* ==================== 模态框移动端适配 ==================== */
@media screen and (max-width: 768px) {
    
    .modal-content,
    .profile-modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        margin: 5vh auto !important;
    }
    
    .modal-header,
    .profile-modal-header {
        padding: 16px !important;
    }
    
    .modal-header h2,
    .profile-modal-header h2 {
        font-size: 18px !important;
    }
    
    .modal-body,
    .profile-modal-body {
        padding: 16px !important;
    }
    
    /* 客服模态框移动端适配 */
    .service-info {
        padding: 20px 16px !important;
    }
    
    .service-avatar img {
        width: 80px !important;
        height: 80px !important;
    }
    
    .contact-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    
    .contact-item .copy-btn {
        align-self: flex-end;
    }
}

/* ==================== 表单移动端适配 ==================== */
@media screen and (max-width: 1024px) {
    
    .form-group {
        margin-bottom: 16px !important;
    }
    
    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important; /* 防止iOS自动缩放 */
        padding: 12px !important;
    }
    
    .btn,
    button {
        padding: 12px 24px !important;
        font-size: 14px !important;
        min-height: 44px !important; /* 触摸友好尺寸 */
    }
}

/* ==================== 订单卡片移动端适配 ==================== */
@media screen and (max-width: 1024px) {
    
    .order-card {
        padding: 16px !important;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    
    .order-details {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .order-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .order-actions .btn {
        width: 100%;
    }
}

/* ==================== 配置面板移动端适配 ==================== */
@media screen and (max-width: 1024px) {
    
    .config-section {
        padding: 16px !important;
    }
    
    .config-grid {
        grid-template-columns: 1fr !important;
    }
    
    .config-item {
        padding: 12px !important;
    }
}

/* ==================== 用户下拉菜单移动端适配 ==================== */
@media screen and (max-width: 768px) {
    
    .user-dropdown {
        right: -60px !important;
        min-width: 200px !important;
    }
    
    .user-dropdown::before {
        right: 70px !important;
    }
}

/* ==================== 表格移动端适配 ==================== */
@media screen and (max-width: 768px) {
    
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ==================== 登录/注册页面移动端适配 ==================== */
@media screen and (max-width: 1024px) {
    
    .auth-container {
        padding: 20px !important;
        min-height: 100vh;
    }
    
    .auth-left,
    .auth-right {
        padding: 24px 20px !important;
    }
    
    .auth-form {
        max-width: 100% !important;
    }
    
    .logo-section h1 {
        font-size: 24px !important;
    }
    
    .google-login-btn {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
}

@media screen and (max-width: 768px) {
    
    .auth-container {
        display: block !important;
    }
    
    .auth-left,
    .auth-right {
        width: 100% !important;
        min-height: auto !important;
    }
    
    .auth-left {
        display: none; /* 移动端隐藏左侧装饰 */
    }
}

/* ==================== 空状态移动端适配 ==================== */
@media screen and (max-width: 768px) {
    
    .empty-state,
    .no-service-state {
        padding: 40px 20px !important;
    }
    
    .empty-state .icon,
    .no-service-state .icon {
        width: 60px !important;
        height: 60px !important;
    }
    
    .empty-state .icon i,
    .no-service-state .icon i {
        font-size: 28px !important;
    }
    
    .empty-state h3,
    .no-service-state h3 {
        font-size: 16px !important;
    }
}

/* ==================== 页面标题移动端适配 ==================== */
@media screen and (max-width: 768px) {
    
    .page-header {
        padding: 16px 0 !important;
    }
    
    .page-title {
        font-size: 22px !important;
    }
    
    .page-subtitle {
        font-size: 13px !important;
    }
}

/* ==================== 提示信息移动端适配 ==================== */
@media screen and (max-width: 768px) {
    
    .notification,
    .toast,
    #customerServiceToast {
        left: 16px !important;
        right: 16px !important;
        transform: none !important;
        width: auto !important;
        max-width: calc(100vw - 32px) !important;
    }
}

/* ==================== 加载状态移动端适配 ==================== */
@media screen and (max-width: 768px) {
    
    .loading-state {
        padding: 40px 20px !important;
    }
}

/* ==================== 登录状态卡片移动端适配 ==================== */
@media screen and (max-width: 768px) {
    
    .login-status-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .device-list {
        max-height: 300px !important;
    }
    
    .device-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    
    .device-item .revoke-btn {
        width: 100%;
    }
}

/* ==================== 修复iOS Safari特定问题 ==================== */
@media screen and (max-width: 1024px) {
    
    /* 修复iOS输入框缩放 */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important;
    }
    
    /* 修复iOS fixed定位抖动 */
    .sidebar,
    .mobile-menu-toggle {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
    
    /* 修复iOS点击高亮 */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* 优化滚动性能 */
    .sidebar,
    .modal-body,
    .profile-modal-body {
        -webkit-overflow-scrolling: touch;
    }
}

/* ==================== 横屏优化 ==================== */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    
    .sidebar {
        width: 240px !important;
        left: -240px !important;
    }
    
    .modal-content,
    .profile-modal-content {
        max-height: 95vh !important;
    }
}

/* ==================== 小屏幕特殊优化 ==================== */
@media screen and (max-width: 375px) {
    
    body {
        font-size: 13px;
    }
    
    .btn,
    button {
        font-size: 13px !important;
        padding: 10px 20px !important;
    }
    
    .modal-content,
    .profile-modal-content {
        width: 98vw !important;
    }
}

/* ==================== 触摸优化 ==================== */
@media screen and (max-width: 1024px) {
    
    /* 增大可点击区域 */
    a,
    button,
    .nav-link,
    .btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 移除hover效果(触摸设备) */
    @media (hover: none) {
        .plan-card:hover,
        .proxy-card:hover,
        .nav-link:hover {
            transform: none !important;
        }
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .mobile-sidebar-overlay,
    .header-right,
    .order-actions {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}
