/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Header 样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 60px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 导航栏样式 */
nav {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow-y: auto;
}

.nav-category {
    margin-bottom: 15px;
}

.nav-category h3 {
    color: #764ba2;
    font-size: 1em;
    margin-bottom: 8px;
    padding-left: 8px;
    border-left: 3px solid #667eea;
}

nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 8px;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    text-decoration: none;
    color: #667eea;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85em;
    background: rgba(102, 126, 234, 0.05);
    display: block;
}

nav ul li a:hover {
    background: #667eea;
    color: white;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

nav ul li a.active {
    background: #667eea;
    color: white;
}

/* 主内容区域 */
main {
    max-width: 90%;
    margin: 10px auto;
    padding: 0 10px 0 290px;
}

.content-section {
    background: white;
    border-radius: 10px;
    padding: 15px 25px;
    margin: 0 auto 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.content-section:hover {
    transform: translateY(-5px);
}

.content-section h2 {
    color: #667eea;
    font-size: 1.8em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.content-section h3 {
    color: #764ba2;
    font-size: 1.2em;
    margin: 12px 0 8px 0;
}

.content-section h4 {
    color: #555;
    font-size: 1.1em;
    margin: 10px 0 6px 0;
}

.content-section p {
    margin-bottom: 8px;
    color: #555;
    font-size: 0.95em;
}

.content-section ul,
.content-section ol {
    margin-left: 18px;
    margin-bottom: 8px;
}

.content-section li {
    margin-bottom: 3px;
    color: #555;
    font-size: 0.95em;
}

/* 代码块样式 */
pre {
    background: #0d1117;
    color: #00ff00;
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    border: 1px solid #30363d;
}

pre code {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

/* 特殊框样式 */
.feature-box {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-left: 4px solid #667eea;
    padding: 10px;
    margin: 10px 0;
    border-radius: 6px;
}

.feature-box h3 {
    color: #667eea;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.feature-box ul {
    list-style: none;
    margin-left: 0;
}

.feature-box li {
    padding: 3px 0;
    font-size: 0.95em;
}

.tip-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px;
    margin: 10px 0;
    border-radius: 6px;
    font-size: 0.95em;
}

.tip-box strong {
    color: #856404;
}

/* 链接样式 */
a {
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 资源卡片网格 */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.resource-card {
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.resource-card:hover {
    transform: translateY(-8px);
    border-color: #667eea;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.resource-card h3 {
    font-size: 1.4em;
    margin-bottom: 15px;
    color: #667eea;
}

.resource-card p {
    margin-bottom: 20px;
    color: #666;
}

.resource-card a {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.resource-card a:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    text-decoration: none;
}

/* 下一步学习 */
.next-steps {
    background: linear-gradient(135deg, #764ba215 0%, #667eea15 100%);
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
}

.next-steps h3 {
    color: #764ba2;
    margin-bottom: 20px;
}

.next-steps ol {
    margin-left: 25px;
}

.next-steps li {
    margin-bottom: 12px;
    font-size: 1.1em;
    color: #555;
}

/* Footer 样式 */
footer {
    display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    header p {
        font-size: 1em;
    }

    .content-section {
        padding: 25px;
    }

    .content-section h2 {
        font-size: 1.8em;
    }

    nav {
        position: static;
        width: 100%;
        height: auto;
        max-height: none;
    }

    nav ul {
        flex-direction: row;
        flex-wrap: wrap;
    }

    main {
        padding: 0 20px;
    }

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

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

/* 代码高亮简单样式 */
.python {
    color: #00ff00;
}

/* 知识点导航样式 */
.topic-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
}

.topic-nav a {
    color: #667eea;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 15px;
    background: white;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9em;
}

.topic-nav a:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}