/**
 * 甘特图交互样式
 * 路径: css/gantt-interactive.css
 * 版本: Delta10 - 衍生依赖样式版
 * 包含: 任务条、标签、依赖箭头（原生/衍生）、视图菜单、里程碑、汇总任务
 */

/* ======================
   任务条样式
   ====================== */
.gantt-bar {
    position: absolute;
    height: 28px;
    top: 6px;
    background: transparent;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    cursor: move;
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    user-select: none;
    overflow: hidden;
    white-space: nowrap;
    will-change: transform;
}

.gantt-bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border-color: var(--gray-400);
}

.gantt-bar.selected {
    border-color: var(--warning-color);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3), 0 4px 12px rgba(255, 193, 7, 0.4);
    z-index: var(--z-gantt-bar-selected);
    transform: scale(1.02);
}

.gantt-bar.conflict {
    border-color: var(--danger-color);
    background: rgba(220, 53, 69, 0.05);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.gantt-bar.dep-highlight {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.gantt-bar.dragging {
    opacity: 0.7;
    cursor: grabbing;
}

/* 进度条 */
.gantt-bar-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    opacity: 0.3;
    border-radius: 4px;
    pointer-events: none;
    transition: width var(--transition-fast);
}

/* 调整手柄 */
.gantt-bar-handle {
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    position: absolute;
    top: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.gantt-bar-handle:hover {
    width: 8px;
    background: var(--gray-500);
}

.gantt-bar-handle.left {
    left: 0;
    border-radius: 4px 0 0 4px;
}

.gantt-bar-handle.right {
    right: 0;
    border-radius: 0 4px 4px 0;
}

.gantt-bar-label { display: none !important; }

/* ======================
   工期类型手柄样式
   ====================== */
.gantt-bar[data-duration-type="workdays"] .gantt-bar-handle {
    background: linear-gradient(to bottom, #667eea, #5568d3);
}

.gantt-bar[data-duration-type="workdays"] .gantt-bar-handle:hover {
    background: linear-gradient(to bottom, #5568d3, #4557c2);
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.6);
}

.gantt-bar[data-duration-type="workdays"].dragging .gantt-bar-handle {
    background: #667eea;
    width: 10px;
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.8);
}

.gantt-bar[data-duration-type="days"] .gantt-bar-handle {
    background: linear-gradient(to bottom, #10b981, #059669);
}

.gantt-bar[data-duration-type="days"] .gantt-bar-handle:hover {
    background: linear-gradient(to bottom, #059669, #047857);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.gantt-bar[data-duration-type="days"].dragging .gantt-bar-handle {
    background: #10b981;
    width: 10px;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
}

/* ======================
   工期类型边框样式
   ====================== */
.gantt-bar[data-duration-type="workdays"] {
    border-style: solid;
}

.gantt-bar[data-duration-type="workdays"]:hover {
    border-color: #667eea;
}

.gantt-bar[data-duration-type="workdays"].selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3), 0 4px 12px rgba(102, 126, 234, 0.4);
}

.gantt-bar[data-duration-type="days"] {
    border-style: dashed;
}

.gantt-bar[data-duration-type="days"]:hover {
    border-color: #10b981;
}

.gantt-bar[data-duration-type="days"].selected {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3), 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ======================
   左侧双层时间标签
   ====================== */
.gantt-bar-label-start {
    position: absolute;
    top: 6px;
    height: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2px 8px;
    color: var(--gray-600);
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: auto;
    z-index: var(--z-gantt-label);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9),
                -1px -1px 2px rgba(255, 255, 255, 0.9),
                1px -1px 2px rgba(255, 255, 255, 0.9),
                -1px 1px 2px rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-align: right;
    gap: 1px;
}

.time-label-row {
    line-height: 1.2;
    transition: all var(--transition-fast);
}

.time-start {
    color: var(--info-color);
    font-weight: 600;
    font-size: 0.7rem;
}

.time-end {
    color: var(--gray-500);
    font-size: 0.65rem;
}

.gantt-bar-label-start:hover {
    transform: translateX(-2px);
    padding-left: 10px;
    border-right: 2px solid rgba(59, 130, 246, 0.4);
    padding-right: 6px;
    background: rgba(255, 255, 255, 0.5) !important;
    text-shadow: 1px 1px 3px white, -1px -1px 3px white, 1px -1px 3px white, -1px 1px 3px white;
}

.gantt-bar-label-start:hover .time-start,
.gantt-bar-label-start:hover .time-end {
    transform: scale(1.05);
}

.gantt-bar-label-start:hover .time-start {
    color: var(--primary-color);
}

.gantt-bar-label-start:hover .time-end {
    color: var(--gray-700);
}

.gantt-bar-label-start.selected {
    background: rgba(255, 243, 205, 0.3) !important;
    border-right: 3px solid var(--warning-color);
}

.gantt-bar-label-start.selected .time-start {
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 1px 1px 3px white, -1px -1px 3px white, 1px -1px 3px white, -1px 1px 3px white, 0 0 8px rgba(102, 126, 234, 0.4);
}

.gantt-bar-label-start.selected .time-end {
    color: var(--gray-700);
    font-weight: 600;
}

/* 冲突/依赖高亮 */
.gantt-bar.conflict ~ .gantt-bar-label-start .time-start,
.gantt-bar.conflict ~ .gantt-bar-label-start .time-end {
    color: var(--danger-color);
}

.gantt-bar.conflict ~ .gantt-bar-label-start .time-end {
    opacity: 0.8;
}

.gantt-bar.dep-highlight ~ .gantt-bar-label-start .time-start,
.gantt-bar.dep-highlight ~ .gantt-bar-label-start .time-end {
    color: var(--success-color);
}

.gantt-bar.dep-highlight ~ .gantt-bar-label-start .time-end {
    opacity: 0.8;
}

/* ======================
   右侧任务名称标签
   ====================== */
.gantt-bar-label-external {
    position: absolute;
    top: 6px;
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: var(--gray-700);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: auto;
    z-index: var(--z-gantt-label);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9),
                -1px -1px 2px rgba(255, 255, 255, 0.9),
                1px -1px 2px rgba(255, 255, 255, 0.9),
                -1px 1px 2px rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.gantt-bar-label-external:hover {
    color: var(--primary-color);
    transform: translateX(2px);
    padding-right: 8px;
    border-left: 2px solid rgba(102, 126, 234, 0.4);
    padding-left: 6px;
    text-shadow: 1px 1px 3px white, -1px -1px 3px white, 1px -1px 3px white, -1px 1px 3px white;
}

.gantt-bar-label-external.selected {
    color: var(--primary-color);
    font-weight: 600;
    text-shadow: 1px 1px 3px white, -1px -1px 3px white, 1px -1px 3px white, -1px 1px 3px white, 0 0 8px rgba(102, 126, 234, 0.4);
}

.gantt-bar.conflict + .gantt-bar-label-external {
    color: var(--danger-color);
}

.gantt-bar.dep-highlight + .gantt-bar-label-external {
    color: var(--success-color);
}

/* ======================
   ⭐ 依赖关系箭头（区分原生/衍生）
   ====================== */
.gantt-dependencies {
    position: absolute;
    inset: 0 0 auto 0;
    pointer-events: none;
}

/* 原生依赖箭头（实线，红色） */
.gantt-dependencies path.dependency-arrow {
    stroke: var(--danger-color);
    stroke-width: 2;
    fill: none;
    transition: all 0.3s ease;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gantt-dependencies path.dependency-arrow:hover {
    stroke: #ff6b6b;
    stroke-width: 3;
    filter: drop-shadow(0 0 6px rgba(220, 53, 69, 0.6));
}

/* ⭐ 衍生依赖箭头（虚线，紫色） */
.gantt-dependencies path.derived-arrow {
    stroke: #8b5cf6 !important;
    stroke-dasharray: 4, 2;
    opacity: 0.8;
}

.gantt-dependencies path.derived-arrow:hover {
    stroke: #7c3aed !important;
    stroke-width: 3;
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.6));
}

