/* ===============================================
   流程可视化设计系统 - Flow Visualization System
   适用于：发送消息、接收消息、发送图片、接收图片
   =============================================== */

/* -----------------------------------------------
   流程图容器
   ----------------------------------------------- */
.flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    position: relative;
    min-height: auto;
    overflow-y: auto;
}

/* 流程图标题 */
.flowchart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(13,124,255,0.15), rgba(0,210,255,0.1));
    border: 1px solid rgba(13,124,255,0.3);
    border-radius: 20px;
}

.flowchart-header-icon {
    font-size: 18px;
}

.flowchart-header-text {
    font-size: 13px;
    color: var(--text-accent);
    font-weight: 500;
    letter-spacing: 1px;
}

/* -----------------------------------------------
   流程节点 - 基础样式 (正方形)
   ----------------------------------------------- */
.flow-node {
    position: relative;
    width: 70px;
    min-height: 82px;
    height: auto;
    padding: 6px;
    background: linear-gradient(135deg, rgba(4,22,54,0.9), rgba(2,14,38,0.95));
    border: 1px solid rgba(26,77,154,0.5);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.flow-node:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(0,210,255,0.6);
    box-shadow: 0 8px 25px rgba(13,124,255,0.3), 0 0 20px rgba(0,210,255,0.2);
}

/* 节点激活状态 */
.flow-node.active {
    border-color: var(--glow-cyan);
    background: linear-gradient(135deg, rgba(13,124,255,0.25), rgba(0,210,255,0.15));
    box-shadow: 0 0 30px rgba(0,210,255,0.4), inset 0 0 20px rgba(0,210,255,0.1);
    animation: nodePulse 2s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% { box-shadow: 0 0 30px rgba(0,210,255,0.4), inset 0 0 20px rgba(0,210,255,0.1); }
    50% { box-shadow: 0 0 40px rgba(0,210,255,0.6), inset 0 0 30px rgba(0,210,255,0.2); }
}

/* 节点完成状态 */
.flow-node.done {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(0,255,170,0.15), rgba(0,200,150,0.1));
}

.flow-node.done .fn-icon svg {
    stroke: var(--success);
}

.flow-node.done .fn-name {
    color: var(--success);
}

/* 节点错误状态 */
.flow-node.error {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(255,68,68,0.15), rgba(200,50,50,0.1));
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 步骤编号 */
.step-number {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #0d7cff, #00d2ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 2px 6px rgba(13,124,255,0.5);
    border: 1px solid rgba(255,255,255,0.2);
}

