/* 移动端适配样式 */

/* 基础响应式设置 */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
}

/* 小屏幕手机适配 */
@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .header-content {
        padding: 0 5px;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .filters {
        padding: 1rem;
    }
    
    .form-container {
        padding: 1rem;
    }
}

/* 移动端特定功能 */
@media (max-width: 768px) {
    /* 移动端侧边栏 */
    .mobile-sidebar {
        display: block;
    }
    
    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: #333;
        padding: 0.5rem;
    }
    
    /* 移动端导航 */
    .mobile-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        margin-bottom: 1rem;
    }
    
    .mobile-nav h1 {
        font-size: 1.2rem;
        color: #333;
    }
}

/* 移动端特定组件 */
@media (max-width: 768px) {
    /* 移动端卡片 */
    .mobile-list {
        display: block;
    }
    
    .mobile-card {
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        margin-bottom: 1rem;
        padding: 1rem;
        border-left: 4px solid #007bff;
    }
    
    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 1rem;
    }
    
    .mobile-card-title {
        flex: 1;
    }
    
    .mobile-card-title h3 {
        font-size: 1.1rem;
        color: #333;
        margin-bottom: 0.25rem;
    }
    
    .mobile-card-title p {
        color: #666;
        font-size: 0.9rem;
    }
    
    .mobile-card-actions {
        display: flex;
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    .mobile-card-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .mobile-card-field {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .mobile-card-field label {
        font-size: 0.8rem;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 500;
    }
    
    .mobile-card-field span {
        font-size: 0.9rem;
        color: #333;
    }
    
    .mobile-card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 1rem;
        border-top: 1px solid #eee;
    }
    
    .mobile-card-footer .mobile-card-field {
        margin: 0;
    }
    
    .mobile-card-footer .mobile-card-field label {
        font-size: 0.7rem;
    }
    
    .mobile-card-footer .mobile-card-field span {
        font-size: 0.8rem;
    }
}

/* 移动端列表视图（替代桌面表格） */
@media (max-width: 768px) {
    .mobile-list-item {
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        margin-bottom: 1rem;
        overflow: hidden;
    }
    
    .mobile-list-header {
        background: #f8f9fa;
        padding: 1rem;
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-list-title {
        font-weight: 600;
        color: #333;
        font-size: 1rem;
    }
    
    .mobile-list-subtitle {
        color: #666;
        font-size: 0.9rem;
        margin-top: 0.25rem;
    }
    
    .mobile-list-body {
        padding: 1rem;
    }
    
    .mobile-list-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .mobile-list-row:last-child {
        border-bottom: none;
    }
    
    .mobile-list-label {
        font-size: 0.8rem;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 500;
        flex: 1;
    }
    
    .mobile-list-value {
        font-size: 0.9rem;
        color: #333;
        text-align: right;
        flex: 1;
    }
    
    .mobile-list-actions {
        padding: 1rem;
        background: #f8f9fa;
        border-top: 1px solid #eee;
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
    }
}

/* 移动端开关控件 */
@media (max-width: 768px) {
    .mobile-switch-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
    }
    
    .mobile-switch-label {
        font-size: 0.9rem;
        color: #333;
        font-weight: 500;
    }
    
    .mobile-switch {
        position: relative;
        display: inline-block;
        width: 44px;
        height: 24px;
    }
    
    .mobile-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }
    
    .mobile-switch .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        transition: 0.4s;
        border-radius: 24px;
    }
    
    .mobile-switch .slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.4s;
        border-radius: 50%;
    }
    
    .mobile-switch input:checked + .slider {
        background-color: #007bff;
    }
    
    .mobile-switch input:checked + .slider:before {
        transform: translateX(20px);
    }
}

/* 移动端下拉菜单 */
@media (max-width: 768px) {
    .mobile-select {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 1rem;
        background: white;
        margin-bottom: 1rem;
    }
    
    .mobile-select-group {
        margin-bottom: 1rem;
    }
    
    .mobile-select-label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: #555;
        font-size: 0.9rem;
    }
}

