* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
}

/* 导航栏样式 */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-brand h2 {
    margin: 0;
}

.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #3498db;
}

.user-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    color: #333;
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    min-width: 200px;
    z-index: 1000;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

/* 主容器 */
.main-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: #34495e;
    color: white;
    padding: 2rem 0;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    transition: background 0.3s;
}

.nav-links a:hover {
    background: #3498db;
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 2rem;
}

/* 主页样式 */
.home-container {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: calc(100vh - 70px);
    position: relative;
}

.home-overlay {
    background: rgba(0, 0, 0, 0.6);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-content {
    margin-top: -120px;
    color: white;
}

.home-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.home-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-primary {
    background: #e74c3c;
}

.btn-primary:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* 表单样式 */
.form-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* JSON内容显示 */
.json-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 1rem;
    margin: 1rem 0;
}

.json-item {
    background: white;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        order: 2;
    }

    .content {
        order: 1;
    }

    .nav-links {
        display: flex;
        overflow-x: auto;
    }

    .nav-links li {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .home-content h1 {
        font-size: 2rem;
    }

    .toolbar, .viewer-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .viewer-content {
        grid-template-columns: 1fr;
        height: auto;
    }

    .model-properties {
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 彩带效果样式 */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 20px;
}

/* 用户信息工具提示增强样式 */
.user-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    color: #333;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
    border: 1px solid #e1e8ed;
}

.user-tooltip p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.user-tooltip p:first-child {
    font-weight: bold;
    color: #2c3e50;
}

.logout-btn {
    display: block;
    text-align: center;
    background: #e74c3c;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: #c0392b;
}

/* 登录/注册成功消息 */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 0.8rem;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
    margin-bottom: 1rem;
}

/* 3D预览器特定样式 */
.model-viewer-container {
    position: relative;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 1000;
}

.progress-bar {
    width: 300px;
    height: 4px;
    background: #34495e;
    border-radius: 2px;
    margin: 1rem 0;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: #3498db;
    border-radius: 2px;
    transition: width 0.3s ease;
}

@media (max-width: 768px) {
    .exercises-overlay,
    .subject-overlay {
        padding: 1.5rem;
        margin: 0.5rem;
        border-radius: 15px;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .subjects-grid,
    .files-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .subject-card,
    .file-card {
        padding: 1.2rem;
    }

    .subject-name,
    .file-name {
        font-size: 1.1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .deep-learning-container {
        padding: 0.5rem;
    }

    .deep-learning-content {
        padding: 1rem;
        margin: 0.5rem;
    }

    .dl-header h1 {
        font-size: 1.8rem;
    }

    .dl-header p {
        font-size: 1rem;
    }

    .loss-functions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .loss-card {
        padding: 1.2rem;
    }

    .loss-name {
        font-size: 1.2rem;
    }

    .filter-buttons {
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .filter-btn {
        flex-shrink: 0;
    }

    .search-box {
        margin: 1rem auto;
    }
}