/**
 * 调度中心样式 - 单画布设计
 * Dispatch Center Styles - Single Canvas Design
 */

/* ========================================
   单画布主布局
   ======================================== */

.dispatch-canvas-layout {
    display: flex;
    height: calc(100vh - 64px);
    background: #f0f2f5;
    overflow: hidden;
}

/* 调度中心默认禁止文本选中，避免误拖拽高亮 */
.dispatch-canvas-layout,
.dispatch-canvas-layout * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 保留可编辑控件的文本选中能力 */
.dispatch-canvas-layout input,
.dispatch-canvas-layout textarea,
.dispatch-canvas-layout select,
.dispatch-canvas-layout option,
.dispatch-canvas-layout [contenteditable="true"],
.dispatch-canvas-layout [contenteditable="plaintext-only"] {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* ========================================
   左侧面板（可折叠）
   ======================================== */

.side-panel {
    width: 260px;
    min-width: 260px;
    background: white;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: width 0.3s ease, min-width 0.3s ease;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
    z-index: 50;
}

.side-panel.collapsed {
    width: 0;
    min-width: 0;
}

.side-panel.collapsed .panel-filters,
.side-panel.collapsed .project-list-container {
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
}

/* 筛选器 */
.panel-filters {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity 0.2s;
}

/* P2: 紧凑一行式筛选器 */
.panel-filters-compact {
    padding: 10px 12px;
    gap: 6px;
}
.filter-row-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.filter-search-toggle {
    flex-shrink: 0;
}
.search-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
}
.search-icon-btn:hover {
    background: #f3f0ff;
}
.filter-search-dropdown {
    margin-top: 6px;
    animation: filterDropdownSlide 0.15s ease-out;
}
@keyframes filterDropdownSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.filter-select-sm {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 6px;
}
.search-input-sm {
    padding: 7px 10px;
    font-size: 13px;
}

.filter-item {
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    background: #f9f9f9;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #713eff;
    background: white;
    box-shadow: 0 0 0 3px rgba(113, 62, 255, 0.1);
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #713eff;
}

/* 项目列表 */
.project-list-container {
    flex: 1;
    overflow-y: auto;
    transition: opacity 0.2s;
}

.task-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 16px 10px;
}

.task-list-toolbar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #303030;
}

.task-list-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f3f0ff;
    color: #5b38d1;
    font-size: 12px;
}

.project-list {
    padding: 8px;
}

.project-list-item {
    padding: 14px 16px;
    margin-bottom: 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.project-list-item:hover {
    background: #f5f0ff;
}

.project-list-item.active {
    background: #f5f0ff;
    border-color: #713eff;
}

.project-list-item .item-name {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-list-item .item-status {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-list-item .item-tags,
.project-list-item .item-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.project-list-item .item-tag,
.project-list-item .item-kpi {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 18px;
}

.project-list-item .item-tag {
    background: #f3f0ff;
    color: #5b38d1;
    border: 1px solid #d9ccff;
}

.project-list-item .item-tag.type-season {
    background: #e6f4ff;
    color: #0958d9;
    border-color: #91caff;
}

.project-list-item .item-tag.mode-intent {
    background: #fff7e6;
    color: #d46b08;
    border-color: #ffd591;
}

.project-list-item .item-tag.mode-script {
    background: #f6ffed;
    color: #389e0d;
    border-color: #b7eb8f;
}

.project-list-item .item-kpi {
    background: #fafafa;
    color: #666;
    border: 1px solid #f0f0f0;
}

.project-list-item .item-kpi.project-pinned {
    background: #fff7e6;
    border-color: #ffd591;
    color: #d46b08;
}

.project-list-item .item-kpi.record-status-deleted {
    background: #fff2f0;
    border-color: #ffccc7;
    color: #cf1322;
}

.project-list-item .item-summary {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fafafa;
    color: #555;
    line-height: 1.5;
    font-size: 12px;
}

.project-list-item .item-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.project-list-item .item-detail-btn {
    padding: 3px 10px;
    font-size: 11px;
    line-height: 1.4;
    border-radius: 999px;
    border: 1px solid rgba(124, 77, 255, 0.28);
    background: rgba(124, 77, 255, 0.08);
    color: #5b3bd6;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.project-list-item .item-detail-btn:hover {
    background: rgba(124, 77, 255, 0.16);
    border-color: rgba(124, 77, 255, 0.48);
    color: #3f23a8;
}

.project-list-item.active .item-detail-btn {
    background: rgba(124, 77, 255, 0.18);
    border-color: rgba(124, 77, 255, 0.5);
    color: #3f23a8;
}

.project-list-item .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.project-list-item .status-badge.running {
    background: #e6f7ff;
    color: #1890ff;
}

.project-list-item .status-badge.queued {
    background: #fffbe6;
    color: #faad14;
}

.project-list-item .status-badge.completed {
    background: #f6ffed;
    color: #52c41a;
}

.project-list-item .status-badge.failed {
    background: #fff2f0;
    color: #ff4d4f;
}

.project-list-item .status-badge.paused {
    background: #f5f5f5;
    color: #999;
}

.project-list-item .item-progress {
    color: #999;
}

/* 折叠按钮 - 放在布局层级，不受侧边栏折叠影响 */
.panel-toggle-btn {
    position: absolute;
    left: 260px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 48px;
    background: white;
    border: 1px solid #e8e8e8;
    border-left: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    transition: left 0.3s ease, background 0.2s;
    z-index: 100;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
}

.panel-toggle-btn:hover {
    background: #f5f0ff;
    color: #713eff;
}

/* 折叠状态样式通过 JS 添加 class 控制 */
.panel-toggle-btn.collapsed {
    left: 0;
}

.panel-toggle-btn.collapsed .toggle-icon {
    transform: rotate(180deg);
}

/* ========================================
   右侧画布区域
   ======================================== */

.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    min-height: 0; /* P1: 允许 flex 子项收缩到内容以下 */
}

/* 项目信息头 */
.project-header {
    background: white;
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative;
    overflow: visible;
    z-index: 220;
    flex-shrink: 0; /* P1: 头部不被压缩 */
    /* 与 .project-header-sections 四列网格同宽对齐，供详情弹出层定位（4 列、gap 与网格一致） */
    --ph-section-gap: 12px;
    --ph-section-col-w: calc((100% - 3 * var(--ph-section-gap)) / 4);
}

.project-header-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    flex-wrap: nowrap;
}

.project-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
    flex: 1 1 auto;
    min-width: 0;
}

.project-icon {
    font-size: 18px;
}

.project-stats {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: nowrap;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #f5f5f5;
}

.stat-badge .stat-icon {
    font-size: 12px;
}

