/* source.css - 源码下载页面样式 */

/* CSS变量定义 */
:root {
    --primary: #2c7be5;
    --primary-dark: #1a68d1;
    --secondary: #6c757d;
    --light: #f8f9fa;
    --dark: #343a40;
    --success: #00d97e;
    --danger: #e63757;
    --warning: #f6c343;
    --premium: #ff6b35;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    height: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background-color: #f5f7fa;
    color: var(--dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.btn-premium {
    background-color: var(--premium);
    color: white;
}

.btn-premium:hover {
    background-color: #e55a2b;
}

/* 头部导航 */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    margin-right: 10px;
    font-size: 28px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
    padding: 5px 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
}

.user-menu {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.login-actions {
    display: flex;
    gap: 10px;
}

.user-info-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

#navUsername {
    font-weight: 500;
    color: var(--dark);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    color: var(--secondary);
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: #f8f9fa;
    border-color: var(--secondary);
    color: var(--dark);
}

/* 页面标题区域 */
.page-header {
    background: linear-gradient(135deg, #2c7be5 0%, #1a68d1 100%);
    color: white;
    padding: 60px 0;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
}

.section {
    padding: 80px 0;
    margin: 0;
}

/* 源码内容区域 */
.source-content {
    display: flex;
    gap: 30px;
    padding: 40px 0;
}

.filters-sidebar {
    flex: 0 0 280px;
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

.filter-section {
    margin-bottom: 25px;
}

.filter-section h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.1rem;
}

.filter-options {
    list-style: none;
}

.filter-options li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.filter-options input[type="radio"] {
    margin-right: 10px;
}

.filter-options label {
    cursor: pointer;
    display: flex;
    align-items: center;
    width: 100%;
}

.filter-count {
    margin-left: auto;
    color: var(--secondary);
    font-size: 0.9rem;
}

.source-main {
    flex: 1;
}

.search-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 5px;
    padding: 7px 15px;
    border-radius: 4px;
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
}

.sort-options select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 0.9rem;
}
.pagination-info-top {
    margin: 10px 0;
    font-size: 14px;
    color: #666;
    text-align: right;
    margin-bottom: 5px;
}
/* 源码网格布局 */
.source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.source-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.source-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.premium-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--premium);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
}

/* 源码图片容器 */
.source-image {
    width: 48px;
    height: 48px;
    background: transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;      /* 垂直居中 */
    justify-content: center;  /* 水平居中 */
    font-size: 32px;
    margin: 10px auto 15px;   /* 上边距10px，左右auto水平居中，下边距15px */
    overflow: hidden;
}

/* 图片样式 */
.source-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 10px;
    background: transparent;
    /* 确保图片在flex容器中居中 */
    align-self: center;
    /* 保持图片比例，填充整个容器 */
    object-fit: contain;
}

/* Font Awesome图标样式 */
.source-image i {
    font-size: 32px;
    color: var(--primary);
    line-height: 1; /* 确保图标垂直居中 */
}

/* 鼠标悬停效果 */
.source-card:hover .source-image {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.source-card:hover .source-image i {
    color: var(--primary-dark);
}
.source-content-inner {
    padding: 25px;
}

.source-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.source-tag {
    display: inline-block;
    background-color: #e6f2ff;
    color: var(--primary);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.source-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.source-card p {
    color: var(--secondary);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.source-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--secondary);
}

.rating {
    color: var(--warning);
}

.source-price {
    font-weight: 700;
    color: var(--premium);
    font-size: 1.2rem;
}

.source-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.source-actions .btn {
    flex: 1;
    text-align: center;
}

.license-badge {
    display: inline-block;
    background-color: #f8f9fa;
    color: var(--secondary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 5px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination-list {
    display: flex;
    list-style: none;
}

.pagination-item {
    margin: 0 5px;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-color: white;
    color: var(--dark);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.pagination-link:hover, .pagination-link.active {
    background-color: var(--primary);
    color: white;
}

.pagination-link.disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-link.disabled:hover {
    background-color: #f8f9fa;
    color: #6c757d;
}
/* 会员计划样式增强 */
.plan-card.featured {
    transform: scale(1.05);
    border: 2px solid #6c5ce7;
    position: relative;
}

.featured-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.plan-price {
    font-size: 2rem;
    font-weight: bold;
    color: #6c5ce7;
    margin: 15px 0;
}

.plan-price span {
    font-size: 1rem;
    color: #666;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.plan-features li {
    margin: 10px 0;
    padding-left: 25px;
    position: relative;
}

.plan-features li i.fa-check {
    color: #00b894;
    position: absolute;
    left: 0;
    top: 3px;
}

.plan-features li i.fa-times {
    color: #dfe6e9;
    position: absolute;
    left: 0;
    top: 3px;
}

/* 企业会员特殊样式 */
.plan-card:last-child .plan-price {
    color: #e17055;
}

.role-enterprise {
    background-color: #e17055;
    color: white;
}
/* 区域标题 */
.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 15px;
}

.section-title p {
    color: var(--secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 开源信息区域 */
.open-source-info {
    background-color: white;
    border-radius: 8px;
    padding: 40px;
    margin-top: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.open-source-info h2 {
    margin-bottom: 20px;
    color: var(--primary);
}

.open-source-info p {
    margin-bottom: 20px;
    color: var(--secondary);
}

.source-stats {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--secondary);
}

/* 会员计划区域 */
.membership-plans {
    background-color: white;
    border-radius: 8px;
    padding: 40px;
    margin-top: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.plan-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.plan-card.featured {
    border: 2px solid var(--premium);
    transform: scale(1.05);
}

.plan-card.featured:hover {
    transform: scale(1.05) translateY(-5px);
}

.featured-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--premium);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--premium);
    margin-bottom: 20px;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--premium);
}

.plan-price span {
    font-size: 1rem;
    color: var(--secondary);
}

.plan-features {
    list-style: none;
    margin-bottom: 25px;
    text-align: left;
}

.plan-features li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.plan-features li i {
    color: var(--success);
    margin-right: 10px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-but {
    text-align: center;
}

.form-but .btn {
    margin: 0 10px;
}

.form-switch {
    text-align: center;
    margin-top: 15px;
}

.form-switch a {
    color: var(--primary);
    cursor: pointer;
}

.form-switch a:hover {
    text-decoration: underline;
}

.payment-methods {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.payment-method {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-method.selected {
    border-color: var(--primary);
    background-color: #e6f2ff;
}

.payment-method i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--primary);
}

/* 页脚样式 */
footer {
    background-color: var(--dark);
    color: white;
    padding: 60px 0 20px;
    margin-top: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #adb5bd;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
    color:white;
    font-size: 0.9rem;
}

/* 搜索结果信息 */
.search-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: #e6f2ff;
    border-radius: 4px;
}

.clear-search {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.clear-search:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 15px 0;
    }

    .nav-links {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links li {
        margin: 0 10px;
    }

    .source-content {
        flex-direction: column;
    }

    .filters-sidebar {
        flex: none;
    }

    .search-sort-bar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .plans-grid {
        grid-template-columns: 1fr;
    }

    .plan-card.featured {
        transform: none;
    }

    .plan-card.featured:hover {
        transform: translateY(-5px);
    }

    .user-info-display {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .logout-btn {
        margin-top: 5px;
    }
}
