* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
}

.user-info {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.role-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.role-admin {
    background: #ff6b6b;
}

.role-owner {
    background: #4ecdc4;
}

.role-employee {
    background: #95e1d3;
}

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 6px 15px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 6px;
    transition: background 0.3s;
}

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

.period-activity {
    background: #fff3cd;
    border-left: 5px solid #ffc107;
    padding: 20px;
    margin: 20px;
    border-radius: 10px;
}

.period-activity h2 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 24px;
}

.period-info {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.period-item {
    flex: 1;
    min-width: 200px;
}

.period-item strong {
    color: #856404;
    display: block;
    margin-bottom: 5px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 5px solid #6c757d;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-card.clickable-stat {
    cursor: pointer;
}

.stat-card.clickable-stat.active {
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    transform: translateY(-3px);
    border-width: 6px;
}

/* 交通信号灯颜色系统 */
.stat-card.stat-gray {
    border-left-color: #6c757d;
}

.stat-card.stat-gray .stat-number {
    color: #6c757d;
}

.stat-card.stat-orange {
    border-left-color: #fd7e14;
}

.stat-card.stat-orange .stat-number {
    color: #fd7e14;
}

.stat-card.stat-green {
    border-left-color: #28a745;
}

.stat-card.stat-green .stat-number {
    color: #28a745;
}

.stat-card.stat-red {
    border-left-color: #dc3545;
}

.stat-card.stat-red .stat-number {
    color: #dc3545;
}

.stat-card.stat-yellow {
    border-left-color: #ffc107;
}

.stat-card.stat-yellow .stat-number {
    color: #ffc107;
}

.stat-card.stat-blue {
    border-left-color: #3b82f6;
}

.stat-card.stat-blue .stat-number {
    color: #3b82f6;
}

/* 完成进度卡片 - 根据百分比动态显示颜色 */
.stat-card.stat-progress {
    border-left-color: #6c757d;
}

.stat-card.stat-progress .stat-number {
    color: #6c757d;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
}

.filter-buttons {
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background: #667eea;
    color: white;
}

.filter-group select {
    padding: 8px 15px;
    border: 2px solid #667eea;
    border-radius: 20px;
    background: white;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
}

.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    padding: 20px;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.module {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.module:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 18px 20px;
    border-bottom: 3px solid;
    gap: 15px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.08));
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.module-header h2 {
    flex: 1;
    margin: 0;
}

.module-header .progress-bar-container {
    flex-shrink: 0;
}

.module-header-left {
    flex: 1;
}

.module-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.module-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-sort-order {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 10px;
    font-size: 12px;
    color: #495057;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    border: 1px solid rgba(73, 80, 87, 0.15);
}

.module-1 .module-header {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.12);
}

.module-2 .module-header {
    border-color: #17a2b8;
    background: rgba(23, 162, 184, 0.12);
}

.module-3 .module-header {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.16);
}

.module-4 .module-header {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.12);
}

.module h2 {
    font-size: 22px;
    color: #333;
}

