/**
 * HTML源码网 - 样式文件
 */

:root {
    --primary: #0d6efd;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --dark: #212529;
    --light: #f8f9fa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
}

.navbar .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    transition: all 0.3s;
}

.navbar .nav-link:hover {
    color: #fff !important;
}

.navbar .dropdown-menu {
    border: none;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    border-radius: 10px;
}

.navbar .dropdown-item {
    padding: 10px 20px;
    transition: all 0.3s;
}

.navbar .dropdown-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.navbar .dropdown-item i {
    width: 20px;
}

/* Hero区域 */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    margin-bottom: 0;
}

.hero-section h1 {
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-stats {
    margin-top: 30px;
}

.stat-item {
    background: rgba(255,255,255,0.15);
    padding: 15px 30px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.stat-num {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 分类卡片 */
.category-card {
    display: block;
    background: white;
    border-radius: 12px;
    padding: 25px 15px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    color: inherit;
}

.category-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.category-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.category-count {
    font-size: 0.85rem;
    color: #6c757d;
}

/* 作品卡片 */
.work-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.work-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.work-preview {
    height: 180px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.work-icon {
    font-size: 4rem;
    color: rgba(255,255,255,0.9);
}

.work-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.3);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    backdrop-filter: blur(5px);
}

.preview-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(255,255,255,0.95);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
}

.work-card:hover .preview-btn {
    opacity: 1;
    transform: translateY(0);
}

.preview-btn:hover {
    background: white;
    color: #667eea;
}

.work-info {
    padding: 20px;
}

.work-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.work-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.work-title a:hover {
    color: #667eea;
}

.work-desc {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-tags {
    margin-bottom: 12px;
}

.work-tags .tag {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-right: 5px;
    margin-bottom: 5px;
    text-decoration: none;
    transition: all 0.3s;
}

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

.work-meta {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 15px;
}

.work-meta span {
    margin-right: 15px;
}

.work-actions {
    display: flex;
    gap: 10px;
}

.work-actions .btn {
    flex: 1;
}

/* 特色卡片 */
.feature-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

/* 详情页 */
.detail-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.detail-preview {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-placeholder {
    text-align: center;
    color: rgba(255,255,255,0.9);
}

.preview-placeholder i {
    font-size: 5rem;
    margin-bottom: 15px;
}

.detail-content {
    padding: 30px;
}

.detail-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.detail-desc {
    font-size: 1rem;
    color: #666;
    line-height: 1.8;
}

.detail-meta {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 0.9rem;
}

.detail-meta span {
    margin-right: 20px;
}

.feature-list,
.usage-list {
    padding-left: 0;
    list-style: none;
}

.feature-list li,
.usage-list li {
    padding: 8px 0;
    color: #555;
}

.usage-list {
    counter-reset: step;
}

.usage-list li {
    counter-increment: step;
    padding-left: 35px;
    position: relative;
}

.usage-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

/* 侧边栏 */
.sidebar-card .card {
    border: none;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border-radius: 12px;
    overflow: hidden;
}

.sidebar-card .card-header {
    border-bottom: none;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.recommend-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

/* 页脚 */
.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 50px 0 20px;
    margin-top: auto;
}

.footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: all 0.3s;
}

.footer a:hover {
    color: #667eea;
}

.footer p,
.footer li,
.footer .text-muted {
    color: rgba(255,255,255,0.8) !important;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 10px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 30px;
}

/* 搜索框 */
.search-box {
    position: relative;
    max-width: 300px;
}

.search-box input {
    border-radius: 20px;
    padding-right: 40px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: white;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-box input:focus {
    background: rgba(255,255,255,0.2);
    box-shadow: none;
    color: white;
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: rgba(255,255,255,0.8);
}

/* 面包屑 */
.breadcrumb {
    background: transparent;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    color: #667eea;
    border-color: #667eea;
}

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

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-section {
        padding: 50px 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .stat-item {
        padding: 10px 15px;
    }

    .stat-num {
        font-size: 1.5rem;
    }

    .work-preview {
        height: 150px;
    }

    .detail-preview {
        height: 200px;
    }

    .detail-title {
        font-size: 1.4rem;
    }

    .category-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

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

.work-card {
    animation: fadeInUp 0.5s ease forwards;
}

.work-card:nth-child(1) { animation-delay: 0.1s; }
.work-card:nth-child(2) { animation-delay: 0.2s; }
.work-card:nth-child(3) { animation-delay: 0.3s; }
.work-card:nth-child(4) { animation-delay: 0.4s; }
.work-card:nth-child(5) { animation-delay: 0.5s; }
.work-card:nth-child(6) { animation-delay: 0.6s; }
