.firework-item {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
    transition: background-color 0.3s ease;
    padding: 0;
    border: none;
    border-right: 3px solid #000000;
    border-radius: 0;
    margin: 0;
    cursor: pointer;
}

.firework-item:first-child {
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
}

.firework-item:last-child {
    border-right: none;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
}

.icons-container img {
    max-width: 80% !important;
    max-height: 80% !important;
}

/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.4;
    color: #333;
    background-color: #f5f5f5;
    padding: 10px;
}

/* 整体容器 - 更紧凑的布局 */
.container {
    max-width: 100%;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.5rem;
    order: 0; /* 标题在最顶部 */
}

h2 {
    margin-bottom: 8px;
    color: #444;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
    font-size: 1.1rem;
}

/* 配置面板和预览面板 - 更紧凑的布局，改为垂直排列 */
.config-panel {
    display: flex;
    flex-direction: column; /* 改为垂直排列 */
    gap: 10px;
    margin-bottom: 10px;
    order: 3; /* 配置面板位于第四位 */
}

.config-section {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%; /* 使用全宽 */
    min-width: auto; /* 取消最小宽度限制 */
}

/* 图标选择面板 - 整体布局调整 */
.icon-selection-panel {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    overflow: hidden;
    order: 1; /* 图标选择区在第二位 */
}

.icon-selection-panel h2 {
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.icon-selection-panel h2::after {
    content: none; /* 移除之前的装饰线 */
}

/* 图标选择面板标题区 */
.icon-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 8px;
}

.icon-selection-header h2 {
    margin-bottom: 0;
    flex: 1;
    font-size: 16px;
    color: #333;
    position: relative;
}

.icon-selection-header h2::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: #2196F3;
}

/* 控制按钮容器 */
.tree-controls {
    display: flex;
    gap: 6px;
    margin-bottom: 0;
    flex-shrink: 0;
}

/* 颜色配置区调整顺序 */
.config-section:nth-of-type(1) {
    order: 0; /* 颜色配置放在第一位 */
}

/* 基本配置放在第二位 */
.config-section.basic-config-section {
    order: 1; /* 基本配置放在第二位 */
}

/* 预览面板 */
.preview-panel {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-top: 0;
    order: 4; /* 预览在最底部 */
}

.preview-container {
    background-color: #fff;
    border: none;
    border-radius: 0;
    min-height: 300px;
    height: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin: 0 auto; /* 居中显示 */
    max-width: 90%; /* 增加宽度 */
}

/* 表单组件 - 更紧凑 */
.form-group {
    margin-bottom: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.form-group label {
    width: 30%;
    margin-bottom: 0;
    font-weight: bold;
    white-space: nowrap;
    font-size: 0.9rem;
}

.form-group input[type="number"] {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    width: 60%;
    max-width: 130px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
}

.checkbox-label {
    margin-left: 6px;
    font-size: 0.9rem;
}

/* 宽度比例容器 - 更紧凑 */
.width-ratios-container {
    margin-top: 8px;
}

/* 表格布局容器 */
.table-layout-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;
}

/* 宽度比例输入项样式优化 */
.width-ratio-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 5px;
    background-color: #f5f5f5;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.width-ratio-item:hover {
    background-color: #eef5ff;
}

.width-ratio-item label {
    width: 30%;
    white-space: nowrap;
    font-size: 0.9rem;
}

.width-ratio-item input {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    width: 60%;
    max-width: 130px;
}

/* 图标数量输入项样式优化 */
.icons-count-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 5px;
    background-color: #f5f5f5;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.icons-count-item:hover {
    background-color: #eef5ff;
}

.icons-count-item label {
    width: 30%;
    white-space: nowrap;
    font-size: 0.9rem;
}

.icons-count-item input {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    width: 60%;
    max-width: 130px;
}

/* 输入框标题样式优化 */
.width-ratio-title, .icons-count-title {
    font-weight: bold;
    color: #333;
    margin-top: 5px;
    position: relative;
    padding-left: 8px;
}

.width-ratio-title:before, .icons-count-title:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: #2196F3;
    border-radius: 3px;
}

/* 描述文本样式优化 */
.width-ratio-desc, .icons-count-desc {
    margin-bottom: 15px;
    color: #666;
    font-size: 12px;
    padding-left: 8px;
}

/* 响应式调整 */
@media (max-width: 767px) {
    .table-layout-container {
        grid-template-columns: 1fr; /* 在小屏幕上改为单列 */
    }
}

/* 合并后的配置容器 */
.combined-config-container {
    margin-top: 6px;
    border: 1px solid #eee;
    padding: 8px;
    border-radius: 6px;
    background-color: #f9f9f9;
}

