/* 全局样式 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    background-color: var(--light-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

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

/* 卡片样式 */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,.2);
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid rgba(0,0,0,.1);
    font-weight: 600;
}

/* 代码块样式 */
pre {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

/* 测试方法说明样式 */
.test-method {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

/* 实践区元素样式 */
.practice-element {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.practice-element:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,.2);
}

.practice-element h2 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.test-info {
    background-color: var(--light-color);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.test-info h4 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.test-info ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

/* 拖拽测试样式 */
.draggable-item {
    background-color: var(--light-color);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    cursor: move;
    transition: background-color 0.3s ease;
}

.draggable-item:hover {
    background-color: #e9ecef;
}

.dropzone {
    min-height: 150px;
    border: 2px dashed #ced4da;
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.dropzone.dragover {
    background-color: #e9ecef;
    border-color: var(--primary-color);
}

/* 进度条样式 */
.progress {
    height: 20px;
    margin: 0;
    border-radius: 0;
    background-color: #e9ecef;
}

.progress-bar {
    background-color: #0d6efd;
    transition: width 0.3s ease;
}

/* 表格样式 */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.table thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* 分页样式 */
.pagination {
    margin-top: 1rem;
}

.page-link {
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 登录模态框样式 */
.modal-content {
    border-radius: 10px;
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .practice-element {
        padding: 1rem;
    }
    
    .example-code {
        padding: 1rem;
    }
    
    .table-responsive {
        margin: 0 -1rem;
    }
}

/* 代码生成器样式 */
.code-generator {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.generated-code {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 15px;
    margin: 0;
    overflow-x: auto;
}

.generated-code pre {
    margin: 0;
    padding: 0;
    background: none;
}

.generated-code code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre;
    word-wrap: normal;
}

/* 代码高亮样式 */
.generated-code .keyword {
    color: #0033b3;
    font-weight: bold;
}

.generated-code .method {
    color: #6f42c1;
    font-weight: bold;
}

.generated-code .string {
    color: #067d17;
}

.generated-code .comment {
    color: #8c8c8c;
    font-style: italic;
}

.generated-code .annotation {
    color: #6f42c1;
}

/* 表单样式优化 */
.form-select, .form-control {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 12px;
}

.form-select:focus, .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.form-check {
    margin-bottom: 8px;
}

/* 按钮样式优化 */
.btn {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    transform: translateY(-1px);
}

/* 测试结果样式 */
.test-result {
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
    animation: slideIn 0.3s ease;
}

.test-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.test-failure {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 动画 */
@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 学习区样式 */
.learning-section {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    margin-bottom: 20px;
}

/* 示例代码样式 */
.example-code {
    background-color: #272822;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    overflow-x: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
    position: relative;
    margin-top: 15px;
    padding-top: 15px;
}

.example-code pre {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

.example-code code {
    display: block;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre;
    word-wrap: normal;
}

/* 代码高亮样式 */
.example-code .language-java {
    color: #f8f8f2;
}

.example-code .language-java .annotation {
    color: #f92672;
}

.example-code .language-java .comment {
    color: #75715e;
}

.example-code .language-java .keyword {
    color: #f92672;
}

.example-code .language-java .string {
    color: #e6db74;
}

.example-code .language-java .method {
    color: #a6e22e;
}

.example-code .language-java .class {
    color: #66d9ef;
}

/* 注释样式 */
.comment {
    color: #75715e;
}

/* 关键字样式 */
.keyword {
    color: #f92672;
}

/* 字符串样式 */
.string {
    color: #e6db74;
}

/* 方法样式 */
.method {
    color: #a6e22e;
}

/* 类样式 */
.class {
    color: #66d9ef;
}

/* 时间线样式 */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    width: 100%;
}

.timeline-item:nth-child(odd) {
    padding-right: 50%;
}

.timeline-item:nth-child(even) {
    padding-left: 50%;
}

.timeline-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    top: 0;
    transform: translateX(-50%);
}

.timeline-item:nth-child(odd) .timeline-marker {
    right: -10px;
}

.timeline-item:nth-child(even) .timeline-marker {
    left: -10px;
}

.timeline-content {
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.timeline-content h4 {
    margin-bottom: 10px;
    color: var(--dark-color);
}

/* 统计信息样式 */
.stat-item {
    text-align: center;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-item i {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.stat-item h3 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 50px !important;
        padding-right: 0 !important;
    }
    
    .timeline-marker {
        left: 10px !important;
        right: auto !important;
    }
    
    .stat-item {
        margin-bottom: 20px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .timeline-item, .stat-item {
    animation: fadeIn 0.5s ease-out;
}

/* 登录模态框样式优化 */
.modal-content {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
}

.modal-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
}

.modal-body {
    padding: 2rem;
}

.form-check {
    margin-bottom: 1rem;
}

/* 页脚样式优化 */
footer {
    background-color: var(--dark-color);
}

footer h5 {
    color: white;
    margin-bottom: 1rem;
    font-weight: 600;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer a {
    color: rgba(255,255,255,.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: white;
}

footer .bi {
    margin-right: 0.5rem;
}

/* 导航栏样式优化 */
.navbar {
    background-color: var(--dark-color) !important;
}

.navbar-brand i {
    color: var(--primary-color);
}

.nav-link {
    position: relative;
}

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

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

/* 按钮样式优化 */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255,255,255,.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

/* 卡片悬停效果 */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,.2);
}

/* 代码块样式优化 */
.example-code {
    position: relative;
}

/* 实践区元素样式优化 */
.practice-element {
    position: relative;
    overflow: hidden;
}

.practice-element::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.practice-element:hover::before {
    opacity: 1;
}

/* 测试结果动画 */
.test-result {
    animation: slideIn 0.3s ease;
}

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

/* 模态框按钮样式 */
.modal-open-btn {
    position: relative;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modal-open-btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.modal-open-btn:active {
    transform: translateY(1px);
}

/* 修复模态框样式 */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

.modal-dialog {
    margin: 1.75rem auto;
    max-width: 500px;
}

.modal-content {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
}

.modal-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
    padding: 1rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 10px 10px;
    padding: 1rem;
}

/* 自定义模态框样式 */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow: auto;
    padding: 0;
    margin: 0;
}

.custom-modal-content {
    position: relative;
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-modal-header {
    padding: 15px;
    background-color: var(--light-color);
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-modal-header h5 {
    margin: 0;
    font-weight: 600;
}

.custom-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.custom-modal-close:hover {
    color: #000;
}

.custom-modal-body {
    padding: 20px;
}

.custom-modal-footer {
    padding: 15px;
    background-color: var(--light-color);
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 10px 10px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.custom-modal.show {
    display: block;
}

/* AI助手样式 */
.chat-container {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background-color: #f8f9fa;
    margin-bottom: 15px;
}

.user-message, .ai-message, .system-message {
    margin-bottom: 15px;
    max-width: 80%;
    clear: both;
}

.user-message {
    float: right;
}

.ai-message, .system-message {
    float: left;
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    display: inline-block;
}

.user-message .message-content {
    background-color: var(--primary-color);
    color: white;
    border-top-right-radius: 4px;
}

.ai-message .message-content {
    background-color: #e9ecef;
    color: #212529;
    border-top-left-radius: 4px;
}

.system-message .message-content {
    background-color: #d1e7dd;
    color: #0f5132;
    border-top-left-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 5px;
    display: block;
}

.user-message .message-time {
    text-align: right;
}

.message-content p {
    margin-bottom: 0.5rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content pre {
    background-color: #272822;
    color: #f8f8f2;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-content code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
}

.suggested-question {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.suggested-question:hover {
    background-color: #e9ecef;
}

.typing-indicator {
    display: inline-block;
    padding: 10px 15px;
    background-color: #e9ecef;
    border-radius: 18px;
    border-top-left-radius: 4px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    float: left;
    margin: 0 1px;
    background-color: #9E9EA1;
    display: block;
    border-radius: 50%;
    opacity: 0.4;
}

.typing-indicator span:nth-of-type(1) {
    animation: 1s blink infinite 0.3333s;
}

.typing-indicator span:nth-of-type(2) {
    animation: 1s blink infinite 0.6666s;
}

.typing-indicator span:nth-of-type(3) {
    animation: 1s blink infinite 0.9999s;
}

@keyframes blink {
    50% {
        opacity: 1;
    }
}

/* 代码输入框样式 */
.code-input {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    resize: vertical;
}

.code-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
} 