/* 高亮箭头 */
.gantt-dependencies path.dep-highlight-arrow {
    stroke: var(--success-color) !important;
    stroke-width: 3 !important;
    stroke-dasharray: none !important;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.7));
    animation: arrowPulse 2s ease-in-out infinite;
}

.gantt-dependencies marker path {
    fill: var(--danger-color);
    transition: fill 0.3s ease;
}

.gantt-dependencies path.dep-highlight-arrow + marker path {
    fill: var(--success-color);
}

@keyframes arrowPulse {
    0%, 100% { stroke-width: 3; opacity: 1; }
    50% { stroke-width: 4; opacity: 0.8; }
}

/* 不同时间刻度下的箭头粗细 */
[data-scale="week"] ~ .gantt-dependencies path { stroke-width: 1.5; }
[data-scale="month"] ~ .gantt-dependencies path { stroke-width: 1; }

[data-scale="week"] ~ .gantt-dependencies path:hover,
[data-scale="week"] ~ .gantt-dependencies path.dep-highlight-arrow {
    stroke-width: 2.5;
}

[data-scale="month"] ~ .gantt-dependencies path:hover,
[data-scale="month"] ~ .gantt-dependencies path.dep-highlight-arrow {
    stroke-width: 2;
}

/* ======================
   时间轴视图切换菜单
   ====================== */
