/* 自定义样式 */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 美化卡片 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* 统计卡片美化 */
.card.bg-primary, .card.bg-success, .card.bg-warning, .card.bg-info {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-dark) 100%);
    border: none;
}

.card.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.card.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.card.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
}

/* 表格美化 */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    border: none;
    padding: 1rem 0.75rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

.table tbody td {
    text-align: center;
    vertical-align: middle;
    padding: 0.75rem;
    border-color: #e9ecef;
}

/* 按钮美化 */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 徽章美化 */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
}

/* 分页美化 */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: #495057;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

/* 筛选卡片美化 */
.card-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 2px solid #e9ecef;
}

/* 空状态美化 */
.fa-inbox {
    opacity: 0.3;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.2rem;
}

.table th {
    background-color: #343a40;
    color: white;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}

.table td {
    vertical-align: middle;
    text-align: center;
}

/* 针对具体列内容的对齐方式 */
.table td[data-field="location"],
.table td[data-field="remarks"] {
    text-align: left;
}

/* 或者使用类名方式 */
.table td.text-left {
    text-align: left;
}

/* 任务详情模态框样式优化 */
.task-detail-modal {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.task-detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1.5rem 2rem;
    position: relative;
}

.task-detail-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.task-detail-header .modal-title {
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
}

.task-detail-body {
    padding: 2rem;
    background: #f8f9fa;
}

/* 任务详情网格布局 */
.task-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.task-detail-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.task-detail-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.task-detail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.task-detail-item:hover::before {
    width: 6px;
}

.task-detail-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.task-detail-label i {
    margin-right: 0.5rem;
    color: #667eea;
}

.task-detail-value {
    color: #212529;
    font-size: 1rem;
    line-height: 1.5;
    word-break: break-word;
}