/* 移动端按钮 */
@media (max-width: 768px) {
    .mobile-btn {
        width: 100%;
        padding: 0.75rem;
        border: none;
        border-radius: 4px;
        font-size: 1rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s;
        margin-bottom: 0.5rem;
    }
    
    .mobile-btn-primary {
        background: #007bff;
        color: white;
    }
    
    .mobile-btn-primary:hover {
        background: #0056b3;
    }
    
    .mobile-btn-secondary {
        background: #6c757d;
        color: white;
    }
    
    .mobile-btn-secondary:hover {
        background: #5a6268;
    }
    
    .mobile-btn-success {
        background: #28a745;
        color: white;
    }
    
    .mobile-btn-success:hover {
        background: #218838;
    }
    
    .mobile-btn-danger {
        background: #dc3545;
        color: white;
    }
    
    .mobile-btn-danger:hover {
        background: #c82333;
    }
    
    .mobile-btn-group {
        display: flex;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .mobile-btn-group .mobile-btn {
        flex: 1;
        margin-bottom: 0;
    }
}

/* 移动端表单 */
@media (max-width: 768px) {
    .mobile-form {
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        margin-bottom: 1rem;
    }
    
    .mobile-form-header {
        padding: 1rem;
        border-bottom: 1px solid #eee;
        background: #f8f9fa;
    }
    
    .mobile-form-title {
        font-size: 1.2rem;
        color: #333;
        margin: 0;
    }
    
    .mobile-form-body {
        padding: 1rem;
    }
    
    .mobile-form-group {
        margin-bottom: 1.5rem;
    }
    
    .mobile-form-label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: #555;
        font-size: 0.9rem;
    }
    
    .mobile-form-input,
    .mobile-form-select,
    .mobile-form-textarea {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 1rem;
        transition: border-color 0.3s;
    }
    
    .mobile-form-input:focus,
    .mobile-form-select:focus,
    .mobile-form-textarea:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
    }
    
    .mobile-form-textarea {
        resize: vertical;
        min-height: 100px;
    }
    
    .mobile-form-footer {
        padding: 1rem;
        background: #f8f9fa;
        border-top: 1px solid #eee;
    }
}

/* 移动端分页 */
@media (max-width: 768px) {
    .mobile-pagination {
        background: white;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        text-align: center;
    }
    
    .mobile-pagination-info {
        color: #666;
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .mobile-pagination-controls {
        display: flex;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .mobile-pagination-btn {
        padding: 0.75rem 1rem;
        border: 1px solid #ddd;
        background: white;
        color: #333;
        border-radius: 4px;
        cursor: pointer;
        font-size: 0.9rem;
        transition: all 0.3s;
        flex: 1;
        max-width: 120px;
    }
    
    .mobile-pagination-btn:hover:not(:disabled) {
        background: #f8f9fa;
        border-color: #007bff;
        color: #007bff;
    }
    
    .mobile-pagination-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
}

/* 移动端模态框 */
@media (max-width: 768px) {
    .mobile-modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
    }
    
    .mobile-modal-content {
        background-color: white;
        margin: 20% auto;
        border-radius: 8px;
        width: 90%;
        max-width: 400px;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .mobile-modal-header {
        padding: 1rem;
        border-bottom: 1px solid #eee;
        background: #f8f9fa;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-modal-title {
        font-size: 1.1rem;
        color: #333;
        margin: 0;
    }
    
    .mobile-modal-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: #666;
        padding: 0;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-modal-body {
        padding: 1rem;
    }
    
    .mobile-modal-footer {
        padding: 1rem;
        background: #f8f9fa;
        border-top: 1px solid #eee;
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
    }
    
    .mobile-modal-footer .mobile-btn {
        flex: 1;
        margin-bottom: 0;
    }
}