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

/* CSS性能优化 - 添加硬件加速和性能提示 */
:root {
    --primary-blue: #3b82f6;
    --primary-purple: #8b5cf6;
    --primary-green: #10b981;
    --background-light: #f8fafc;
    --background-dark: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-light: rgba(0, 0, 0, 0.06);
    --shadow-medium: rgba(0, 0, 0, 0.08);
    --shadow-heavy: rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-dark) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    position: relative;
    /* 性能优化 */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 优化背景几何装饰 - 减少复杂度 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    will-change: transform;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 60px;
    padding: 80px 20px 40px;
    position: relative;
}

.logo {
    font-size: 3.5rem;
    margin-bottom: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #10b981);
    border-radius: 2px;
}

.subtitle {
    font-size: 1.25rem;
    color: #64748b;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* 搜索和筛选区域 - 性能优化 */
.filters {
    background: var(--glass-bg);
    backdrop-filter: blur(10px); /* 减少blur强度 */
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 8px 32px var(--shadow-light);
    position: relative;
    /* 性能优化 */
    will-change: transform;
    transform: translateZ(0);
}

/* 简化渐变边框效果 */
.filters::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask-composite: xor;
    opacity: 0.3; /* 降低不透明度以减少GPU负载 */
}

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

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

#searchInput {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1e293b;
}

#searchInput:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

#searchInput::placeholder {
    color: #94a3b8;
}

.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.6);
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 14px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(236, 239, 244, 0.8);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.filter-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
    border-color: transparent;
}

.component-filters select {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* 风格展示网格 */
.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

/* 优化卡片性能 */
.style-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px); /* 减少blur强度 */
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow-medium);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    min-height: 420px;
    /* 性能优化 */
    will-change: transform;
    transform: translateZ(0);
    contain: layout style paint;
}

/* 简化hover效果 */
.style-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.style-card:hover::before {
    opacity: 0.05; /* 降低效果强度 */
}

.style-card:hover {
    transform: translateY(-6px) translateZ(0); /* 减少scale以提高性能 */
    box-shadow: 0 16px 48px var(--shadow-heavy);
    background: rgba(255, 255, 255, 0.85);
}

.style-preview {
    height: 240px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #f7fafc, #edf2f7);
}

.style-preview iframe {
    width: 300%;
    height: 300%;
    transform: scale(0.33);
    transform-origin: 0 0;
    pointer-events: none;
    border: none;
    background: white;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 12px 12px 0 0;
}

.style-preview .preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    cursor: pointer;
    z-index: 1;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.style-preview .preview-overlay:hover {
    background: rgba(102, 126, 234, 0.1);
    opacity: 1;
}

.style-preview .preview-overlay .preview-hint {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(0.8);
    transition: transform 0.2s ease;
}

.style-preview .preview-overlay:hover .preview-hint {
    transform: scale(1);
}

.style-preview:not(.loaded) {
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
}

.style-preview:not(.loaded)::after {
    content: '🔄 Loading...';
    color: #667eea;
    font-weight: 500;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.style-info {
    padding: 16px;
}

.style-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1e293b;
}

.style-description {
    color: #64748b;
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 14px;
}

.style-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.tag {
    background: rgba(241, 245, 249, 0.8);
    color: #475569;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.component-lib {
    background: rgba(239, 246, 255, 0.8);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.use-case {
    background: rgba(245, 243, 255, 0.8);
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.2);
}

/* 移除了不需要的按钮样式 */

/* 复制提示 */
.copy-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    color: #1e293b;
    padding: 16px 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.copy-toast i {
    color: #10b981;
    font-size: 16px;
}

.copy-toast.show {
    transform: translateX(0);
}

/* 模态框样式 */
.style-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h2 {
    margin: 0;
    color: #2d3748;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background: #f8f9fa;
}

.modal-body {
    padding: 30px;
}

.demo-preview {
    text-align: center;
    margin-bottom: 30px;
}

.demo-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.demo-info h3 {
    color: #2d3748;
    margin: 25px 0 10px 0;
    font-size: 1.1rem;
}

.demo-info h3:first-child {
    margin-top: 0;
}

.use-cases {
    margin-bottom: 20px;
}

.prompt-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.prompt-text {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: #2d3748;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.copy-prompt-modal {
    width: 100%;
}

/* 无结果样式 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3 {
    margin-bottom: 10px;
    color: #2d3748;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .filters {
        padding: 20px;
    }
    
    .style-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filter-tabs {
        justify-content: center;
    }
    
    .style-actions {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .demo-preview img {
        max-width: 100%;
    }
}

/* 技术栈标签 */
.style-tech-stack {
    margin: 8px 0;
}

.tech-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* 更新按钮样式 */
.style-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e081e9 0%, #e3455a 100%);
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #3d9aec 0%, #00e0ec 100%);
}

/* 更新卡片布局以适应移除按钮后的高度 */
.style-card {
    min-height: 420px;
}

@media (max-width: 768px) {
    .style-actions {
        flex-direction: column;
    }
    
    .btn {
        font-size: 13px;
        padding: 8px 12px;
    }
}