.flow-node.done .step-number {
    background: linear-gradient(135deg, #00aa66, #00ffaa);
}

.flow-node.error .step-number {
    background: linear-gradient(135deg, #cc2200, #ff4444);
}

/* 完成标记 */
.done-check {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #fff;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.flow-node.done .done-check {
    opacity: 1;
    transform: scale(1);
}

/* 节点内部光晕 */
.node-glow {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: radial-gradient(circle at center, rgba(0,210,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.flow-node:hover .node-glow,
.flow-node.active .node-glow {
    opacity: 1;
}

/* 节点图标 */
.fn-icon {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fn-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: #4dd4ff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.flow-node:hover .fn-icon svg {
    transform: scale(1.1);
    stroke: #00d2ff;
}

.flow-node.active .fn-icon svg {
    stroke: #00d2ff;
    filter: drop-shadow(0 0 4px rgba(0,210,255,0.6));
}

.flow-node.done .fn-icon svg {
    stroke: #00ffaa;
}

.flow-node.error .fn-icon svg {
    stroke: #ff4444;
}

/* 节点名称 */
.fn-name {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

/* 节点副标题 */
.fn-sub {
    font-size: 9px;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.flow-node.active .fn-sub {
    color: var(--text-accent);
}

/* 节点名称 */
.fn-name {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    transition: color 0.3s ease;
}

/* 节点副标题 */
.fn-sub {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
}

.flow-node.active .fn-sub {
    color: var(--text-accent);
}

/* 处理时间 */
.fn-time {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 4px;
    font-family: 'Consolas', monospace;
}

.flow-node.active .fn-time {
    color: var(--glow-cyan);
}

/* -----------------------------------------------
   垂直箭头连接器
   ----------------------------------------------- */
.flow-arrow-v {
    position: relative;
    width: 2px;
    height: 20px;
    background: linear-gradient(180deg, 
        rgba(26,77,154,0.8) 0%, 
        rgba(13,124,255,0.6) 50%, 
        rgba(26,77,154,0.8) 100%);
}

.flow-arrow-v::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid rgba(13,124,255,0.8);
}

/* 激活状态的箭头 */
.flow-arrow-v.active {
    background: linear-gradient(180deg, 
        rgba(0,210,255,0.9) 0%, 
        var(--glow-cyan) 50%, 
        rgba(0,210,255,0.9) 100%);
    box-shadow: 0 0 10px rgba(0,210,255,0.5);
}

.flow-arrow-v.active::after {
    border-top-color: var(--glow-cyan);
}

/* -----------------------------------------------
   水平布局流程图
   ----------------------------------------------- */
.flowchart-horizontal {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 10px;
}

.flowchart-horizontal .flow-node {
    width: 140px;
    padding: 12px 10px;
}

.flowchart-horizontal .flow-arrow-h {
    position: relative;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(26,77,154,0.8) 0%, 
        rgba(13,124,255,0.6) 50%, 
        rgba(26,77,154,0.8) 100%);
    align-self: center;
}

.flowchart-horizontal .flow-arrow-h::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid rgba(13,124,255,0.8);
}

.flowchart-horizontal .flow-arrow-h.active {
    background: linear-gradient(90deg, 
        rgba(0,210,255,0.9) 0%, 
        var(--glow-cyan) 50%, 
        rgba(0,210,255,0.9) 100%);
    box-shadow: 0 0 10px rgba(0,210,255,0.5);
}

.flowchart-horizontal .flow-arrow-h.active::after {
    border-left-color: var(--glow-cyan);
}

/* -----------------------------------------------
   网格布局流程图
   ----------------------------------------------- */
.flowchart-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 15px;
}

.flowchart-grid .flow-node {
    width: auto;
}

/* -----------------------------------------------
   流程图包装器 - 用于缩放控制
   ----------------------------------------------- */
.flowchart-wrapper {
    width: 100%;
    overflow: visible;
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

/* -----------------------------------------------
   四层Flex布局流程图 - 优化版
   ----------------------------------------------- */
.flowchart-four-layer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 5px;
    position: relative;
    min-height: auto;
    align-items: center;
    transform: scale(1);
    transform-origin: top center;
    width: 100%;
    max-width: none;
}

/* 每一行容器 */
.flow-row {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    z-index: 2;
    flex-wrap: nowrap;
    width: auto;
}

.flow-bridge-row {
    min-height: 18px;
}

.flow-bridge-spacer {
    height: 2px;
    flex-shrink: 0;
}

.flow-bridge-left {
    width: 180px;
}

.receive-flow-layered .flow-row,
.image-send-layered .flow-row,
.image-receive-layered .flow-row {
    width: 100%;
    justify-content: center;
}

.receive-bridge-spacer {
    width: 452px;
}

.receive-bridge-left {
    width: 176px;
}

.receive-row-main,
.receive-row-secondary,
.receive-row-tertiary {
    min-width: 0;
}

.receive-decrypt-cluster {
    min-width: 70px;
}

.compact-flow {
    gap: 6px;
}

.compact-flow .flow-row {
    gap: 3px;
}

.compact-flow .flow-node,
.compact-flow .encrypt-label,
.compact-flow .shard-label {
    width: 64px;
    min-height: 76px;
    height: auto;
}

.compact-flow .fn-icon,
.compact-flow .encrypt-icon,
.compact-flow .shard-icon {
    width: 18px;
    height: 18px;
}

.compact-flow .fn-name,
.compact-flow .encrypt-text,
.compact-flow .shard-text {
    font-size: 10px;
    line-height: 1.15;
}

.compact-flow .fn-sub {
    font-size: 8px;
    line-height: 1.15;
}

.compact-flow .flow-arrow-h,
.compact-flow .flow-arrow-h-left {
    width: 10px;
}

.compact-flow .flow-arrow-v-down {
    height: 8px;
}

.image-send-bridge-spacer {
    width: 542px;
}

.image-send-row-main,
.image-send-row-package,
.image-send-row-tail,
.image-recv-row-main,
.image-recv-row-outer,
.image-recv-row-package,
.image-recv-row-inner {
    min-width: 0;
}

.image-recv-mid-spacer {
    width: 466px;
}

.image-recv-final-spacer {
    width: 374px;
}

/* 第二层占位元素 - 用于向右偏移对齐 */
.layer-2-spacer {
    width: 85px;
    flex-shrink: 0;
}

/* 第三层占位元素 - 用于向右偏移对齐 */
.layer-3-spacer {
    width: 0px;
    flex-shrink: 0;
}

/* 第三层整体向左偏移 */
.flow-row.layer-3 {
    margin-left: 0px;
}

/* 加密集群 - SM2和CP-ABE上下排列 */
.encrypt-cluster {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

/* 加密标签 - 无方框样式，但宽度与方框一致 */
.encrypt-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px 4px;
    background: transparent;
    border: none;
    width: 70px;
    min-height: 82px;
    height: auto;
}

.encrypt-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.encrypt-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: #4dd4ff;
    stroke-width: 1.5;
}

.encrypt-text {
    font-size: 11px;
    color: #fff;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.encrypt-label.active,
.shard-label.active {
    filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.45));
}

.encrypt-label.active .encrypt-icon svg,
.encrypt-label.active .encrypt-text,
.shard-label.active .shard-icon svg,
.shard-label.active .shard-text {
    stroke: #7ef7ff;
    color: #7ef7ff;
}

.encrypt-label.done .encrypt-icon svg,
.encrypt-label.done .encrypt-text,
.shard-label.done .shard-icon svg,
.shard-label.done .shard-text {
    stroke: #00ffaa;
    color: #00ffaa;
}

.encrypt-label.error .encrypt-icon svg,
.encrypt-label.error .encrypt-text,
.shard-label.error .shard-icon svg,
.shard-label.error .shard-text {
    stroke: #ff4d6d;
    color: #ff4d6d;
}

/* 分片集群 - 分片一和分片二上下排列 */
.shard-cluster {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* 右侧分片容器 - 只包含分片二 */
.shard-cluster-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* 分片标签 - 无方框样式，但宽度和高度与加密标签一致 */
.shard-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px 4px;
    background: transparent;
    border: none;
    width: 70px;
    min-height: 82px;
    height: auto;
}

.shard-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shard-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: #4dd4ff;
    stroke-width: 1.5;
}

