/**
 * BFS/DFS遍历可视化样式
 * @author changyadai
 */

.container {
    max-width: 1100px;
    padding: 25px;
}

.nav-link {
    position: absolute;
    top: 25px;
    left: 25px;
}

/* 模式切换 */
.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    padding: 10px 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.mode-btn.active {
    background: rgba(6, 182, 212, 0.2);
    border-color: #06b6d4;
    color: #fff;
}

.mode-btn:hover:not(.active) {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* 图形面板 */
.graphs-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.graph-panel {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
}

.graph-panel.single {
    max-width: 600px;
    margin: 0 auto;
}

.panel-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent-cyan);
    margin-bottom: 10px;
}

.graph-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.graph-container svg {
    width: 100%;
    height: 280px;
    display: block;
}

/* 节点 */
.node circle {
    fill: rgba(255, 255, 255, 0.1);
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 2;
    transition: all 0.3s ease;
}

.node text {
    fill: #fff;
    font-size: 14px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: central;
}

.node.start circle {
    fill: rgba(34, 197, 94, 0.4);
    stroke: #22c55e;
    stroke-width: 3;
}

.node.current circle {
    fill: rgba(251, 191, 36, 0.5);
    stroke: #fbbf24;
    stroke-width: 3;
    animation: pulse 0.4s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}

.node.visited circle {
    fill: rgba(6, 182, 212, 0.4);
    stroke: #06b6d4;
}

.node.in-queue circle {
    fill: rgba(168, 85, 247, 0.4);
    stroke: #a855f7;
}

/* 边 */
.edge {
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 2;
}

.edge.traversed {
    stroke: #06b6d4;
    stroke-width: 3;
}

/* 数据结构显示 */
.data-structure, .visit-order {
    margin-bottom: 10px;
}

.ds-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.ds-content {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    min-height: 35px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    align-items: center;
}

.ds-item {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.3);
    border: 1px solid #a855f7;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
    animation: itemAppear 0.2s ease-out;
}

@keyframes itemAppear {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.ds-item.visited {
    background: rgba(6, 182, 212, 0.3);
    border-color: #06b6d4;
}

.ds-item.current {
    background: rgba(251, 191, 36, 0.4);
    border-color: #fbbf24;
}

/* 访问顺序箭头 */
.order-arrow {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 2px;
}
