/* Tailwind CSS 自定义配置和样式 */
@layer utilities {
    .content-auto {
        content-visibility: auto;
    }
    .shadow-custom {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    .transition-custom {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* 自定义颜色变量 */
:root {
    --primary: #165DFF;
    --secondary: #4080FF;
    --neutral: #F2F3F5;
    --dark: #1D2129;
}

/* 高端渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.particles-bg {
    background: radial-gradient(ellipse at center, rgba(22, 93, 255, 0.05) 0%, rgba(242, 243, 245, 0.8) 70%, rgba(242, 243, 245, 1) 100%);
}

/* 粒子动画容器优化 */
#particles-container {
    position: relative;
    overflow: hidden;
}

#particles-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(22, 93, 255, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(64, 128, 255, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -2;
}

/* 自定义颜色类 */
.text-primary {
    color: var(--primary);
}

.text-secondary {
    color: var(--secondary);
}

.text-dark {
    color: var(--dark);
}

.bg-primary {
    background-color: var(--primary);
}

.bg-secondary {
    background-color: var(--secondary);
}

.bg-neutral {
    background-color: var(--neutral);
}

.border-primary {
    border-color: var(--primary);
}

.hover\:bg-primary\/90:hover {
    background-color: rgba(22, 93, 255, 0.9);
}

.hover\:text-primary:hover {
    color: var(--primary);
}

.focus\:border-primary:focus {
    border-color: var(--primary);
}

.focus\:ring-primary:focus {
    --tw-ring-color: var(--primary);
}

/* 响应式字体大小 */
.responsive-title {
    font-size: clamp(2rem, 5vw, 3rem);
}

/* 搜索建议样式 */
#search-suggestions {
    max-height: 300px;
    overflow-y: auto;
}

/* 表格悬停效果 */
.table-row-hover:hover {
    background-color: #f9fafb;
}

/* 分类按钮活跃状态 */
.category-btn.active {
    background-color: var(--primary);
    color: white;
}

/* 加载动画 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* 星级评分样式 */
.rating-stars {
    color: #fbbf24;
}

/* 搜索框焦点效果 */
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

/* 按钮悬停效果 */
.btn-primary {
    background-color: var(--primary);
    color: white;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: rgba(22, 93, 255, 0.9);
    transform: translateY(-1px);
}

/* 卡片阴影效果 */
.card-shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* 分页按钮样式 */
.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #6b7280;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background-color: #f9fafb;
}

.pagination-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .responsive-table {
        font-size: 0.875rem;
    }
    
    .responsive-padding {
        padding: 1rem;
    }
    
    .category-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 简洁现代表格样式 */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.table-header {
    background: #f9fafb;
    color: #374151;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.table-header h2 {
    margin: 0;
    font-weight: 600;
    font-size: 1.125rem;
    color: #111827;
}

.table-wrapper {
    background: white;
}

.enhanced-table {
    width: 100%;
    border-collapse: collapse;
}

.enhanced-table thead {
    background: #f9fafb;
}

.enhanced-table th {
    padding: 0.875rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.enhanced-table tbody tr {
    transition: background-color 0.15s ease;
}

.enhanced-table tbody tr:hover {
    background-color: #f9fafb;
}

.enhanced-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.enhanced-table tbody tr:last-child td {
    border-bottom: none;
}

/* 网站名称样式 */
.website-name {
    font-weight: 600;
    color: #111827;
    font-size: 0.9rem;
}

/* URL链接样式 */
.website-url {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.website-url:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* 分类标签样式 */
.category-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 评分星级样式 */
.rating-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-stars {
    color: #fbbf24;
    font-size: 0.9rem;
}

.rating-value {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.875rem;
}

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.action-btn.edit {
    background: #10b981;
    color: white;
}

.action-btn.edit:hover {
    background: #059669;
}

.action-btn.delete {
    background: #ef4444;
    color: white;
}

.action-btn.delete:hover {
    background: #dc2626;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 2.5rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

/* 分页容器美化 */
.pagination-container {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

/* 响应式表格 */
@media (max-width: 768px) {
    .enhanced-table th,
    .enhanced-table td {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .action-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* 在小屏幕上隐藏分类列 */
    .table-col-category {
        display: none;
    }
}

@media (max-width: 640px) {
    /* 在更小屏幕上隐藏评分列 */
    .table-col-rating {
        display: none;
    }
    
    /* 优化表格在移动端的显示 */
    .min-w-full {
        min-width: 500px;
    }
    
    /* 分类按钮在小屏幕上换行 */
    .category-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
}