* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Microsoft YaHei', sans-serif;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #e8f4fd;
    border-color: #3498db;
    color: #3498db;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination #inspPageInfo,
.pagination #rectAdminPageInfo {
    padding: 6px 12px;
    background: #ecf0f1;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 15px 25px;
    text-align: center;
    border-radius: 8px 8px 0 0;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.login-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    max-width: 500px;
    margin: 20px auto;
}

.login-section h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #444;
}

input, select, textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: #3498db;
    outline: none;
}

button {
    padding: 14px 20px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.btn-outline {
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
}

.main-content {
    display: none;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    color: #7f8c8d;
    font-weight: bold;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    box-shadow: none;
}

.tab-btn:hover {
    transform: none;
    box-shadow: none;
    color: #3498db;
}

.tab-btn.active {
    color: #3498db;
    border-bottom: 3px solid #3498db;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-info h3 {
    color: #7f8c8d;
    margin-bottom: 5px;
    font-size: 14px;
}

.stat-info .number {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.trend {
    font-size: 12px;
    font-weight: bold;
}

.trend.up {
    color: #27ae60;
}

.trend.down {
    color: #e74c3c;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.chart-container h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.location-stats-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.location-stats-panel h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.location-stats-item {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}

.location-stats-item:last-child {
    border-bottom: none;
}

.location-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.location-stats-table th {
    background: #f8f9fa;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

.location-stats-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.location-stats-table tr:last-child td {
    border-bottom: none;
}

.location-stats-table .num {
    font-weight: 600;
    color: #3498db;
}

.location-stats-table .completed-num {
    font-weight: 600;
    color: #27ae60;
}

.location-stats-table .pending-num {
    font-weight: 600;
    color: #e67e22;
}

.location-stats-table .overdue-num {
    font-weight: 600;
    color: #e74c3c;
}

.urgent-items {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.urgent-items h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.urgent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.urgent-item {
    padding: 15px;
    border-left: 4px solid #e74c3c;
    background: #fff4f4;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.urgent-item .item-info {
    flex: 1;
}

.urgent-item .item-actions {
    display: flex;
    gap: 10px;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-item {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.stats-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.stats-card.large {
    grid-column: span 2;
}

.stats-card h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.inspections-summary, .rectifications-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.summary-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    padding: 8px 15px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
}

.inspections-list, .rectifications-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.inspection-item, .rectification-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.item-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.item-date {
    color: #7f8c8d;
    font-size: 14px;
}

.item-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.detail-value {
    font-weight: bold;
    color: #2c3e50;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-pending {
    background-color: #ffeaa7;
    color: #d35400;
}

.status-inprogress {
    background-color: #81ecec;
    color: #00a6a6;
}

.status-completed {
    background-color: #55efc4;
    color: #00b894;
}

.status-overdue {
    background-color: #fab1a0;
    color: #d63031;
}

.report-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.report-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.report-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin: 0 auto 15px;
}

.report-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.report-card p {
    color: #7f8c8d;
    font-size: 14px;
}

.custom-report-panel {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.custom-report-panel h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.report-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.report-history {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.report-history h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.history-info {
    flex: 1;
}

.history-actions {
    display: flex;
    gap: 10px;
}

/* 人员管理 - 用户表格样式 */
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.users-table thead {
    background: #f4f6f8;
}

.users-table th,
.users-table td {
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    text-align: left;
    white-space: nowrap;
}

.users-table th {
    font-weight: bold;
    color: #555;
}

.users-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.users-table tbody tr:hover {
    background-color: #eef5ff;
}

.users-table tbody tr.inactive {
    color: #999;
    background-color: #f7f7f7;
}

.users-table tbody tr.inactive td {
    text-decoration: none;
}

.users-table td:last-child {
    min-width: 220px;
}

.users-table td button {
    padding: 6px 10px;
    font-size: 12px;
    margin-right: 6px;
    box-shadow: none;
}

.users-table td button:last-child {
    margin-right: 0;
}

/* 通用模态框样式（用于添加/编辑用户和重置密码） */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal .modal-content {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    padding: 24px 28px 20px;
    width: 100%;
    max-width: 480px;
}

.modal .modal-content h2 {
    margin-bottom: 18px;
    font-size: 20px;
    color: #2c3e50;
}

#imageZoomModal {
    background: rgba(0, 0, 0, 0.85);
    cursor: zoom-out;
    z-index: 2000;
}

.modal .form-group {
    margin-bottom: 14px;
}

.modal .form-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal .form-actions button {
    padding: 8px 14px;
    font-size: 14px;
    box-shadow: none;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: #7f8c8d;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.hidden {
    display: none;
}

@media (max-width: 1024px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-card.large {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .filters, .report-filters {
        grid-template-columns: 1fr;
    }
    
    .summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .summary-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .report-types {
        grid-template-columns: 1fr;
    }
}

/* ===================== */
/* 位置年度统计报表样式    */
/* ===================== */
.table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
    border-radius: 10px;
}

.report-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.toolbar-left label {
    font-weight: bold;
    font-size: 14px;
}
.toolbar-left select {
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.report-filter-bar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: #f0f4f8;
    border-radius: 6px;
    flex-wrap: wrap;
}
.report-filter-bar > label {
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    line-height: 28px;
}
.location-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    flex: 1;
}
.location-checkboxes label {
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.location-checkboxes input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}
.filter-actions {
    display: flex;
    gap: 6px;
}
.filter-actions button {
    padding: 4px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.filter-actions button:hover {
    background: #e9ecef;
}

/* 位置统计表格 */
.location-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
    border: 2px solid #34495e;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    margin-top: 10px;
}
.location-report-table thead th {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: white;
    padding: 10px 6px;
    text-align: center;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 4;
    white-space: nowrap;
}
.location-report-table thead th:first-child {
    width: 160px;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 5;
}
/* 表头第二行子列 */
.location-report-table thead tr:nth-child(2) th {
    background: linear-gradient(135deg, #3d566e 0%, #2c3e50 100%);
    font-size: 11px;
    font-weight: 500;
    padding: 6px 4px;
}
.location-report-table tbody td {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #dde3ea;
    vertical-align: middle;
}
.location-report-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 2px solid #b0bec5;
}
.location-report-table tbody tr {
    background: #fff;
    transition: background 0.15s;
}
.location-report-table tbody tr:nth-child(even) {
    background: #f8fafc;
}
.location-report-table tbody tr:nth-child(even) td:first-child {
    background: linear-gradient(135deg, #f0f2f5 0%, #e4e8ec 100%);
}
.location-report-table tbody tr:hover td {
    background: #e8f4fd;
}
.location-report-table tbody tr:hover td:first-child {
    background: linear-gradient(135deg, #d6eaff 0%, #c0d8f5 100%);
}
/* 月份组分隔线：每3列后加分隔 
.location-report-table tbody td:nth-child(3n+2) {
    border-left: 2px solid #aab7c4;
}*/
.location-report-table thead th:nth-child(3n+2) {
    border-left: 2px solid rgba(255,255,255,0.2);
}
.location-report-table thead th:nth-child(3n+3) {
    border-left: 1px solid rgba(255,255,255,0.1);
}
.location-report-table thead th:nth-child(3n+4) {
    border-left: 2px solid rgba(255,255,255,0.25);
}
.location-report-table tfoot td {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: white;
    padding: 10px 6px;
    text-align: center;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.08);
}
.location-report-table tfoot td:first-child {
    text-align: left;
    border-right: 2px solid rgba(255,255,255,0.15);
}
.location-report-table tfoot td:nth-child(3n+2) {
    border-left: 2px solid rgba(255,255,255,0.15);
}
.location-report-table td.cell-complete {
    color: #166534;
    font-weight: 700;
    background: #f0fdf4 !important;
}
.location-report-table td.cell-overdue {
    color: #dc2626;
    font-weight: 700;
    background: #fef2f2 !important;
}

/* 可编辑单元格 */
.loc-cell {
    min-width: 52px;
    cursor: text;
    border-radius: 2px;
    display: block;
    min-height: 22px;
}
.loc-cell:hover {
    background: #fffbeb;
    outline: 1px solid #f59e0b;
}
.loc-cell[contenteditable="true"] {
    background: #fffbeb;
    outline: 1.5px solid #f59e0b;
    cursor: text;
}

/* 橙色按钮（填充数据） */
.btn-warning {
    background: #f59e0b !important;
    color: white !important;
    border: none !important;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    padding: 7px 14px;
}
.btn-warning:hover {
    background: #d97706 !important;
}
.btn {
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.btn-primary {
    background: #3498db;
    color: white;
    border: none;
    padding: 7px 14px;
}
.btn-primary:hover {
    background: #2980b9;
}
.export-btn {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.export-btn:hover {
    background: #1e8449;
}

/* 检查详情对比图片 */
.inspection-detail-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fafafa;
}
.comparison-row {
    display: flex;
    gap: 16px;
    margin: 8px 0;
}
.comparison-cell {
    flex: 1;
    text-align: center;
}
.comparison-cell p {
    margin: 0 0 4px;
    font-size: 13px;
}

/* 详情模态框头部 */
.detail-modal-wrap {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.detail-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
    margin-bottom: 12px;
}
.detail-modal-header h2 {
    margin: 0;
}
.detail-modal-body {
    overflow-y: auto;
    flex: 1;
}
.detail-modal-close {
    padding: 6px 16px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.detail-modal-close:hover {
    background: #5a6268;
}