.combined-config-item {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #ddd;
}

.combined-config-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.combined-config-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #333;
}

.combined-config-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    gap: 6px;
}

.combined-config-label {
    width: 40%;
    font-size: 0.85rem;
}

.combined-config-inputs {
    display: flex;
    gap: 6px;
    width: 60%;
}

.combined-config-inputs input {
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    flex: 1;
}

/* 按钮样式 - 更紧凑 */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.primary-btn, .secondary-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    font-size: 14px;
    min-width: 160px;
}

.primary-btn {
    background-color: #2196F3;
    color: white;
}

.primary-btn:hover {
    background-color: #0d8bf2;
}

.secondary-btn {
    background-color: #e0e0e0;
    color: #333;
}

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

.secondary-btn:disabled {
    background-color: #cccccc;
    color: #999;
    cursor: not-allowed;
}

/* 颜色配置样式 - 更紧凑 */
.color-config {
    margin-bottom: 12px;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 8px;
}

.color-config-title {
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.color-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

.color-section {
    flex: 1;
}

.fixed-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 6px;
}

/* 色彩卡区域 - 更紧凑 */
.color-palette-area {
    margin-bottom: 10px;
}

.color-palette-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* 图标网格样式 - 改为树形结构 */
.icon-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
    padding-bottom: 10px;
    max-height: 480px; /* 调整最大高度以适应更大的图标 */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2196F3 #e0e0e0;
    width: 100%;
}

/* 自定义滚动条样式 */
.icon-grid::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.icon-grid::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 3px;
}

.icon-grid::-webkit-scrollbar-thumb {
    background-color: #2196F3;
    border-radius: 3px;
}

.icon-grid::-webkit-scrollbar-thumb:hover {
    background-color: #0d8bf2;
}

/* 树形容器 */
.tree-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
}

/* 搜索框容器 */
.tree-search-container {
    margin-bottom: 10px;
    width: 100%;
}

/* 搜索框 */
.tree-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tree-search-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

/* 控制按钮 */
.tree-control-btn {
    padding: 4px 10px;
    background-color: #f5f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
    color: #444;
}

.tree-control-btn:hover {
    background-color: #ebebeb;
    border-color: #d5d5d5;
    color: #2196F3;
}

.tree-control-btn:active {
    transform: translateY(1px);
    background-color: #e5e5e5;
}

/* 图标容器 */
.tree-icons-container {
    display: flex;
    flex-wrap: wrap;
    padding: 8px 5px;
    gap: 6px; /* 增加间距，让大图标有更好的视觉效果 */
    background-color: #fff;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    will-change: max-height, opacity, padding;
}

.tree-icons-container.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
}

/* 树形分类节点 */
.tree-category {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 8px;
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.tree-category:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tree-category:active {
    transform: translateY(1px);
}

/* 选中计数器 */
.tree-selected-count {
    margin-left: auto;
    font-size: 12px;
    color: #2196F3;
    background-color: rgba(33, 150, 243, 0.1);
    padding: 3px 8px;
    border-radius: 12px;
    display: none;
    transition: background-color 0.2s ease;
}

/* 分类标题栏 */
.tree-category-header {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    background-color: #f5f5f5;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.tree-category-header:hover {
    background-color: #eaeaea;
}

.tree-category-header:active {
    background-color: #e0e0e0;
}

/* 折叠/展开图标 */
.tree-toggle {
    font-size: 10px;
    margin-right: 10px;
    color: #555;
    width: 12px;
    height: 12px;
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tree-toggle.collapsed {
    transform: rotate(-90deg);
}

/* 分类标题 */
.tree-category-title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

/* 图标项 */
.tree-icon-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    background-color: #fff;
    width: calc(33.333% - 4px); /* 默认为三列布局 */
    box-sizing: border-box;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    height: 48px; /* 固定高度，以适应更大的图标 */
}

.tree-icon-item:hover {
    background-color: #f5f5f5;
    border-color: #e6e6e6;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tree-icon-item:active {
    transform: translateY(0);
    background-color: #f0f0f0;
}

/* 图标项被选中状态 */
.tree-icon-item.selected {
    background-color: rgba(33, 150, 243, 0.08);
    border-color: #2196F3;
    position: relative;
}

.tree-icon-item.selected::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #2196F3;
    opacity: 0.7;
}

/* 图标容器 */
.tree-icon-img-container {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 3px;
    background-color: #fafafa;
    transition: transform 0.2s ease;
    margin-right: 2px;
}

.tree-icon-item:hover .tree-icon-img-container {
    transform: scale(1.08);
}

