/* css/mobile.css */
/* 移动端特有样式优化 */

/* 触摸优化 */
button, 
.btn-icon,
.task-item,
.channel-card,
.employee-stat {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

/* 更好的触摸反馈 */
.btn-primary:active,
.btn-secondary:active,
.btn-icon:active {
    transform: scale(0.98);
}

/* 防止iOS缩放 */
input[type="text"],
input[type="search"],
input[type="number"],
textarea,
select {
    font-size: 16px; /* 防止iOS缩放 */
}

/* 长按菜单 */
.context-menu {
    display: none;
    position: absolute;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    border-radius: var(--border-radius);
    z-index: 1000;
}

.context-menu-item {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    white-space: nowrap;
}

.context-menu-item:last-child {
    border-bottom: none;
}

.context-menu-item:hover {
    background: #f5f5f5;
}

/* 下拉刷新 */
.pull-to-refresh {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-color);
}

/* 底部安全区域 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .container {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* 横屏优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .navbar {
        height: 40px;
    }
    
    .container {
        padding-top: 50px;
    }
    
    .quick-actions {
        display: flex;
        flex-wrap: wrap;
    }
    
    .quick-actions button {
        flex: 1;
        min-width: auto;
    }
}

/* 平板优化 */
@media (min-width: 768px) and (max-width: 1024px) {
    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .employees-stats {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .section {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .task-item {
        background: #3d3d3d;
    }
    
    .channel-card {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .employee-stat {
        background: #3d3d3d;
    }
    
    .modal {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .form-control {
        background: #3d3d3d;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .form-control:focus {
        border-color: var(--primary-color);
    }
    
    .table th {
        background: #3d3d3d;
        color: #e0e0e0;
        border-color: #444;
    }
    
    .table td {
        border-color: #444;
    }
    
    .table tr:hover {
        background: #3d3d3d;
    }
    
    .search-input {
        background: #3d3d3d;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .filter-select {
        background: #3d3d3d;
        border-color: #444;
        color: #e0e0e0;
    }
}

/* 在 css/mobile.css 中添加 */
@media (max-width: 768px) {
    /* 渠道分配顺序表格响应式 */
    .channel-order-table {
        font-size: 12px;
    }
    
    .employee-cell {
        min-width: 100px;
    }
    
    .position-badge {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .action-btn {
        width: 26px;
        height: 26px;
    }
    
    /* 输入框响应式 */
    .weight-input,
    .limit-input {
        width: 50px !important;
        padding: 4px 6px !important;
        font-size: 12px !important;
    }
    
    .limit-help {
        font-size: 10px;
    }
    
    /* 状态标签响应式 */
    .status-badge {
        padding: 3px 6px;
        font-size: 10px;
    }
}