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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 容器布局 */
.container {
    display: flex;
    min-height: 100vh;
}

/* 左侧导航栏 */
.sidebar {
    width: 240px;
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.logo {
    padding: 0 20px 30px;
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    border-bottom: 1px solid #34495e;
}

.logo i {
    margin-right: 10px;
    font-size: 24px;
    color: #3498db;
}

nav ul {
    list-style: none;
    margin-top: 20px;
}

nav ul li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
    background-color: #34495e;
    color: #3498db;
    border-left: 4px solid #3498db;
}

nav ul li a i {
    margin-right: 12px;
    font-size: 18px;
}

.user-actions {
    padding: 20px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid #34495e;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    width: 100%;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #ecf0f1;
    color: #2c3e50;
}

.btn-secondary:hover {
    background-color: #bdc3c7;
}

.btn-outline {
    background-color: transparent;
    color: #ecf0f1;
    border: 1px solid #3498db;
}

.btn-outline:hover {
    background-color: #3498db;
    color: white;
}

/* 用户操作区域的按钮布局 */
.user-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 20px;
}

.section {
    display: none;
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: calc(100vh - 40px);
}

.section.active {
    display: block;
}

/* 首页样式 */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #3498db, #8e44ad);
    color: white;
    border-radius: 8px;
    margin-bottom: 30px;
}

.hero h1 {
    font-size: 40px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
}

.search-bar {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
}

.search-bar input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 5px 0 0 5px;
    font-size: 16px;
}

.search-bar button {
    padding: 15px 30px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-size: 16px;
}

.search-bar button:hover {
    background-color: #1a252f;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.feature-card {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 40px;
    color: #3498db;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

/* AI问答样式 */
.chat-container {
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.model-options {
    display: flex;
    align-items: center;
}

.model-options label {
    display: flex;
    align-items: center;
    margin-left: 15px;
    cursor: pointer;
}

.model-options input[type="checkbox"] {
    margin-right: 5px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.message {
    margin-bottom: 20px;
    max-width: 80%;
}

.message.user {
    margin-left: auto;
}

.message.ai {
    margin-right: auto;
}

.message-content {
    padding: 15px 20px;
    border-radius: 18px;
    word-wrap: break-word;
}

.message.user .message-content {
    background-color: #3498db;
    color: white;
}

.message.ai .message-content {
    background-color: white;
    border: 1px solid #e0e0e0;
}

.chat-input {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.chat-input input {
    flex: 1;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
}

.chat-input button {
    padding: 15px 25px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-questions {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.related-question {
    background-color: white;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.related-question:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 课程推荐样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.section-header h2 {
    font-size: 28px;
}

.course-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.course-filters select,
.course-filters input {
    padding: 8px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
}

.course-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.course-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.course-info {
    padding: 20px;
}

.course-info h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.course-description {
    color: #666;
    margin-bottom: 15px;
}

.course-platforms {
    margin-bottom: 15px;
}

.platform-tag {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.course-link {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.course-link:hover {
    text-decoration: underline;
}

/* 职业规划样式 */
.career-form {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
}

.career-result {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
}

.career-plan-section {
    display: none;
}

.career-plan-section.active {
    display: block;
}

/* 学习记录样式 */
.history-tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    padding: 8px 20px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.tab-content {
    display: none;
    margin-top: 20px;
}

.tab-content.active {
    display: block;
}

.history-item {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.switch-auth {
    text-align: center;
    margin-top: 15px;
    color: #3498db;
    cursor: pointer;
}

.switch-auth:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .course-filters {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .course-filters select,
    .course-filters input {
        flex: 1;
        min-width: 150px;
    }
}