/* 状态徽章样式 */
.task-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-status-badge.completed {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.task-status-badge.pending {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: white;
}

/* 图片展示区域 */
.task-detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.task-detail-image {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.task-detail-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.task-detail-image img {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.task-detail-image img:hover {
    border-color: #667eea;
    transform: scale(1.02);
}

.task-detail-image-label {
    margin-top: 1rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-detail-no-image {
    width: 100%;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #6c757d;
    font-size: 0.875rem;
}

.task-detail-no-image i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .task-detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .task-detail-body {
        padding: 1rem;
    }
    
    .task-detail-header {
        padding: 1rem 1.5rem;
    }
    
    .task-detail-images {
        grid-template-columns: 1fr;
    }
}

/* 默认隐藏移动端卡片 */
.mobile-task-list {
    display: none;
}

/* 移动端响应式优化 */
@media (max-width: 768px) {
    /* 移动端容器优化 */
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* 移动端卡片优化 */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .card-header {
        padding: 1rem;
        border-bottom: 1px solid #e9ecef;
    }
    
    .card-body {
        padding: 0;
    }
    
    /* 移动端表格隐藏，使用卡片布局 */
    .table-responsive {
        display: none;
    }
    
    /* 移动端卡片列表 */
    .mobile-task-list {
        display: block !important;
        padding: 0;
    }
    
    .mobile-task-item {
        background: white;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        margin-bottom: 0.75rem;
        padding: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }
    
    .mobile-task-item:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transform: translateY(-1px);
    }
    
    .mobile-task-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #f8f9fa;
    }
    
    .mobile-task-title {
        font-weight: 600;
        color: #495057;
        font-size: 0.9rem;
    }
    
    .mobile-task-status {
        display: inline-flex;
        align-items: center;
        padding: 0.25rem 0.5rem;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 500;
    }
    
    .mobile-task-status.completed {
        background: #d4edda;
        color: #155724;
    }
    
    .mobile-task-status.pending {
        background: #fff3cd;
        color: #856404;
    }
    
    .mobile-task-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .mobile-task-field {
        display: flex;
        flex-direction: column;
    }
    
    .mobile-task-label {
        font-size: 0.75rem;
        color: #6c757d;
        font-weight: 500;
        margin-bottom: 0.25rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .mobile-task-value {
        font-size: 0.875rem;
        color: #212529;
        word-break: break-word;
        line-height: 1.3;
    }
    
    .mobile-task-images {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .mobile-task-image {
        flex: 1;
        text-align: center;
    }
    
    .mobile-task-image img {
        width: 100%;
        height: 80px;
        object-fit: cover;
        border-radius: 6px;
        border: 1px solid #e9ecef;
    }
    
    .mobile-task-image-label {
        font-size: 0.7rem;
        color: #6c757d;
        margin-top: 0.25rem;
    }
    
    .mobile-task-no-image {
        width: 100%;
        height: 80px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        border-radius: 6px;
        color: #6c757d;
        font-size: 0.7rem;
    }
    
    .mobile-task-no-image i {
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
        opacity: 0.5;
    }
    
    .mobile-task-actions {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #f8f9fa;
    }
    
    .mobile-task-actions .btn {
        flex: 1;
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* 移动端筛选器优化 */
    .filter-section {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .filter-section .form-group {
        width: 100%;
        margin-bottom: 0;
    }
    
    .filter-section .form-control,
    .filter-section .form-select {
        font-size: 0.875rem;
    }
    
    /* 移动端分页优化 */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 1rem;
    }
    
    .pagination .page-item {
        margin: 0.125rem;
    }
    
    .pagination .page-link {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* 移动端隐藏页码跳转，只显示上下页 */
    .pagination .page-item:not(.page-item-prev):not(.page-item-next):not(.page-item-first):not(.page-item-last) {
        display: none;
    }
    
    /* 移动端按钮组优化 */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* 移动端导航栏优化 */
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* 移动端模态框优化 */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
}

/* 超小屏幕进一步优化 */
@media (max-width: 480px) {
    .container-fluid {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
    .mobile-task-content {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .mobile-task-item {
        padding: 0.75rem;
    }
    
    .mobile-task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .mobile-task-actions {
        flex-direction: column;
    }
    
    .mobile-task-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.badge {
    font-size: 0.75em;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* 移动端导航栏 */
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-nav {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    /* 移动端按钮 */
    .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    /* 移动端卡片 */
    .card {
        margin-bottom: 1rem;
    }
    
    /* 移动端表单 */
    .form-control {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 移动端表格优化 */
    .table th,
    .table td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    /* 移动端统计卡片 */
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .stats-number {
        font-size: 1.5rem;
        font-weight: bold;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* iOS推荐最小触摸目标 */
        min-width: 44px;
    }
    
    .table-hover tbody tr:hover {
        background-color: transparent; /* 禁用悬停效果 */
    }
    
    .btn:hover {
        transform: none; /* 禁用悬停变换 */
    }
}

/* 表单样式 */
.form-label {
    font-weight: 600;
    color: #495057;
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 登录页面样式 */
.card-header {
    background-color: #007bff;
    color: white;
    border-bottom: none;
}

/* 状态指示器 */
.status-completed {
    color: #28a745;
    font-weight: bold;
}

.status-pending {
    color: #ffc107;
    font-weight: bold;
}

/* 图片链接样式 */
.btn-outline-primary {
    border-color: #007bff;
    color: #007bff;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* 操作按钮组 */
.btn-group-vertical .btn {
    margin-bottom: 0.25rem;
}

/* 空状态样式 */
.text-muted {
    color: #6c757d !important;
}

/* 导航栏样式 */
.navbar-text {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* 表格悬停效果 */
.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

/* 徽章样式 */
.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}

/* 必填项星号样式 */
.required::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* 分页样式 */
.pagination {
    margin: 0;
}

.pagination .page-link {
    color: #007bff;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
}

.pagination .page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* 分页控制按钮组 */
.btn-group .btn {
    border-radius: 0.375rem;
}

.btn-group .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* 移动端分页优化 */
@media (max-width: 768px) {
    .pagination {
        font-size: 0.875rem;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.5rem;
    }
    
    .pagination .page-item:not(:first-child):not(:last-child) {
        display: none;
    }
    
    .pagination .page-item:first-child,
    .pagination .page-item:last-child,
    .pagination .page-item.active {
        display: block;
    }
}

@media (max-width: 768px) {
    /* 统一移动端导航：纵向、左对齐、全宽 */
    .navbar-brand {
        font-size: 1rem;
    }
    .navbar-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        width: 100%;
    }
    .nav-link {
        padding: 10px 12px;
        font-size: 1rem;
        margin: 0;
        text-align: left;
        background: #ffffff;
        border: 1px solid #e9ecef;
        color: #2b2f51;
    }
}