.stat-badge.running { background: #e6f7ff; }
.stat-badge.running .stat-value { color: #1890ff; }
.stat-badge.queued { background: #fffbe6; }
.stat-badge.queued .stat-value { color: #faad14; }
.stat-badge.completed { background: #f6ffed; }
.stat-badge.completed .stat-value { color: #52c41a; }
.stat-badge.failed { background: #fff2f0; }
.stat-badge.failed .stat-value { color: #ff4d4f; }

/* P3: 项目头部展开/收起按钮 */
.header-expand-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2px 0;
    margin-top: 2px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #999;
    font-size: 11px;
    transition: color 0.2s;
}
.header-expand-toggle:hover {
    color: #713eff;
}
.header-expand-icon {
    display: inline-block;
    transition: transform 0.2s;
}
.header-expand-toggle.expanded .header-expand-icon {
    transform: rotate(180deg);
}

/* 风格切换器（运行状态栏前面） */
.style-switcher-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.style-switcher-label {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.style-switcher-select {
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 12px;
    background: white;
    cursor: pointer;
    min-width: 124px;
}

.style-switcher-select:hover,
.style-switcher-select:focus {
    border-color: #713eff;
    outline: none;
}

.project-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.project-toolbar-divider {
    width: 1px;
    height: 26px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.04) 0%, rgba(17, 24, 39, 0.18) 50%, rgba(17, 24, 39, 0.04) 100%);
    flex: 0 0 auto;
}

.governance-status-group {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.governance-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(113, 62, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #47326f;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(113, 62, 255, 0.08);
}

.governance-status-pill.is-healthy {
    border-color: rgba(28, 172, 120, 0.2);
    color: #166447;
    background: rgba(240, 255, 248, 0.95);
}

.governance-status-pill.is-warning {
    border-color: rgba(245, 158, 11, 0.24);
    color: #9a5d00;
    background: rgba(255, 249, 235, 0.96);
}

.governance-status-pill.is-error {
    border-color: rgba(239, 68, 68, 0.24);
    color: #a53b43;
    background: rgba(255, 243, 243, 0.96);
}

.governance-status-pill.is-offline {
    border-color: rgba(107, 114, 128, 0.22);
    color: #4b5563;
    background: rgba(249, 250, 251, 0.96);
}

.governance-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.6);
}

.governance-status-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(113, 62, 255, 0.12);
    background: rgba(21, 24, 36, 0.96);
    color: #eef2ff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
    pointer-events: none;
    z-index: 260;
}

.governance-status-group:hover .governance-status-tooltip,
.governance-status-group:focus-within .governance-status-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.governance-tooltip-title {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.governance-tooltip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    line-height: 1.5;
}

.governance-tooltip-row + .governance-tooltip-row {
    margin-top: 6px;
}

.governance-tooltip-label {
    color: rgba(226, 232, 240, 0.72);
}

.governance-tooltip-value {
    color: #ffffff;
    text-align: right;
    max-width: 136px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.governance-tooltip-subtitle {
    margin-top: 10px;
    margin-bottom: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 600;
    color: rgba(167, 139, 250, 0.95);
}

.governance-tooltip-hint {
    margin-top: 8px;
    font-size: 10px;
    line-height: 1.4;
    color: rgba(148, 163, 184, 0.9);
}

/* HUD 面板：接口失败时不冒充有数 */
.dispatch-hud-stale .ar-panel-title,
.dispatch-hud-stale .ar-data,
.dispatch-hud-stale .ar-cost-value,
.dispatch-hud-stale .ar-energy-value,
.dispatch-hud-stale .ar-monitor-value,
.dispatch-hud-stale .ar-queue-value,
.dispatch-hud-stale .ar-squad-count {
    color: rgba(148, 163, 184, 0.85) !important;
}

.dispatch-hud-stale .ar-energy-fill {
    opacity: 0.35;
}

.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.project-header-meta {
    display: none;
    gap: 16px;
    row-gap: 6px;
    flex-wrap: wrap;
}

.project-creative-meta {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.project-header-sections {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--ph-section-gap, 12px);
    margin-top: 8px;
}

.project-header-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(180deg, #fcfbff 0%, #f8f5ff 100%);
    border: 1px solid rgba(113, 62, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.project-header-section-toggle {
    width: 100%;
    text-align: left;
    cursor: pointer;
    appearance: none;
    border: 1px solid rgba(113, 62, 255, 0.12);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.project-header-section-toggle:hover,
.project-header-section-toggle.active {
    border-color: rgba(113, 62, 255, 0.32);
    box-shadow: 0 6px 16px rgba(113, 62, 255, 0.08);
    transform: translateY(-1px);
}

.project-header-section-caption {
    font-size: 11px;
    font-weight: 600;
    color: #8166df;
}

.project-header-section-primary {
    width: 100%;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-header-section-secondary {
    width: 100%;
    font-size: 12px;
    color: #6b6b78;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-header-section-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #4a4a57;
}

.project-header-section-action {
    margin-top: auto;
    font-size: 12px;
    font-weight: 600;
    color: #6d57c8;
}

.project-header-section-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-header-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    color: #5b38d1;
    background: rgba(113, 62, 255, 0.08);
    border: 1px solid rgba(113, 62, 255, 0.12);
}

.project-creative-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(113, 62, 255, 0.08);
    color: #5b38d1;
    border: 1px solid rgba(113, 62, 255, 0.18);
}

.project-detail-dropdown {
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(113, 62, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    padding: 14px;
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 261;
    max-height: min(72vh, 640px);
    overflow: auto;
}

.project-detail-dropdown-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 12px;
}

/* 注：旧的 .project-detail-tabbar 胶囊 tabbar 容器样式已于 2026-04-17 随收束方案删除；tabbar 现在渲染在 #project-detail-modal-tabbar slot 里（紧贴 header） */

.project-detail-tab {
    appearance: none;
    border: 1px solid rgba(113, 62, 255, 0.14);
    background: rgba(113, 62, 255, 0.04);
    color: #5b38d1;
    border-radius: 999px;
    padding: 6px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.project-detail-tab:hover,
.project-detail-tab.active {
    background: rgba(113, 62, 255, 0.1);
    border-color: rgba(113, 62, 255, 0.3);
    color: #4420c0;
}

.project-detail-modal-card {
    width: 100%;
    box-sizing: border-box;
    max-height: none;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    backdrop-filter: none;
}

.project-detail-modal-body {
    min-width: 0;
}

.project-detail-card {
    background: rgba(255,255,255,0.94);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid rgba(113, 62, 255, 0.08);
    overflow: hidden;
}

.project-detail-card details {
    width: 100%;
}

.project-detail-card summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
}

.project-detail-card summary::-webkit-details-marker {
    display: none;
}

.project-detail-card summary::after {
    content: '▾';
    font-size: 12px;
    color: #713eff;
    transition: transform 0.2s ease;
}

.project-detail-card details:not([open]) summary::after {
    transform: rotate(-90deg);
}

.project-detail-body {
    padding: 0 14px 14px;
}

.project-detail-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-detail-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-detail-section-label {
    font-size: 12px;
    font-weight: 600;
    color: #6d57c8;
}

.project-detail-summary-text {
    padding: 10px;
    background: #fafafa;
    border-radius: 10px;
    color: #555;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.project-detail-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-detail-metric {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: #f6f4ff;
    color: #5b38d1;
    border: 1px solid #e5dcff;
}

.project-episode-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-episode-item {
    padding: 10px;
    border-radius: 10px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-episode-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.project-episode-item:hover {
    border-color: #d9ccff;
    background: #f8f5ff;
}

.project-episode-item.active {
    border-color: #713eff;
    background: #f5f0ff;
    box-shadow: 0 0 0 1px rgba(113, 62, 255, 0.08);
}

.project-episode-title {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0;
}

.project-episode-action {
    font-size: 11px;
    color: #6d57c8;
    white-space: nowrap;
}

.project-episode-summary {
    font-size: 12px;
    line-height: 1.5;
    color: #666;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.project-episode-runtime {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.project-episode-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    background: #fff;
    color: #666;
    border: 1px solid #ececec;
}

.project-detail-empty {
    padding: 14px 16px;
    border-radius: 10px;
    background: #fafafa;
    color: #888;
    font-size: 12px;
}

.project-detail-footer {
    font-size: 11px;
    line-height: 1.5;
    color: #777;
}

.project-workflow-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.project-workflow-select {
    min-width: 220px;
    max-width: 100%;
    flex: 1 1 220px;
    padding: 7px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
}

.project-workflow-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.project-workflow-summary {
    font-size: 12px;
    color: #333;
    line-height: 1.5;
}

.project-workflow-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.project-workflow-layer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
}

.project-workflow-layer-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 20px;
    border-radius: 999px;
    background: rgba(113, 62, 255, 0.1);
    color: #5b38d1;
    font-size: 11px;
    font-weight: 600;
}

.project-workflow-layer-label {
    font-size: 12px;
    line-height: 1.5;
    color: #333;
}

.project-input-check-panel {
    margin-top: 8px;
}

.project-input-check-result {
    font-size: 12px;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: 8px;
    background: #fffbe6;
    color: #d48806;
}

.project-input-check-result.ok {
    background: #f6ffed;
    color: #389e0d;
}

.project-input-check-result.warning {
    background: #fff7e6;
    color: #d46b08;
}

.project-warning-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #ad6800;
}

.project-warning-item {
    line-height: 1.6;
    margin-bottom: 4px;
}

@media (max-width: 1280px) {
    .project-header-sections {
        grid-template-columns: 1fr;
    }
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.meta-label {
    color: #999;
}

.meta-value {
    color: #333;
    font-weight: 500;
}

/* 链路卡片包装器 - 背景容器 */
.chain-cards-wrapper {
    flex: 1;
    min-height: 0; /* P1: 允许收缩，防止撑爆父容器 */
    border-radius: 12px;
    padding: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent;
}

/* 独立背景层：粒子/拓扑只挂载于此，避免与 HUD 混用导致风格错乱 */
.dispatch-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: 12px;
}

.dispatch-bg-layer canvas {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px;
}

/* 粒子 canvas 样式（兼容旧选择器） */
.chain-cards-wrapper canvas {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 0 !important;
    border-radius: 12px;
}

/* 空状态 */
.empty-canvas {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    color: #999;
}

.empty-canvas .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-canvas .empty-text {
    font-size: 16px;
}

/* 操作按钮栏 — P1: 始终吸底 */
.canvas-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
    flex-shrink: 0; /* P1: 不被压缩 */
    position: sticky;
    bottom: 0;
    z-index: 210;
    background: rgba(240, 242, 245, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-top: 1px solid rgba(0,0,0,0.06);
}

/* ========================================
   旧样式兼容（保留）
   ======================================== */

.dispatch-container {
    display: none; /* 隐藏旧布局 */
}

.header-stats {
    display: flex;
    gap: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
}

.stat-icon {
    font-size: 14px;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: #333;
}

.stat-item.running .stat-value { color: #1890ff; }
.stat-item.queued .stat-value { color: #faad14; }
.stat-item.completed .stat-value { color: #52c41a; }
.stat-item.failed .stat-value { color: #ff4d4f; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.auto-refresh-toggle input {
    cursor: pointer;
}

/* 音效开关 */
.sound-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.sound-toggle:hover {
    background: rgba(113, 62, 255, 0.1);
}

.sound-toggle input {
    display: none;
}

.sound-toggle span {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.sound-toggle input:checked + span {
    opacity: 1;
}

.sound-toggle input:not(:checked) + span::after {
    content: '🔇';
    position: absolute;
    margin-left: -16px;
}

/* ========================================
   筛选栏
   ======================================== */

.dispatch-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: white;
    border-bottom: 1px solid #e8e8e8;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.filter-group select,
.filter-group input {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    min-width: 120px;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #713eff;
    box-shadow: 0 0 0 2px rgba(113, 62, 255, 0.1);
}

.search-group input {
    min-width: 200px;
}

/* ========================================
   主内容区
   ======================================== */

.dispatch-main {
    flex: 1;
    overflow: auto;
    padding: 16px 24px;
}

.view-content {
    display: none;
    height: 100%;
}

.view-content.active {
    display: block;
}

/* ========================================
   总览视图
   ======================================== */

.overview-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
    height: 100%;
}

.projects-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: auto;
}

/* 项目列表项 */
.project-item {
    display: grid;
    grid-template-columns: 1fr 120px 100px 80px 100px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.project-item:hover {
    background: #f9f9ff;
}

.project-item:last-child {
    border-bottom: none;
}

.project-item-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-item-title {
    font-weight: 500;
    color: #333;
}

.project-item-id {
    font-size: 12px;
    color: #999;
}

.project-item-pipeline {
    font-size: 13px;
    color: #666;
}

.project-item-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #713eff, #9d7bff);
    border-radius: 3px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 12px;
    color: #666;
    min-width: 35px;
    text-align: right;
}

.project-item-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.running { background: #1890ff; animation: pulse 1.5s infinite; }
.status-dot.queued { background: #faad14; }
.status-dot.paused { background: #d9d9d9; }
.status-dot.completed { background: #52c41a; }
.status-dot.failed { background: #ff4d4f; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.project-item-actions {
    display: flex;
    gap: 8px;
}

/* 队列状态面板 */
.queue-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 16px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.panel-icon {
    font-size: 16px;
}

.queue-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.queue-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.queue-stat-label {
    font-size: 13px;
    color: #666;
}

.queue-stat-value {
    font-weight: 600;
    color: #333;
}

/* ========================================
   流水线视图
   ======================================== */

.pipeline-view-container {
    height: 100%;
}

.pipeline-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pipeline-selector label {
    font-weight: 500;
    color: #333;
}

.pipeline-selector select {
    flex: 1;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.pipeline-projects {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: auto;
    max-height: calc(100% - 80px);
}

/* ========================================
   单项目视图
   ======================================== */

.project-view-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.project-selector label {
    font-weight: 500;
    color: #333;
}

.project-selector select {
    flex: 1;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.project-chain-container {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    overflow: auto;
}

/* 项目信息头 */
.project-info-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 20px;
}

.project-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.project-icon {
    font-size: 20px;
}

.project-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.meta-label {
    color: #999;
}

.meta-value {
    color: #333;
    font-weight: 500;
}

.project-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* ========================================
   链路卡片 - 2560x1440 基准设计 - 竖向矩形
   ======================================== */

:root {
    --card-min-width: 180px;
    --card-max-width: 220px;
    --card-min-height: 320px;
    --card-gap: 10px;
}

.chain-cards-container {
    display: flex;
    align-items: stretch;
    align-content: center;
    justify-content: center;
    gap: var(--card-gap);
    padding: 20px 24px;
    flex-wrap: nowrap;
    width: 100%;
    position: relative;
    z-index: 10;
}

.chain-cards-empty {
    width: min(720px, 100%);
    padding: 24px;
    border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.28);
    background: rgba(9, 12, 28, 0.55);
    color: rgba(255,255,255,0.9);
    text-align: center;
    line-height: 1.7;
    backdrop-filter: blur(6px);
}

.chain-card-flow.layered {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 100%;
}

.chain-layer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    justify-content: center;
    min-width: var(--card-min-width);
    max-width: var(--card-max-width);
}

.chain-layer-badge {
    align-self: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(113, 62, 255, 0.14);
    color: #c9b8ff;
    font-size: 11px;
    line-height: 16px;
    border: 1px solid rgba(201, 184, 255, 0.18);
}

.chain-layer-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    color: rgba(255,255,255,0.75);
    font-size: 18px;
}

.chain-card {
    display: flex;
    flex-direction: column;
    min-width: var(--card-min-width);
    max-width: var(--card-max-width);
    min-height: var(--card-min-height);
    flex: 0 0 var(--card-min-width);
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    /* 传送带节点效果 - 更强的阴影让卡片"浮起来" */
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.08),
        0 8px 24px rgba(113, 62, 255, 0.06);
    z-index: 1;
    overflow: hidden;
    /* 禁止文本选中 */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 卡片刷新时的边框加载动效 */
.chain-card.refreshing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    pointer-events: none;
    animation: borderLoading 1.5s linear infinite;
}

@keyframes borderLoading {
    0% {
        border-top-color: #713eff;
        border-right-color: transparent;
        border-bottom-color: transparent;
        border-left-color: transparent;
    }
    25% {
        border-top-color: #713eff;
        border-right-color: #713eff;
        border-bottom-color: transparent;
        border-left-color: transparent;
    }
    50% {
        border-top-color: #713eff;
        border-right-color: #713eff;
        border-bottom-color: #713eff;
        border-left-color: transparent;
    }
    75% {
        border-top-color: #713eff;
        border-right-color: #713eff;
        border-bottom-color: #713eff;
        border-left-color: #713eff;
    }
    100% {
        border-top-color: transparent;
        border-right-color: transparent;
        border-bottom-color: transparent;
        border-left-color: transparent;
    }
}

.chain-card:hover {
    border-color: #713eff;
    box-shadow: 0 8px 24px rgba(113, 62, 255, 0.2);
    z-index: 10;
}

.chain-card.selected {
    border-color: #713eff;
    background: linear-gradient(180deg, #faf8ff 0%, #f5f0ff 100%);
    box-shadow: 0 4px 16px rgba(113, 62, 255, 0.15);
}

/* 状态指示器 - 放在卡片内部避免被 overflow 裁剪 */
.chain-card-status {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 10;
}

.chain-card-status.completed { background: #52c41a; }
.chain-card-status.running { background: #1890ff; animation: pulse 1.5s infinite; }
.chain-card-status.queued { background: #faad14; }
.chain-card-status.pending { background: #d9d9d9; }
.chain-card-status.failed { background: #ff4d4f; }

/* 卡片标题 */
.chain-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.3;
}

.chain-card-subtitle {
    margin: -4px 0 10px;
    text-align: center;
    font-size: 11px;
    color: #8c8c8c;
}

.chain-card.readonly {
    cursor: default;
}

.chain-card-flow.layered .chain-card {
    min-height: 220px;
}

.chain-card-context {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin: -2px 0 10px;
}

.chain-card-context-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 9px;
    line-height: 14px;
    background: rgba(113, 62, 255, 0.08);
    color: #5b38d1;
    border: 1px solid rgba(113, 62, 255, 0.15);
}

/* 进度条 */
.chain-card-progress-bar {
    position: relative;
    height: 10px;
    background: #e8e8e8;
    border-radius: 5px;
    margin-bottom: 12px;
    overflow: hidden;
}

.chain-card-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #713eff, #9d7bff);
    border-radius: 5px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

/* 进度条流动光效 */
.chain-card-progress-bar .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 完成状态不需要流动 */
.chain-card.completed-state .chain-card-progress-bar .progress-fill::after {
    animation: none;
    opacity: 0;
}

.chain-card-progress-bar .progress-percent {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    z-index: 1;
}

/* 任务计数 */
.chain-card-count {
    font-size: 13px;
    color: #666;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(0,0,0,0.02);
    border-radius: 6px;
}

.chain-card-count span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.chain-card-count .completed { color: #52c41a; font-weight: 500; }
.chain-card-count .running { color: #1890ff; font-weight: 500; }
.chain-card-count .failed { color: #ff4d4f; font-weight: 500; }
.chain-card-count .queued { color: #faad14; font-weight: 500; }
.chain-card-count .total { color: #999; }
.chain-card-count .pending { color: #999; font-style: italic; }

/* 预设选择器 */
.chain-card-preset {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.chain-card-preset:hover {
    border-color: #713eff;
}

.chain-card-preset:focus {
    outline: none;
    border-color: #713eff;
    box-shadow: 0 0 0 3px rgba(113, 62, 255, 0.1);
}

/* 剩余时间 */
.chain-card-time {
    font-size: 13px;
    color: #666;
    text-align: center;
    padding: 8px 0;
    border-top: 1px solid #f0f0f0;
}

.chain-card-time.completed {
    color: #52c41a;
    font-weight: 600;
}

/* ========================================
   Hover 展开信息区域
   ======================================== */

/* hover-info 默认显示在卡片内 */
.chain-card-hover-info {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed #e8e8e8;
}

/* 任务详情（默认显示） */
.chain-card-task-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    padding: 8px 10px;
    background: #f0f5ff;
    border-radius: 6px;
    margin-top: 8px;
}

.chain-card-task-detail .label {
    font-size: 11px;
    color: #666;
}

.chain-card-task-detail .value {
    font-weight: 500;
    color: #1890ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chain-card-task-detail.running {
    background: #e6f7ff;
    border-left: 3px solid #1890ff;
}

.chain-card-task-detail.queued {
    background: #fffbe6;
    border-left: 3px solid #faad14;
}
.chain-card-task-detail.queued .value { color: #d48806; }

.chain-card-task-detail.failed {
    background: #fff2f0;
    border-left: 3px solid #ff4d4f;
}
.chain-card-task-detail.failed .value { color: #ff4d4f; }

.chain-card-task-detail.completed {
    background: #f6ffed;
    border-left: 3px solid #52c41a;
}
.chain-card-task-detail.completed .value { color: #52c41a; }

/* 预设行 */
.chain-card-preset-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.chain-card-preset-row .chain-card-preset {
    flex: 1;
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: white;
}

/* 当前任务（兼容旧样式） */
.chain-card-current-task {
    font-size: 12px;
    color: #1890ff;
    text-align: center;
    padding: 6px 10px;
    background: #f0f5ff;
    border-radius: 6px;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chain-card-current-task.queued {
    color: #faad14;
    background: #fffbe6;
}

.chain-card-current-task.failed {
    color: #ff4d4f;
    background: #fff2f0;
}

/* 质检状态 */
.chain-card-qc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
}

.chain-card-qc-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #666;
}

.chain-card-qc-item .icon {
    font-size: 12px;
}

.chain-card-qc-item .value {
    font-weight: 600;
    color: #333;
}

.chain-card-qc-item.pending .value { color: #faad14; }
.chain-card-qc-item.passed .value { color: #52c41a; }
.chain-card-qc-item.review .value { color: #1890ff; }
.chain-card-qc-item.rejected .value { color: #ff4d4f; }

/* 平均耗时 */
.chain-card-avg-time {
    font-size: 11px;
    color: #999;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ========================================
   连接器 - 多轨道流水线动效
   ======================================== */

/* 连接器 - 多条细线流水设计 */
.chain-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    align-self: stretch;
    position: relative;
    width: 50px;
    min-height: var(--card-min-height);
}

/* 数据流轨道容器 */
.chain-connector .data-tracks {
    position: absolute;
    top: 20px;
    left: 0;
    right: 8px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

/* 单条数据流轨道 - 细线 */
.chain-connector .data-track {
    position: relative;
    height: 2px;
    background: rgba(147, 112, 255, 0.35);
    border-radius: 1px;
    overflow: hidden;
}

/* 流动的数据点 */
.chain-connector .data-track::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -20px;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(167, 139, 250, 1), 0 0 20px rgba(147, 112, 255, 0.6);
    animation: dataFlowThin 2s ease-in-out infinite;
}

/* 不同轨道不同延迟 */
.chain-connector .data-track:nth-child(1)::after { animation-delay: 0s; }
.chain-connector .data-track:nth-child(2)::after { animation-delay: 0.25s; }
.chain-connector .data-track:nth-child(3)::after { animation-delay: 0.5s; }
.chain-connector .data-track:nth-child(4)::after { animation-delay: 0.75s; }
.chain-connector .data-track:nth-child(5)::after { animation-delay: 1s; }
.chain-connector .data-track:nth-child(6)::after { animation-delay: 1.25s; }
.chain-connector .data-track:nth-child(7)::after { animation-delay: 1.5s; }
.chain-connector .data-track:nth-child(8)::after { animation-delay: 1.75s; }
.chain-connector .data-track:nth-child(9)::after { animation-delay: 0.15s; }
.chain-connector .data-track:nth-child(10)::after { animation-delay: 0.4s; }
.chain-connector .data-track:nth-child(11)::after { animation-delay: 0.65s; }
.chain-connector .data-track:nth-child(12)::after { animation-delay: 0.9s; }

@keyframes dataFlowThin {
    0% {
        left: -20px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: calc(100% + 10px);
        opacity: 0;
    }
}

/* 边缘连接器 - 左侧入口，延伸到页面边缘 */
.chain-connector.edge-left {
    flex: 1;
    min-width: 60px;
    max-width: none;
}

.chain-connector.edge-left .data-track::after {
    animation: dataFlowFromLeft 3s ease-in-out infinite;
}

@keyframes dataFlowFromLeft {
    0% {
        left: -100%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: calc(100% + 10px);
        opacity: 0;
    }
}

/* 边缘连接器 - 右侧出口，延伸到页面边缘 */
.chain-connector.edge-right {
    flex: 1;
    min-width: 60px;
    max-width: none;
}

.chain-connector.edge-right .data-track::after {
    animation: dataFlowToRight 3s ease-in-out infinite;
}

@keyframes dataFlowToRight {
    0% {
        left: -20px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: calc(100% + 100%);
        opacity: 0;
    }
}

/* 箭头指示 */
.chain-connector .connector-arrow {
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    color: #713eff;
    font-size: 12px;
    opacity: 0.6;
}

/* 空闲状态 - 慢速流动 */
.chain-connector.idle .data-track::after {
    animation-duration: 4s;
    opacity: 0.6;
}

.chain-connector.idle .data-track {
    background: rgba(147, 112, 255, 0.2);
}

/* 活跃状态 - 快速流动 */
.chain-connector.active .data-track::after {
    animation-duration: 1.2s;
    background: linear-gradient(135deg, #c4b5fd 0%, #e9d5ff 100%);
    box-shadow: 0 0 12px rgba(196, 181, 253, 1), 0 0 24px rgba(167, 139, 250, 0.8);
}

.chain-connector.active .data-track {
    background: rgba(167, 139, 250, 0.45);
}

/* ========================================
   卡片状态动效
   ======================================== */

/* 执行中 - 边框呼吸光晕 */
.chain-card-status.running {
    background: #1890ff;
    animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(24, 144, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(24, 144, 255, 0);
    }
}

/* 执行中卡片 - 边框发光 */
.chain-card.running-state {
    border-color: #1890ff;
    animation: cardGlow 2s ease-in-out infinite;
}

@keyframes cardGlow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 0 0 0 rgba(24, 144, 255, 0.2);
    }
    50% {
        box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 0 20px 2px rgba(24, 144, 255, 0.3);
    }
}

/* 执行中卡片 - 背景流动 */
.chain-card.running-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(24, 144, 255, 0.05) 25%,
        rgba(24, 144, 255, 0.1) 50%,
        rgba(24, 144, 255, 0.05) 75%,
        transparent 100%);
    animation: bgFlow 3s linear infinite;
    pointer-events: none;
    border-radius: 12px;
}

@keyframes bgFlow {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(50%);
    }
}

/* 排队中 - 淡黄脉冲 */
.chain-card.queued-state {
    border-color: #faad14;
}

.chain-card.queued-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(250, 173, 20, 0.05);
    border-radius: 12px;
    animation: queuedPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes queuedPulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.8;
    }
}

/* 失败 - 红色闪烁 + 微抖 */
.chain-card.failed-state {
    border-color: #ff4d4f;
    animation: failedShake 0.5s ease-in-out;
}

.chain-card-status.failed {
    background: #ff4d4f;
    animation: failedBlink 1s ease-in-out infinite;
}

@keyframes failedBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes failedShake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-3px);
    }
    40%, 80% {
        transform: translateX(3px);
    }
}

/* 完成 - 成功闪光 */
.chain-card.completed-state.just-completed {
    animation: completedFlash 0.6s ease-out;
}

@keyframes completedFlash {
    0% {
        box-shadow: 0 0 0 0 rgba(82, 196, 26, 0.6);
    }
    50% {
        box-shadow: 0 0 30px 10px rgba(82, 196, 26, 0.3);
    }
    100% {
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
}

/* ========================================
   数据传输动效（WebSocket触发）
   ======================================== */

/* 数据发送动效 - 从卡片发出能量波 */
.chain-card.data-sending::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: transparent;
    border: 2px solid #713eff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: energyWave 0.8s ease-out forwards;
    pointer-events: none;
}

@keyframes energyWave {
    0% {
        width: 20px;
        height: 20px;
        opacity: 1;
    }
    100% {
        width: 150px;
        height: 150px;
        opacity: 0;
    }
}

/* 数据接收动效 - 卡片高亮闪烁 */
.chain-card.data-receiving {
    animation: dataReceive 0.4s ease-out;
}

@keyframes dataReceive {
    0% {
        background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    }
    50% {
        background: linear-gradient(180deg, #f0f5ff 0%, #e6f0ff 100%);
        box-shadow: 0 0 20px rgba(113, 62, 255, 0.3);
    }
    100% {
        background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    }
}

/* 连接器数据包加速 */
.chain-connector.data-transfer::after {
    animation: dataTransferFast 0.4s ease-out forwards;
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
    width: 12px;
    height: 12px;
    box-shadow: 0 0 15px rgba(82, 196, 26, 0.8), -5px 0 10px rgba(82, 196, 26, 0.5);
}

@keyframes dataTransferFast {
    0% {
        left: 0;
        opacity: 1;
    }
    100% {
        left: calc(100% - 12px);
        opacity: 0;
    }
}

/* ========================================
   响应式布局 - 竖向卡片设计
   ======================================== */

/* 2560px+: 8个卡片一行，连接器显示 */
@media (min-width: 2200px) {
    :root {
        --card-min-width: 220px;
        --card-max-width: 260px;
        --card-min-height: 420px;
    }
    .chain-cards-container {
        gap: 4px;
    }
    .chain-connector {
        width: 45px;
        flex-shrink: 0;
    }
    .chain-connector.edge-left,
    .chain-connector.edge-right {
        flex: 1;
        min-width: 60px;
    }
}

/* 1920px: 6-7个卡片一行 */
@media (max-width: 2199px) and (min-width: 1700px) {
    :root {
        --card-min-width: 200px;
        --card-max-width: 240px;
        --card-min-height: 280px; /* P5: 从 400px 降到 280px，给画布留空间 */
    }
    .chain-connector {
        width: 40px;
        flex-shrink: 0;
    }
    .chain-connector.edge-left,
    .chain-connector.edge-right {
        flex: 1;
        min-width: 50px;
    }
}

/* 1440px: 5-6个卡片一行 */
@media (max-width: 1699px) and (min-width: 1300px) {
    :root {
        --card-min-width: 180px;
        --card-max-width: 220px;
        --card-min-height: 260px; /* P5: 从 380px 降到 260px */
    }
    .chain-connector {
        width: 30px;
        flex-shrink: 0;
    }
    .chain-connector.edge-left,
    .chain-connector.edge-right {
        flex: 1;
        min-width: 40px;
    }
    .chain-connector .connector-arrow {
        display: none;
    }
}

/* 1280px: 横向滚动 */
@media (max-width: 1299px) {
    .chain-cards-container {
        overflow-x: auto;
        justify-content: flex-start;
        padding: 20px;
    }
    :root {
        --card-min-width: 180px;
        --card-max-width: 200px;
        --card-min-height: 240px; /* P5: 从 360px 降到 240px */
    }
    .chain-connector {
        width: 24px;
        min-height: var(--card-min-height);
        flex-shrink: 0;
    }
    .chain-connector.edge-left,
    .chain-connector.edge-right {
        flex: 1;
        min-width: 30px;
    }
    .chain-connector .connector-arrow {
        display: none;
    }
}

/* 移动端 */
@media (max-width: 600px) {
    .chain-cards-container {
        flex-direction: column;
        align-items: center;
    }
    .chain-card {
        width: 90%;
        max-width: 300px;
        min-height: auto;
    }
    .chain-connector {
        width: 100%;
        min-height: 40px;
        height: 40px;
    }
    .chain-connector.edge-left,
    .chain-connector.edge-right {
        display: none;
    }
}

/* P5: 1920x1080 竖屏高度约束 — 确保操作栏可见 */
@media (max-height: 1080px) and (min-width: 1200px) {
    .canvas-area {
        padding: 12px 20px;
    }
    .project-header {
        padding: 8px 14px;
        margin-bottom: 8px;
    }
    .chain-cards-wrapper {
        min-height: 200px;
    }
    .canvas-actions {
        padding: 8px 0;
        gap: 8px;
    }
    .canvas-actions .btn {
        padding: 5px 12px;
        font-size: 13px;
    }
}

/* P5: 极矮视口（<700px 高度）— 极限压缩 */
@media (max-height: 700px) and (min-width: 1200px) {
    .canvas-area {
        padding: 8px 16px;
    }
    .project-header {
        padding: 6px 12px;
        margin-bottom: 6px;
        border-radius: 8px;
    }
    .canvas-actions .btn {
        padding: 4px 10px;
        font-size: 12px;
    }
}

/* P5: 2560+ 大屏 — 充分利用空间 */
@media (min-width: 2560px) {
    .canvas-area {
        padding: 24px 32px;
    }
    .project-header {
        padding: 16px 22px;
    }
    .canvas-actions {
        gap: 14px;
        padding: 14px 0;
    }
    .side-panel {
        width: 300px;
        min-width: 300px;
    }
    .panel-toggle-btn {
        left: 300px;
    }
}

/* ========================================
   兼容旧样式
   ======================================== */

.chain-card-time.completed {
    color: #52c41a;
    font-weight: 600;
}

/* ========================================
   空列表状态
   ======================================== */

.empty-list {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.task-context-menu {
    position: fixed;
    min-width: 176px;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(113, 62, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.14);
    padding: 8px;
    z-index: 1200;
    display: none;
    backdrop-filter: blur(10px);
}

.task-context-menu.open {
    display: block;
}

.task-context-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 13px;
    color: #303030;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.task-context-menu-item:hover {
    background: #f5f0ff;
    color: #5b38d1;
}

.task-context-menu-item.danger:hover {
    background: #fff2f0;
    color: #cf1322;
}

.task-context-menu-item.disabled,
.task-context-menu-item:disabled {
    color: #bfbfbf;
    cursor: not-allowed;
    background: transparent;
}

.task-context-menu-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 6px 0;
}

/* ========================================
   子任务弹窗
   ======================================== */

/* 使用更高的 specificity 覆盖默认 modal-content 样式 */
.modal-content.modal-large {
    width: 95%;
    max-width: 1800px;
    min-width: 1000px;
    max-height: 90vh;
}

.modal-large {
    width: 95%;
    max-width: 1800px;
    min-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-large .modal-header {
    padding: 24px 36px;
    border-bottom: 1px solid #e8e8e8;
}

.modal-large .modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.modal-large .modal-body {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.modal-large .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 36px;
    border-top: 1px solid #e8e8e8;
    background: #fafafa;
}

.batch-manage-modal-content {
    max-width: min(1080px, 96vw);
}

.batch-manage-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-manage-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    padding: 8px 10px;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
    border: 1px solid #f0f0f0;
    border-radius: 12px;
}

/* 宽屏一行：记录态 | 流水线 | 搜索 | 操作 */
.batch-toolbar-primary {
    display: grid;
    grid-template-columns: auto minmax(140px, 200px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    min-width: 0;
}

.batch-manage-filters,
.batch-manage-actions,
.batch-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.batch-manage-actions {
    flex-shrink: 0;
}

.batch-manage-pipeline-select {
    width: 100%;
    min-width: 0;
}

.batch-manage-search-input {
    width: 100%;
    min-width: 0;
}

.batch-toolbar-secondary {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 12px;
    min-width: 0;
}

.batch-toolbar-secondary .batch-status-details {
    flex: 1 1 260px;
    min-width: 0;
}

.batch-toolbar-secondary .batch-exclude-row {
    flex: 0 1 auto;
    align-self: center;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    padding-left: 12px;
    border-left: 1px solid #f0f0f0;
    min-height: 32px;
}

@media (max-width: 899px) {
    .batch-toolbar-primary {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .batch-manage-actions {
        align-self: flex-end;
    }

    .batch-toolbar-secondary {
        flex-direction: column;
        align-items: stretch;
    }

    .batch-toolbar-secondary .batch-exclude-row {
        border-left: none;
        padding-left: 0;
        border-top: 1px dashed #f0f0f0;
        padding-top: 8px;
    }

    .batch-exclude-hint {
        margin-left: 0;
        width: 100%;
    }
}

.batch-status-details {
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.batch-status-details-summary {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #434343;
    cursor: pointer;
    list-style: none;
}

.batch-status-details-summary::-webkit-details-marker {
    display: none;
}

.batch-status-details-summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 6px;
    color: #8c8c8c;
    transition: transform 0.15s ease;
}

.batch-status-details[open] .batch-status-details-summary::before {
    transform: rotate(90deg);
}

.batch-status-details-hint {
    font-weight: 400;
    color: #8c8c8c;
}

.batch-status-multi {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    padding: 0 10px 8px 24px;
}

.batch-status-chip {
    font-size: 12px;
    color: #595959;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f5f5f5;
}

.batch-status-chip:hover {
    background: #ebebeb;
}

.batch-exclude-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: 12px;
    color: #595959;
}

.batch-exclude-title {
    font-weight: 600;
    color: #434343;
    margin-right: 4px;
}

.batch-exclude-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.batch-exclude-hint {
    color: #bfbfbf;
    font-size: 11px;
    margin-left: auto;
}

.batch-manage-summary-block {
    line-height: 1.4;
}

.batch-summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.batch-metric {
    flex: 1 1 160px;
    min-width: 158px;
    padding: 8px 10px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
}

.batch-metric-label {
    display: block;
    font-size: 11px;
    color: #8c8c8c;
    margin-bottom: 4px;
}

.batch-metric-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 4px 6px;
    white-space: nowrap;
    min-width: 0;
}

.batch-metric-value {
    font-size: 16px;
    font-weight: 700;
    color: #262626;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.batch-metric-line .batch-metric-value {
    line-height: 1.2;
}

.batch-metric-unit {
    font-size: 13px;
    font-weight: 600;
    color: #595959;
    flex-shrink: 0;
}

.batch-metric-page-suffix {
    font-size: 12px;
    font-weight: 600;
    color: #595959;
    flex-shrink: 0;
}

.batch-metric-sub {
    display: block;
    font-size: 11px;
    color: #8c8c8c;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-metric-sep {
    font-weight: 600;
    font-size: 14px;
    color: #bfbfbf;
    padding: 0 2px;
    flex-shrink: 0;
}

.batch-metric-line > .batch-metric-sep {
    font-size: 15px;
    line-height: 1;
}

.batch-scope-hint {
    font-size: 12px;
    color: #5b38d1;
    line-height: 1.5;
    padding: 8px 12px;
    background: #f3f0ff;
    border-radius: 8px;
    border-left: 3px solid #713eff;
}

.batch-manage-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 8px 10px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
}

.batch-pagination-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.batch-page-indicator,
.project-page-indicator {
    font-size: 12px;
    color: #595959;
    min-width: 120px;
    text-align: center;
}

.batch-page-size-label,
.project-page-size-label {
    font-size: 12px;
    color: #595959;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: max-content;
}

.page-size-label-text {
    white-space: nowrap;
    flex-shrink: 0;
}

.batch-page-size-select {
    flex-shrink: 0;
    min-width: 72px;
}

.batch-manage-modal-footer {
    flex-wrap: wrap;
    gap: 12px;
}

.batch-footer-selected {
    font-size: 13px;
    color: #434343;
    font-weight: 500;
}

.project-list-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 4px 4px;
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
}

.project-page-size-select {
    flex-shrink: 0;
    min-width: 72px;
    padding: 4px 8px;
    font-size: 12px;
}

.batch-filter-chip {
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #595959;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}

.batch-filter-chip.active {
    border-color: #713eff;
    background: #f3f0ff;
    color: #5b38d1;
}

.batch-manage-summary {
    color: #595959;
    font-size: 13px;
}

.batch-manage-summary .batch-summary-stats {
    margin: 0;
}

.batch-manage-table-wrap {
    max-height: 56vh;
    overflow: auto;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
}

.batch-manage-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.batch-manage-table th,
.batch-manage-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f5f5f5;
    text-align: left;
    font-size: 13px;
    vertical-align: middle;
}

.batch-manage-table th:nth-child(1),
.batch-manage-table td:nth-child(1) {
    width: 36px;
    padding-left: 10px;
}

.batch-col-wf {
    max-width: 200px;
    font-size: 12px;
    color: #595959;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-col-time {
    max-width: 118px;
    font-size: 12px;
    color: #8c8c8c;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.batch-row-actions {
    gap: 4px 10px;
}

.batch-action-link {
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    color: #713eff;
}

.batch-action-link:hover {
    text-decoration: underline;
}

.batch-action-link.batch-action-danger {
    color: #cf1322;
}

.batch-action-link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    text-decoration: none;
}

.batch-manage-table th {
    position: sticky;
    top: 0;
    background: #fafafa;
    z-index: 1;
    color: #595959;
    font-weight: 600;
}

.batch-task-name {
    font-weight: 600;
    color: #262626;
}

.batch-task-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #8c8c8c;
}

.batch-record-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.batch-record-badge.active {
    background: #f6ffed;
    color: #389e0d;
}

.batch-record-badge.deleted {
    background: #fff2f0;
    color: #cf1322;
}

.batch-empty {
    text-align: center;
    color: #8c8c8c;
    padding: 28px 12px !important;
}

/* 子任务统计摘要 */
.subtask-summary {
    display: flex;
    gap: 32px;
    padding: 24px 36px;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e8e8e8;
    flex-wrap: wrap;
}

.subtask-summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    padding: 8px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.subtask-summary-item .icon {
    font-size: 18px;
}

.subtask-summary-item .label {
    color: #666;
}

.subtask-summary-item .value {
    font-weight: 700;
    font-size: 16px;
}

.subtask-summary-item .icon {
    font-size: 16px;
}

.subtask-summary-item .label {
    color: #666;
}

.subtask-summary-item .value {
    font-weight: 600;
    color: #333;
}

.subtask-summary-item.completed .value { color: #52c41a; }
.subtask-summary-item.running .value { color: #1890ff; }
.subtask-summary-item.queued .value { color: #faad14; }
.subtask-summary-item.failed .value { color: #ff4d4f; }

/* 子任务数量 */
.subtask-count {
    font-size: 13px;
    color: #666;
}

/* 子任务表格容器 */
.sub-tasks-container {
    padding: 24px 36px 32px 36px;
    max-height: 600px;
    overflow: auto;
}

/* 子任务表格 */
.sub-tasks-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 15px;
}

.sub-tasks-table th,
.sub-tasks-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.sub-tasks-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #444;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.sub-tasks-table tbody tr {
    transition: background 0.2s;
}

.sub-tasks-table tbody tr:hover {
    background: #f5f0ff;
}

.sub-tasks-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.sub-tasks-table tbody tr:nth-child(even):hover {
    background: #f5f0ff;
}

/* W11：多集分组折叠 */
.sub-task-group-header td {
    background: #ede7f6;
    font-weight: 600;
    border-bottom: 1px solid #d3c4e8;
}

.btn-subtask-group-toggle {
    margin-right: 10px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #b39ddb;
    border-radius: 4px;
    background: #fff;
    vertical-align: middle;
}

.sub-task-group-parent {
    color: #5e35b1;
    margin-right: 12px;
    font-size: 13px;
}

.sub-task-group-episode {
    margin-right: 12px;
    color: #333;
}

.sub-task-group-seg.readonly-hint,
.sub-task-ep-readonly,
.sub-task-seg-readonly {
    color: #555;
    font-size: 13px;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 子任务缩略图 */
.sub-task-thumb {
    width: 48px;
    min-width: 48px;
    padding: 2px !important;
    text-align: center;
    vertical-align: middle;
}
.sub-task-thumb-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

/* 批量管理缩略图 */
.batch-thumb {
    width: 48px;
    min-width: 48px;
    padding: 2px !important;
    text-align: center;
    vertical-align: middle;
}
.batch-thumb-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

.sub-task-group-seg.readonly-hint {
    max-width: none;
    white-space: normal;
    font-weight: 400;
    color: #666;
}

tr.sub-task-group-row-hidden {
    display: none;
}

.sub-task-group-child td.sub-task-seg-readonly {
    max-width: 280px;
}

.sub-task-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.sub-task-actions {
    display: flex;
    gap: 6px;
}

.sub-task-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* ========================================
   确认弹窗
   ======================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

#confirm-modal.active {
    z-index: 1300;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    min-width: 400px;
    max-width: 500px;
}

/* 大尺寸弹窗 - 覆盖默认限制 */
.modal-content.modal-large {
    min-width: 1000px;
    max-width: 1800px;
    width: 95%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
}

#project-detail-modal.active {
    z-index: 1280;
}

/* ---- 详情弹层收束版（2026-04-17） ---- */
/* 说明：用更高 specificity 覆盖 .modal-content.modal-large 里来自"子任务弹窗"的宽/高/padding 基线 */
.modal-content.project-detail-modal-shell {
    width: min(1040px, calc(100vw - 64px));
    min-width: 0;
    max-width: min(1040px, calc(100vw - 64px));
    max-height: min(82vh, 780px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(20, 14, 60, 0.16);
}

/* header 紧凑化：从 24px/36px 收到 12px/20px，h3 字号 15px，单行省略号 */
.modal-large .project-detail-modal-header,
.project-detail-modal-header {
    padding: 12px 20px;
    border-bottom: 1px solid #eeeaf6;
    background: linear-gradient(180deg, #ffffff 0%, #faf8ff 100%);
    flex: 0 0 auto;
}

.project-detail-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.project-detail-modal-title-icon {
    font-size: 14px;
    line-height: 1;
    flex: 0 0 auto;
    opacity: 0.7;
}

.modal-large .project-detail-modal-header h3,
.project-detail-modal-header h3#project-detail-modal-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    color: #1f1a3a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
}

/* tabbar slot：紧贴 header 下方，不再和 body 之间有独立 padding/margin */
.project-detail-modal-tabbar-slot {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    border-bottom: 1px solid #eeeaf6;
    background: #faf8ff;
    flex: 0 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
}

.project-detail-modal-tabbar-slot::-webkit-scrollbar {
    display: none;
}

/* slot 作用域下把"胶囊 tab"改写为"下划线 tab"，更紧凑、更像现代弹层分段 */
.project-detail-modal-tabbar-slot .project-detail-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: #6b6486;
    border-radius: 0;
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    position: relative;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.project-detail-modal-tabbar-slot .project-detail-tab::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: transparent;
    transition: background 0.15s ease;
}

.project-detail-modal-tabbar-slot .project-detail-tab:hover {
    background: transparent;
    color: #4420c0;
    border-color: transparent;
}

.project-detail-modal-tabbar-slot .project-detail-tab.active {
    background: transparent;
    color: #4420c0;
    border-color: transparent;
    font-weight: 600;
}

.project-detail-modal-tabbar-slot .project-detail-tab.active::after {
    background: #7c4dff;
}

/* body 滚动区：接管 modal-large 的 body padding，给一份更克制的值 */
.modal-large .project-detail-modal-scroll,
.project-detail-modal-scroll {
    flex: 1 1 auto;
    overflow: auto;
    padding: 16px 20px 20px;
    max-height: none;
    background: #ffffff;
}

/* 右上角 × 缩小并与 header 视觉齐平 */
.project-detail-modal-close {
    appearance: none;
    border: none;
    background: transparent;
    color: #8f8aa8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
    flex: 0 0 auto;
}

.project-detail-modal-close:hover {
    background: rgba(124, 77, 255, 0.1);
    color: #5b38d1;
}

#confirm-message {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e8e8e8;
}

/* ========================================
   WebSocket 状态
   ======================================== */

.ws-status {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 12px;
    z-index: 100;
}

.ws-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ws-indicator.connected { background: #52c41a; }
.ws-indicator.connecting { background: #faad14; animation: pulse 1s infinite; }
.ws-indicator.disconnected { background: #ff4d4f; }

.ws-text {
    color: #666;
}

/* ========================================
   通用按钮
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #713eff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5f35d9;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.btn-warning {
    background: #faad14;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #d99a0b;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #d9363e;
}

.btn-success {
    background: #52c41a;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #43a814;
}

.review-actions-divider {
    width: 1px;
    height: 24px;
    background: #d9d9d9;
    margin: 0 4px;
    align-self: center;
}

.btn-icon {
    padding: 8px;
    background: transparent;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
}

.btn-icon:hover {
    background: #f0f0f0;
    border-color: #bfbfbf;
}

.btn-close {
    border: none;
    background: transparent;
    font-size: 16px;
    color: #999;
}

.btn-close:hover {
    color: #333;
}

/* ========================================
   空状态
   ======================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 14px;
}

/* ========================================
   加载状态
   ======================================== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e8e8e8;
    border-top-color: #713eff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   响应式
   ======================================== */

@media (max-width: 1200px) {
    .overview-container {
        grid-template-columns: 1fr;
    }
    
    .queue-panel {
        order: -1;
    }
}

@media (max-width: 768px) {
    .dispatch-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .header-stats {
        flex-wrap: wrap;
    }
    
    .dispatch-filters {
        flex-wrap: wrap;
    }
    
    .project-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* ========================================
   AR 全息 HUD 系统
   ======================================== */

/* === 顶部弧形信息条 === */
.ar-hud-top-bar {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%) perspective(600px) rotateX(15deg);
    z-index: 100;
    pointer-events: none;
}

.dispatch-hud-toggle {
    pointer-events: auto;
    cursor: pointer;
}

.ar-hud-top-bar .ar-bar-content {
    background: linear-gradient(180deg, rgba(167,139,250,0.15) 0%, rgba(167,139,250,0.05) 100%);
    border: 1px solid rgba(167,139,250,0.4);
    border-radius: 0 0 30px 30px;
    padding: 8px 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #a78bfa;
    text-shadow: 0 0 10px rgba(167,139,250,0.8);
    backdrop-filter: blur(5px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.dispatch-hud-toggle:hover .ar-bar-content,
.dispatch-hud-toggle:focus-visible .ar-bar-content,
.dispatch-hud-toggle.dispatch-hud-toggle-active .ar-bar-content {
    border-color: rgba(192,132,252,0.75);
    box-shadow: 0 0 24px rgba(167,139,250,0.24);
}

.dispatch-hud-toggle:focus-visible {
    outline: none;
}

.ar-status-dot {
    width: 8px;
    height: 8px;
    background: #c084fc;
    border-radius: 50%;
    box-shadow: 0 0 10px #c084fc;
    animation: arPulse 1.5s ease-in-out infinite;
}

.ar-divider {
    opacity: 0.4;
}

.ar-time {
    font-weight: bold;
    letter-spacing: 2px;
}

/* === 底部弧形信息条 === */
.ar-hud-bottom-bar {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) perspective(600px) rotateX(-15deg);
    z-index: 100;
    pointer-events: none;
}

.ar-hud-bottom-bar .ar-bar-content {
    background: linear-gradient(0deg, rgba(167,139,250,0.15) 0%, rgba(167,139,250,0.05) 100%);
    border: 1px solid rgba(167,139,250,0.4);
    border-radius: 30px 30px 0 0;
    padding: 8px 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #a78bfa;
    text-shadow: 0 0 10px rgba(167,139,250,0.8);
    backdrop-filter: blur(5px);
}

.ar-version {
    letter-spacing: 1px;
}

.ar-core-text {
    color: #c084fc;
    animation: arBlink 2s ease-in-out infinite;
}

/* === AR HUD 面板基础 === */
.ar-hud-panel {
    position: absolute;
    z-index: 100;
    pointer-events: auto;
    animation: arFadeIn 0.6s ease-out;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.dispatch-hud-panel-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes arFadeIn {
    from {
        opacity: 0;
        transform: perspective(800px) rotateY(0deg) scale(0.8);
    }
    to {
        opacity: 1;
    }
}

/* 左侧面板 - 3D 透视向右倾斜 */
.ar-hud-left {
    transform: perspective(800px) rotateY(12deg);
    transform-origin: right center;
}

.ar-hud-left.ar-hud-top {
    top: 60px;
    left: 15px;
}

.ar-hud-left.ar-hud-bottom {
    bottom: 60px;
    left: 15px;
}

/* 右侧面板 - 3D 透视向左倾斜 */
.ar-hud-right {
    transform: perspective(800px) rotateY(-12deg);
    transform-origin: left center;
}

.ar-hud-right.ar-hud-top {
    top: 60px;
    right: 15px;
}

.ar-hud-right.ar-hud-bottom {
    bottom: 60px;
    right: 15px;
}

/* === AR 面板框架 === */
.ar-panel-frame {
    background: linear-gradient(135deg, rgba(24,15,42,0.9) 0%, rgba(45,25,70,0.85) 100%);
    border: 1px solid rgba(167,139,250,0.5);
    border-radius: 4px;
    padding: 12px 16px;
    min-width: 160px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 0 30px rgba(167,139,250,0.2),
        inset 0 0 20px rgba(167,139,250,0.05);
    position: relative;
    overflow: hidden;
}

/* 全息扫描线 */
.ar-scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(167,139,250,0.8), transparent);
    animation: arScanline 3s linear infinite;
}

@keyframes arScanline {
    0% {
        top: 0;
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0.3;
    }
}

/* 面板头部 */
.ar-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(167,139,250,0.3);
}

.ar-panel-icon {
    color: #a78bfa;
    font-size: 14px;
    text-shadow: 0 0 10px #a78bfa;
    animation: arPulse 2s ease-in-out infinite;
}

.ar-panel-title {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    font-weight: bold;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(167,139,250,0.5);
}

/* 面板底部 */
.ar-panel-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(167,139,250,0.2);
}

.ar-data {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: rgba(167,139,250,0.7);
    letter-spacing: 1px;
}

.ar-data span {
    color: #a78bfa;
    font-weight: bold;
}

/* === 雷达组件 === */
.ar-radar-container {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.ar-radar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45,25,70,0.9) 0%, rgba(24,15,42,0.95) 100%);
    border: 2px solid rgba(167,139,250,0.5);
    position: relative;
    overflow: hidden;
}

/* 雷达圆环 */
.ar-radar-ring {
    position: absolute;
    border: 1px solid rgba(167,139,250,0.2);
    border-radius: 50%;
}

.ar-radar-ring.ring-1 {
    top: 15%;
    left: 15%;
    width: 70%;
    height: 70%;
}

.ar-radar-ring.ring-2 {
    top: 30%;
    left: 30%;
    width: 40%;
    height: 40%;
}

.ar-radar-ring.ring-3 {
    top: 45%;
    left: 45%;
    width: 10%;
    height: 10%;
}

/* 雷达中心点 */
.ar-radar-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #a78bfa;
    border-radius: 50%;
    box-shadow: 0 0 10px #a78bfa;
}

/* 雷达扫描线 */
.ar-radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, rgba(167,139,250,0.8) 0%, transparent 100%);
    transform-origin: left center;
    animation: arRadarSweep 3s linear infinite;
}

@keyframes arRadarSweep {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 雷达上的点 */
.ar-radar-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #c084fc;
    border-radius: 50%;
    box-shadow: 0 0 6px #c084fc;
    animation: arDotBlink 1.5s ease-in-out infinite;
}

.ar-radar-dot.dot-1 { top: 25%; left: 60%; animation-delay: 0s; }
.ar-radar-dot.dot-2 { top: 40%; left: 75%; animation-delay: 0.3s; }
.ar-radar-dot.dot-3 { top: 65%; left: 30%; animation-delay: 0.6s; }
.ar-radar-dot.dot-4 { top: 55%; left: 65%; animation-delay: 0.9s; }
.ar-radar-dot.dot-5 { top: 30%; left: 35%; animation-delay: 1.2s; }

@keyframes arDotBlink {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* === 任务目标列表 === */
.ar-objectives-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ar-objective-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: rgba(167,139,250,0.05);
    border-left: 2px solid transparent;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.ar-objective-item.active {
    border-left-color: #a78bfa;
    background: rgba(167,139,250,0.1);
}

.ar-objective-item.pending {
    border-left-color: #e879f9;
}

.ar-objective-item.complete {
    border-left-color: #c084fc;
}

.ar-objective-item.failed {
    border-left-color: #f472b6;
}

.ar-obj-icon {
    color: #a78bfa;
    font-size: 10px;
}

.ar-objective-item.active .ar-obj-icon { color: #a78bfa; }
.ar-objective-item.pending .ar-obj-icon { color: #e879f9; }
.ar-objective-item.complete .ar-obj-icon { color: #c084fc; }
.ar-objective-item.failed .ar-obj-icon { color: #f472b6; }

.ar-obj-label {
    flex: 1;
    color: rgba(255,255,255,0.7);
    letter-spacing: 1px;
}

.ar-obj-value {
    font-weight: bold;
    min-width: 30px;
    text-align: right;
}

.ar-objective-item.active .ar-obj-value { color: #a78bfa; text-shadow: 0 0 8px #a78bfa; }
.ar-objective-item.pending .ar-obj-value { color: #e879f9; }
.ar-objective-item.complete .ar-obj-value { color: #c084fc; }
.ar-objective-item.failed .ar-obj-value { color: #f472b6; }

/* === 小队状态列表 === */
.ar-squad-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ar-squad-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.ar-squad-indicator {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.ar-squad-item.critical .ar-squad-indicator {
    background: #f472b6;
    box-shadow: 0 0 8px #f472b6;
    animation: arPulse 1s ease-in-out infinite;
}

.ar-squad-item.warning .ar-squad-indicator {
    background: #e879f9;
    box-shadow: 0 0 8px #e879f9;
}

.ar-squad-item.normal .ar-squad-indicator {
    background: #c084fc;
    box-shadow: 0 0 8px #c084fc;
}

.ar-squad-name {
    flex: 1;
    color: rgba(255,255,255,0.8);
    letter-spacing: 2px;
}

.ar-squad-count {
    color: #a78bfa;
    font-weight: bold;
    min-width: 20px;
    text-align: right;
}

/* === 能量条 === */
.ar-energy-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ar-energy-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ar-energy-label {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: rgba(167,139,250,0.7);
    width: 28px;
    letter-spacing: 1px;
}

.ar-energy-bar {
    flex: 1;
    height: 8px;
    background: rgba(167,139,250,0.1);
    border: 1px solid rgba(167,139,250,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.ar-energy-fill {
    height: 100%;
    background: linear-gradient(90deg, #a78bfa 0%, #c084fc 100%);
    box-shadow: 0 0 10px rgba(167,139,250,0.5);
    transition: width 0.5s ease;
}

.ar-energy-value {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #a78bfa;
    width: 35px;
    text-align: right;
}

.ar-core-status {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #c084fc;
    text-shadow: 0 0 8px rgba(192,132,252,0.5);
    animation: arBlink 2s ease-in-out infinite;
}

/* === 预警徽章 === */
.ar-alert-badge {
    color: #f472b6;
    font-weight: bold;
    animation: arPulse 1.5s ease-in-out infinite;
}

/* === 监控额外信息 === */
.ar-monitor-extra {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(167,139,250,0.2);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ar-monitor-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
}

.ar-monitor-icon {
    font-size: 10px;
}

.ar-monitor-label {
    flex: 1;
    color: rgba(255,255,255,0.6);
}

.ar-monitor-value {
    color: #a78bfa;
    font-weight: bold;
}

.ar-monitor-value.warning {
    color: #f472b6;
    animation: arPulse 1.5s ease-in-out infinite;
}

/* === 队列额外信息 === */
.ar-queue-extra {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(167,139,250,0.2);
    display: flex;
    gap: 16px;
}

.ar-queue-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
}

.ar-queue-icon {
    font-size: 10px;
}

.ar-queue-label {
    color: rgba(255,255,255,0.6);
}

.ar-queue-value {
    color: #a78bfa;
    font-weight: bold;
}

.ar-queue-value.warning {
    color: #f472b6;
}

/* === 成本内容 === */
.ar-cost-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ar-cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Courier New', monospace;
}

.ar-cost-row.highlight {
    padding-top: 8px;
}

.ar-cost-label {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
}

.ar-cost-value {
    font-size: 12px;
    font-weight: bold;
}

.ar-cost-value.positive {
    color: #c084fc;
    text-shadow: 0 0 8px rgba(192,132,252,0.5);
}

.ar-cost-value.negative {
    color: #e879f9;
}

.ar-cost-divider {
    height: 1px;
    background: rgba(167,139,250,0.2);
    margin: 4px 0;
}

/* === 底部预算文本 === */
.ar-budget-text {
    color: rgba(255,255,255,0.8);
}

.ar-budget-text span {
    color: #a78bfa;
    font-weight: bold;
}

/* === 角落装饰 === */
.ar-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid rgba(167,139,250,0.4);
    z-index: 90;
    pointer-events: none;
}

.ar-corner-tl {
    top: 5px;
    left: 5px;
    border-right: none;
    border-bottom: none;
}

.ar-corner-tr {
    top: 5px;
    right: 5px;
    border-left: none;
    border-bottom: none;
}

.ar-corner-bl {
    bottom: 5px;
    left: 5px;
    border-right: none;
    border-top: none;
}

.ar-corner-br {
    bottom: 5px;
    right: 5px;
    border-left: none;
    border-top: none;
}

/* === 动画 === */
@keyframes arPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes arBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* === 悬停效果 === */
.ar-hud-panel:hover .ar-panel-frame {
    border-color: rgba(167,139,250,0.8);
    box-shadow: 
        0 0 40px rgba(167,139,250,0.3),
        inset 0 0 30px rgba(167,139,250,0.1);
}

/* === 响应式 === */
@media (max-width: 1600px) {
    .ar-hud-panel {
        transform: perspective(800px) rotateY(10deg) scale(0.85);
    }
    
    .ar-hud-right {
        transform: perspective(800px) rotateY(-10deg) scale(0.85);
    }
}

@media (max-width: 1400px) {
    .ar-hud-panel {
        transform: perspective(800px) rotateY(8deg) scale(0.75);
    }
    
    .ar-hud-right {
        transform: perspective(800px) rotateY(-8deg) scale(0.75);
    }
    
    .ar-hud-top-bar,
    .ar-hud-bottom-bar {
        transform: translateX(-50%) scale(0.8);
    }
}

@media (max-width: 1200px) {
    .ar-hud-panel.ar-hud-bottom {
        display: none;
    }
    
    .ar-hud-bottom-bar {
        display: none;
    }
}

@media (max-width: 1000px) {
    .ar-hud-panel {
        display: none;
    }
    
    .ar-hud-top-bar {
        display: none;
    }
    
    .ar-corner {
        display: none;
    }
}

/* ========================================
   四维度大弹窗（点击 HUD 卡片打开）
   ======================================== */
.dimension-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    --dimension-overlay-bg: rgba(0, 0, 0, 0.6);
    --dimension-card-bg: linear-gradient(180deg, rgba(30, 25, 50, 0.98) 0%, rgba(20, 18, 35, 0.98) 100%);
    --dimension-card-border: rgba(167, 139, 250, 0.35);
    --dimension-divider: rgba(167, 139, 250, 0.25);
    --dimension-card-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    --dimension-tab-text: #a78bfa;
    --dimension-tab-hover-bg: rgba(167, 139, 250, 0.15);
    --dimension-tab-hover-text: #e9d5ff;
    --dimension-tab-active-bg: rgba(167, 139, 250, 0.25);
    --dimension-tab-active-text: #ffffff;
    --dimension-title: #e9d5ff;
    --dimension-text: #d1d5db;
    --dimension-muted: #9ca3af;
    --dimension-faint: #6b7280;
    --dimension-input-bg: rgba(0, 0, 0, 0.3);
    --dimension-input-border: rgba(167, 139, 250, 0.4);
    --dimension-input-text: #e9d5ff;
    --dimension-btn-bg: rgba(167, 139, 250, 0.4);
    --dimension-btn-hover-bg: rgba(167, 139, 250, 0.5);
    --dimension-btn-border: rgba(167, 139, 250, 0.6);
    --dimension-btn-text: #ffffff;
    --dimension-btn-small-bg: rgba(167, 139, 250, 0.3);
    --dimension-btn-small-border: rgba(167, 139, 250, 0.5);
    --dimension-btn-small-text: #e9d5ff;
    --dimension-list-divider: rgba(167, 139, 250, 0.2);
    --dimension-list-hover: rgba(167, 139, 250, 0.2);
    --dimension-table-header-bg: rgba(167, 139, 250, 0.08);
    --dimension-link: #c4b5fd;
    --dimension-scrollbar-track: rgba(255, 255, 255, 0.06);
    --dimension-scrollbar-thumb: rgba(167, 139, 250, 0.35);
    --dimension-chart-axis: #cbd5e1;
    --dimension-chart-grid: rgba(255, 255, 255, 0.12);
    --dimension-chart-cpu: #60a5fa;
    --dimension-chart-memory: #a3e635;
    --dimension-chart-pause: #f87171;
    --dimension-chart-resume: #4ade80;
    --dimension-tooltip-bg: rgba(15, 23, 42, 0.92);
    --dimension-tooltip-border: rgba(167, 139, 250, 0.35);
    --dimension-surface-bg: rgba(255, 255, 255, 0.04);
    --dimension-surface-border: rgba(255, 255, 255, 0.08);
    --dimension-surface-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --dimension-focus-ring: 0 0 0 3px rgba(167, 139, 250, 0.18);
    background: var(--dimension-overlay-bg);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dimension-modal-overlay.open {
    display: flex;
    animation: dimensionModalFadeIn 0.18s ease-out;
}
.dimension-modal-content {
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    background: var(--dimension-card-bg);
    border: 1px solid var(--dimension-card-border);
    border-radius: 12px;
    box-shadow: var(--dimension-card-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: dimensionModalRiseIn 0.22s ease-out;
}
.dimension-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--dimension-divider);
    flex-shrink: 0;
}
.dimension-modal-tabs {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.dimension-modal-tabs::-webkit-scrollbar { display: none; }
.dimension-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--dimension-tab-text);
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.dimension-tab:hover {
    background: var(--dimension-tab-hover-bg);
    color: var(--dimension-tab-hover-text);
}
.dimension-tab.active {
    background: var(--dimension-tab-active-bg);
    color: var(--dimension-tab-active-text);
}
.dimension-tab:focus-visible,
.dimension-modal-close:focus-visible,
.dimension-btn:focus-visible,
.dimension-btn-small:focus-visible,
.dimension-form-block input:focus-visible,
.dimension-form-block select:focus-visible,
.dimension-table input:focus-visible {
    outline: none;
    box-shadow: var(--dimension-focus-ring);
}
.dimension-modal-close {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--dimension-tab-text);
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.18s ease, color 0.18s ease;
}
.dimension-modal-close:hover {
    background: var(--dimension-tab-hover-bg);
    color: var(--dimension-tab-active-text);
}
.dimension-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.dimension-modal-body::-webkit-scrollbar,
.dimension-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.dimension-modal-body::-webkit-scrollbar-track,
.dimension-list::-webkit-scrollbar-track {
    background: var(--dimension-scrollbar-track);
    border-radius: 999px;
}
.dimension-modal-body::-webkit-scrollbar-thumb,
.dimension-list::-webkit-scrollbar-thumb {
    background: var(--dimension-scrollbar-thumb);
    border-radius: 999px;
}
.dimension-tab-panel {
    display: none;
}
.dimension-tab-panel.active {
    display: block;
}
.dimension-tab-panel h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--dimension-title);
}
.dimension-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.dimension-card-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.dimension-stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 112px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--dimension-surface-border);
    background: var(--dimension-surface-bg);
    box-shadow: var(--dimension-surface-shadow);
    position: relative;
    overflow: hidden;
}
.dimension-stat-card::after {
    content: '';
    position: absolute;
    inset: auto -24px -24px auto;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--dimension-card-border) 18%, transparent);
    pointer-events: none;
}
.dimension-stat-card.is-info { border-color: color-mix(in srgb, var(--dimension-chart-cpu) 40%, transparent); }
.dimension-stat-card.is-success { border-color: color-mix(in srgb, var(--dimension-chart-memory) 38%, transparent); }
.dimension-stat-card.is-warning { border-color: color-mix(in srgb, var(--dimension-chart-resume) 28%, var(--dimension-card-border)); }
.dimension-stat-card.is-danger { border-color: color-mix(in srgb, var(--dimension-chart-pause) 45%, transparent); }
.dimension-stat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.dimension-stat-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dimension-muted);
}
.dimension-stat-chip {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--dimension-card-border) 80%, transparent);
    background: color-mix(in srgb, var(--dimension-surface-bg) 85%, transparent);
    color: var(--dimension-muted);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.dimension-stat-value {
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1;
    color: var(--dimension-title);
    font-variant-numeric: tabular-nums;
}
.dimension-stat-card-project .dimension-stat-value {
    font-size: clamp(14px, 1.6vw, 20px);
    line-height: 1.18;
    letter-spacing: -0.01em;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}
.dimension-stat-meta {
    font-size: 12px;
    line-height: 1.4;
    color: var(--dimension-text);
    max-width: 14ch;
}
.dimension-stat-card-project .dimension-stat-meta {
    max-width: none;
}
.dimension-section-card {
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--dimension-surface-border);
    background: var(--dimension-surface-bg);
    box-shadow: var(--dimension-surface-shadow);
}
.dimension-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.dimension-section-title {
    margin: 0;
    font-size: 15px;
    color: var(--dimension-title);
}
.dimension-section-desc {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--dimension-muted);
}
.dimension-section-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dimension-placeholder {
    color: var(--dimension-muted);
    font-size: 14px;
}
.dimension-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--dimension-faint);
}
.dimension-resource-bars p,
.dimension-meta {
    margin: 6px 0;
    color: var(--dimension-text);
    font-size: 14px;
}
.dimension-tab-panel a {
    color: var(--dimension-link);
}
.dimension-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
    color: var(--dimension-text);
}
.dimension-table th,
.dimension-table td {
    border: 1px solid var(--dimension-card-border);
    padding: 8px 12px;
    text-align: left;
}
.dimension-table th {
    color: var(--dimension-title);
    background: var(--dimension-table-header-bg);
}
.dimension-form-block { margin: 16px 0; }
.dimension-form-block label { display: block; margin: 8px 0; color: var(--dimension-text); }
.dimension-form-block input[type="number"],
.dimension-form-block input[type="text"],
.dimension-form-block input[type="date"],
.dimension-form-block select,
.dimension-table input[type="number"] {
    margin-left: 8px;
    min-height: 38px;
    padding: 8px 12px;
    background: var(--dimension-input-bg);
    border: 1px solid var(--dimension-input-border);
    color: var(--dimension-input-text);
    border-radius: 10px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.dimension-control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.dimension-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--dimension-text);
}
.dimension-field > span {
    font-size: 12px;
    color: var(--dimension-muted);
}
.dimension-field input,
.dimension-field select {
    width: 100%;
    margin-left: 0;
}
.dimension-field-checkbox {
    justify-content: flex-end;
}
.dimension-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 2px;
    color: var(--dimension-text);
}
.dimension-checkbox input {
    margin: 0;
}
.dimension-input-compact {
    width: 100%;
    min-width: 96px;
}
.dimension-action-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.dimension-btn {
    min-height: 38px;
    padding: 8px 16px;
    margin-top: 8px;
    background: var(--dimension-btn-bg);
    border: 1px solid var(--dimension-btn-border);
    color: var(--dimension-btn-text);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}
