:root {
    /* 主色调 - 青绿色系 */
    --primary-50: #f0fdfa;
    --primary-100: #ccfbf1;
    --primary-500: #14b8a6;
    --primary-600: #0d9488;
    --primary-700: #0f766e;
    
    /* 辅助色 - 青色 */
    --accent-500: #06b6d4;
    --accent-600: #0891b2;
    
    /* 中性灰阶 - 明亮中性灰 */
    --gray-50: #ffffff;
    --gray-100: #ffffff;
    --gray-200: #e5e5e5;
    --gray-300: #dddddd;
    --gray-400: #aaaaaa;
    --gray-500: #777777;
    --gray-600: #555555;
    --gray-700: #333333;
    --gray-800: #222222;
    --gray-900: #111111;
    
    /* 功能色 */
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333333;
    min-height: 100vh;
    overflow-y: auto;
}

/* 确保滚动条始终显示 */
html {
    overflow-y: scroll;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px 24px;
}

/* 内容区域底部间距 */
#content {
    margin-bottom: 32px;
}

.header {
    margin-bottom: 32px;
    padding: 24px 32px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #eeeeee;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.01);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.header-logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo {
    width: 160px;
    height: auto;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.logo-link:hover .header-logo {
    opacity: 0.8;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #222222;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-number {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-500);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-weight: 500;
}

.demo-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: #555555;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #eeeeee;
    transition: all 0.2s ease;
}

.demo-link:hover {
    background: #ffffff;
    color: #555555;
    border-color: var(--gray-300);
}

.category {
    background: #ffffff;
    border-radius: 20px;
    margin-bottom: 32px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.01);
    border: 1px solid var(--gray-200);
}

.category-header {
    background: #ffffff;
    color: var(--gray-800);
    padding: 20px 28px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    border-bottom: 1px solid var(--gray-300);
    display: flex;
    align-items: center;
}

.category-header i {
    color: var(--primary-500);
    width: 24px;
    text-align: center;
}

.category-count {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-500) 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 12px;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3);
}

.libraries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    padding: 20px;
}

.library-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.library-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.01);
    transform: translateY(-2px);
    border-color: var(--gray-300);
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.library-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

/* 版本选择器容器 */
.library-version-selector {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 版本选择下拉菜单 - 优化样式 (已注释，使用 .library-version-select 替代) */
/*
.version-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #4a5568;
    color: #ffffff;
    border: 1px solid #4a5568;
    border-radius: 6px;
    padding: 6px 28px 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    min-width: 90px;
    height: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

.version-select:hover {
    background: #2d3748;
    border-color: #2d3748;
}

.version-select:focus {
    border-color: #2d3748;
}

.version-select option {
    background: #4a5568;
    color: #ffffff;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 400;
}

.version-select option:hover {
    background: #2d3748;
}

.version-select option:checked {
    background: #2d3748;
    color: #ffffff;
    font-weight: 500;
}

.version-select option:first-child {
    border-radius: 4px 4px 0 0;
}

.version-select option:last-child {
    border-radius: 0 0 4px 4px;
}
*/

/* 原来的版本标签样式保留，用于向后兼容 */
.library-version {
    background: #ffffff;
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.library-description {
    color: #555555;
    font-size: 0.875rem;
    margin-bottom: 12px;
    line-height: 1.5;
    font-weight: 400;
    min-height: 2.625em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
}

.library-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tag {
    background: #ffffff;
    color: #555555;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
}

.tag:hover {
    background: #ffffff;
    color: #333333;
}

.files-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.files-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    border: 1px solid #eeeeee;
}

.file-item:hover {
    background: #ffffff;
    border-color: var(--gray-300);
    transform: translateX(1px);
}

.file-path {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.75rem;
    color: #333333;
    flex: 1;
    word-break: break-all;
    margin-right: 10px;
    font-weight: 450;
}

.copy-btn {
    background: var(--primary-500);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--primary-600);
    transform: translateY(-1px);
}

.copy-btn.copied {
    background: #059669;
}

.loading {
    text-align: center;
    color: #555555;
    font-size: 1.1rem;
    margin-top: 60px;
    font-weight: 400;
}

.error {
    background: #fed7d7;
    color: #742a2a;
    padding: 16px;
    border-radius: 6px;
    text-align: center;
    margin: 20px auto;
    max-width: 600px;
    border: 1px solid #feb2b2;
}

@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }
    
    .header {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
    }
    
    .header-main {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .header-logo-title {
        flex-direction: column;
        gap: 8px;
    }
    
    .header-logo {
        width: 140px;
        height: auto;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .header-stats {
        gap: 24px;
    }
    
    .libraries-grid {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }
    
    .library-card {
        padding: 16px;
    }
}

.footer {
    background: #ffffff;
    border-top: 1px solid var(--gray-300);
    margin-top: 0;
    padding: 32px 0;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
    color: #555555;
}

.footer-content p {
    margin: 8px 0;
    font-size: 0.875rem;
    font-weight: 400;
}

/* 顶部导航 */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--gray-300);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.01);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 16px;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo-img {
    width: 160px;
    height: auto;
    object-fit: contain;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333333;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-500);
    transition: all 0.25s ease;
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--primary-500);
}

