/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo h2 {
    color: #2563eb;
    font-size: 1.8rem;
}

.logo h2 span {
    color: #f59e0b;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0 15px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #2563eb;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #2563eb;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* 横幅样式 */
.hero {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    padding: 150px 0 100px;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.primary-btn {
    background-color: #f59e0b;
    color: white;
}

.primary-btn:hover {
    background-color: #d97706;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.secondary-btn {
    background-color: transparent;
    color: white;
    border-color: white;
}

.secondary-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 特色内容样式 */
.features {
    padding: 80px 0;
    background-color: #fff;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: #2563eb;
    margin-bottom: 15px;
}

.section-title p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    color: #2563eb;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.feature-card p {
    color: #666;
    line-height: 1.7;
}

/* ML简介样式 */
.ml-intro {
    padding: 80px 0;
    background-color: #edf2f7;
}

.ml-intro-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.ml-intro-text {
    flex: 1;
}

.ml-intro-text h2 {
    font-size: 2.5rem;
    color: #2563eb;
    margin-bottom: 20px;
}

.ml-intro-text p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.8;
}

.ml-intro-image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.ml-intro-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 热门算法样式 */
.popular-algorithms {
    padding: 80px 0;
    background-color: #fff;
}

.algorithms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.algorithm-card {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.algorithm-card:hover {
    transform: translateY(-5px);
}

.algorithm-card h3 {
    font-size: 1.5rem;
    color: #2563eb;
    margin-bottom: 15px;
}

.algorithm-card p {
    color: #555;
    line-height: 1.7;
}

.text-center {
    text-align: center;
}

.text-center .btn {
    margin-top: 20px;
}

/* 底部样式 */
.footer {
    background-color: #1e293b;
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 10px;
}

.footer-logo h2 span {
    color: #f59e0b;
}

.footer-logo p {
    color: #cbd5e1;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #f59e0b;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #f59e0b;
}

.footer-contact p {
    color: #cbd5e1;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.footer-contact i {
    margin-right: 10px;
    color: #f59e0b;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #334155;
    color: #94a3b8;
}

/* 页面标题样式 */
.page-header {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    padding: 120px 0 60px;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.page-header p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

/* 内容区域样式 */
.content-section {
    padding: 60px 0;
}

.content-wrapper {
    display: flex;
    gap: 30px;
}

.main-content {
    flex: 3;
}

.sidebar {
    flex: 1;
}

.content-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.content-card h2 {
    color: #2563eb;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.content-card h3 {
    color: #333;
    margin: 20px 0 15px;
    font-size: 1.4rem;
}

.content-card p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.content-card ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.content-card li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.image-placeholder {
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.image-placeholder img {
    width: 100%;
    height: auto;
    display: block;
}

.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.type-card {
    background: #f0f9ff;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.type-icon {
    font-size: 2rem;
    color: #2563eb;
    margin-bottom: 15px;
}

.type-card h3 {
    margin-bottom: 10px;
    color: #333;
}

.type-card p {
    margin-bottom: 15px;
}

.type-card ul {
    text-align: left;
}

.workflow-steps {
    margin-top: 30px;
}

.step {
    display: flex;
    margin-bottom: 30px;
    align-items: flex-start;
}

.step-number {
    background: #2563eb;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 20px;
}

.step-content h3 {
    margin-bottom: 5px;
}

.step-content p {
    margin: 0;
}

.terms-list {
    margin-top: 20px;
}

.term-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.term-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.term-item h3 {
    color: #2563eb;
    margin-bottom: 8px;
}

.sidebar-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.sidebar-card h3 {
    color: #2563eb;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.learning-path,
.related-resources {
    list-style: none;
}

.learning-path li,
.related-resources li {
    margin-bottom: 12px;
}

.learning-path a,
.related-resources a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.learning-path a:hover,
.related-resources a:hover {
    color: #2563eb;
}

/* 算法页面样式 */
.algorithm-categories {
    padding: 30px 0;
    background: #f8f9fa;
}

.category-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tab-button {
    padding: 10px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-button.active,
.tab-button:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.algorithms-section {
    padding: 60px 0;
    background: #f8f9fa;
}

.algorithms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.algorithm-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.algorithm-card:hover {
    transform: translateY(-5px);
}

.algorithm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.algorithm-header h3 {
    color: #2563eb;
    margin: 0;
}

.algorithm-type {
    background: #dbeafe;
    color: #2563eb;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.algorithm-card p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
}

.algorithm-details {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.detail-item {
    margin-bottom: 15px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item h4 {
    color: #333;
    margin-bottom: 5px;
}

.detail-item p {
    margin: 0;
    font-size: 0.95rem;
}

.comparison-section {
    padding: 80px 0;
    background: white;
}

.comparison-table {
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.comparison-table th,
.comparison-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.comparison-table th {
    background: #f1f5f9;
    color: #333;
    font-weight: 600;
}

.comparison-table tr:hover {
    background: #f8f9fa;
}

/* 资源页面样式 */
.resources-section {
    padding: 60px 0;
    background: #f8f9fa;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.resource-category {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.category-header {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
}

.category-header i {
    font-size: 1.5rem;
    margin-right: 15px;
}

.category-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.resources-list {
    padding: 20px;
}

.resource-item {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.resource-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.resource-item h3 {
    color: #333;
    margin-bottom: 10px;
}

.resource-item p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.resource-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.difficulty,
.duration,
.pages,
.type,
.level,
.datasets,
.samples {
    background: #dbeafe;
    color: #2563eb;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.resource-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.resource-link:hover {
    color: #1d4ed8;
}

.roadmap-section {
    padding: 80px 0;
    background: white;
}

.roadmap {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.roadmap-step {
    display: flex;
    flex: 1 1 300px;
    background: #f0f9ff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.step-icon {
    background: #2563eb;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-right: 20px;
}

.step-content h3 {
    margin-bottom: 10px;
    color: #333;
}

.step-content p {
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.subscribe-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    text-align: center;
}

.subscribe-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.subscribe-content p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.subscribe-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 10px;
}

.subscribe-form input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 20px 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 15px 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .ml-intro-content {
        flex-direction: column;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .content-wrapper {
        flex-direction: column;
    }

    .subscribe-form {
        flex-direction: column;
    }

    .roadmap-step {
        flex: 1 1 100%;
    }
}

@media screen and (max-width: 576px) {
    .nav-container {
        padding: 1rem;
    }

    .hero {
        padding: 120px 0 80px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }

    .features-grid,
    .algorithms-grid,
    .resources-grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .algorithm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}