.dimension-btn:hover { background: var(--dimension-btn-hover-bg); transform: translateY(-1px); }
.dimension-btn:disabled,
.dimension-btn-small:disabled {
    opacity: 0.7;
    cursor: progress;
}
.dimension-btn[data-state="success"] {
    border-color: color-mix(in srgb, var(--dimension-chart-resume) 45%, transparent);
}
.dimension-btn[data-state="error"] {
    border-color: color-mix(in srgb, var(--dimension-chart-pause) 45%, transparent);
}
.dimension-btn-small {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 12px;
    background: var(--dimension-btn-small-bg);
    border: 1px solid var(--dimension-btn-small-border);
    color: var(--dimension-btn-small-text);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}
.dimension-btn-small:hover { transform: translateY(-1px); }
.dimension-list { list-style: none; padding: 0; margin: 8px 0; max-height: 320px; overflow-y: auto; }
.dimension-list-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--dimension-list-divider);
    color: var(--dimension-text);
    font-size: 13px;
}
.dimension-list-item-grid {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.dimension-list-item[draggable="true"] { cursor: grab; }
.dimension-list-item[draggable="true"]:active { cursor: grabbing; }
.dimension-item-main {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
}
.dimension-item-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.dimension-item-title {
    font-size: 13px;
    color: var(--dimension-title);
    word-break: break-all;
}
.dimension-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 12px;
    color: var(--dimension-muted);
}
.dimension-item-desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--dimension-text);
    word-break: break-word;
}
.dimension-inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.dimension-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--dimension-card-border);
    background: color-mix(in srgb, var(--dimension-card-border) 22%, transparent);
}
.dimension-status-badge.is-success {
    border-color: color-mix(in srgb, var(--dimension-chart-memory) 50%, transparent);
}
.dimension-status-badge.is-info {
    border-color: color-mix(in srgb, var(--dimension-chart-cpu) 50%, transparent);
}
.dimension-status-badge.is-warning {
    border-color: color-mix(in srgb, var(--dimension-chart-resume) 38%, transparent);
}
.dimension-status-badge.is-danger {
    border-color: color-mix(in srgb, var(--dimension-chart-pause) 55%, transparent);
}
.dimension-drag-handle {
    cursor: grab;
    margin-right: 2px;
    color: var(--dimension-muted);
    user-select: none;
}
.dimension-list-item.dimension-drag-over { background: var(--dimension-list-hover); border-radius: 4px; }
.dimension-stats-row { margin: 12px 0; }
.dimension-chart-legend { font-size: 12px; color: var(--dimension-muted); margin-top: 8px; }
.dimension-chart-container { width: 100%; height: 220px; margin-top: 8px; }
.dimension-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.dimension-links-row a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--dimension-card-border);
    background: color-mix(in srgb, var(--dimension-card-border) 14%, transparent);
    text-decoration: none;
}
.dimension-empty-state {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border-radius: 14px;
    border: 1px dashed var(--dimension-card-border);
    background: color-mix(in srgb, var(--dimension-surface-bg) 80%, transparent);
    color: var(--dimension-muted);
    text-align: center;
}
.dimension-empty-state strong {
    color: var(--dimension-title);
}
.ar-hud-panel {
    cursor: pointer;
}