.shard-text {
    font-size: 11px;
    color: #fff;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* 分支结构样式 */
.branch-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.branch-top,
.branch-bottom {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* 分支占位元素 - 用于对齐分片一和分片二 */
.branch-spacer {
    width: 70px;
    min-height: 82px;
    height: auto;
    flex-shrink: 0;
}

/* 分支连接器 */
.branch-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 16px;
    position: relative;
}

.connector-line-top {
    width: 2px;
    height: 16px;
    background: linear-gradient(180deg, 
        rgba(13, 124, 255, 0.4) 0%, 
        rgba(26, 77, 154, 0.6) 100%);
}

.connector-merge {
    width: 16px;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(26, 77, 154, 0.6) 0%, 
        rgba(13, 124, 255, 0.8) 100%);
    position: relative;
}

.connector-merge::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 5px solid rgba(13, 124, 255, 0.8);
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
}

.connector-line-bottom {
    width: 2px;
    height: 16px;
    background: linear-gradient(180deg, 
        rgba(26, 77, 154, 0.6) 0%, 
        rgba(13, 124, 255, 0.4) 100%);
}

/* 水平箭头 */
.flow-arrow-h {
    width: 12px;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(26, 77, 154, 0.8) 0%, 
        rgba(13, 124, 255, 0.6) 100%);
    position: relative;
    flex-shrink: 0;
}

