/* 小组件市场 & 添加面板 (Bottom Sheet Style) */

.bottom-sheet-overlay {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-sheet-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet-window {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bottom-sheet-overlay.visible .bottom-sheet-window {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    margin: 10px auto;
    flex-shrink: 0;
}

.bottom-sheet-header {
    padding: 0 20px 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.bottom-sheet-header .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.bottom-sheet-header .title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.bottom-sheet-header .close-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.bottom-sheet-header .close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

/* 搜索框 */
.search-bar-container {
    margin-bottom: 15px;
}

.search-input-wrapper {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.search-input-wrapper:focus-within {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-input-wrapper svg {
    color: #999;
}

.search-input-wrapper input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: 14px;
    outline: none;
    color: #333;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 5px;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.category-tab.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

/* 组件网格布局 */
.widget-add-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    align-content: start;
}

/* 针对不同尺寸的网格跨度 */
.widget-market-card[data-size="4x2"],
.widget-market-card[data-size="4x4"] {
    grid-column: span 2;
}

/* 优化卡片样式 */
.widget-market-card {
    background: #fff;
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.widget-market-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.widget-preview-canvas {
    border-radius: 14px;
    margin-bottom: 10px;
    background: #f8f9fa;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}

.widget-market-card .info-area {
    padding: 0 4px;
}

.widget-market-card .widget-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.widget-market-card .widget-meta {
    font-size: 11px;
    color: #999;
}
