body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    color: #f1f5f9;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand {
    font-size: 1.5em;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
    text-decoration: none;
    color: #f1f5f9;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #10b981;
}

.user-info {
    background: rgba(16, 185, 129, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    display: none;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.course-nav {
    background: rgba(30, 41, 59, 0.6);
    padding: 10px 0;
    text-align: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    margin-top: 10px;
}

.course-nav a {
    color: #e2e8f0;
    text-decoration: none;
    margin: 0 20px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.course-nav a:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #f1f5f9;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
}

.modules-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.module {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 30px;
    width: 280px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.2);
}

.module-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 50%;
}

.module-icon svg {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.7));
}

.module h2 {
    color: #f1f5f9;
    margin-bottom: 15px;
    font-size: 1.5em;
    font-weight: 600;
}

.module p {
    color: #94a3b8;
    line-height: 1.6;
    font-size: 0.95em;
}

footer {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    color: #94a3b8;
    text-align: center;
    padding: 15px;
    margin-top: 40px;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

/* 额外的课程页面样式 */
h1 {
    margin: 0;
    font-size: 2.8em;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* 课程导航样式 */
header+nav {
    display: block;
    background: rgba(30, 41, 59, 0.6);
    padding: 10px 0;
    text-align: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

header+nav a {
    color: #e2e8f0;
    text-decoration: none;
    margin: 0 20px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

header+nav a:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #f1f5f9;
}

/* 课程列表样式 */
#intro-courses {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 40px;
}

.courses-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 20px 0;
}

.course-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 25px;
    width: 250px;
    height: auto;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.2);
}

.course-image {
    margin-bottom: 20px;
}

.course-image img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.7));
}

.course-info h3 {
    color: #f1f5f9;
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: 600;
}

.course-info p {
    color: #94a3b8;
    line-height: 1.6;
    font-size: 0.95em;
}

/* 未登录提示样式 */
.login-prompt {
    background: rgba(234, 179, 8, 0.2);
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: #fbbf24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    text-align: center;
}

.login-prompt a {
    color: #10b981;
    text-decoration: none;
    font-weight: 600;
}

.login-prompt a:hover {
    text-decoration: underline;
}

/* 禁用状态样式 */
.code-editor textarea:disabled {
    background: rgba(15, 23, 42, 0.5);
    cursor: not-allowed;
    opacity: 0.7;
}

button:disabled {
    background: rgba(100, 116, 139, 0.5);
    cursor: not-allowed;
    opacity: 0.7;
}

/* 课程内容样式 */
.lesson-content {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 40px;
    margin-bottom: 30px;
}

.lesson-content h2 {
    color: #10b981;
    font-size: 2em;
    margin-bottom: 30px;
}

.lesson-content h3 {
    color: #3b82f6;
    font-size: 1.5em;
    margin-top: 30px;
    margin-bottom: 20px;
}

.lesson-content p {
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 1.1em;
}

/* 代码块样式 */
.code-container {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
    border-left: 4px solid #6366f1;
}

/* 代码编辑器样式 */
.code-editor {
    margin-bottom: 15px;
    position: relative;
    width: 100%;
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #6366f1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 行号样式 */
.line-numbers {
    width: 60px;
    min-width: 60px;
    box-sizing: border-box;
    overflow: hidden;
    vertical-align: top;
    padding: 15px 8px;
    background: rgba(15, 23, 42, 0.95);
    color: #6b7280;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    text-align: right;
    user-select: none;
    white-space: pre-wrap;
    pointer-events: none;
    border-right: 1px solid #374151;
}

/* 代码区域容器 */
.code-editor .code-area {
    flex: 1;
    position: relative;
}

/* 代码输入框样式 */
.code-editor textarea {
    width: 100%;
    padding: 15px;
    background: rgba(15, 23, 42, 0.85);
    color: #e2e8f0;
    border: 1px solid #6366f1;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    tab-size: 4;
    min-height: 200px;
    box-sizing: border-box;
}

/* 代码容器样式 */
.code-container pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.code-container code {
    color: #e2e8f0;
}

/* C++语法高亮样式 */
.keyword {
    color: #ff79c6;
    font-weight: bold;
}

.string {
    color: #f1fa8c;
}

.comment {
    color: #6272a4;
    font-style: italic;
}

.function {
    color: #50fa7b;
}

/* 预处理器指令 */
.preprocessor {
    color: #ff79c6;
    font-weight: bold;
}

/* 标准库对象和函数 */
.std-library {
    color: #8be9fd;
}

/* 运算符 */
.operator {
    color: #ffb86c;
}

/* 练习部分样式 */
.exercise-section {
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    padding: 30px;
    margin-top: 40px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.exercise-section h3 {
    color: #10b981;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.exercise-section ul {
    line-height: 2;
    font-size: 1.1em;
    margin-left: 20px;
}

/* 导航按钮样式 */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 20px;
}

.nav-button {
    background: rgba(99, 102, 241, 0.3);
    color: #e2e8f0;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.5);
    flex: 1;
    text-align: center;
}

.nav-button:hover {
    background: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.nav-button:first-child {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.nav-button:first-child:hover {
    background: rgba(30, 41, 59, 0.8);
}

/* 单词学习部分 */
.vocabulary-section {
    margin-bottom: 30px;
}

.vocabulary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.vocab-word {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vocab-word:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

/* 弹窗样式 */
.vocab-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.vocab-modal-content {
    background-color: #1e293b;
    margin: 15% auto;
    padding: 30px;
    border: 1px solid #3b82f6;
    border-radius: 12px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.vocab-close {
    color: #94a3b8;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.vocab-close:hover,
.vocab-close:focus {
    color: #f1f5f9;
    text-decoration: none;
    cursor: pointer;
}

.vocab-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.vocab-modal-header h4 {
    color: #3b82f6;
    font-size: 24px;
    margin-bottom: 5px;
}