/* 主样式文件 */
:root {
    --primary-color: #00c4cc;
    --primary-hover: #00a8b0;
    --secondary-color: #7d2ae8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background-color: #ebeced;
    --surface-color: #ffffff;
    --text-primary: #3f4652;
    --text-secondary: #64748b;
    --border-color: #d1d5db;
    --gradient-primary: linear-gradient(135deg, #00c4cc 0%, #7d2ae8 100%);
    --gradient-secondary: linear-gradient(135deg, rgba(0, 196, 204, 0.1) 0%, rgba(125, 42, 232, 0.1) 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    min-height: 100vh;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 头部 */
.header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo img {
    width: 32px;
    height: 32px;
    margin-right: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 500;
    color: var(--text-secondary);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

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

.btn-secondary:hover:not(:disabled) {
    background: #475569;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--background-color);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* 表单 */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.form-input.error {
    border-color: var(--error-color);
}

.form-error {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--error-color);
}

.form-help {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 卡片 */
.card {
    background: var(--surface-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--background-color);
}

/* 网格布局 */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

/* 动画 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .header-content {
        padding: 0.75rem 0;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .card-header,
    .card-body,
    .card-footer {
        padding: 1rem;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* 学习路径规划样式 */
.learning-path {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.path-title {
    text-align: center;
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-weight: 600;
}

.path-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stage {
    background: var(--gradient-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

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

.stage-foundation {
    border-color: #3b82f6;
}

.stage-tools {
    border-color: #10b981;
}

.stage-architecture {
    border-color: #f59e0b;
}

.stage-advanced {
    border-color: #8b5cf6;
}

.stage-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

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

.stage p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.stage-chapters {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.course-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.stat-icon {
    font-size: 1.25rem;
}

.stat-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .learning-path .path-stages {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .learning-path .course-stats {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .learning-path {
        padding: 1.5rem;
        margin: 2rem 0;
    }
    
    .learning-path .path-title {
        font-size: 1.5rem;
    }
}

/* 课程介绍样式 */
.intro-section {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.intro-section h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.intro-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.intro-section p:last-child {
    margin-bottom: 0;
}

/* 章节知识点列表样式 */
.chapter-topics {
    list-style: none;
    margin: 1rem 0 1.5rem 0;
    padding: 0;
}

.chapter-topics li {
    position: relative;
    padding: 0.5rem 0 0.5rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.chapter-topics li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 0.8rem;
}

/* AI部分介绍样式 */
.ai-intro {
    margin: 1.5rem 0 2rem 0;
    padding: 1.5rem;
    background: var(--gradient-secondary);
    border-radius: 12px;
    border: 1px solid rgba(0, 196, 204, 0.2);
}

.ai-intro h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.ai-intro p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.ai-intro p:last-child {
    margin-bottom: 0;
}

/* AI分组样式 */
.ai-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.ai-section {
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ai-section:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.section-header {
    padding: 1.5rem;
    color: white;
    text-align: center;
}

.concept-section .section-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #00a8b0 100%);
}

.method-section .section-header {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.practice-section .section-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.section-header p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.section-chapters {
    padding: 1.5rem;
}

.ai-chapter {
    display: block;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.ai-chapter:hover {
    background: #f1f5f9;
    transform: translateX(5px);
    text-decoration: none;
}

.concept-section .ai-chapter:hover {
    border-left-color: var(--primary-color);
    background: #f0fffe;
}

.method-section .ai-chapter:hover {
    border-left-color: #ec4899;
    background: #fdf2f8;
}

.practice-section .ai-chapter:hover {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.ai-chapter h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.ai-chapter p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ai-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .intro-section {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .intro-section h2 {
        font-size: 1.25rem;
    }
    
    .ai-intro {
        padding: 1rem;
    }
    
    .section-chapters {
        padding: 1rem;
    }
    
    .chapter-topics li {
        padding: 0.4rem 0 0.4rem 1.2rem;
        font-size: 0.85rem;
    }
}