﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    background-color: #f0f2f5;
}

h1 {
    color: #1f2937;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.input-item {
    display: flex;
    gap: 10px;
    align-items: center;
}

input[type="number"] {
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 100px;
    outline: none;
    transition: border-color 0.2s;
}

input[type="number"]:focus {
    border-color: #2563eb;
}

.controls {
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

button {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #64748b;
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

button:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.array-container {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 120px;
    margin: 30px 0;
    padding: 25px;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: 90%;
    max-width: 800px;
    justify-content: center;
}

.array-item {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: #e0e7ff;
    color: #1e293b;
    font-size: 22px;
    font-weight: bold;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 不同状态的样式 */
.array-item.highlight {
    background-color: #f97316;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(249, 115, 22, 0.3);
}

.array-item.moving {
    background-color: #8b5cf6;
    color: white;
    transform: translateX(10px);
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
}

.array-item.inserting {
    background-color: #10b981;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.array-item.deleting {
    background-color: #ef4444;
    color: white;
    transform: scale(0.9);
    opacity: 0.7;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.array-item.empty {
    background-color: #f3f4f6;
    border: 2px dashed #d1d5db;
    color: #9ca3af;
}

.status {
    font-size: 18px;
    margin-top: 20px;
    color: #374151;
    min-height: 28px;
    text-align: center;
    line-height: 1.5;
    padding: 10px 20px;
    border-radius: 8px;
    background-color: #f8fafc;
    width: 90%;
    max-width: 800px;
}

.step-indicator {
    margin-top: 15px;
    font-size: 14px;
    color: #64748b;
}