:root {
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --bg-color: #f5f7fa;
            --card-bg: #ffffff;
        }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
            background-color: var(--bg-color);
            color: #333;
            height: 100vh;
            overflow: hidden;
        }
        .container {
            max-width: none;
            margin: 0;
            background: var(--card-bg);
            padding: 0;
            border-radius: 0;
            box-shadow: none;
            height: 100%;
            display: flex;
            flex-direction: column;
        }
        header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0;
            border-bottom: 1px solid #eee;
            padding: 20px 30px;
            flex-shrink: 0;
        }
        h1 {
            color: var(--secondary-color);
            margin: 0;
            font-size: 24px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .controls {
            display: flex;
            gap: 10px;
            align-items: center;
            justify-content: flex-end;
            flex-wrap: wrap;
        }
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .btn-primary {
            background-color: var(--primary-color);
            color: white;
        }
        .btn-primary:hover {
            background-color: #2980b9;
            transform: translateY(-1px);
        }
        .btn-secondary {
            background-color: #ecf0f1;
            color: var(--secondary-color);
        }
        .btn-secondary:hover {
            background-color: #bdc3c7;
        }
        .btn-danger {
            background-color: #e74c3c;
            color: white;
        }
        .btn-danger:hover {
            background-color: #c0392b;
        }
        
        .view-modes {
            background: #ecf0f1;
            padding: 4px;
            border-radius: 8px;
            display: flex;
            gap: 4px;
        }
        .view-mode-btn {
            padding: 6px 16px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            background: transparent;
            color: #7f8c8d;
            font-weight: 500;
        }
        .view-mode-btn.active {
            background: white;
            color: var(--secondary-color);
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .main-content {
            display: flex;
            gap: 0;
            margin-top: 0;
            align-items: stretch;
            flex: 1;
            overflow: hidden;
            height: 100%;
        }

        .gantt-panel {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
            overflow: hidden;
        }
        
        .task-list-container {
            width: 0;
            padding: 0;
            border-right: none;
            overflow: hidden;
            transition: all 0.3s ease;
            flex-shrink: 0;
            background: #f8f9fa;
            max-height: none;
            overflow-y: auto;
            border: none;
        }

        .gantt-scrollbar {
            height: 18px;
            overflow-x: auto;
            overflow-y: hidden;
            background: #f8f9fa;
            border-bottom: 1px solid #e5e7eb;
            flex-shrink: 0;
        }

        .gantt-scrollbar-inner {
            height: 1px;
            min-width: 100%;
            pointer-events: none;
        }

        .gantt-chart-wrapper {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background: white;
            padding: 20px;
            border-radius: 0;
            border: none;
            min-height: 0;
        }

        .long-term-task-lane {
            display: none;
            flex: 0 0 auto;
            padding: 4px 0 5px;
            background: #f8fafc;
            border-bottom: 1px solid #dbe2ea;
        }

        .long-term-task-label {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 0 10px 3px;
            color: #0f172a;
            font-size: 13px;
            font-weight: 800;
            line-height: 1.2;
            text-align: center;
            text-shadow: 0 1px 0 #ffffff;
            -webkit-text-stroke: 0.2px currentColor;
        }

        .long-term-task-label::before,
        .long-term-task-label::after {
            content: '';
            width: 20px;
            height: 2px;
            background: #0f766e;
            box-shadow: 0 1px 0 rgba(15, 118, 110, 0.18);
        }

        .long-term-task-rows {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .long-term-task-row {
            min-height: 24px;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 2px 12px;
            color: #fff;
            font-size: 12px;
            font-weight: 600;
            line-height: 1.2;
            text-align: center;
            cursor: pointer;
            overflow: hidden;
            white-space: nowrap;
        }

        .long-term-task-name,
        .long-term-task-avatars {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .long-term-task-name {
            display: block;
            max-width: calc(100% - 160px);
        }

        .long-term-task-avatars {
            position: absolute;
            left: 10px;
            top: 50%;
            max-width: calc(50% - 90px);
            transform: translateY(-50%);
        }

        .long-term-task-avatars .avatar-group {
            display: flex;
            align-items: center;
        }

        .long-term-task-avatars .avatar {
            box-sizing: border-box;
            flex: 0 0 20px;
            width: 20px;
            height: 20px;
            margin-right: -6px;
            border-width: 1px;
            font-size: 8px;
        }

        .long-term-task-avatars .avatar:last-child {
            margin-right: 0;
        }

        .long-term-task-row.color-blue { background: #3498db; }
        .long-term-task-row.color-red { background: #e74c3c; }
        .long-term-task-row.color-green { background: #2ecc71; }
        .long-term-task-row.color-orange { background: #e67e22; }
        .long-term-task-row.color-purple { background: #9b59b6; }
        .long-term-task-row.color-teal { background: #1abc9c; }

        .toolbar-divider {
            width: 1px;
            height: 28px;
            background: #d8dde3;
            margin: 0 2px;
        }

        .task-list-container.active {
            width: 300px;
            padding: 12px;
            border-right: 1px solid #e0e0e0;
        }

        .task-list-heading {
            margin-bottom: 8px;
            padding-bottom: 6px;
            border-bottom: 1px solid #ddd;
        }

        .task-list {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .task-list-section-title {
            margin: 1px 0 0;
            padding-bottom: 4px;
            border-bottom: 1px solid #ddd;
            color: var(--secondary-color);
            font-size: 12px;
            font-weight: 700;
        }

        .long-task-list,
        .regular-task-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .task-list-empty {
            padding: 8px;
            color: #999;
            font-size: 12px;
            text-align: center;
        }

        .task-item {
            background: white;
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            column-gap: 8px;
            row-gap: 3px;
            padding: 6px 8px;
            border-radius: 4px;
            border: 1px solid #ddd;
            transition: all 0.2s;
        }

        .task-item:hover {
            border-color: var(--primary-color);
            box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
        }
        
        .task-item-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            grid-column: 1 / -1;
            min-width: 0;
            margin-bottom: 0;
        }

        .task-item-title {
            font-weight: 600;
            color: var(--secondary-color);
            font-size: 13px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: flex;
            align-items: center;
        }

        .task-item-participants {
            grid-column: 1;
            min-width: 0;
            min-height: 20px;
            display: flex;
            align-items: center;
            margin-bottom: 0;
            color: #888;
            font-size: 11px;
        }

        .task-list .avatar-group {
            max-width: 100%;
            overflow: hidden;
        }

        .task-list .avatar {
            flex: 0 0 20px;
            width: 20px;
            height: 20px;
            margin-right: -6px;
            border-width: 1px;
            font-size: 8px;
        }

        .long-task-dot {
            width: 9px;
            height: 9px;
            flex: 0 0 auto;
            margin-right: 7px;
            border-radius: 50%;
        }

        .long-task-dot.color-blue { background: #3498db; }
        .long-task-dot.color-red { background: #e74c3c; }
        .long-task-dot.color-green { background: #2ecc71; }
        .long-task-dot.color-orange { background: #e67e22; }
        .long-task-dot.color-purple { background: #9b59b6; }
        .long-task-dot.color-teal { background: #1abc9c; }

        .task-item-progress {
            font-size: 10px;
            color: #fff;
            background: var(--primary-color);
            padding: 1px 5px;
            border-radius: 10px;
        }

        .task-item-dates {
            grid-column: 2;
            align-self: center;
            font-size: 10px;
            color: #666;
            display: flex;
            gap: 5px;
            white-space: nowrap;
        }

        .gantt-chart-wrapper > .gantt-container {
            flex: 1;
            overflow: auto;
            background: white;
            padding: 0;
            border-radius: 0;
            border: none;
            height: auto;
            min-height: 0;
        }

        /* 吸顶日期轴：让固定后的日期轴与下方滚动内容视觉分层 */
        .gantt-sticky-header .grid-header {
            stroke: #c8cdd4;
            stroke-width: 1.6;
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .modal.active {
            display: flex;
            opacity: 1;
        }
        .modal-content {
            background: white;
            padding: 30px;
            border-radius: 12px;
            width: 500px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
            transform: translateY(20px);
            transition: transform 0.3s ease;
        }
        .modal.active .modal-content {
            transform: translateY(0);
        }
        .modal-header {
            margin-bottom: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .modal-header h2 {
            margin: 0;
            font-size: 20px;
            color: var(--secondary-color);
        }
        .form-group {
            margin-bottom: 15px;
        }
        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #666;
            font-size: 14px;
        }
        .form-control {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 6px;
            box-sizing: border-box;
            font-size: 14px;
            transition: border-color 0.2s;
        }
        .form-control:focus {
            border-color: var(--primary-color);
            outline: none;
        }
        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #eee;
        }
        .close-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #999;
        }
        .close-btn:hover {
            color: #666;
        }
        
        /* Custom Gantt Styles Overrides */
        .gantt .bar-label {
            fill: #fff;
            font-weight: 500;
        }
        .gantt .bar-progress {
            fill: rgba(255, 255, 255, 0.3);
        }

        /* Avatar Styles */
        .avatar-group {
            display: flex;
            align-items: center;
        }
        .avatar {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            background-color: #3498db;
            color: white;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: bold;
            margin-right: -10px;
            border: 2px solid white;
            position: relative;
            z-index: 1;
        }
        .avatar:hover {
            z-index: 10;
            transform: scale(1.1);
        }
        /* 为不同的用户生成随机背景色 */
        .avatar-0 { background-color: #e74c3c; }
        .avatar-1 { background-color: #e67e22; }
        .avatar-2 { background-color: #f1c40f; }
        .avatar-3 { background-color: #2ecc71; }
        .avatar-4 { background-color: #1abc9c; }
        .avatar-5 { background-color: #3498db; }
        .avatar-6 { background-color: #9b59b6; }
        .avatar-7 { background-color: #34495e; }

        /* Tag Input Styles */
        .tag-container {
            border: 1px solid #ddd;
            padding: 5px;
            border-radius: 6px;
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            min-height: 38px;
        }
        .tag-container:focus-within {
            border-color: var(--primary-color);
        }
        .tag {
            background-color: #ecf0f1;
            color: #2c3e50;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .tag-close {
            cursor: pointer;
            font-weight: bold;
            color: #7f8c8d;
        }
        .tag-close:hover {
            color: #c0392b;
        }
        .tag-input {
            border: none;
            outline: none;
            padding: 5px;
            flex: 1;
            font-size: 14px;
            min-width: 60px;
        }

        /* Task Colors */
        .gantt .bar-wrapper.color-blue .bar { fill: #3498db; }
        .gantt .bar-wrapper.color-blue .bar-progress { fill: #2980b9; }
        
        .gantt .bar-wrapper.color-red .bar { fill: #e74c3c; }
        .gantt .bar-wrapper.color-red .bar-progress { fill: #c0392b; }
        
        .gantt .bar-wrapper.color-green .bar { fill: #2ecc71; }
        .gantt .bar-wrapper.color-green .bar-progress { fill: #27ae60; }
        
        .gantt .bar-wrapper.color-orange .bar { fill: #e67e22; }
        .gantt .bar-wrapper.color-orange .bar-progress { fill: #d35400; }
        
        .gantt .bar-wrapper.color-purple .bar { fill: #9b59b6; }
        .gantt .bar-wrapper.color-purple .bar-progress { fill: #8e44ad; }
        
        .gantt .bar-wrapper.color-teal .bar { fill: #1abc9c; }
        .gantt .bar-wrapper.color-teal .bar-progress { fill: #16a085; }

        .gantt .bar-wrapper.timeline-anchor {
            display: none;
        }

        .color-options {
            display: flex;
            gap: 10px;
            margin-top: 5px;
        }
        .color-option {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            cursor: pointer;
            border: 2px solid transparent;
            transition: transform 0.2s;
        }
        .color-option.selected {
            border-color: #333;
            transform: scale(1.1);
            box-shadow: 0 0 5px rgba(0,0,0,0.3);
        }
        .color-option:hover {
            transform: scale(1.1);
        }

        /* Month Divider */
        .month-divider {
            stroke: #7f8c8d;
            stroke-width: 2;
        }
