/* ==========================================================================
   技能大厅 /skills 页面样式
   - 页面级布局（Banner / 侧栏 / 网格容器 / 分页 / 空态）镜像 prompt-market
   - 卡片本体视觉复用 common/prompt-card.css 的 .prompt-card* 基础类
   - 本文件额外定义技能专属样式：
     .prompt-card-type-tag-positioned（⚙️ 技能 徽章）
     .skill-file-count-badge（📄 N 文件数）
     .skill-card-header-bg（按名称 hash 计算的渐变背景）
   ========================================================================== */

/* 弥散光背景 */
.skill-market-glow-bg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 450px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(0, 101, 255, 0.03) 60%, transparent 100%);
    filter: blur(80px);
    pointer-events: none;
    z-index: -1;
}

/* ==========================================================================
   首屏 Banner
   ========================================================================== */
.skill-market-hero {
    position: relative;
    padding: 56px 24px 32px;
    text-align: center;
}

.skill-market-hero-title {
    font-size: 38px;
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, #0f172a 20%, #059669 60%, #0065ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skill-market-hero-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 24px;
    font-weight: 500;
}

.skill-market-search-wrapper {
    max-width: 580px;
    margin: 0 auto;
}

.skill-market-search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 99px;
    padding: 4px 4px 4px 16px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-market-search-box:focus-within {
    border-color: #0065ff;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 101, 255, 0.08), 0 10px 30px -10px rgba(0, 101, 255, 0.12);
}

.skill-market-search-icon {
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.skill-market-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: #0f172a;
    width: 100%;
    height: 32px;
    font-weight: 500;
}

.skill-market-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.skill-market-search-kbd {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 9px;
    color: #94a3b8;
    font-family: monospace;
    font-weight: 700;
    margin-right: 8px;
    pointer-events: none;
    user-select: none;
}

.skill-market-search-clear {
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s;
}

.skill-market-search-clear:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.skill-market-search-clear.active {
    visibility: visible;
    opacity: 1;
}

.skill-market-search-btn {
    background-color: #0f172a;
    color: white;
    border: none;
    border-radius: 99px;
    padding: 0 18px;
    height: 32px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.skill-market-search-btn:hover {
    background-color: #334155;
}

/* ==========================================================================
   主体布局
   ========================================================================== */
.skill-market-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px 80px;
    display: flex;
    gap: 32px;
}

.skill-market-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    align-self: flex-start;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 16px 8px 32px 4px;
}

.skill-market-sidebar::-webkit-scrollbar {
    width: 4px;
}

.skill-market-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.06);
    border-radius: 99px;
}

.skill-market-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.skill-market-sidebar-group {
    display: flex;
    flex-direction: column;
}

.skill-market-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    margin-bottom: 8px;
    padding-left: 8px;
}

/* 排序下拉框 */
.skill-market-sort-dropdown {
    position: relative;
    margin-bottom: 8px;
    padding: 0 4px;
}

.skill-market-sort-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.2s;
}

.skill-market-sort-trigger:hover {
    border-color: rgba(203, 213, 225, 0.8);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

.skill-market-sort-value::before {
    content: "⚡";
    font-size: 12px;
    margin-right: 6px;
}

.skill-market-sort-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 4px;
    right: 4px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    z-index: 10;
    display: none;
    flex-direction: column;
    padding: 4px;
    overflow: hidden;
}

.skill-market-sort-menu.active {
    display: flex;
}

.skill-market-sort-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.skill-market-sort-option:hover {
    background-color: rgba(0, 101, 255, 0.05);
    color: #0065ff;
}

.skill-market-sort-option.active {
    background-color: rgba(0, 101, 255, 0.05);
    color: #0065ff;
    font-weight: 700;
}

.skill-market-sort-check {
    opacity: 0;
    font-size: 11px;
}

.skill-market-sort-option.active .skill-market-sort-check {
    opacity: 1;
}