@keyframes dimensionModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes dimensionModalRiseIn {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
    .dimension-modal-content {
        max-width: min(100%, 760px);
    }

    .dimension-list-item-grid {
        flex-direction: column;
    }

    .dimension-inline-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .dimension-modal-overlay {
        padding: 10px;
    }

    .dimension-modal-header,
    .dimension-modal-body {
        padding: 14px;
    }

    .dimension-modal-content {
        max-height: 92vh;
        border-radius: 14px;
    }

    .dimension-control-grid,
    .dimension-card-grid,
    .dimension-card-grid-compact {
        grid-template-columns: 1fr;
    }

    .dimension-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .dimension-action-row {
        justify-content: stretch;
    }

    .dimension-action-row .dimension-btn {
        width: 100%;
    }
}

/* 创编待允许（/dispatch 侧栏，与 dispatch_console 数据同源） */
.creative-pending-panel {
    margin: 8px 12px 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.06);
    max-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.creative-pending-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #1f1f1f;
}
.creative-pending-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 0 6px;
    height: 22px;
    border-radius: 11px;
    background: #e6f4ff;
    color: #1677ff;
    font-size: 12px;
}
.creative-pending-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.creative-pending-empty {
    font-size: 12px;
    color: #8c8c8c;
    padding: 4px 0;
}
.creative-pending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
}
.creative-pending-item-main {
    min-width: 0;
    flex: 1;
}
.creative-pending-item-title {
    font-size: 12px;
    font-weight: 500;
    color: #262626;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.creative-pending-item-meta {
    font-size: 11px;
    color: #8c8c8c;
    margin-top: 2px;
}
.creative-allowing-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.4;
    vertical-align: middle;
    border-radius: 4px;
    background: rgba(22, 119, 255, 0.12);
    color: #1677ff;
}
.creative-pending-item .btn-sm {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 12px;
}
.creative-pending-item .btn-sm[data-busy="true"],
.creative-pending-item .btn-sm:disabled {
    opacity: 0.65;
    cursor: progress;
}