.progress-bar-container {
    width: 150px;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 15px;
    transition: width 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.sub-module {
    margin-bottom: 20px;
    position: relative;
}

.sub-module h3 {
    font-size: 18px;
    color: #495057;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 4px solid #667eea;
}

.public-domain,
.private-domain,
.none-domain {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.public-domain {
    border-left: 4px solid #17a2b8;
}

.private-domain {
    border-left: 4px solid #28a745;
}

.none-domain {
    border-left: 4px solid #6c757d;
}

.domain-title {
    font-size: 16px;
    font-weight: bold;
    color: #495057;
    margin-bottom: 12px;
}

.task-list {
    list-style: none;
}

.task-item {
    background: white;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.task-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.task-item.dragging {
    opacity: 0.6;
    border-style: dashed;
}

.task-item .task-drag-handle {
    display: none;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    color: #adb5bd;
    font-size: 16px;
    cursor: grab;
}

.task-sortable .task-drag-handle {
    display: flex;
}

.task-sortable {
    cursor: grab;
}

.task-list.task-list-sorting {
    opacity: 0.7;
}

/* 子模块拖动排序样式 */
.sub-module-sortable {
    cursor: grab;
}

.sub-module-sortable:active {
    cursor: grabbing;
}

.sub-module.dragging {
    opacity: 0.6;
    border-style: dashed;
}

.sub-module-drag-handle {
    position: absolute;
    left: 5px;
    top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #adb5bd;
    font-size: 16px;
    cursor: grab;
    z-index: 10;
}

.sub-module-drag-handle:active {
    cursor: grabbing;
}

.sub-module-sortable h3 {
    padding-left: 30px;
}

.sub-module-container-sorting {
    opacity: 0.7;
}

.task-item.completed {
    opacity: 0.7;
}

.task-item.completed .task-name {
    text-decoration: line-through;
}

/* 状态按钮样式 */
.status-btn {
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.status-btn:active {
    transform: translateY(0);
}

/* 待开始状态按钮 */
.status-btn-pending {
    background: #6c757d;
    color: white;
}

.status-btn-pending:hover {
    background: #5a6268;
}

/* 进行中状态按钮 */
.status-btn-in_progress {
    background: #ffc107;
    color: #333;
}

.status-btn-in_progress:hover {
    background: #e0a800;
}

/* 已完成状态按钮 */
.status-btn-completed {
    background: #28a745;
    color: white;
}

.status-btn-completed:hover {
    background: #218838;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.task-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    font-weight: 500;
}

.task-desc {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 6px;
}

.task-meta {
    display: flex;
    gap: 15px;
    margin-top: 4px;
    font-size: 11px;
    color: #6c757d;
    flex-wrap: wrap;
}

.task-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-owner {
    color: #667eea;
    font-weight: 500;
}

.task-deadline {
    color: #6c757d;
}

.task-deadline.overdue {
    color: #dc3545;
    background: #f8d7da;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

/* 倒计时预警样式 */
.countdown-info {
    font-weight: 500;
}

.countdown-info.warning {
    color: #ffc107;
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 4px;
}

.countdown-info.overdue {
    color: #dc3545;
    background: #f8d7da;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.countdown-text {
    font-size: 0.9em;
}

.task-start-time,
.task-end-time {
    color: #6c757d;
    font-size: 0.9em;
}

.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inspect-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
}

.inspect-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.edit-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
}

.edit-btn:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.progress-btn {
    background: #ffe08a;
    color: #5c3b00;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
}

.progress-btn:hover {
    background: #f0b429;
    color: #fff;
    transform: scale(1.05);
}

.task-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: bold;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-in-progress {
    background: #cfe2ff;
    color: #084298;
}

.status-completed {
    background: #d1e7dd;
    color: #0f5132;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

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

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .period-info {
        flex-direction: column;
    }

    .task-item {
        flex-wrap: wrap;
    }

    .task-actions {
        width: 100%;
        margin-top: 8px;
        justify-content: flex-end;
    }

    .user-info {
        position: static;
        justify-content: center;
        margin-top: 15px;
    }
}

/* 删除按钮样式 */
.btn-delete-module,
.btn-delete-task {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    margin-left: 10px;
}

.btn-delete-module:hover,
.btn-delete-task:hover {
    background: #c82333;
    transform: scale(1.05);
}

.btn-delete-task {
    padding: 4px 8px;
    font-size: 12px;
    margin-left: 5px;
}

.btn-edit-module {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-edit-module:hover {
    background: #e0a800;
    transform: scale(1.05);
}

.module-header-actions .btn-delete-module {
    margin-left: 0;
}

/* 模块头部样式调整 */
.module-header {
    position: relative;
}

/* 表单样式增强 */
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

/* 多选责任人样式 */
.owners-checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    background: #fff;
}

.owners-checkbox-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    margin: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.owners-checkbox-item:hover {
    background-color: #f5f5f5;
}

.owners-checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.owners-checkbox-item label {
    cursor: pointer;
    flex: 1;
    margin: 0;
    font-weight: normal;
}

.owners-selected-count {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* 添加任务模态框样式调整 */
#addTaskModal .modal-content {
    max-width: 600px;
}

/* 责任人管理样式 */
.modal-large {
    max-width: 800px;
}

.modal-body {
    padding: 0;
}

.owners-list-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.owners-list {
    max-height: 500px;
    overflow-y: auto;
}

.owners-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.owners-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.owners-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.owners-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

.owners-table tbody tr:hover {
    background: #f8f9fa;
}

.owners-table tbody tr:last-child td {
    border-bottom: none;
}

.status-enabled {
    color: #28a745;
    font-weight: 500;
}

.status-disabled {
    color: #dc3545;
    font-weight: 500;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 12px;
    text-transform: uppercase;
}

.badge-success {
    background: #28a745;
    color: white;
}

.period-activities-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.period-activity-item {
    transition: all 0.3s;
}

.period-activity-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.empty-state,
.error-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.error-state {
    color: #dc3545;
}

.progress-task-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: grid;
    gap: 6px;
}

.progress-report-form textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    resize: vertical;
    min-height: 90px;
    box-sizing: border-box;
    font-family: inherit;
}

.progress-permission-hint {
    margin: 10px 0 15px;
    color: #666;
    background: #fff8e1;
    border: 1px dashed #f0b429;
    border-radius: 6px;
    padding: 10px 12px;
}

.progress-history-title {
    margin: 20px 0 10px;
    font-size: 16px;
    color: #374151;
}

.progress-report-list {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-report-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.progress-report-item .report-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 8px;
    gap: 10px;
}

.progress-report-item .report-content {
    font-size: 14px;
    color: #111827;
    line-height: 1.6;
    white-space: pre-wrap;
}

.progress-report-empty {
    text-align: center;
    color: #9ca3af;
    padding: 20px 0;
}

.hidden {
    display: none !important;
}

.inspection-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    gap: 4px;
}

.inspection-badge.pending {
    background: #fff7ed;
    color: #c2410c;
}

.inspection-badge.approved {
    background: #dcfce7;
    color: #166534;
}

.inspection-badge.rework {
    background: #fee2e2;
    color: #b91c1c;
}

.inspection-body {
    padding: 0 10px 10px;
}

.inspection-task-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.inspection-task-info strong {
    color: #475569;
    margin-right: 6px;
}

.inspection-action-panel {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    background: #fff;
}

.inspection-action-panel textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    min-height: 80px;
    padding: 10px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 12px;
}

.inspection-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.inspection-history-title {
    font-size: 16px;
    color: #334155;
    margin-bottom: 12px;
}

.inspection-history-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inspection-history-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
}

.inspection-history-item .history-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
}

.inspection-history-item .history-note {
    font-size: 13px;
    color: #1e293b;
    white-space: pre-wrap;
}