.timeline-view-menu {
    position: absolute;
    top: 100%;
    right: 15px;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.2);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 140px;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    visibility: hidden;
}

.timeline-view-menu.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

.view-menu-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 8px 4px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 4px;
}

.view-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.view-menu-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, transparent, rgba(102, 126, 234, 0.1));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.view-menu-btn:hover::before { opacity: 1; }
.view-menu-btn:hover {
    background: rgba(102, 126, 234, 0.08);
}

.view-menu-btn.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.view-menu-btn.active::after {
    content: '✓';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.view-icon {
    font-size: 1.2rem;
    transition: all 0.2s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    position: relative;
    z-index: 1;
}

.view-menu-btn:hover .view-icon { transform: scale(1.15); }
.view-menu-btn.active .view-icon {
    transform: scale(1.2);
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.4));
}

.view-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.view-menu-btn:hover .view-text,
.view-menu-btn.active .view-text {
    color: var(--primary-color);
}

.view-menu-btn.active .view-text {
    font-weight: 600;
}

.timeline-view-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 30px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.98);
    border-left: 1px solid rgba(102, 126, 234, 0.2);
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    transform: rotate(45deg);
    backdrop-filter: blur(20px);
}

.view-menu-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gray-300) 20%, var(--gray-300) 80%, transparent);
    margin: 8px 0;
}

/* 全貌视图按钮 */
.view-menu-overview {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(6, 182, 212, 0.05));
    border: 1px dashed rgba(16, 185, 129, 0.3) !important;
}

.view-menu-overview:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
    border-color: rgba(16, 185, 129, 0.5) !important;
}

.view-menu-overview.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.25));
    border: 2px solid rgba(16, 185, 129, 0.6) !important;
}

.view-menu-overview .view-icon {
    color: var(--success-color);
}

.view-menu-overview .view-text {
    color: var(--success-color);
    font-weight: 600;
}

.view-menu-overview:hover .view-icon,
.view-menu-overview.active .view-icon {
    animation: overviewPulse 1s ease-in-out infinite;
}

@keyframes overviewPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.view-menu-overview.active::after {
    color: var(--success-color) !important;
}

/* ======================
   工期类型图标
   ====================== */
.duration-type-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.65rem;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.gantt-bar-label-start:hover .duration-type-icon {
    opacity: 1;
    transform: scale(1.15);
}

#durationTypeHint {
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 8px;
    transition: all 0.3s ease;
    display: block;
}

#durationTypeHint .text-info {
    font-weight: 600;
}

#editDurationType {
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