.nav-link:hover::before {
    width: 60%;
}

.nav-link.active {
    color: var(--primary-500);
}

.nav-link.active::before {
    width: 60%;
}

.nav-link i {
    font-size: 1rem;
    transition: transform 0.25s ease;
}

.nav-link:hover i {
    transform: translateY(-2px);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 60px;
    right: 45px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #eeeeee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.03);
}

.back-to-top i {
    color: #555555;
    font-size: 1.2rem;
}

.back-to-top:hover i {
    color: var(--primary-500);
}

@media (max-width: 768px) {
    .footer-content {
        padding: 0 16px;
    }
    
    .footer-content p {
        font-size: 0.8rem;
    }
}

/* ==================== 搜索和筛选区域样式 ==================== */
.search-filter-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #eeeeee;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    color: #ffffff;
    background: #334155;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    background: #1e293b;
    box-shadow: 0 0 0 4px rgba(51, 65, 85, 0.3);
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
}

/* 分类筛选标签 */
.filter-section {
    border-top: 1px solid var(--gray-300);
    padding-top: 20px;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label i {
    color: var(--primary-500);
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-filter {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #eeeeee;
    background: #ffffff;
    color: #555555;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-filter:hover {
    background: #ffffff;
    border-color: var(--primary-500);
    color: var(--primary-500);
}

.category-filter.active {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-500) 100%);
    color: white;
    border-color: var(--primary-500);
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3);
}

.category-filter.category-link {
    text-decoration: none;
    background: #f0f9ff;
    color: #0369a1;
    border-color: #e0f2fe;
}

.category-filter.category-link:hover {
    background: #e0f2fe;
    border-color: #0ea5e9;
}

.category-filter .count {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== 紧凑列表视图 ==================== */
.libraries-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.library-list-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
    cursor: pointer;
}

.library-list-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.01);
    border-color: var(--gray-300);
    transform: translateX(4px);
}

.library-list-item.hidden {
    display: none;
}

.library-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.library-list-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.library-list-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    min-width: 140px;
}

.library-version-badge {
    font-size: 0.75rem;
    color: #555555;
    font-weight: 500;
    margin-right: 12px;
}

.library-list-category {
    font-size: 0.85rem;
    color: #0369a1;
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.library-list-description {
    font-size: 0.875rem;
    color: #555555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.library-list-description-mobile {
    display: none;
    font-size: 0.875rem;
    color: #555555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 4px 20px 12px 0;
}

.library-list-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.library-list-version {
    font-size: 0.875rem;
    color: #555555;
    font-weight: 500;
}

.library-version-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #4a5568;
    color: #ffffff;
    border: 1px solid #4a5568;
    border-radius: 6px;
    padding: 6px 28px 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    min-width: 90px;
    height: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

.library-version-select:hover {
    background: #2d3748;
    border-color: #2d3748;
}

.library-version-select:focus {
    border-color: #2d3748;
}

.library-version-select option {
    background: #4a5568;
    color: #ffffff;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 400;
}

.library-version-select option:checked {
    background: #2d3748;
    color: #ffffff;
    font-weight: 500;
}

.library-list-expand {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #ffffff;
    color: #555555;
    transition: all 0.2s ease;
}

.library-list-item:hover .library-list-expand {
    background: var(--primary-500);
    color: white;
}

.library-list-expand i {
    transition: transform 0.2s ease;
}

.library-list-item.expanded .library-list-expand i {
    transform: rotate(180deg);
}

/* 展开详情区域 */
.library-details {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-300);
}

.library-list-item.expanded .library-details {
    display: block;
}

.library-details-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    align-items: center;
}

.library-details-tags .library-version-select {
    margin-left: auto;
}

.library-details-files {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
}

.library-details-files-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 8px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #555555;
}

.empty-state i {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: #333333;
    margin-bottom: 8px;
}

/* 视图切换 */
.view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.view-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #eeeeee;
    background: #ffffff;
    color: #555555;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-btn:hover {
    background: #ffffff;
    border-color: var(--primary-500);
    color: var(--primary-500);
}

.view-btn.active {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-500) 100%);
    color: white;
    border-color: var(--primary-500);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .library-list-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
        flex-wrap: wrap;
    }

    .library-list-info {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .library-list-name {
        min-width: auto;
        flex-shrink: 0;
    }

    .library-list-category {
        flex-shrink: 0;
    }

    .library-list-description.desktop-only {
        display: none;
    }

    .library-list-description-mobile {
        display: block;
    }

    .library-list-meta {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .category-filters {
        gap: 6px;
    }

    .category-filter {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: var(--gray-100);
    color: var(--primary-500);
}

.mobile-menu-toggle.active {
    color: var(--primary-500);
    background: var(--primary-50);
}

/* 移动端导航适配 */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header-container {
        flex-wrap: wrap;
    }

    .header-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 4px;
        padding: 16px 0 8px;
        border-top: 1px solid var(--gray-200);
        margin-top: 12px;
    }

    .header-nav.mobile-open {
        display: flex;
    }

    .nav-link {
        padding: 12px 16px;
        justify-content: flex-start;
        border-radius: 8px;
    }

    .nav-link::before {
        display: none;
    }

    .nav-link.active {
        background: var(--primary-50);
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}