.flow-arrow-h::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 5px solid rgba(13, 124, 255, 0.8);
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
}

/* 左向水平箭头 */
.flow-arrow-h-left {
    width: 12px;
    height: 2px;
    background: linear-gradient(270deg, 
        rgba(26, 77, 154, 0.8) 0%, 
        rgba(13, 124, 255, 0.6) 100%);
    position: relative;
    flex-shrink: 0;
}

.flow-arrow-h-left::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    border-right: 5px solid rgba(13, 124, 255, 0.8);
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
}

.flow-arrow-h-left.active {
    background: linear-gradient(270deg,
        rgba(0, 255, 170, 0.95) 0%,
        rgba(0, 212, 255, 0.85) 100%);
    box-shadow: 0 0 8px rgba(0, 255, 170, 0.45);
}

.flow-arrow-h-left.active::after {
    border-right-color: rgba(0, 255, 170, 0.95);
}

/* 水平长箭头 */
.flow-arrow-h-long {
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(26, 77, 154, 0.8) 0%, 
        rgba(13, 124, 255, 0.6) 100%);
    position: relative;
    flex-shrink: 0;
}

.flow-arrow-h-long::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 5px solid rgba(13, 124, 255, 0.8);
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
}

.flow-arrow-h-long.active {
    background: linear-gradient(90deg,
        rgba(0, 255, 170, 0.95) 0%,
        rgba(0, 212, 255, 0.85) 100%);
    box-shadow: 0 0 8px rgba(0, 255, 170, 0.45);
}

.flow-arrow-h-long.active::after {
    border-left-color: rgba(0, 255, 170, 0.95);
}

/* 垂直向下箭头 */
.flow-arrow-v-down {
    width: 2px;
    height: 10px;
    background: linear-gradient(180deg, 
        rgba(26, 77, 154, 0.8) 0%, 
        rgba(13, 124, 255, 0.6) 100%);
    position: relative;
    flex-shrink: 0;
}

.flow-arrow-v-down::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-top: 5px solid rgba(13, 124, 255, 0.8);
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
}

.flow-arrow-v-down.active {
    background: linear-gradient(180deg,
        rgba(0, 255, 170, 0.95) 0%,
        rgba(0, 212, 255, 0.85) 100%);
    box-shadow: 0 0 8px rgba(0, 255, 170, 0.45);
}

.flow-arrow-v-down.active::after {
    border-top-color: rgba(0, 255, 170, 0.95);
}

/* 节点集群中的小型节点 */
.encrypt-cluster .flow-node.small,
.shard-cluster .flow-node.small,
.branch-top .flow-node.small,
.branch-bottom .flow-node.small {
    width: 60px;
    height: 40px;
    padding: 3px;
}

.encrypt-cluster .flow-node.small .fn-icon,
.shard-cluster .flow-node.small .fn-icon,
.branch-top .flow-node.small .fn-icon,
.branch-bottom .flow-node.small .fn-icon {
    width: 12px;
    height: 12px;
}

.encrypt-cluster .flow-node.small .fn-name,
.shard-cluster .flow-node.small .fn-name,
.branch-top .flow-node.small .fn-name,
.branch-bottom .flow-node.small .fn-name {
    font-size: 8px;
}