#editDurationType:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

#editDurationType option {
    padding: 8px;
}

/* ======================
   里程碑样式
   ====================== */
.gantt-milestone {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    cursor: pointer;
    transition: all 0.3s ease;
}

.milestone-diamond {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
    border: 2px solid #fff;
    transition: all 0.3s ease;
    position: relative;
}

.milestone-icon {
    transform: rotate(-45deg);
    font-size: 0.8rem;
    position: absolute;
}

.gantt-milestone:hover .milestone-diamond {
    transform: rotate(45deg) scale(1.2);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.6);
}

.gantt-milestone.selected .milestone-diamond {
    transform: rotate(45deg) scale(1.3);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3), 0 4px 16px rgba(255, 193, 7, 0.6);
    animation: milestonePulse 2s ease-in-out infinite;
}

@keyframes milestonePulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3), 0 4px 16px rgba(255, 193, 7, 0.6);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 193, 7, 0.2), 0 6px 24px rgba(255, 193, 7, 0.8);
    }
}

.gantt-milestone ~ .gantt-bar-label-external {
    color: #ff9800;
    font-weight: 600;
}

.gantt-milestone ~ .gantt-bar-label-start .time-start,
.gantt-milestone ~ .gantt-bar-label-start .time-end {
    color: #ff9800;
}

/* ======================
   汇总任务样式
   ====================== */
.gantt-bar-summary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border: 2px solid #667eea;
    border-left: 4px solid #667eea;
    font-weight: 600;
    height: 32px;
    top: 4px;
    cursor: default;
}

.gantt-bar-summary .gantt-bar-progress {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
    opacity: 0.5;
}

.gantt-bar-summary:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.25));
    border-color: #5568d3;
}

.gantt-row-summary {
    background: linear-gradient(to right, rgba(102, 126, 234, 0.03), transparent);
}

/* ======================
   优先级指示器
   ====================== */
.gantt-bar[data-priority="high"]::before,
.gantt-bar[data-priority="low"]::before {
    content: '';
    position: absolute;
    left: -4px;
    inset-block: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
}

