/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 工具栏样式 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    gap: 20px;
}

/* 左侧筛选区域 */
.filter-section {
    flex: 0 0 auto;
}

.select-wrapper {
    position: relative;
    min-width: 160px;
}

.category-select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-select:hover {
    border-color: #9ca3af;
}

.category-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.select-wrapper:hover .select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* 右侧按钮组 - 修复排版问题 */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* 按钮基础样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* 刷新按钮样式 */
.btn-refresh {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 12px;
    min-width: 48px;
    height: 48px;
}

.btn-refresh:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
    transform: translateY(-1px);
}

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

.btn-refresh i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.btn-refresh:hover i {
    transform: rotate(180deg);
}

/* 主要按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: 2px solid transparent;
    padding: 12px 20px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5855eb 0%, #7c3aed 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary i {
    font-size: 14px;
}

.btn-text {
    white-space: nowrap;
    font-size: 14px;
}

/* 内容区域 */
.content-area {
    padding: 32px;
    min-height: 500px;
}

/* 加载状态 */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #6b7280;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
    color: #d1d5db;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto;
}

/* 内容列表 */
.content-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

/* 内容卡片 */
.content-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
    position: relative;
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: #e2e8f0;
}

.content-card.featured {
    border-left: 4px solid #fbbf24;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.content-card.featured::before {
    content: '✨';
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 16px;
    z-index: 2;
}

/* 卡片图片 */
.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* 卡片内容 */
.card-content {
    padding: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin: 0;
    flex: 1;
}

.card-category {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-category.tech {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.card-category.life {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.card-category.thinking {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #be185d;
}

.card-category.creation {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.card-category.sharing {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #6b21a8;
}

.card-description {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-description p {
    margin: 0 0 8px 0;
}

.card-description strong {
    color: #374151;
    font-weight: 600;
}

.card-description em {
    font-style: italic;
    color: #4b5563;
}

/* 卡片底部 */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    margin-top: 16px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    font-size: 13px;
}

.card-author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-author i {
    font-size: 12px;
}

.card-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9ca3af;
    font-size: 13px;
}

.view-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-count i {
    font-size: 12px;
}

/* 标签 */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tag {
    background: #f8fafc;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
}

/* 卡片操作按钮 */
.card-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6366f1;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-read-more:hover {
    color: #4f46e5;
    transform: translateX(2px);
}

.btn-read-more i {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.btn-read-more:hover i {
    transform: translateX(2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
        align-items: stretch;
    }
    
    .action-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .select-wrapper {
        min-width: auto;
        width: 100%;
    }
    
    .btn-text {
        display: none;
    }
    
    .btn-primary {
        padding: 12px;
        min-width: 48px;
    }
    
    .content-area {
        padding: 20px 16px;
    }
    
    .content-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .content-card {
        margin: 0;
    }
    
    .card-image {
        height: 180px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .card-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .toolbar {
        padding: 16px;
    }
    
    .content-area {
        padding: 16px 12px;
    }
    
    .content-list {
        gap: 16px;
    }
    
    .card-content {
        padding: 16px;
    }
    
    .card-tags {
        gap: 4px;
    }
    
    .tag {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: fadeIn 0.3s ease-out;
}

/* 焦点可访问性 */
.btn:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}