* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6a75f8;
    --dark-color: #1d2144;
    --light-color: #f5f8ff;
    --text-color: #333;
    --text-light: #666;
    --border-color: #eaeaea;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

body {
    color: var(--text-color);
    line-height: 1.6;
    background-color: #fff;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 8px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-buttons {
    display: flex;
    align-items: center;
}

.btn {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-outline {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    margin-right: 15px;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* 用户进度区域 */
.user-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 30px auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-width: 1200px;
}

.progress-info {
    display: flex;
    align-items: center;
}

.progress-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 15px;
}

.progress-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
}

/* 练习题目区域 */
.challenges {
    padding: 40px 0 80px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 36px;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.section-title p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* 筛选器样式 */
.filter-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-right: 10px;
    display: flex;
    align-items: center;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tab {
    padding: 10px 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab i {
    font-size: 16px;
}

.difficulty-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.difficulty-btn.active {
    color: white;
    border-color: transparent;
}

.difficulty-btn.easy.active {
    background-color: #4caf50;
}

.difficulty-btn.medium.active {
    background-color: #ff9800;
}

.difficulty-btn.hard.active {
    background-color: #f44336;
}

.difficulty-btn .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.difficulty-btn.easy .dot {
    background-color: #4caf50;
}

.difficulty-btn.medium .dot {
    background-color: #ff9800;
}

.difficulty-btn.hard .dot {
    background-color: #f44336;
}

.difficulty-btn.active .dot {
    background-color: white;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0 15px;
    height: 44px;
    width: 250px;
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
}

.search-box i {
    color: var(--text-light);
    margin-right: 10px;
}

/* 题目卡片样式 */
.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.challenge-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.challenge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.challenge-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.challenge-difficulty {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.difficulty-easy {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.difficulty-medium {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.difficulty-hard {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.challenge-content {
    padding: 20px;
}

.challenge-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.challenge-content p {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.challenge-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.challenge-tag {
    padding: 4px 10px;
    background-color: rgba(74, 108, 247, 0.1);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.challenge-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.progress-bar {
    height: 6px;
    background-color: #eaeaea;
    border-radius: 3px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.challenge-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.challenge-link i {
    margin-left: 5px;
    transition: var(--transition);
}

.challenge-link:hover i {
    transform: translateX(5px);
}

/* 底部区域 */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 80px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-column h3 {
    font-size: 20px;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #a0a0a0;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a0a0;
    font-size: 14px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .filter-container {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
        max-width: 400px;
    }

    .user-progress {
        flex-direction: column;
        text-align: center;
    }

    .progress-info {
        margin-bottom: 15px;
    }

    .progress-stats {
        width: 100%;
        justify-content: space-around;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: white;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 50px;
        transition: var(--transition);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 15px 0;
    }

    .section-title h2 {
        font-size: 28px;
    }

    .challenge-card {
        padding: 15px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-tabs, .difficulty-filter {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }

    .challenges-grid {
        grid-template-columns: 1fr;
    }

    .tab, .difficulty-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

/* 来源筛选按钮样式 */
.difficulty-filter .source-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.difficulty-filter .source-btn.active {
    color: white;
    border-color: transparent;
    background-color: #2196f3;  /* Active state - Blue */
}

/* 圆点颜色 */
.source-btn .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.source-btn[data-source="all"] .dot {
    background-color: #54bb29;
}

.source-btn[data-source="BUGKU"] .dot {
    background-color: #2196f3;
}

.source-btn[data-source="NSSCTF"] .dot {
    background-color: #f44336;
}

.source-btn[data-source="BUUCTF"] .dot {
    background-color: #ff9800;
}

.source-btn[data-source="OTHER"] .dot {
    background-color: #9e9e9e;
}

.source-btn[data-source="SELF"] .dot {
    background-color: #6f338f;
}

.source-btn.active .dot {
    background-color: white;
}