.gantt-bar[data-priority="high"]::before {
    background: linear-gradient(to bottom, #dc3545, #c82333);
}

.gantt-bar[data-priority="low"]::before {
    background: linear-gradient(to bottom, #6c757d, #5a6268);
}

.gantt-bar[data-priority="high"] {
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.gantt-bar[data-priority="high"]:hover {
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.4);
}

/* ======================
   折叠按钮
   ====================== */
.task-collapse-btn,
.collapse-toggle {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    margin-right: 6px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.task-collapse-btn:hover,
.collapse-toggle:hover {
    background: rgba(102, 126, 234, 0.25);
    transform: scale(1.15);
}

.task-collapse-btn:active,
.collapse-toggle:active {
    transform: scale(0.95);
}

.collapse-toggle {
    margin-left: 8px;
    margin-right: 0;
    font-weight: bold;
}

/* ======================
   WBS 徽章
   ====================== */
.wbs-badge {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    color: #667eea;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 4px;
    font-family: 'Courier New', monospace;
}

/* ======================
   进度徽章
   ====================== */
.task-progress-badge {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
}

/* ======================
   任务名称内容
   ====================== */
.task-name-content {
    display: inline-block;
    transition: all 0.2s ease;
}

.gantt-task-name:hover .task-name-content {
    transform: translateX(2px);
}

/* ======================
   不同刻度下的标签优化
   ====================== */
[data-scale="week"] .gantt-bar-label-start { font-size: 0.6rem; }
[data-scale="week"] .time-start { font-size: 0.65rem; }
[data-scale="week"] .time-end { font-size: 0.6rem; }

[data-scale="month"] .gantt-bar-label-start { font-size: 0.55rem; }
[data-scale="month"] .time-start { font-size: 0.6rem; }
[data-scale="month"] .time-end { font-size: 0.55rem; }

/* ======================
   响应式
   ====================== */
@media (max-width: 768px) {
    .gantt-bar,
    .gantt-bar-label-start,
    .gantt-bar-label-external {
        height: 24px;
        font-size: 0.6rem;
        padding: 1px 6px;
    }
    
    .time-start { font-size: 0.65rem; }
    .time-end { font-size: 0.6rem; }
    
    .timeline-view-menu {
        right: 10px;
        min-width: 120px;
        padding: 10px;
    }
    
    .view-menu-btn {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .view-icon { font-size: 1rem; }
    .view-text { font-size: 0.8rem; }
    
    .gantt-milestone .milestone-diamond {
        width: 18px;
        height: 18px;
    }
    
    .milestone-icon { font-size: 0.65rem; }
    
    .task-collapse-btn,
    .collapse-toggle {
        width: 16px;
        height: 16px;
        font-size: 0.65rem;
    }
    
    .wbs-badge {
        font-size: 0.65rem;
        padding: 1px 4px;
    }
    
    .gantt-bar-summary { height: 28px; }
    
    .task-progress-badge {
        font-size: 0.65rem;
        padding: 1px 4px;
    }
    
    .gantt-bar-handle { width: 5px; }
    .gantt-bar-handle:hover { width: 7px; }
}

/* ======================
   打印样式
   ====================== */
@media print {
    .timeline-view-menu,
    .task-collapse-btn,
    .collapse-toggle,
    .gantt-bar-handle {
        display: none !important;
    }
    
    .gantt-bar-label-start,
    .gantt-bar-label-external {
        background: white !important;
        border: 1px solid var(--gray-300) !important;
        text-shadow: none !important;
    }
    
    .time-start { color: black !important; }
    .time-end { color: var(--gray-600) !important; }
    
    .gantt-milestone .milestone-diamond {
        background: #ffc107;
        box-shadow: none;
        border: 1px solid #333;
    }
    
    .gantt-bar-summary {
        background: rgba(102, 126, 234, 0.1);
        border: 2px solid #667eea;
    }
    
    .gantt-bar[data-priority="high"]::before,
    .gantt-bar[data-priority="low"]::before {
        display: none;
    }
    
    .gantt-bar[data-duration-type="workdays"] {
        border: 2px solid #667eea !important;
    }
    
    .gantt-bar[data-duration-type="days"] {
        border: 2px dashed #10b981 !important;
    }
    
    .task-progress-badge {
        background: #f0f0f0;
        color: #333;
    }
    
    /* ⭐ 打印时显示所有依赖（包括衍生） */
    .gantt-dependencies path.derived-arrow {
        stroke: #8b5cf6 !important;
        stroke-dasharray: 2, 1;
    }
}

/* ======================
   深色模式
   ====================== */
@media (prefers-color-scheme: dark) {
    .timeline-view-menu {
        background: rgba(33, 37, 41, 0.98);
        border-color: rgba(102, 126, 234, 0.4);
    }
    
    .timeline-view-menu::before {
        background: rgba(33, 37, 41, 0.98);
        border-color: rgba(102, 126, 234, 0.4);
    }
    
    .view-menu-overview {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.1));
        border-color: rgba(16, 185, 129, 0.4) !important;
    }
}
/* ⭐ 新增：锁定任务样式 (100%完成) */
.gantt-bar.locked {
    cursor: default !important; /* 强制变为默认光标 */
    border-color: #10b981 !important; /* 绿色边框 */
    /* 增加一点纹理表示归档/锁定感 */
    background-image: repeating-linear-gradient(
        45deg,
        rgba(16, 185, 129, 0.05),
        rgba(16, 185, 129, 0.05) 10px,
        rgba(16, 185, 129, 0.1) 10px,
        rgba(16, 185, 129, 0.1) 20px
    );
}

.gantt-bar.locked:hover {
    transform: none !important; /* 禁用悬停上浮效果 */
    box-shadow: none !important;
}

/* 隐藏锁定任务的进度条背景，让纹理更明显 */
.gantt-bar.locked .gantt-bar-progress {
    opacity: 0.2;
}