/* 吃个瓜项目自定义样式 */

/* 基础样式重置 */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    color: #333;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 导航栏样式增强 */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

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

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #dc2626;
    border-radius: 1px;
}

/* 卡片样式增强 */
.news-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.news-card img {
    transition: transform 0.3s ease;
}

.news-card:hover img {
    transform: scale(1.05);
}

/* 按钮样式增强 */
.btn-primary {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-outline-primary {
    border: 2px solid #dc2626;
    color: #dc2626;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: #dc2626;
    color: white;
    transform: translateY(-2px);
}

/* 标签样式 */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

.badge-category {
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
    color: #b91c1c;
}

.badge-hot {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
}

.badge-new {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #059669;
}

/* 评论区样式 */
.comment-item {
    transition: all 0.3s ease;
}

.comment-item:hover {
    background: #f9fafb;
    border-radius: 8px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* 表单样式增强 */
.form-control:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25);
}

.form-floating > label {
    color: #6b7280;
}

/* 页脚样式 */
.footer {
    background: linear-gradient(135deg, #1f2937, #111827);
}

.footer a {
    transition: all 0.3s ease;
}

.footer a:hover {
    color: #dc2626 !important;
    transform: translateY(-2px);
}

/* 热搜榜样式 */
.trending-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.trending-item:hover {
    background: #374151;
    transform: translateX(4px);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 响应式设计增强 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .news-card {
        margin-bottom: 1rem;
    }
}

/* 自定义动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 文本截断样式 */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 特殊效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.gradient-text {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 打印样式 */
@media print {
    .navbar,
    .footer,
    .sidebar,
    .btn {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
    }
}
