/**
 * 素材市场主样式
 * 符合代码规范：<400行
 * 与项目面板保持统一的深色主题风格
 */

/* 素材市场主面板 */
.material-market-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

/* 素材市场布局 - 融合一体容器 */
.material-market-layout {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #141414;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px);
    position: relative;
}

.material-market-layout:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-lg);
}

/* 左侧子导航栏 - 融合样式，无独立边框 */
.material-market-sub-nav {
    width: 140px;
    min-width: 140px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md) 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    border-right: 1px solid var(--border-primary);
}

/* 导航区域分组容器 */
.sub-nav-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* 公用库区域背景色 */
.sub-nav-group-common {
    background: rgba(102, 126, 234, 0.03);
    border-radius: 0;
}

/* 虚幻库区域背景色 */
.sub-nav-group-unreal {
    background: rgba(138, 43, 226, 0.03);
    border-radius: 0;
}

/* 分隔线 */
.sub-nav-divider {
    height: 1px;
    margin: 8px 12px;
    border: none;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

/* 子导航项 */
.sub-nav-item {
    width: 100%;
    padding: 12px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    font-size: 14px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    text-align: left;
    position: relative;
}

.sub-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sub-nav-item.active {
    background: rgba(102, 126, 234, 0.15);
    color: var(--text-accent);
    font-weight: 600;
    border-left: 3px solid var(--text-accent);
}

.sub-nav-item.active::before {
    display: none;
}

.sub-nav-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sub-nav-item-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
}

.sub-nav-item:hover .sub-nav-item-icon {
    transform: scale(1.1);
}

.sub-nav-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 右侧内容区域 - 融合样式，无独立边框 */
.material-market-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
    position: relative;
    min-width: 0;
}

/* 占位内容 */
.material-market-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.material-market-placeholder .placeholder-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.material-market-placeholder .placeholder-text {
    font-size: 16px;
    color: var(--text-muted);
}

/* 库内容容器 - 使用flex布局，支持固定分页 */
.library-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 库头部 - 搜索框容器 */
.library-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 6px var(--spacing-xl);
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    flex-shrink: 0;
    z-index: 10;
    backdrop-filter: blur(20px);
}

/* 搜索容器（具体列宽与 2:1 比例见 material-category.css） */
.library-search-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    max-width: 100%;
    flex-wrap: wrap;
    width: fit-content;
    margin-left: auto;
}

/* 搜索输入框 */
.library-search-input {
    flex: 1;
    padding: 5px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 12px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.library-search-input::placeholder {
    color: var(--text-muted);
}

.library-search-input:hover {
    border-color: var(--border-secondary);
}

.library-search-input:focus {
    border-color: var(--text-accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 搜索按钮 */
.library-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.library-search-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-secondary);
    transform: translateY(-1px);
}

.library-search-btn:active {
    transform: translateY(0);
}

.library-search-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* 库主体 - 可滚动内容区域 */
.library-body {
    flex: 1;
    padding: var(--spacing-xl);
    padding-bottom: calc(var(--spacing-xl) + 72px); /* 预留 sticky 分页条空间，避免遮挡底部内容 */
    overflow-y: auto;
    overflow-x: hidden;
    background: transparent;
    min-height: 0;
    max-height: 100%;
}

/* 库占位内容 */
.library-placeholder {
    width: 100%;
    height: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.library-placeholder .placeholder-icon {
    font-size: 80px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.4;
}

.library-placeholder .placeholder-text {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.library-placeholder .placeholder-hint {
    font-size: 14px;
    color: var(--text-muted);
}

/* 滚动条样式 - 与项目面板保持一致 */
.material-market-sub-nav::-webkit-scrollbar,
.material-market-content::-webkit-scrollbar,
.library-content::-webkit-scrollbar,
.library-body::-webkit-scrollbar {
    width: 6px;
}

.material-market-sub-nav::-webkit-scrollbar-track,
.material-market-content::-webkit-scrollbar-track,
.library-content::-webkit-scrollbar-track,
.library-body::-webkit-scrollbar-track {
    background: transparent;
}

.material-market-sub-nav::-webkit-scrollbar-thumb,
.material-market-content::-webkit-scrollbar-thumb,
.library-content::-webkit-scrollbar-thumb,
.library-body::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}

.material-market-sub-nav::-webkit-scrollbar-thumb:hover,
.material-market-content::-webkit-scrollbar-thumb:hover,
.library-content::-webkit-scrollbar-thumb:hover,
.library-body::-webkit-scrollbar-thumb:hover {
    background: var(--border-secondary);
}