/* 用户节点特殊样式 */
.flow-node.node-user {
    background: linear-gradient(135deg, rgba(13, 124, 255, 0.3), rgba(0, 210, 255, 0.2));
    border-color: rgba(0, 210, 255, 0.6);
}

/* 优化的响应式适配 */
@media (max-width: 1400px) {
    .flow-node {
        width: 65px;
        height: 65px;
    }
    .fn-name {
        font-size: 10px;
    }
}

@media (max-width: 1200px) {
    .flow-node {
        width: 60px;
        height: 60px;
    }
    .fn-name {
        font-size: 9px;
    }
    .fn-icon {
        width: 18px;
        height: 18px;
    }
}

/* -----------------------------------------------
   数据流动画
   ----------------------------------------------- */
.data-flow-line {
    position: absolute;
    width: 2px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(0,210,255,0.8) 20%, 
        rgba(0,255,200,1) 50%, 
        rgba(0,210,255,0.8) 80%, 
        transparent 100%);
    animation: dataFlow 1.5s linear infinite;
    opacity: 0;
}

.flow-node.active ~ .data-flow-line,
.flow-arrow-v.active .data-flow-line {
    opacity: 1;
}

@keyframes dataFlow {
    0% { transform: translateY(-100%); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
}

/* -----------------------------------------------
   节点分支样式
   ----------------------------------------------- */
.flow-branch {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.flow-branch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* 分支连接线 */
.flow-branch-connector {
    position: relative;
    width: 100%;
    height: 20px;
}

.flow-branch-connector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: rgba(26,77,154,0.6);
    transform: translateX(-50%);
}

.flow-branch-connector::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 25%;
    right: 25%;
    height: 2px;
    background: rgba(26,77,154,0.6);
}

/* -----------------------------------------------
   主题变体 - SNR紫色主题
   ----------------------------------------------- */
.flowchart.snr-theme .flow-node {
    border-color: rgba(170,0,255,0.4);
    background: linear-gradient(135deg, rgba(34,8,56,0.9), rgba(22,8,38,0.95));
}

.flowchart.snr-theme .flow-node:hover {
    border-color: rgba(200,125,255,0.7);
    box-shadow: 0 8px 25px rgba(170,0,255,0.3), 0 0 20px rgba(200,125,255,0.2);
}

.flowchart.snr-theme .flow-node.active {
    border-color: var(--glow-purple);
    background: linear-gradient(135deg, rgba(102,0,204,0.25), rgba(170,0,255,0.15));
    box-shadow: 0 0 30px rgba(170,0,255,0.4), inset 0 0 20px rgba(200,125,255,0.1);
    animation: nodePulseSNR 2s ease-in-out infinite;
}

@keyframes nodePulseSNR {
    0%, 100% { box-shadow: 0 0 30px rgba(170,0,255,0.4), inset 0 0 20px rgba(200,125,255,0.1); }
    50% { box-shadow: 0 0 40px rgba(170,0,255,0.6), inset 0 0 30px rgba(200,125,255,0.2); }
}

.flowchart.snr-theme .step-number {
    background: linear-gradient(135deg, #6600cc, #aa00ff);
}

.flowchart.snr-theme .flow-arrow-v {
    background: linear-gradient(180deg, 
        rgba(102,0,204,0.8) 0%, 
        rgba(170,0,255,0.6) 50%, 
        rgba(102,0,204,0.8) 100%);
}

.flowchart.snr-theme .flow-arrow-v::after {
    border-top-color: rgba(170,0,255,0.8);
}

.flowchart.snr-theme .fn-icon svg {
    stroke: #c87dff;
}

.flowchart.snr-theme .flow-node.active .fn-icon svg {
    stroke: #c87dff;
    filter: drop-shadow(0 0 4px rgba(200,125,255,0.6));
}

.flowchart.snr-theme .flow-node.done .fn-icon svg {
    stroke: #00ffaa;
}

/* -----------------------------------------------
   主题变体 - 接收绿色主题
   ----------------------------------------------- */
.flowchart.receive-theme .flow-node.active {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(0,200,150,0.2), rgba(0,255,170,0.1));
    box-shadow: 0 0 30px rgba(0,255,170,0.3), inset 0 0 20px rgba(0,255,170,0.1);
    animation: nodePulseReceive 2s ease-in-out infinite;
}