/* 图标图片 */
.tree-icon-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: filter 0.2s ease;
}

/* 图标名称 */
.tree-icon-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    transition: color 0.2s ease;
}

.tree-icon-item:hover .tree-icon-name {
    color: #2196F3;
}

.tree-icon-item.selected .tree-icon-name {
    color: #1976D2;
    font-weight: 500;
}

/* 响应式布局 */
@media (max-width: 575px) {
    .tree-icon-item {
        width: calc(50% - 6px); /* 超小屏幕二列 */
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .tree-icon-item {
        width: calc(33.333% - 6px); /* 小屏幕三列 */
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .tree-icon-item {
        width: calc(25% - 6px); /* 中等屏幕四列 */
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .tree-icon-item {
        width: calc(20% - 6px); /* 大屏幕五列 */
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .tree-icon-item {
        width: calc(16.666% - 6px); /* 超大屏幕六列 */
    }
}

@media (min-width: 1400px) {
    .tree-icon-item {
        width: calc(14.285% - 6px); /* 特大屏幕七列 */
    }
}

/* 横屏排列模式 */
@media (min-width: 768px) {
    .config-panel {
        flex-direction: column; /* 在所有屏幕大小上保持垂直排列 */
    }
}

@media (min-width: 992px) {
    .config-panel {
        flex-direction: column;
        flex-wrap: nowrap; 
    }
    
    .config-section {
        flex: none;
        width: 100%;
    }
}

.icon-item {
    position: relative;
    width: 70px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
    border-radius: 6px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

.icon-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.icon-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.icon-name {
    font-size: 11px;
    text-align: center;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-weight: 500;
}

.icon-item.selected {
    border-color: #2196F3;
    background-color: rgba(33, 150, 243, 0.1);
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(33, 150, 243, 0.3);
}

/* 为烟花进度条容器添加样式 */
.firework-progress {
    display: flex;
    width: 100%;
    height: 300px;
    margin: 0;
    padding: 0;
    gap: 0;
    border: none;
    overflow: hidden;
    border-radius: 0;
}

/* 统一效果预览容器 */
.firework-container {
    display: flex;
    width: 100%;
    height: 300px;
    justify-content: center;
    align-items: center;
    background-color: #000000;
    border-radius: 30px;    
    border: 3px solid #000000;
    padding: 0;
    box-shadow: none;
    margin: 0;
    overflow: hidden;
}

/* 响应式布局 - 适应紧凑布局 */
@media (min-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        padding: 15px;
    }
    
    .config-panel {
        flex-direction: column;
    }
}

@media (min-width: 992px) {
    .config-panel {
        flex-direction: column;
        flex-wrap: wrap;
    }
    
    .config-section {
        flex: 1 1 250px;
    }
}

/* 色彩卡选择UI - 更紧凑 */
select {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: white;
    font-size: 0.9rem;
}

/* 修复某些浏览器中select的右侧padding */
select::-ms-expand {
    display: none;
}

/* 额外的美化样式 */
button {
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.98);
}

.icon-category {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
}

.icon-category h3 {
    font-size: 1rem;
    color: #333;
    margin: 0 0 10px 0;
    padding: 5px 0;
    border-bottom: 1px solid #ddd;
    position: relative;
}

.icon-category h3::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background-color: #536DFE;
    position: absolute;
    bottom: -1px;
    left: 0;
}

/* 图片项设置面板样式 */
.item-settings-panel {
    background-color: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    position: fixed;
    z-index: 1000;
    width: 300px;
    padding: 15px;
    animation: fade-in 0.2s ease-out;
}

/* 修改悬停提示 */
.item-settings-hint {
    position: absolute;
    top: 40px;
    right: 5px;
    background-color: rgba(33, 150, 243, 0.8);
    color: white;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 5;
}

/* 淡入动画 */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 简化配置提示样式 */
.simple-config-note {
    margin-top: 15px;
    padding: 10px;
    background-color: #e3f2fd;
    border-left: 3px solid #2196F3;
    border-radius: 4px;
}

.simple-config-note p {
    margin: 0;
    color: #333;
    font-size: 13px;
}

/* 按钮区域样式 */
.button-section {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    order: 0; /* 按钮区域放在最前面 */
}

.button-section .button-group {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* 基本配置区域中的按钮样式优化 */
.basic-config-section .button-group {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* 发射模式图标样式 */
.fire-mode-icon {
    position: absolute;
    object-fit: contain;
    z-index: 5;
    filter: none;
}

.fire-mode-value {
    position: absolute;
    color: black;
    font-weight: bold;
    text-shadow: none;
    z-index: 6;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}