/**
 * 移动端响应式样式文件
 * 
 * @file responsive/mobile.css
 * @description 统一的移动端响应式设计系统，整合所有组件的移动端优化
 * @author CodeBuddy
 * @created 2025-01-13
 * @version 3.0.0
 * 
 * 功能说明：
 * - 专门针对手机和平板设备的响应式设计
 * - 优化触摸交互体验
 * - 改善小屏幕下的布局和可读性
 * - 统一管理所有组件的移动端样式
 * 
 * 断点说明：
 * - 超小屏幕: 320px 及以下
 * - 小屏幕: 480px 及以下 (手机竖屏)
 * - 中等屏幕: 481px - 768px (手机横屏/小平板)
 * - 大屏幕: 769px - 1024px (平板横屏)
 * - 超大屏幕: 1025px - 1200px (小桌面)
 */

/* ================================
   移动端基础设置
   ================================ */

/* 确保在移动设备上正确显示 */
@viewport {
    width: device-width;
    initial-scale: 1.0;
    maximum-scale: 1.0;
    user-scalable: no;
}

/* 防止移动端字体自动缩放 */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* ================================
   超大屏幕设备 (小桌面) 1025px - 1200px
   ================================ */
@media (max-width: 1200px) {
    .sidebar {
        width: 80px;
    }
    .logo-text, .nav-text {
        display: none;
    }
    .logo {
        justify-content: center;
    }
    .nav-item {
        justify-content: center;
        padding: 18px 0;
    }
}