/* 创编待允许头部的「批量管理」小按钮：压低权重，不抢"允许入队"的主操作注意力 */
.creative-pending-head {
    gap: 8px;
}
.creative-pending-batch-btn {
    padding: 3px 10px;
    font-size: 11px;
    line-height: 1.4;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    color: #555;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    margin-left: auto;
}
.creative-pending-batch-btn:hover {
    background: rgba(22, 119, 255, 0.06);
    border-color: rgba(22, 119, 255, 0.4);
    color: #1677ff;
}

/* ========================================
   创编待允许 · 批量管理弹层
   复用 batch-manage 视觉基调（modal-large / 工具栏 / 表格），
   只对容器尺寸和空态/列宽做独立收束。
   ======================================== */
.modal-content.creative-batch-modal-content {
    width: min(1100px, calc(100vw - 64px));
    min-width: 0;
    max-width: min(1100px, calc(100vw - 64px));
    max-height: min(88vh, 820px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
}
.creative-batch-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    overflow: hidden;
}
.creative-batch-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 auto;
}
.creative-batch-toolbar-primary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.creative-batch-workflow-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
}
.creative-batch-label-text {
    white-space: nowrap;
}
.creative-batch-workflow-select {
    min-width: 200px;
}
.creative-batch-search-input {
    flex: 1 1 240px;
    min-width: 200px;
}
.creative-batch-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}
.creative-batch-summary {
    font-size: 12px;
    color: #777;
    padding: 0 2px;
    flex: 0 0 auto;
}
.creative-batch-table-wrap {
    flex: 1 1 auto;
    overflow: auto;
    border: 1px solid #eeeaf6;
    border-radius: 8px;
    background: #ffffff;
}
.creative-batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.creative-batch-table thead th {
    position: sticky;
    top: 0;
    background: #faf8ff;
    color: #555;
    font-weight: 600;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #eeeaf6;
    z-index: 1;
    white-space: nowrap;
}
.creative-batch-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #f4f0fa;
    vertical-align: middle;
}
.creative-batch-table tbody tr:last-child td {
    border-bottom: none;
}
.creative-batch-table tbody tr:hover {
    background: rgba(124, 77, 255, 0.04);
}
.creative-batch-table .col-select {
    width: 36px;
    text-align: center;
}
.creative-batch-row-title {
    font-weight: 500;
    color: #1f1a3a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}
.creative-batch-row-taskid {
    font-size: 11px;
    color: #8f8aa8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}
.creative-batch-empty {
    text-align: center;
    padding: 28px 0;
    color: #999;
    font-size: 13px;
}
.creative-batch-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #eeeaf6;
    background: #fafafa;
    flex: 0 0 auto;
}
.creative-batch-footer-selected {
    font-size: 12px;
    color: #555;
}
.creative-batch-row-allow[data-busy="true"],
.creative-batch-row-allow:disabled {
    opacity: 0.65;
    cursor: progress;
}