/* 分类列表 */
.skill-market-category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.skill-market-category-group-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #cbd5e1;
    padding: 10px 12px 4px;
    list-style: none;
}

.skill-market-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-market-category-item:hover {
    background-color: rgba(15, 23, 42, 0.03);
    color: #0f172a;
}

.skill-market-category-item.active {
    background-color: rgba(0, 101, 255, 0.05);
    color: #0065ff;
    border-color: rgba(0, 101, 255, 0.1);
    font-weight: 700;
}

.skill-market-category-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-market-category-count {
    font-size: 10px;
    color: #94a3b8;
    background-color: rgba(15, 23, 42, 0.04);
    padding: 1px 6px;
    border-radius: 99px;
    font-weight: 600;
}

.skill-market-category-item.active .skill-market-category-count {
    background-color: rgba(0, 101, 255, 0.12);
    color: #0065ff;
}

/* 移动端横向滑动分类栏 */
.skill-market-mobile-category-bar {
    display: none;
    margin-bottom: 16px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
}

.skill-market-mobile-category-bar::-webkit-scrollbar {
    display: none;
}

.skill-market-mobile-category-bar .skill-market-category-item {
    display: inline-flex;
    margin-right: 6px;
    padding: 5px 12px;
    border-radius: 99px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background-color: #ffffff;
}

.skill-market-mobile-category-bar .skill-market-category-item.active {
    border-color: rgba(0, 101, 255, 0.2);
}

/* ==========================================================================
   右侧内容区
   ========================================================================== */
.skill-market-content {
    flex: 1;
    min-width: 0;
}

.skill-market-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.skill-market-result-count {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

.skill-market-result-count span {
    color: #0f172a;
    font-weight: 700;
}

.skill-market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.skill-market-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.4);
    border: 1px dashed rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    font-size: 14px;
    color: #94a3b8;
}

/* ==========================================================================
   无限滚动底部区
   ========================================================================== */
.skill-market-load-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    min-height: 48px;
}

.skill-market-load-more[hidden] {
    display: none !important;
}

.skill-market-sentinel {
    width: 100%;
    height: 1px;
    pointer-events: none;
}

.skill-market-load-more-btn {
    border: 1px solid rgba(226, 232, 240, 0.8);
    background-color: #ffffff;
    color: #475569;
    min-width: 120px;
    height: 36px;
    padding: 0 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.skill-market-load-more-btn:hover:not(:disabled) {
    border-color: #0065ff;
    color: #0065ff;
    background-color: rgba(0, 101, 255, 0.05);
}

.skill-market-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.skill-market-load-more-btn[hidden],
.skill-market-load-more-hint[hidden] {
    display: none !important;
}

.skill-market-load-more-hint {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
}

/* ==========================================================================
   技能卡片专属样式（在 .prompt-card* 基础上扩展）
   ========================================================================== */

/* 左上角「⚙️ 技能」类型徽章（毛玻璃拟态） */
.prompt-card-type-tag-positioned {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #475569;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

/* 卡片头部渐变背景容器（SkillShareDTO 无 themeColor，由 JS 按名称 hash 计算） */
.skill-card-header-bg {
    background: linear-gradient(135deg, #0065ff 0%, #0052cc 100%);
}

/* 文件数量徽章 */
.skill-file-count-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    color: #64748b;
    background-color: #f1f5f9;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
}

.skill-file-count-badge svg {
    color: #94a3b8;
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 992px) {
    .skill-market-container {
        flex-direction: column;
        gap: 0;
        padding-top: 0;
    }

    .skill-market-sidebar {
        display: none;
    }

    .skill-market-mobile-category-bar {
        display: flex;
    }

    .skill-market-hero {
        padding: 40px 16px 20px;
    }

    .skill-market-hero-title {
        font-size: 30px;
    }
}

@media (max-width: 640px) {
    .skill-market-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .skill-market-content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}