/* ================================
   大屏幕设备 (平板横屏) 769px - 1024px
   ================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    /* 侧边栏优化 */
    .sidebar {
        width: 220px !important;
    }
    
    /* 用户信息区域适配 */
    .user-info {
        padding: 12px 10px;
    }
    
    /* 移动端充值按钮适配 */
    .user-points-section {
        gap: 6px;
    }
    
    .recharge-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .recharge-btn span {
        font-size: 12px;
        gap: 10px;
    }
    
    .user-avatar {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
    
    .username {
        font-size: 13px;
    }
    
    .user-points {
        font-size: 11px;
    }
    
    /* 移动端充值按钮适配 */
    .user-points-section {
        gap: 6px;
    }
    
    .recharge-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .recharge-btn span {
        font-size: 12px;
    }
    
    .main-content {
        margin-left: 220px !important;
        padding: 25px 20px !important;
    }
    
    /* 表格容器优化 */
    .table-container {
        padding: 20px;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .search-box {
        width: 100%;
        max-width: none;
    }
    
    .table-actions {
        justify-content: center;
    }
    
    /* 模态框优化 */
    .modal-content {
        width: 80%;
        max-width: 700px;
    }
    
    /* 账户管理页面优化 */
    .account-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .account-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .account-filters {
        justify-content: space-between;
    }
    
    .account-search {
        min-width: 200px;
        flex: 1;
    }
    
    .account-details-content {
        grid-template-columns: 1fr;
    }
    
    .account-form {
        grid-template-columns: 1fr;
    }
}

/* ================================
   中等屏幕设备 (手机横屏/小平板) 481px - 768px
   ================================ */
@media (min-width: 481px) and (max-width: 768px) {
    /* 侧边栏优化 */
    .sidebar {
        width: 200px !important;
    }
    
    /* 用户信息区域适配 */
    .user-info {
        padding: 12px 8px;
        gap: 10px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .username {
        font-size: 13px;
    }
    
    .user-points {
        font-size: 11px;
    }
    
    .main-content {
        margin-left: 200px !important;
        padding: 20px 15px !important;
    }
    
    /* 模态框优化 */
    .modal-content {
        width: 90%;
        max-width: 600px;
    }
    
    /* 按钮优化 */
    .btn {
        padding: 8px 14px; /* 减小内边距 */
        font-size: 13px; /* 减小字体 */
        min-height: 36px; /* 减小最小高度 */
        min-width: 70px; /* 减小最小宽度 */
    }
    
    /* 表格头部布局 */
    .table-header {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    /* 输入框适中尺寸 */
    .po-filter-input,
    .search-input {
        min-width: 140px;
        font-size: 15px;
    }
    
    /* 通知容器优化 */
    .toast-container {
        right: 10px;
        top: 10px;
        width: calc(100% - 20px);
        max-width: 400px;
    }
    
    /* 批量删除内容优化 */
    .batch-delete-content {
        padding: 15px;
    }
    
    /* 表单行优化 */
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-row .form-group {
        flex: 1;
    }
}

/* ================================
   小屏幕设备 (手机竖屏) 最大 768px
   ================================ */
@media (max-width: 768px) {
    /* 主布局调整 */
    .main-content {
        padding: 20px 15px;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .actions {
        width: 100%;
        justify-content: space-between;
    }
    .table-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    .search-box {
        width: 100%;
    }
    .modal-content {
        width: 95%;
    }
    .page-title {
        font-size: 15px;
    }
    .page-title i {
        width: 36px;
        height: 36px;
    }
    .sidebar {
        background: rgba(248, 249, 250, 0.98);
        border-right: 1px solid rgba(0, 0, 0, 0.15);
    }
    .nav-item {
        color: rgba(0, 0, 0, 0.85);
    }
    .nav-item i {
        color: rgba(0, 0, 0, 0.75);
    }
    
    /* 表格容器优化 */
    .table-container {
        padding: 15px;
        margin: 0 -10px;
        border-radius: 12px 12px 0 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 表格头部优化 */
    .table-header > div:first-child {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }
    
    /* 搜索框优化 */
    .search-box {
        padding: 8px 12px; /* 减小内边距 */
        width: 100%;
        min-width: 150px; /* 减小最小宽度 */
    }
    
    .search-box input {
        font-size: 14px; /* 减小字体大小 */
        margin-left: 6px; /* 减小左边距 */
    }
    
    /* 表格样式优化 */
    .table,
    .appointment-table,
    .account-table,
    .po-table,
    .logs-table {
        min-width: 600px;
        font-size: 14px;
        border-radius: 12px 12px 0 0;
    }
    
    .table th,
    .appointment-table th,
    .account-table th,
    .po-table th,
    .logs-table th {
        padding: 10px 8px;
        font-size: 14px;
    }
    
    .table td,
    .appointment-table td,
    .account-table td,
    .po-table td,
    .logs-table td {
        padding: 8px 6px;
        font-size: 13px;
        line-height: 1.3;
    }
    
    /* 状态标签优化 */
    .status {
        font-size: 11px;
        padding: 3px 8px;
        border-radius: 12px;
    }
    
    .account-tag,
    .isa-tag {
        font-size: 12px;
        padding: 3px 12px;
    }
    
    /* 分页控件优化 */
    .pagination-container,
    #appointment-table-pagination {
        padding: 8px 12px;
        font-size: 13px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .pg-btn,
    .pg-num {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .pg-jump {
        margin-left: 0;
        font-size: 12px;
    }
    
    .pg-jump input,
    .pg-jump-input {
        width: 40px;
        font-size: 12px;
    }
    
    /* 筛选组件优化 - 水平布局 */
    .po-filter-input,
    .po-filter-select {
        font-size: 14px !important;
        padding: 6px 10px !important;
        height: 32px !important;
        margin-right: 6px !important;
        margin-bottom: 6px !important;
        min-width: 100px !important; /* 设置最小宽度 */
        flex: 1 !important; /* 自适应宽度 */
        max-width: 150px !important; /* 限制最大宽度 */
    }
    
    /* PO页面筛选器容器水平布局 */
    .po-filters, .table-filters, .filter-container {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        align-items: center !important;
    }
    
    /* 操作按钮优化 */
    .action-cell {
        grid-template-columns: repeat(2, 32px);
        grid-template-rows: repeat(2, 32px);
        gap: 4px;
    }
    
    /* 时间显示优化 */
    .time-display,
    .time-cell {
        font-size: 11px;
        line-height: 1.2;
    }
    
    .time-popover {
        font-size: 16px;
        padding: 15px 20px;
        max-width: 90vw;
    }
    
    /* 操作按钮列优化 */
    .account-table td:last-child,
    .appointment-table td:last-child,
    .po-table td:last-child {
        min-width: 120px;
    }
    
    /* 表格响应式滚动条 */
    .table-responsive {
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive::-webkit-scrollbar {
        height: 6px;
    }
    
    .table-responsive::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: rgba(255, 153, 0, 0.5);
        border-radius: 3px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 153, 0, 0.7);
    }
    
    /* 模态框头部关闭按钮优化 */
    .modal-header .close-modal {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    /* 表单优化 */
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-row .form-group {
        flex: 1;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 12px;
    }
    
    /* 日期时间范围选择器优化 */
    .date-time-range {
        flex-direction: column;
        gap: 10px;
    }
    
    .date-time-range .form-group {
        width: 100%;
    }
}

/* ================================
   手机模式紧凑布局优化 - 搜索框和按钮尺寸优化
   ================================ */
@media (max-width: 768px) {
    /* 表格头部布局优化 - 让搜索框和按钮在同一行 */
    .table-header {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        align-items: center !important;
    }
    
    .table-header > div:first-child {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        align-items: center !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    /* 搜索框紧凑化 - 不独占一行 */
    .search-box {
        padding: 6px 12px !important;
        min-width: 120px !important;
        width: auto !important; /* 改为自动宽度，不独占一行 */
        flex: 1 !important;
        max-width: 200px !important;
        border-radius: 8px !important;
    }
    
    .search-box input {
        font-size: 14px !important;
        margin-left: 6px !important;
    }
    
    /* 按钮紧凑化 */
    .btn {
        padding: 6px 12px !important;
        font-size: 13px !important;
        min-height: 32px !important;
        min-width: 60px !important;
        border-radius: 6px !important;
        white-space: nowrap !important; /* 防止按钮文字换行 */
    }
    
    /* 表格头部按钮组紧凑化 */
    .table-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        align-items: center !important;
    }
    
    .table-actions .btn {
        padding: 5px 10px !important;
        font-size: 12px !important;
        min-width: 50px !important;
    }
    
    /* 操作按钮进一步紧凑 */
    .action-btn, .edit-btn, .delete-btn, .view-btn {
        padding: 4px 8px !important;
        font-size: 11px !important;
        min-width: 40px !important;
        min-height: 28px !important;
    }
    
    /* ISA加PO页面表单元素紧凑化 */
    .form-control, .po-filter-input, .po-filter-select {
        padding: 6px 10px !important; /* 减小内边距 */
        font-size: 14px !important; /* 减小字体 */
        min-height: 32px !important; /* 减小最小高度 */
        border-radius: 6px !important; /* 减小圆角 */
    }
    
    /* 表单行布局优化 - 让元素在同一行显示 */
    .form-row {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        align-items: flex-end !important; /* 底部对齐 */
    }
    
    .form-row .form-group {
        flex: 1 !important;
        min-width: 120px !important; /* 最小宽度确保可用性 */
        margin-bottom: 0 !important; /* 移除底部边距 */
    }
    
    /* 表单组间距优化 */
    .form-group {
        margin-bottom: 8px !important; /* 减小间距 */
    }
    
    .form-group label {
        font-size: 13px !important; /* 减小标签字体 */
        margin-bottom: 3px !important; /* 减小标签下边距 */
        white-space: nowrap !important; /* 防止标签换行 */
    }
    
    /* 日期时间输入框紧凑化 */
    input[type="date"], input[type="datetime-local"], .date-picker, .flatpickr-input {
        padding: 6px 10px !important;
        font-size: 14px !important;
        min-height: 32px !important;
    }
    
    /* 下拉选择器紧凑化 */
    select.form-control, .custom-select-btn {
        padding: 6px 10px !important;
        font-size: 14px !important;
        min-height: 32px !important;
    }
    
    /* 通用表单容器水平布局优化 */
    .table-header .form-group,
    .filter-row .form-group,
    .search-filters .form-group {
        display: inline-block !important;
        margin-right: 8px !important;
        margin-bottom: 6px !important;
        vertical-align: top !important;
    }
    
    /* 确保表单元素不独占一行 */
    .form-inline, .inline-form, .horizontal-form {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        align-items: flex-end !important;
    }
    
    .form-inline .form-group,
    .inline-form .form-group,
    .horizontal-form .form-group {
        flex: 0 1 auto !important;
        min-width: 120px !important;
        margin-bottom: 0 !important;
    }
}

/* ================================
   小屏幕设备特殊优化 (手机竖屏) 最大 480px
   ================================ */
@media (max-width: 480px) {
    /* 整体布局调整 */
    .dashboard {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    /* 侧边栏移动端优化 - 底部导航栏 */
    .sidebar {
        width: 100% !important;
        height: auto !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
        order: 2; /* 将侧边栏移到底部 */
    }
    
    .sidebar .nav-links {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        padding: 8px 0;
        background: linear-gradient(135deg, #f8f9fa, #e9ecef);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .sidebar .nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 6px 4px;
        margin: 0;
        border-radius: 8px;
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        transition: all 0.2s ease;
    }
    
    .sidebar .nav-item.active {
        color: #ff9900;
        background: rgba(255, 153, 0, 0.1);
    }
    
    .sidebar .nav-item i {
        font-size: 18px;
        margin-bottom: 2px;
    }
    
    .sidebar .nav-text {
        font-size: 10px;
        font-weight: 500;
        margin-top: 4px;
    }
    
    .sidebar .sidebar-header {
        display: none; /* 隐藏logo */
    }
    
    /* 移动端隐藏用户信息区域 */
    .sidebar .user-info {
        display: none;
    }
    
    /* 主内容区域调整 */
    .main-content {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 15px 10px !important;
        padding-bottom: 70px !important; /* 底部留出导航栏空间 */
        order: 1; /* 主内容在顶部 */
    }
    
    /* 按钮组优化 */
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    /* 基础按钮移动端调整 - 超紧凑模式 */
    .btn {
        padding: 4px 8px !important; /* 超紧凑内边距 */
        font-size: 11px !important; /* 超小字体 */
        min-height: 28px !important; /* 超小最小高度 */
        min-width: 50px !important; /* 超小最小宽度 */
        border-radius: 4px !important;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 32px;
    }
    
    .btn-lg {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 40px;
    }
    
    /* 操作按钮组优化 */
    .actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-end;
    }
    
    /* 表格头部操作区域 - 保持水平布局 */
    .table-header {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    /* 搜索和筛选区域 - 紧凑水平布局 */
    .table-header > div:first-child {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        align-items: center !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    /* 输入框优化 */
    .po-filter-input,
    .search-input {
        flex: 1;
        min-width: 120px;
        font-size: 14px;
        padding: 8px 12px;
    }
    
    /* 自定义选择器优化 */
    .custom-select {
        min-width: 80px;
    }
    
    .custom-select-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* 批量操作提示文字 */
    .table-header div[style*="color:#e74c3c"] {
        font-size: 12px !important;
        line-height: 1.4;
        margin-top: 5px;
    }
    
    /* 模态框移动端优化 */
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        width: 95% !important;
        max-width: none !important;
        margin: 20px auto !important;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    }
    
    .modal-header {
        padding: 15px;
        font-size: 18px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    /* .modal-footer {
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 10px;
    } */
    
    /* 分页控件移动端优化 */
    .pagination-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .pg-jump {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 14px;
    }
    
    .pg-jump-input {
        width: 50px !important;
        padding: 4px;
        text-align: center;
    }
    
    .page-size-select,
    .pg-size-select {
        padding: 6px;
        font-size: 14px;
    }
    
    /* 状态标签移动端优化 */
    .status {
        font-size: 11px;
        padding: 3px 6px;
        border-radius: 4px;
    }
    
    .status-valid,
    .status-invalid,
    .status-pending {
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 3px;
        white-space: nowrap;
    }
    
    /* 健康度显示优化 */
    .health-score {
        font-size: 12px;
        font-weight: bold;
    }
    
    /* 时间显示优化 */
    .time-display {
        font-size: 12px;
    }
    
    /* 搜索框优化 - 超紧凑水平布局 */
    .search-container {
        margin-bottom: 4px;
    }
    
    .search-box {
        padding: 4px 8px !important;
        min-width: 80px !important; /* 进一步减小最小宽度 */
        width: auto !important; /* 自动宽度，不独占 */
        flex: 1 !important;
        max-width: 150px !important; /* 限制最大宽度 */
        border-radius: 6px !important;
    }
    
    .search-box input {
        font-size: 12px !important;
        margin-left: 3px !important;
    }
    
    .search-input {
        width: 100%;
        font-size: 14px; /* 减小字体大小 */
        padding: 8px 10px; /* 减小内边距 */
    }
    
    /* 表格容器优化 */
    .table-container {
        padding: 10px;
        margin: 0 -5px;
    }
    
    .table,
    .appointment-table,
    .account-table,
    .po-table,
    .logs-table {
        min-width: 500px;
        font-size: 12px;
    }
    
    .table th,
    .appointment-table th,
    .account-table th,
    .po-table th,
    .logs-table th {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .table td,
    .appointment-table td,
    .account-table td,
    .po-table td,
    .logs-table td {
        padding: 6px 4px;
        font-size: 11px;
    }
    
    .pagination-container,
    #appointment-table-pagination,
    #account-table-pagination {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .status {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    /* 加载状态优化 */
    .loading-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
    
    .loading-text {
        font-size: 14px;
        margin-top: 10px;
    }
    
    /* 表单行布局优化 - 超紧凑水平布局 */
    .form-row {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        align-items: flex-end !important;
    }
    
    .form-row .form-group {
        flex: 1 !important;
        min-width: 100px !important; /* 进一步减小最小宽度 */
        margin-bottom: 0 !important;
    }
    
    /* 表单优化 - 超紧凑模式 */
    .form-group {
        margin-bottom: 6px !important; /* 进一步减小间距 */
    }
    
    .form-group label {
        font-size: 11px !important; /* 进一步减小标签字体 */
        margin-bottom: 2px !important; /* 进一步减小标签下边距 */
        white-space: nowrap !important; /* 防止标签换行 */
        overflow: hidden !important;
        text-overflow: ellipsis !important; /* 长标签显示省略号 */
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-control,
    .po-filter-input,
    .po-filter-select {
        font-size: 14px !important; /* 保持可读性，防止iOS缩放 */
        padding: 5px 8px !important; /* 超紧凑内边距 */
        min-height: 30px !important; /* 超小最小高度 */
        border-radius: 4px !important; /* 超小圆角 */
    }
    
    /* 日期时间输入框超紧凑化 */
    input[type="date"], 
    input[type="datetime-local"], 
    .date-picker, 
    .flatpickr-input {
        padding: 5px 8px !important;
        font-size: 14px !important;
        min-height: 30px !important;
        border-radius: 4px !important;
    }
    
    /* 下拉选择器超紧凑化 */
    select.form-control, 
    .custom-select-btn,
    .po-filter-select {
        padding: 5px 8px !important;
        font-size: 14px !important;
        min-height: 30px !important;
        border-radius: 4px !important;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* 账户管理页面移动端优化 */
    .account-management {
        gap: 16px;
    }
    
    .account-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .account-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card-value {
        font-size: 20px;
    }
    
    .stat-card-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .account-toolbar {
        padding: 12px 16px;
        border-radius: 8px 8px 0 0;
    }
    
    .account-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .account-search {
        min-width: auto;
    }
    
    .account-actions {
        justify-content: space-between;
    }
    
    .account-info {
        gap: 8px;
    }
    
    .account-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .account-details h4 {
        font-size: 13px;
    }
    
    .account-details p {
        font-size: 11px;
    }
    
    .account-status {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .account-action-btn {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    /* 账户详情模态框优化 */
    .account-details-modal .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }
    
    .account-details-modal .modal-body {
        padding: 16px;
    }
    
    .account-details-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .account-details-avatar {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .account-details-info h3 {
        font-size: 20px;
    }
    
    .account-form {
        padding: 16px;
        gap: 16px;
    }
    
    .form-group-section {
        padding: 16px;
    }
    
    .permissions-grid {
        grid-template-columns: 1fr;
    }
    
    /* 认证页面优化 */
    .auth-card {
        margin: 10px;
        padding: 20px;
        border-radius: 12px;
    }
    
    .auth-card .form-group {
        margin-bottom: 15px;
    }
    
    .auth-card .btn {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
}

/* ================================
   超小屏幕下的特殊处理 (320px 及以下)
   ================================ */
@media (max-width: 320px) {
    .main-content {
        padding: 10px 5px !important;
    }
    
    .modal-content {
        width: 98%;
        margin: 10px auto;
    }
    
    .auth-container {
        padding: 10px;
    }
    
    .auth-card {
        padding: 15px;
        margin: 5px;
    }
}

/* ================================
   分页控件移动端优化
   ================================ */
@media (max-width: 900px) {
    #account-table-pagination {
        padding: 8px 6px;
        font-size: 13px;
    }
}

/* ================================
   触摸设备优化
   ================================ */
@media (hover: none) and (pointer: coarse) {
    /* 触摸设备按钮优化 */
    .nav-item {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-item:hover {
        transform: none;
        box-shadow: none;
    }
    
    .nav-item:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
    
    /* 优化表格滚动 */
    .table-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* 按钮触摸优化 */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
}

/* ================================
   横屏模式优化
   ================================ */
@media (orientation: landscape) and (max-height: 500px) {
    .sidebar {
        width: 180px !important;
    }
    
    .sidebar .nav-text {
        display: none; /* 横屏时隐藏文字，只显示图标 */
    }
    
    .main-content {
        margin-left: 180px !important;
        padding: 15px !important;
    }
    
    .modal-content {
        max-height: 85vh;
    }
}

/* ================================
   高DPI屏幕优化
   ================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* 高DPI屏幕图标和按钮优化 */
    .btn {
        border-width: 0.5px;
    }
    
    .status {
        border-width: 0.5px;
    }
}

/* ================================
   可访问性优化
   ================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 增强对比度模式 */
@media (prefers-contrast: high) {
    .status {
        border: 1px solid currentColor;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .table,
    .appointment-table,
    .account-table,
    .po-table,
    .logs-table {
        border: 2px solid #000;
    }
    
    .table th,
    .appointment-table th,
    .account-table th,
    .po-table th,
    .logs-table th {
        border-bottom: 2px solid #000;
    }
}

/* ================================
   iOS Safari 特殊优化
   ================================ */
@supports (-webkit-touch-callout: none) {
    /* 防止iOS Safari的橡皮筋效果 */
    body {
        position: fixed;
        overflow: hidden;
        width: 100%;
        height: 100%;
    }
    
    .main-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        height: calc(100vh - 60px); /* 减去底部导航栏高度 */
    }
    
    /* 修复iOS输入框缩放问题 */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important; /* 防止iOS自动缩放 */
    }
}

/* ================================
   Android Chrome 特殊优化
   ================================ */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .table-container {
        overflow-x: auto;
        overflow-y: hidden;
    }
}