/* 快速风格和预设选择器样式 */

.quick-select-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    background-color: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.quick-select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.quick-select-header h4 {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    color: var(--text-color);
}

.view-more-btn {
    font-size: 0.85rem;
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.view-more-btn:hover {
    background-color: rgba(139, 92, 246, 0.1);
}

.quick-styles-grid,
.quick-presets-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    width: 100%;
}

.quick-style-item,
.quick-preset-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.quick-style-item:hover,
.quick-preset-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.quick-style-item.active,
.quick-preset-item.active {
    border-color: var(--primary-color);
}

.quick-style-image,
.quick-preset-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
    position: relative;
}

.quick-style-image img,
.quick-preset-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.quick-style-item:hover .quick-style-image img,
.quick-preset-item:hover .quick-preset-image img {
    transform: scale(1.05);
}

.quick-style-name,
.quick-preset-name {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    background-color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-style-item.active::after,
.quick-preset-item.active::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome";
    font-weight: 900;
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--primary-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 移动端横向布局样式 */
.mobile-quick-select-row {
    display: none; /* 默认隐藏，通过JS在移动端显示 */
}

@media (max-width: 768px) {
    /* 显示移动端布局 - 每个面板只显示相应的快速选择 */
    .mobile-quick-select-row {
        display: block !important; /* 强制显示 */
        gap: 0.75rem;
        margin-bottom: 1rem;
        width: 100%;
        overflow: visible !important; /* 确保内容可见 */
    }
    
    .mobile-quick-select-row .quick-select-container {
        flex: 1;
        margin-bottom: 0;
        padding: 0.6rem;
        min-width: 0; /* 允许flex子元素收缩 */
        width: 100%; /* 单个容器占满宽度 */
    }
    
    .mobile-quick-select-row .quick-select-header {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .mobile-quick-select-row .quick-select-header h4 {
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .mobile-quick-select-row .view-more-btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
        white-space: nowrap;
    }
    
    .mobile-quick-select-row .quick-styles-grid,
    .mobile-quick-select-row .quick-presets-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        grid-template-rows: auto !important;
        gap: 4px !important;
    }
    
    .mobile-quick-select-row .quick-style-item,
    .mobile-quick-select-row .quick-preset-item {
        min-width: 0; /* 确保项目能够收缩 */
    }
    
    .mobile-quick-select-row .quick-style-image,
    .mobile-quick-select-row .quick-preset-image {
        height: 50px;
    }
    
    .mobile-quick-select-row .quick-style-name,
    .mobile-quick-select-row .quick-preset-name {
        font-size: 0.7rem;
        padding: 0.3rem 0.1rem;
    }
    
    /* 在移动端通过JS控制隐藏原始容器 */
}

@media (max-width: 480px) {
    .mobile-quick-select-row .quick-select-container {
        padding: 0.5rem;
    }
    
    .mobile-quick-select-row .quick-select-header h4 {
        font-size: 0.85rem;
    }
    
    .mobile-quick-select-row .quick-styles-grid,
    .mobile-quick-select-row .quick-presets-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        grid-template-rows: auto !important;
        gap: 4px !important;
    }
    
    .mobile-quick-select-row .quick-style-image,
    .mobile-quick-select-row .quick-preset-image {
        height: 80px;
    }
    
    .mobile-quick-select-row .quick-style-name,
    .mobile-quick-select-row .quick-preset-name {
        font-size: 0.65rem;
        padding: 0.25rem 0.05rem;
        line-height: 1.2;
    }
}

/* 桌面端正常布局 */
@media (min-width: 769px) {
    .quick-styles-grid,
    .quick-presets-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .mobile-quick-select-row {
        display: none !important;
    }
}

/* 图片放大查看模态框样式 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.active {
    display: flex;
    opacity: 1;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close-image-modal {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.close-image-modal:hover {
    background-color: #f3f3f3;
    transform: rotate(90deg);
}

.mobile-save-hint {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
}