@keyframes nodePulseReceive {
    0%, 100% { box-shadow: 0 0 30px rgba(0,255,170,0.3), inset 0 0 20px rgba(0,255,170,0.1); }
    50% { box-shadow: 0 0 40px rgba(0,255,170,0.5), inset 0 0 30px rgba(0,255,170,0.2); }
}

.flowchart.receive-theme .step-number {
    background: linear-gradient(135deg, #008844, #00cc66);
}

.flowchart.receive-theme .flow-arrow-v.active {
    background: linear-gradient(180deg, 
        rgba(0,200,150,0.9) 0%, 
        var(--success) 50%, 
        rgba(0,200,150,0.9) 100%);
    box-shadow: 0 0 10px rgba(0,255,170,0.5);
}

.flowchart.receive-theme .flow-arrow-v.active::after {
    border-top-color: var(--success);
}

.flowchart.receive-theme .fn-icon svg {
    stroke: #7da5b4;
}

.flowchart.receive-theme .flow-node.active .fn-icon svg {
    stroke: #00ffaa;
    filter: drop-shadow(0 0 4px rgba(0,255,170,0.6));
}

.flowchart.receive-theme .flow-node.done .fn-icon svg {
    stroke: #00ffaa;
}

/* -----------------------------------------------
   状态标签
   ----------------------------------------------- */
.node-status-tag {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px;
    font-size: 9px;
    border-radius: 10px;
    background: rgba(0,0,0,0.6);
    border: 1px solid currentColor;
    white-space: nowrap;
}

.node-status-tag.waiting {
    color: var(--text-dim);
    border-color: rgba(90,130,180,0.5);
}

.node-status-tag.processing {
    color: var(--glow-cyan);
    border-color: rgba(0,210,255,0.5);
    animation: tagPulse 1s ease-in-out infinite;
}

.node-status-tag.completed {
    color: var(--success);
    border-color: rgba(0,255,170,0.5);
}

.node-status-tag.error {
    color: var(--danger);
    border-color: rgba(255,68,68,0.5);
}

@keyframes tagPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* -----------------------------------------------
   进度指示器
   ----------------------------------------------- */
.flow-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 15px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 20px;
}

.flow-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(90,130,180,0.4);
    transition: all 0.3s ease;
}

.flow-progress-dot.active {
    background: var(--glow-cyan);
    box-shadow: 0 0 10px var(--glow-cyan);
}

.flow-progress-dot.completed {
    background: var(--success);
}

.flow-progress-dot.error {
    background: var(--danger);
}

/* -----------------------------------------------
   响应式适配
   ----------------------------------------------- */
@media (max-width: 1200px) {
    .flowchart-horizontal {
        flex-direction: column;
    }
    
    .flowchart-horizontal .flow-arrow-h {
        width: 2px;
        height: 20px;
        transform: rotate(90deg);
    }
    
    .flowchart-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .flow-node {
        width: 180px;
        padding: 12px 14px;
    }
    
    .flowchart-grid {
        grid-template-columns: 1fr;
    }
    
    .flow-branch {
        flex-direction: column;
        align-items: center;
    }
}

/* -----------------------------------------------
   打印样式
   ----------------------------------------------- */
@media print {
    .flow-node {
        break-inside: avoid;
        border: 1px solid #ccc;
        background: #fff;
        color: #000;
    }
    
    .flow-arrow-v,
    .flow-arrow-h {
        background: #ccc;
    }
}
