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

/* CSS变量定义 */
:root {
    --primary-color: #1e3a8a;
    --secondary-color: #f59e0b;
    --accent-color: #3b82f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-alt: #f1f5f9;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* 基础字体和布局 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: var(--transition);
}

/* 英雄区域样式 */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* 神经网络动画 */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.training-animation {
    width: 400px;
    height: 300px;
    position: relative;
}

.neural-network {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
}

.layer {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 80%;
}

.neuron {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    position: relative;
    animation: pulse 2s infinite;
}

.neuron::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 80px;
    height: 2px;
    background: linear-gradient(to right, var(--accent-color), transparent);
    transform: translateY(-50%);
    animation: signal 3s infinite;
}

.output-layer .neuron::before {
    display: none;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
}

@keyframes signal {
    0% { opacity: 0; transform: translateY(-50%) scaleX(0); }
    50% { opacity: 1; transform: translateY(-50%) scaleX(1); }
    100% { opacity: 0; transform: translateY(-50%) scaleX(0); }
}

/* 概览区域样式 */
.overview {
    padding: 80px 0;
    background: var(--bg-primary);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.125rem;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.training-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.stage-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.stage-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stage-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.stage-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.stage-card > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.stage-details {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stage-card:hover .stage-details {
    opacity: 1;
    max-height: 200px;
}

.stage-details ul {
    list-style: none;
    padding-left: 0;
}

.stage-details li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.stage-details li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

/* 训练流程图 */
.training-flow {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-top: 3rem;
}

.flow-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    min-width: 150px;
}

.flow-step.active {
    background: var(--primary-color);
    color: white;
}

.flow-step:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 1rem;
}

.flow-step.active .step-number {
    background: white;
    color: var(--primary-color);
}

.step-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

.step-content p {
    font-size: 0.875rem;
    text-align: center;
    opacity: 0.8;
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: bold;
}

/* 内容区域样式 */
.content-section {
    padding: 80px 0;
}

.alt-bg {
    background: var(--bg-alt);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    margin-bottom: 3rem;
}

.content-text h3 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.content-text h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

.content-text p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.content-text ul {
    margin-bottom: 1.5rem;
    padding-left: 0;
    list-style: none;
}

.content-text li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 2rem;
    color: var(--text-secondary);
}

.content-text li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* 可视化演示样式 */
.content-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pretraining-demo, .sft-demo, .reward-demo, .rlhf-demo {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
}

.demo-title {
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.text-sequence {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.token {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.token.predicted {
    background: var(--secondary-color);
    color: white;
    animation: highlight 2s infinite;
}

@keyframes highlight {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.prediction-info {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

.instruction-example {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.instruction, .response {
    margin-bottom: 1rem;
}

.instruction {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.response {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1rem;
}

.comparison-example {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.response-option {
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 2px solid;
    transition: var(--transition);
}

.response-option.better {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.response-option.worse {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.response-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.score {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.vs {
    text-align: center;
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.rlhf-cycle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.cycle-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.step-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.step-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.cycle-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* 技术细节样式 */
.technical-details {
    margin-top: 4rem;
}

.technical-details h3 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-primary);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.detail-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.detail-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.detail-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.detail-card li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-card li:last-child {
    border-bottom: none;
}

.detail-card li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* 总结区域样式 */
.summary {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.summary-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.summary-content > p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.7;
}

.key-takeaways h3 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.takeaway-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.takeaway-item {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    text-align: left;
    transition: var(--transition);
}

.takeaway-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.takeaway-item h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.takeaway-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 底部样式 */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

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

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

/* 响应式设计 */
@media (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: var(--shadow-md);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .training-stages {
        grid-template-columns: 1fr;
    }

    .flow-container {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .takeaway-grid {
        grid-template-columns: 1fr;
    }

    .rlhf-cycle {
        flex-direction: column;
    }

    .cycle-arrow {
        transform: rotate(90deg);
    }

    .comparison-example {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.875rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .training-animation {
        width: 300px;
        height: 200px;
    }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e40af;
}

